Commit 034c28b0 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

vp10: split UV int4x4 loopfilter flag in one for each covered edge.

In practice, this fixes the issue that if you have an odd number of
mi_cols, on the full right of the image, the UV int4x4 loopfilter
will be skipped over odd cols as well as odd rows (because it holds a
single variable for both edges).

See issue 1016.

Change-Id: Id53b501cbff9323a8239ed4775ae01fe91874b7e
parent bab8d38f
......@@ -719,7 +719,11 @@ static void build_masks(const loop_filter_info_n *const lfi_n,
uint64_t *const int_4x4_y = &lfm->int_4x4_y;
uint16_t *const left_uv = &lfm->left_uv[tx_size_uv];
uint16_t *const above_uv = &lfm->above_uv[tx_size_uv];
#if CONFIG_MISC_FIXES
uint16_t *const int_4x4_uv = &lfm->left_int_4x4_uv;
#else
uint16_t *const int_4x4_uv = &lfm->int_4x4_uv;
#endif
int i;
// If filter level is 0 we don't loop filter.
......@@ -1015,7 +1019,11 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
lfm->above_uv[i] &= mask_uv;
}
lfm->int_4x4_y &= mask_y;
#if CONFIG_MISC_FIXES
lfm->above_int_4x4_uv = lfm->left_int_4x4_uv & mask_uv;
#else
lfm->int_4x4_uv &= mask_uv;
#endif
// We don't apply a wide loop filter on the last uv block row. If set
// apply the shorter one instead.
......@@ -1049,7 +1057,11 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
lfm->above_uv[i] &= mask_uv;
}
lfm->int_4x4_y &= mask_y;
#if CONFIG_MISC_FIXES
lfm->left_int_4x4_uv &= mask_uv_int;
#else
lfm->int_4x4_uv &= mask_uv_int;
#endif
// We don't apply a wide loop filter on the last uv column. If set
// apply the shorter one instead.
......@@ -1079,7 +1091,11 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
assert(!(lfm->left_uv[TX_16X16]&lfm->left_uv[TX_8X8]));
assert(!(lfm->left_uv[TX_16X16] & lfm->left_uv[TX_4X4]));
assert(!(lfm->left_uv[TX_8X8] & lfm->left_uv[TX_4X4]));
#if CONFIG_MISC_FIXES
assert(!(lfm->left_int_4x4_uv & lfm->left_uv[TX_16X16]));
#else
assert(!(lfm->int_4x4_uv & lfm->left_uv[TX_16X16]));
#endif
assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_8X8]));
assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_4X4]));
assert(!(lfm->above_y[TX_8X8] & lfm->above_y[TX_4X4]));
......@@ -1087,7 +1103,11 @@ void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_8X8]));
assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_4X4]));
assert(!(lfm->above_uv[TX_8X8] & lfm->above_uv[TX_4X4]));
#if CONFIG_MISC_FIXES
assert(!(lfm->above_int_4x4_uv & lfm->above_uv[TX_16X16]));
#else
assert(!(lfm->int_4x4_uv & lfm->above_uv[TX_16X16]));
#endif
}
static void filter_selectively_vert(uint8_t *s, int pitch,
......@@ -1442,7 +1462,11 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
uint16_t mask_16x16 = lfm->left_uv[TX_16X16];
uint16_t mask_8x8 = lfm->left_uv[TX_8X8];
uint16_t mask_4x4 = lfm->left_uv[TX_4X4];
#if CONFIG_MISC_FIXES
uint16_t mask_4x4_int = lfm->left_int_4x4_uv;
#else
uint16_t mask_4x4_int = lfm->int_4x4_uv;
#endif
assert(plane->subsampling_x == 1 && plane->subsampling_y == 1);
......@@ -1494,7 +1518,11 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
mask_16x16 = lfm->above_uv[TX_16X16];
mask_8x8 = lfm->above_uv[TX_8X8];
mask_4x4 = lfm->above_uv[TX_4X4];
#if CONFIG_MISC_FIXES
mask_4x4_int = lfm->above_int_4x4_uv;
#else
mask_4x4_int = lfm->int_4x4_uv;
#endif
for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1;
......
......@@ -80,7 +80,12 @@ typedef struct {
uint64_t int_4x4_y;
uint16_t left_uv[TX_SIZES];
uint16_t above_uv[TX_SIZES];
#if CONFIG_MISC_FIXES
uint16_t left_int_4x4_uv;
uint16_t above_int_4x4_uv;
#else
uint16_t int_4x4_uv;
#endif
uint8_t lfl_y[64];
uint8_t lfl_uv[16];
} LOOP_FILTER_MASK;
......
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