Remove recon_variance variable from MACROBLOCK
Skip redundant computation of recon_variance value.
Change-Id: I0ea1a3528f8bdc7095d9cc458ce0bd3a958989b4
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index 5c7aeb4..38fc18e 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -119,7 +119,6 @@
int mv_best_ref_index[TOTAL_REFS_PER_FRAME];
unsigned int max_mv_context[TOTAL_REFS_PER_FRAME];
unsigned int source_variance;
- unsigned int recon_variance;
unsigned int pred_sse[TOTAL_REFS_PER_FRAME];
int pred_mv_sad[TOTAL_REFS_PER_FRAME];
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index bf6c94c..e91a50d 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -8979,18 +8979,6 @@
#endif // CONFIG_VAR_TX
best_xskip = x->skip;
best_disable_skip = *disable_skip;
-#if CONFIG_AOM_HIGHBITDEPTH
- if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
- x->recon_variance = av1_high_get_sby_perpixel_variance(
- cpi, &xd->plane[0].dst, bsize, xd->bd);
- } else {
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
- }
-#else
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
-#endif // CONFIG_AOM_HIGHBITDEPTH
}
}
@@ -9014,19 +9002,6 @@
#if !(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION)
if (!is_comp_pred) single_skippable[this_mode][refs[0]] = rd_stats->skip;
-
-#if CONFIG_AOM_HIGHBITDEPTH
- if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
- x->recon_variance = av1_high_get_sby_perpixel_variance(
- cpi, &xd->plane[0].dst, bsize, xd->bd);
- } else {
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
- }
-#else
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
-#endif // CONFIG_AOM_HIGHBITDEPTH
#endif // !(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION)
restore_dst_buf(xd, orig_dst);
@@ -9339,18 +9314,6 @@
distortion2 = distortion_y + distortion_uv;
av1_encode_intra_block_plane((AV1_COMMON *)cm, x, bsize, 0, 0, mi_row,
mi_col);
-#if CONFIG_AOM_HIGHBITDEPTH
- if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
- x->recon_variance = av1_high_get_sby_perpixel_variance(
- cpi, &xd->plane[0].dst, bsize, xd->bd);
- } else {
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
- }
-#else
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
-#endif // CONFIG_AOM_HIGHBITDEPTH
rate2 += ref_costs_single[INTRA_FRAME];
@@ -10168,18 +10131,6 @@
if (this_mode != DC_PRED && this_mode != TM_PRED)
rate2 += intra_cost_penalty;
distortion2 = distortion_y + distortion_uv;
-#if CONFIG_AOM_HIGHBITDEPTH
- if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
- x->recon_variance = av1_high_get_sby_perpixel_variance(
- cpi, &xd->plane[0].dst, bsize, xd->bd);
- } else {
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
- }
-#else
- x->recon_variance =
- av1_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
-#endif // CONFIG_AOM_HIGHBITDEPTH
} else {
#if CONFIG_REF_MV
int_mv backup_ref_mv[2];