From 034c28b0a415e6289f66157766a022f056bca2f1 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 9 Sep 2015 16:50:07 -0400 Subject: [PATCH] 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 --- vp10/common/loopfilter.c | 28 ++++++++++++++++++++++++++++ vp10/common/loopfilter.h | 5 +++++ 2 files changed, 33 insertions(+) diff --git a/vp10/common/loopfilter.c b/vp10/common/loopfilter.c index 1b89ed5a2..a1925de55 100644 --- a/vp10/common/loopfilter.c +++ b/vp10/common/loopfilter.c @@ -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; diff --git a/vp10/common/loopfilter.h b/vp10/common/loopfilter.h index 329ab75af..8db705aa0 100644 --- a/vp10/common/loopfilter.h +++ b/vp10/common/loopfilter.h @@ -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; -- 2.40.0