Commit 58fdec2c authored by Jean-Marc Valin's avatar Jean-Marc Valin Committed by Yaowu Xu
Browse files

Renaming deringing blockwise write-back functions to make code clearer

No change in output.

Change-Id: Ifa5df3adce9f24ef6dcd89a5f33a744bfb57194d
parent 3544d151
......@@ -72,14 +72,14 @@ int sb_compute_dering_list(const AV1_COMMON *const cm, int mi_row, int mi_col,
return count;
}
static INLINE void copy_8x8_16_8bit(uint8_t *dst, int dstride, int16_t *src, int sstride) {
static INLINE void copy_8x8_16bit_to_8bit(uint8_t *dst, int dstride, int16_t *src, int sstride) {
int i, j;
for (i = 0; i < 8; i++)
for (j = 0; j < 8; j++)
dst[i * dstride + j] = src[i * sstride + j];
}
static INLINE void copy_4x4_16_8bit(uint8_t *dst, int dstride, int16_t *src, int sstride) {
static INLINE void copy_4x4_16bit_to_8bit(uint8_t *dst, int dstride, int16_t *src, int sstride) {
int i, j;
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
......@@ -87,7 +87,7 @@ static INLINE void copy_4x4_16_8bit(uint8_t *dst, int dstride, int16_t *src, int
}
/* TODO: Optimize this function for SSE. */
void copy_blocks_16_8bit(uint8_t *dst, int dstride, int16_t *src,
void copy_dering_16bit_to_8bit(uint8_t *dst, int dstride, int16_t *src,
dering_list *dlist, int dering_count, int bsize)
{
int bi, bx, by;
......@@ -95,7 +95,7 @@ void copy_blocks_16_8bit(uint8_t *dst, int dstride, int16_t *src,
for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by;
bx = dlist[bi].bx;
copy_8x8_16_8bit(&dst[(by << 3) * dstride + (bx << 3)],
copy_8x8_16bit_to_8bit(&dst[(by << 3) * dstride + (bx << 3)],
dstride,
&src[bi << 2*bsize], 1 << bsize);
}
......@@ -103,7 +103,7 @@ void copy_blocks_16_8bit(uint8_t *dst, int dstride, int16_t *src,
for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by;
bx = dlist[bi].bx;
copy_4x4_16_8bit(&dst[(by << 2) * dstride + (bx << 2)],
copy_4x4_16bit_to_8bit(&dst[(by << 2) * dstride + (bx << 2)],
dstride,
&src[bi << 2*bsize], 1 << bsize);
}
......@@ -344,7 +344,7 @@ void av1_dering_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
dec[pli], dir, pli, dlist, dering_count, threshold, coeff_shift);
#if CONFIG_AOM_HIGHBITDEPTH
if (cm->use_highbitdepth) {
copy_blocks_16bit(
copy_dering_16bit_to_16bit(
(int16_t*)&CONVERT_TO_SHORTPTR(
xd->plane[pli].dst.buf)[xd->plane[pli].dst.stride *
(MAX_MIB_SIZE * sbr << bsize[pli]) +
......@@ -353,7 +353,7 @@ void av1_dering_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
dering_count, 3 - dec[pli]);
} else {
#endif
copy_blocks_16_8bit(
copy_dering_16bit_to_8bit(
&xd->plane[pli].dst.buf[xd->plane[pli].dst.stride *
(MAX_MIB_SIZE * sbr << bsize[pli]) +
(sbc * MAX_MIB_SIZE << bsize[pli])],
......
......@@ -258,14 +258,14 @@ static INLINE int od_adjust_thresh(int threshold, int32_t var) {
return (threshold * OD_THRESH_TABLE_Q8[OD_ILOG(v1)] + 128) >> 8;
}
static INLINE void copy_8x8_16bit(int16_t *dst, int dstride, int16_t *src, int sstride) {
static INLINE void copy_8x8_16bit_to_16bit(int16_t *dst, int dstride, int16_t *src, int sstride) {
int i, j;
for (i = 0; i < 8; i++)
for (j = 0; j < 8; j++)
dst[i * dstride + j] = src[i * sstride + j];
}
static INLINE void copy_4x4_16bit(int16_t *dst, int dstride, int16_t *src, int sstride) {
static INLINE void copy_4x4_16bit_to_16bit(int16_t *dst, int dstride, int16_t *src, int sstride) {
int i, j;
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
......@@ -273,7 +273,7 @@ static INLINE void copy_4x4_16bit(int16_t *dst, int dstride, int16_t *src, int s
}
/* TODO: Optimize this function for SSE. */
void copy_blocks_16bit(int16_t *dst, int dstride, int16_t *src,
void copy_dering_16bit_to_16bit(int16_t *dst, int dstride, int16_t *src,
dering_list *dlist, int dering_count, int bsize)
{
int bi, bx, by;
......@@ -281,7 +281,7 @@ void copy_blocks_16bit(int16_t *dst, int dstride, int16_t *src,
for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by;
bx = dlist[bi].bx;
copy_8x8_16bit(&dst[(by << 3) * dstride + (bx << 3)],
copy_8x8_16bit_to_16bit(&dst[(by << 3) * dstride + (bx << 3)],
dstride,
&src[bi << 2*bsize], 1 << bsize);
}
......@@ -289,7 +289,7 @@ void copy_blocks_16bit(int16_t *dst, int dstride, int16_t *src,
for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by;
bx = dlist[bi].bx;
copy_4x4_16bit(&dst[(by << 2) * dstride + (bx << 2)],
copy_4x4_16bit_to_16bit(&dst[(by << 2) * dstride + (bx << 2)],
dstride,
&src[bi << 2*bsize], 1 << bsize);
}
......@@ -342,7 +342,7 @@ void od_dering(int16_t *y, int16_t *in, int xdec,
dir[by][bx]);
}
}
copy_blocks_16bit(in, OD_FILT_BSTRIDE, y, dlist, dering_count,
copy_dering_16bit_to_16bit(in, OD_FILT_BSTRIDE, y, dlist, dering_count,
bsize);
for (bi = 0; bi < dering_count; bi++) {
by = dlist[bi].by;
......
......@@ -44,7 +44,7 @@ typedef int (*od_filter_dering_direction_func)(int16_t *y, int ystride,
typedef void (*od_filter_dering_orthogonal_func)(int16_t *y, int ystride,
const int16_t *in,
int threshold, int dir);
void copy_blocks_16bit(int16_t *dst, int dstride, int16_t *src,
void copy_dering_16bit_to_16bit(int16_t *dst, int dstride, int16_t *src,
dering_list *dlist, int dering_count, int bsize);
void od_dering(int16_t *y, int16_t *in, int xdec,
......
......@@ -138,7 +138,7 @@ int av1_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
}
od_dering(tmp_dst, in, 0, dir, 0, dlist, dering_count, threshold,
coeff_shift);
copy_blocks_16bit(dst, MAX_MIB_SIZE << bsize[0], tmp_dst, dlist,
copy_dering_16bit_to_16bit(dst, MAX_MIB_SIZE << bsize[0], tmp_dst, dlist,
dering_count, 3);
cur_mse = (int)compute_dist(
dst, MAX_MIB_SIZE << bsize[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