clean up CDEF code for tile boundary handling since loop_filter_cross_tiles_enable flag is removed, CDEF does not need to handle tile boundaies anymore. instead, we just need to handle frame boundary. this patch will not change the encoder and decoder behavior, because the boundary_info is programmed by high level code, which has been removed, so tile_left, tile_above, tile_right, tile_bottom flag is only set to 1 for frame boundaries. this change only clean up the code and change the varialble name and comment to avoid confusion. Change-Id: I2f5333570d2c330004e4b63cb5a5dbb62ca71310
diff --git a/av1/common/cdef.c b/av1/common/cdef.c index 213350a..7545dc5 100644 --- a/av1/common/cdef.c +++ b/av1/common/cdef.c
@@ -200,7 +200,7 @@ if (!cdef_left) cstart = -CDEF_HBORDER; nhb = AOMMIN(MI_SIZE_64X64, cm->mi_cols - MI_SIZE_64X64 * fbc); nvb = AOMMIN(MI_SIZE_64X64, cm->mi_rows - MI_SIZE_64X64 * fbr); - int tile_top, tile_left, tile_bottom, tile_right; + int frame_top, frame_left, frame_bottom, frame_right; int mi_row = MI_SIZE_64X64 * fbr; int mi_col = MI_SIZE_64X64 * fbc; @@ -209,34 +209,29 @@ int mi_idx_bl = (mi_row + MI_SIZE_64X64 - 1) * cm->mi_stride + mi_col; // for the current filter block, it's top left corner mi structure (mi_tl) // is first accessed to check whether the top and left boundaries are - // tile boundaries. Then bottom-left and top-right mi structures are + // frame boundaries. Then bottom-left and top-right mi structures are // accessed to check whether the bottom and right boundaries - // (respectively) are tile boundaries. + // (respectively) are frame boundaries. // // Note that we can't just check the bottom-right mi structure - eg. if // we're at the right-hand edge of the frame but not the bottom, then // the bottom-right mi is NULL but the bottom-left is not. - // - // We assume the boundary information is set correctly based on the - // loop_filter_across_tiles_enabled flag, i.e, if this flag is set to 1, - // then boundary_info should not be treated as tile boundaries. Also - // assume CDEF filter block size is 64x64. BOUNDARY_TYPE *const bi_tl = cm->boundary_info + mi_idx_tl; BOUNDARY_TYPE *const bi_tr = cm->boundary_info + mi_idx_tr; BOUNDARY_TYPE *const bi_bl = cm->boundary_info + mi_idx_bl; BOUNDARY_TYPE boundary_tl = *bi_tl; - tile_top = boundary_tl & TILE_ABOVE_BOUNDARY; - tile_left = boundary_tl & TILE_LEFT_BOUNDARY; + frame_top = boundary_tl & FRAME_ABOVE_BOUNDARY; + frame_left = boundary_tl & FRAME_LEFT_BOUNDARY; if (fbr != nvfb - 1 && bi_bl) - tile_bottom = *bi_bl & TILE_BOTTOM_BOUNDARY; + frame_bottom = *bi_bl & FRAME_BOTTOM_BOUNDARY; else - tile_bottom = 1; + frame_bottom = 1; if (fbc != nhfb - 1 && bi_tr) - tile_right = *bi_tr & TILE_RIGHT_BOUNDARY; + frame_right = *bi_tr & FRAME_RIGHT_BOUNDARY; else - tile_right = 1; + frame_right = 1; const int mbmi_cdef_strength = cm->mi_grid_visible[MI_SIZE_64X64 * fbr * cm->mi_stride + @@ -357,19 +352,19 @@ (MI_SIZE_64X64 << mi_high_l2[pli]) * (fbr + 1) - CDEF_VBORDER, coffset, xd->plane[pli].dst.stride, CDEF_VBORDER, hsize); - if (tile_top) { + if (frame_top) { fill_rect(src, CDEF_BSTRIDE, CDEF_VBORDER, hsize + 2 * CDEF_HBORDER, CDEF_VERY_LARGE); } - if (tile_left) { + if (frame_left) { fill_rect(src, CDEF_BSTRIDE, vsize + 2 * CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE); } - if (tile_bottom) { + if (frame_bottom) { fill_rect(&src[(vsize + CDEF_VBORDER) * CDEF_BSTRIDE], CDEF_BSTRIDE, CDEF_VBORDER, hsize + 2 * CDEF_HBORDER, CDEF_VERY_LARGE); } - if (tile_right) { + if (frame_right) { fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE, vsize + 2 * CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE); }
diff --git a/av1/common/enums.h b/av1/common/enums.h index 6877943..c5843bc 100644 --- a/av1/common/enums.h +++ b/av1/common/enums.h
@@ -308,14 +308,10 @@ #define IS_2D_TRANSFORM(tx_type) (tx_type < IDTX) typedef enum ATTRIBUTE_PACKED { - TILE_LEFT_BOUNDARY = 1, - TILE_RIGHT_BOUNDARY = 2, - TILE_ABOVE_BOUNDARY = 4, - TILE_BOTTOM_BOUNDARY = 8, - FRAME_LEFT_BOUNDARY = 16, - FRAME_RIGHT_BOUNDARY = 32, - FRAME_ABOVE_BOUNDARY = 64, - FRAME_BOTTOM_BOUNDARY = 128, + FRAME_LEFT_BOUNDARY = 1, + FRAME_RIGHT_BOUNDARY = 2, + FRAME_ABOVE_BOUNDARY = 4, + FRAME_BOTTOM_BOUNDARY = 8, } BOUNDARY_TYPE; #define EXT_TX_SIZES 4 // number of sizes that use extended transforms
diff --git a/av1/common/tile_common.c b/av1/common/tile_common.c index 179c4f3..01766b0 100644 --- a/av1/common/tile_common.c +++ b/av1/common/tile_common.c
@@ -125,26 +125,26 @@ BOUNDARY_TYPE *bi = cm->boundary_info; int col; for (col = 0; col < cm->mi_cols; ++col) { - *bi |= FRAME_ABOVE_BOUNDARY | TILE_ABOVE_BOUNDARY; + *bi |= FRAME_ABOVE_BOUNDARY; bi += 1; } bi = cm->boundary_info; int row; for (row = 0; row < cm->mi_rows; ++row) { - *bi |= FRAME_LEFT_BOUNDARY | TILE_LEFT_BOUNDARY; + *bi |= FRAME_LEFT_BOUNDARY; bi += cm->mi_stride; } bi = cm->boundary_info + (cm->mi_rows - 1) * cm->mi_stride; for (col = 0; col < cm->mi_cols; ++col) { - *bi |= FRAME_BOTTOM_BOUNDARY | TILE_BOTTOM_BOUNDARY; + *bi |= FRAME_BOTTOM_BOUNDARY; bi += 1; } bi = cm->boundary_info + cm->mi_cols - 1; for (row = 0; row < cm->mi_rows; ++row) { - *bi |= FRAME_RIGHT_BOUNDARY | TILE_RIGHT_BOUNDARY; + *bi |= FRAME_RIGHT_BOUNDARY; bi += cm->mi_stride; } }