Commit 1cd34621 authored by Yushin Cho's avatar Yushin Cho
Browse files

[dist-8x8] Add more asserts

Added more asserts for dist-8x8 running in PSNR mode,
i.e. with the encoder option "--enable-dist-8x8=1"
instead of --tune=[cdef-dist | daala-dist].

The asserts checks whether a 8x8 distortion measured on reconstructed 8x8 pixels
is identical to the sum of distortions from sub8x8 partitions (or tx blocks for
var-tx case).

Change-Id: I14f2b24e674a9cbbe60e663449fc4e7f46f0e481
parent 0c7eb10d
......@@ -3004,6 +3004,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
int64_t dist_8x8;
dist_8x8 =
dist_8x8_yuv(cpi, x, x->plane[0].src.buf - 4 * src_stride - 4);
if (x->tune_metric == AOM_TUNE_PSNR) assert(sum_rdc.dist == dist_8x8);
sum_rdc.dist = dist_8x8;
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
}
......@@ -3095,6 +3096,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
const int src_stride = x->plane[0].src.stride;
int64_t dist_8x8;
dist_8x8 = dist_8x8_yuv(cpi, x, x->plane[0].src.buf - 4 * src_stride);
if (x->tune_metric == AOM_TUNE_PSNR) assert(sum_rdc.dist == dist_8x8);
sum_rdc.dist = dist_8x8;
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
}
......@@ -3178,6 +3180,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
bsize == BLOCK_8X8) {
int64_t dist_8x8;
dist_8x8 = dist_8x8_yuv(cpi, x, x->plane[0].src.buf - 4);
if (x->tune_metric == AOM_TUNE_PSNR) assert(sum_rdc.dist == dist_8x8);
sum_rdc.dist = dist_8x8;
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
}
......
......@@ -5126,6 +5126,7 @@ static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row,
dist_8x8 = av1_dist_8x8(cpi, x, src, src_stride, dst, dst_stride,
BLOCK_8X8, 8, 8, 8, 8, qindex) *
16;
if (x->tune_metric == AOM_TUNE_PSNR) assert(sum_rd_stats.sse == dist_8x8);
sum_rd_stats.sse = dist_8x8;
#if CONFIG_HIGHBITDEPTH
......@@ -5183,6 +5184,8 @@ static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row,
dist_8x8 = av1_dist_8x8(cpi, x, src, src_stride, pred8, 8, BLOCK_8X8, 8,
8, 8, 8, qindex) *
16;
if (x->tune_metric == AOM_TUNE_PSNR)
assert(sum_rd_stats.dist == dist_8x8);
sum_rd_stats.dist = dist_8x8;
tmp_rd = RDCOST(x->rdmult, sum_rd_stats.rate, sum_rd_stats.dist);
}
......
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