Commit dbcdeeb4 authored by hui su's avatar hui su Committed by Hui Su
Browse files

Fix bugs in av1_has_right() and av1_has_bottom()

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=29

Change-Id: Iac2822a7c5c64de1ad7fc6ee0efb4fcca3aacbc1
parent f627a31d
......@@ -81,6 +81,8 @@ static const uint8_t *const orders[BLOCK_SIZES] = {
static int av1_has_right(BLOCK_SIZE bsize, int mi_row, int mi_col,
int right_available, TX_SIZE txsz, int y, int x,
int ss_x) {
if (!right_available) return 0;
if (y == 0) {
int wl = mi_width_log2_lookup[bsize];
int hl = mi_height_log2_lookup[bsize];
......@@ -94,14 +96,14 @@ static int av1_has_right(BLOCK_SIZE bsize, int mi_row, int mi_col,
mi_row = (mi_row & 7) >> hl;
mi_col = (mi_col & 7) >> wl;
if (mi_row == 0) return right_available;
if (mi_row == 0) return 1;
if (((mi_col + 1) << wl) >= 8) return 0;
my_order = order[((mi_row + 0) << (3 - wl)) + mi_col + 0];
tr_order = order[((mi_row - 1) << (3 - wl)) + mi_col + 1];
return my_order > tr_order && right_available;
return my_order > tr_order;
} else {
int wl = mi_width_log2_lookup[bsize];
int w = 1 << (wl + 1 - ss_x);
......@@ -114,7 +116,9 @@ static int av1_has_right(BLOCK_SIZE bsize, int mi_row, int mi_col,
static int av1_has_bottom(BLOCK_SIZE bsize, int mi_row, int mi_col,
int bottom_available, TX_SIZE txsz, int y, int x,
int ss_y) {
if (x == 0) {
if (!bottom_available || x != 0) {
return 0;
} else {
int wl = mi_width_log2_lookup[bsize];
int hl = mi_height_log2_lookup[bsize];
int h = 1 << (hl + 1 - ss_y);
......@@ -137,8 +141,6 @@ static int av1_has_bottom(BLOCK_SIZE bsize, int mi_row, int mi_col,
bl_order = order[((mi_row + 1) << (3 - wl)) + mi_col - 1];
return bl_order < my_order && bottom_available;
} else {
return 0;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment