Commit 228cc18f authored by Angie Chiang's avatar Angie Chiang

Replace dist_has_residue by enum OUTPUT_STATUS

Change-Id: I816cada620c6fcff30955cf0e62766ce601eedaf
parent 1e6e1306
......@@ -1371,10 +1371,15 @@ static int64_t sum_squares_visible(const MACROBLOCKD *xd, int plane,
return aom_sum_squares_2d_i16(diff, diff_stride, visible_cols, visible_rows);
}
typedef enum OUTPUT_STATUS {
OUTPUT_HAS_PREDICTED_PIXELS,
OUTPUT_HAS_DECODED_PIXELS
} OUTPUT_STATUS;
static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
BLOCK_SIZE plane_bsize, int block, int blk_row,
int blk_col, TX_SIZE tx_size, int64_t *out_dist,
int64_t *out_sse, int dst_has_residue) {
int64_t *out_sse, OUTPUT_STATUS output_status) {
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblock_plane *const p = &x->plane[plane];
const struct macroblockd_plane *const pd = &xd->plane[plane];
......@@ -1443,7 +1448,7 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
#if CONFIG_DAALA_DIST
if (plane == 0) {
if (bsw >= 8 && bsh >= 8) {
if (dst_has_residue) {
if (output_status == OUTPUT_HAS_DECODED_PIXELS) {
const int pred_stride = block_size_wide[plane_bsize];
const int16_t *pred = &pd->pred[(blk_row * pred_stride + blk_col)
<< tx_size_wide_log2[0]];
......@@ -1475,7 +1480,7 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
*out_sse = (int64_t)tmp * 16;
if (eob) {
if (dst_has_residue) {
if (output_status == OUTPUT_HAS_DECODED_PIXELS) {
#if CONFIG_DAALA_DIST
if (plane == 0) {
if (bsw >= 8 && bsh >= 8)
......@@ -1595,10 +1600,12 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
av1_inverse_transform_block(xd, dqcoeff, tx_type, tx_size, dst, dst_stride,
p->eobs[block]);
dist_block(args->cpi, x, plane, plane_bsize, block, blk_row, blk_col,
tx_size, &this_rd_stats.dist, &this_rd_stats.sse, 1);
tx_size, &this_rd_stats.dist, &this_rd_stats.sse,
OUTPUT_HAS_DECODED_PIXELS);
} else {
dist_block(args->cpi, x, plane, plane_bsize, block, blk_row, blk_col,
tx_size, &this_rd_stats.dist, &this_rd_stats.sse, 0);
tx_size, &this_rd_stats.dist, &this_rd_stats.sse,
OUTPUT_HAS_PREDICTED_PIXELS);
}
rd = RDCOST(x->rdmult, x->rddiv, 0, this_rd_stats.dist);
......@@ -5252,7 +5259,7 @@ static int64_t encode_inter_mb_segment_sub8x8(
if (xd->lossless[xd->mi[0]->mbmi.segment_id] == 0)
av1_optimize_b(cm, x, 0, block, tx_size, coeff_ctx);
dist_block(cpi, x, 0, BLOCK_8X8, block, idy + (i >> 1), idx + (i & 0x1),
tx_size, &dist, &ssz, 0);
tx_size, &dist, &ssz, OUTPUT_HAS_PREDICTED_PIXELS);
thisdistortion += dist;
thissse += ssz;
#if !CONFIG_PVQ
......
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