Calculate intra sse/dist under ducky_encode
Change-Id: I2688c8f0e8c67aab7a26f710d72144a5466ca841
diff --git a/av1/encoder/tpl_model.c b/av1/encoder/tpl_model.c
index dd6f89e..6ddcf9e 100644
--- a/av1/encoder/tpl_model.c
+++ b/av1/encoder/tpl_model.c
@@ -570,14 +570,17 @@
}
int rate_cost = 1;
- get_rate_distortion(&rate_cost, &recon_error, &pred_error, src_diff, coeff,
- qcoeff, dqcoeff, cm, x, NULL, rec_buffer_pool,
- rec_stride_pool, tx_size, best_mode, mi_row, mi_col,
- use_y_only_rate_distortion, NULL);
- tpl_stats->intra_dist = recon_error << TPL_DEP_COST_SCALE_LOG2;
- tpl_stats->intra_sse = pred_error << TPL_DEP_COST_SCALE_LOG2;
- tpl_stats->intra_rate = rate_cost;
+ if (cpi->use_ducky_encode) {
+ get_rate_distortion(&rate_cost, &recon_error, &pred_error, src_diff, coeff,
+ qcoeff, dqcoeff, cm, x, NULL, rec_buffer_pool,
+ rec_stride_pool, tx_size, best_mode, mi_row, mi_col,
+ use_y_only_rate_distortion, NULL);
+
+ tpl_stats->intra_dist = recon_error << TPL_DEP_COST_SCALE_LOG2;
+ tpl_stats->intra_sse = pred_error << TPL_DEP_COST_SCALE_LOG2;
+ tpl_stats->intra_rate = rate_cost;
+ }
if (cpi->third_pass_ctx &&
frame_offset < cpi->third_pass_ctx->frame_info_count &&