From 935a837c01c05ded35775d21aa1f5ff9f32d776a Mon Sep 17 00:00:00 2001 From: hui su Date: Mon, 29 Feb 2016 09:27:33 -0800 Subject: [PATCH] Fix a couple of minor bugs in vp10_has_right and vp10_has_bottom The above-right and left-bottom pixels were sometimes not used even though they are available. Results on lowres_all and hdres_all are mostly neutral. Change-Id: Ic13533dd498442ad5592b83bb5fabf053cc8e8f0 --- vp10/common/reconintra.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vp10/common/reconintra.c b/vp10/common/reconintra.c index 4a79466d0..e2ab95254 100644 --- a/vp10/common/reconintra.c +++ b/vp10/common/reconintra.c @@ -107,6 +107,10 @@ static int vp10_has_right(BLOCK_SIZE bsize, int mi_row, int mi_col, const int w = VPXMAX(num_4x4_blocks_wide_lookup[bsize] >> ss_x, 1); const int step = 1 << txsz; + // Handle block size 4x8 and 4x4 + if (ss_x == 0 && num_4x4_blocks_wide_lookup[bsize] < 2 && x == 0) + return 1; + if (y == 0) { const int hl = mi_height_log2_lookup[bsize]; const uint8_t *order = orders[bsize]; @@ -144,6 +148,13 @@ static int vp10_has_bottom(BLOCK_SIZE bsize, int mi_row, int mi_col, const uint8_t *order = orders[bsize]; int my_order, bl_order; + // Handle block size 8x4 and 4x4 + if (ss_y == 0 && num_4x4_blocks_high_lookup[bsize] < 2 && y == 0) + return 1; + + if (y + step < h) + return 1; + mi_row = (mi_row & 7) >> hl; mi_col = (mi_col & 7) >> wl; @@ -154,9 +165,6 @@ static int vp10_has_bottom(BLOCK_SIZE bsize, int mi_row, int mi_col, if (((mi_row + 1) << hl) >= 8) return 0; - if (y + step < h) - return 1; - my_order = order[((mi_row + 0) << (3 - wl)) + mi_col + 0]; bl_order = order[((mi_row + 1) << (3 - wl)) + mi_col - 1]; -- 2.40.0