Commit 75b01004 authored by Yushin Cho's avatar Yushin Cho

Fix daala_dist to handle visible pixels only

- If invisible pixels, av1_daala_dist() simply use source pixles for dst.
- Added av1_daala_dist_diff() which inputs diff signal instead of dst.

- Refactored daala_dist code so that av1_daala_dist() and _diff()
is called inside av1's distortion calculation functions, pixel_sse() and
sum_squares_visible().

Change-Id: Id857db52fe19856d92c46a9e84ac2962c01ae045
parent 6f0566e7
......@@ -3661,8 +3661,8 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
int64_t daala_dist;
const int src_stride = x->plane[0].src.stride;
daala_dist = av1_daala_dist(x->plane[0].src.buf - 4 * src_stride - 4,
src_stride, x->decoded_8x8, 8, 8, 8, 1,
use_activity_masking, x->qindex)
src_stride, x->decoded_8x8, 8, 8, 8, 8, 8,
1, use_activity_masking, x->qindex)
<< 4;
assert(sum_rdc.dist_y < INT64_MAX);
sum_rdc.dist = sum_rdc.dist - sum_rdc.dist_y + daala_dist;
......@@ -3837,8 +3837,8 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
int64_t daala_dist;
const int src_stride = x->plane[0].src.stride;
daala_dist = av1_daala_dist(x->plane[0].src.buf - 4 * src_stride,
src_stride, x->decoded_8x8, 8, 8, 8, 1,
use_activity_masking, x->qindex)
src_stride, x->decoded_8x8, 8, 8, 8, 8, 8,
1, use_activity_masking, x->qindex)
<< 4;
sum_rdc.dist = sum_rdc.dist - sum_rdc.dist_y + daala_dist;
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
......@@ -4010,7 +4010,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
const int src_stride = x->plane[0].src.stride;
daala_dist =
av1_daala_dist(x->plane[0].src.buf - 4, src_stride, x->decoded_8x8,
8, 8, 8, 1, use_activity_masking, x->qindex)
8, 8, 8, 8, 8, 1, use_activity_masking, x->qindex)
<< 4;
sum_rdc.dist = sum_rdc.dist - sum_rdc.dist_y + daala_dist;
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
......
This diff is collapsed.
......@@ -64,8 +64,9 @@ void av1_dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
#if CONFIG_DAALA_DIST
int64_t av1_daala_dist(const uint8_t *src, int src_stride, const uint8_t *dst,
int dst_stride, int bsw, int bsh, int qm,
int use_activity_masking, int qindex);
int dst_stride, int bsw, int bsh, int visible_w,
int visible_h, int qm, int use_activity_masking,
int qindex);
#endif
#if !CONFIG_PVQ || CONFIG_VAR_TX
......
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