Commit b06af207 authored by Jingning Han's avatar Jingning Han
Browse files

Make cdef block offset scalable with mode_info size

Properly map the mode_info offset to pixel offset in cdef to
support cb4x4 mode.

Change-Id: I1f876387cb327cbf6c5689a4bc5ac41a1b1b0f34
parent c86e7aa0
...@@ -222,20 +222,23 @@ void copy_dering_16bit_to_16bit(uint16_t *dst, int dstride, uint16_t *src, ...@@ -222,20 +222,23 @@ void copy_dering_16bit_to_16bit(uint16_t *dst, int dstride, uint16_t *src,
dering_list *dlist, int dering_count, dering_list *dlist, int dering_count,
BLOCK_SIZE bsize) { BLOCK_SIZE bsize) {
int bi, bx, by; int bi, bx, by;
const int mi_size_l2 = (bsize == BLOCK_8X8) ? MI_SIZE_LOG2 : MI_SIZE_LOG2 - 1;
if (bsize == BLOCK_8X8) { if (bsize == BLOCK_8X8) {
for (bi = 0; bi < dering_count; bi++) { for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by; by = dlist[bi].by;
bx = dlist[bi].bx; bx = dlist[bi].bx;
copy_8x8_16bit_to_16bit(&dst[(by << 3) * dstride + (bx << 3)], dstride, copy_8x8_16bit_to_16bit(
&src[bi << (2 * 3)], 8); &dst[(by << mi_size_l2) * dstride + (bx << mi_size_l2)], dstride,
&src[bi << (2 * 3)], 8);
} }
} else { } else {
for (bi = 0; bi < dering_count; bi++) { for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by; by = dlist[bi].by;
bx = dlist[bi].bx; bx = dlist[bi].bx;
copy_4x4_16bit_to_16bit(&dst[(by << 2) * dstride + (bx << 2)], dstride, copy_4x4_16bit_to_16bit(
&src[bi << (2 * 2)], 4); &dst[(by << mi_size_l2) * dstride + (bx << mi_size_l2)], dstride,
&src[bi << (2 * 2)], 4);
} }
} }
} }
...@@ -303,6 +306,7 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec, ...@@ -303,6 +306,7 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec,
}; };
int threshold = (pli ? level_table_uv : level_table)[level] << coeff_shift; int threshold = (pli ? level_table_uv : level_table)[level] << coeff_shift;
const int mi_size_l2 = xdec ? MI_SIZE_LOG2 - 1 : MI_SIZE_LOG2;
od_filter_dering_direction_func filter_dering_direction[OD_DERINGSIZES] = { od_filter_dering_direction_func filter_dering_direction[OD_DERINGSIZES] = {
od_filter_dering_direction_4x4, od_filter_dering_direction_8x8 od_filter_dering_direction_4x4, od_filter_dering_direction_8x8
}; };
...@@ -314,7 +318,7 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec, ...@@ -314,7 +318,7 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec,
by = dlist[bi].by; by = dlist[bi].by;
bx = dlist[bi].bx; bx = dlist[bi].bx;
dir[by][bx] = dir[by][bx] =
od_dir_find8(&in[8 * by * OD_FILT_BSTRIDE + 8 * bx], od_dir_find8(&in[MI_SIZE * by * OD_FILT_BSTRIDE + MI_SIZE * bx],
OD_FILT_BSTRIDE, &var[by][bx], coeff_shift); OD_FILT_BSTRIDE, &var[by][bx], coeff_shift);
} }
if (dirinit) *dirinit = 1; if (dirinit) *dirinit = 1;
...@@ -332,7 +336,7 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec, ...@@ -332,7 +336,7 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec,
get removed by the directional filtering. */ get removed by the directional filtering. */
(filter_dering_direction[bsize - OD_LOG_BSIZE0])( (filter_dering_direction[bsize - OD_LOG_BSIZE0])(
&y[bi << 2 * bsize], 1 << bsize, &y[bi << 2 * bsize], 1 << bsize,
&in[(by * OD_FILT_BSTRIDE << bsize) + (bx << bsize)], &in[(by * OD_FILT_BSTRIDE << mi_size_l2) + (bx << mi_size_l2)],
od_adjust_thresh(threshold, var[by][bx]), dir[by][bx]); od_adjust_thresh(threshold, var[by][bx]), dir[by][bx]);
} }
} else { } else {
...@@ -341,8 +345,8 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec, ...@@ -341,8 +345,8 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec,
bx = dlist[bi].bx; bx = dlist[bi].bx;
(filter_dering_direction[bsize - OD_LOG_BSIZE0])( (filter_dering_direction[bsize - OD_LOG_BSIZE0])(
&y[bi << 2 * bsize], 1 << bsize, &y[bi << 2 * bsize], 1 << bsize,
&in[(by * OD_FILT_BSTRIDE << bsize) + (bx << bsize)], threshold, &in[(by * OD_FILT_BSTRIDE << mi_size_l2) + (bx << mi_size_l2)],
dir[by][bx]); threshold, dir[by][bx]);
} }
} }
} }
...@@ -358,8 +362,8 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec, ...@@ -358,8 +362,8 @@ void od_dering(uint8_t *dst, int dstride, uint16_t *y, uint16_t *in, int xdec,
(!threshold || (dir[by][bx] < 4 && dir[by][bx]) ? aom_clpf_block_hbd (!threshold || (dir[by][bx] < 4 && dir[by][bx]) ? aom_clpf_block_hbd
: aom_clpf_hblock_hbd)( : aom_clpf_hblock_hbd)(
in, &y[((bi - by) << 2 * bsize) - (bx << bsize)], OD_FILT_BSTRIDE, in, &y[((bi - by) << 2 * bsize) - (bx << bsize)], OD_FILT_BSTRIDE,
1 << bsize, bx << bsize, by << bsize, 1 << bsize, 1 << bsize, 1 << bsize, bx << mi_size_l2, by << mi_size_l2, 1 << bsize,
clpf_strength << coeff_shift, clpf_damping + coeff_shift); 1 << bsize, clpf_strength << coeff_shift, clpf_damping + coeff_shift);
} }
} }
if (dst) { if (dst) {
......
...@@ -18,7 +18,11 @@ ...@@ -18,7 +18,11 @@
#define OD_DERING_SIZE_LOG2 (3) #define OD_DERING_SIZE_LOG2 (3)
#if CONFIG_CB4X4
#define OD_DERING_NBLOCKS (OD_BSIZE_MAX / 4)
#else
#define OD_DERING_NBLOCKS (OD_BSIZE_MAX / 8) #define OD_DERING_NBLOCKS (OD_BSIZE_MAX / 8)
#endif
/* We need to buffer three vertical lines. */ /* We need to buffer three vertical lines. */
#define OD_FILT_VBORDER (3) #define OD_FILT_VBORDER (3)
......
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