Merge FINAL_PASS_TRELLIS_OPT with DISABLE_TRELLISQ_SEARCH
The speed feature FINAL_PASS_TRELLIS_OPT is meant to disable
optimize_b during the transform search but allow it for the
final encode of blocks. There was a previously existing macro
called DISABLE_TRELLISQ_SEARCH, which does the same thing. This
patch merges the functionality so the macro serves only to enable
the speed feature.
Change-Id: Ieee70f97f817998b7ca275f6e4647cc89a330ad6
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index 7e0491e..0825675 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -2462,15 +2462,15 @@
RD_STATS this_rd_stats;
av1_invalid_rd_stats(&this_rd_stats);
-#if DISABLE_TRELLISQ_SEARCH
- av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
- AV1_XFORM_QUANT_B);
-#else
- av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
- AV1_XFORM_QUANT_FP);
- av1_optimize_b(cm, x, plane, blk_row, blk_col, block, plane_bsize, tx_size,
- a, l, 1);
-#endif
+ if (cpi->sf.optimize_coefficients != FULL_TRELLIS_OPT) {
+ av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize,
+ tx_size, AV1_XFORM_QUANT_B);
+ } else {
+ av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize,
+ tx_size, AV1_XFORM_QUANT_FP);
+ av1_optimize_b(cm, x, plane, blk_row, blk_col, block, plane_bsize,
+ tx_size, a, l, 1);
+ }
av1_dist_block(cpi, x, plane, plane_bsize, block, blk_row, blk_col, tx_size,
&this_rd_stats.dist, &this_rd_stats.sse,
OUTPUT_HAS_PREDICTED_PIXELS);
@@ -2498,17 +2498,17 @@
x->plane[plane].txb_entropy_ctx[block] = best_txb_ctx;
if (!is_inter_block(mbmi)) {
-// intra mode needs decoded result such that the next transform block
-// can use it for prediction.
-#if DISABLE_TRELLISQ_SEARCH
- av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
- AV1_XFORM_QUANT_B);
-#else
- av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
- AV1_XFORM_QUANT_FP);
- av1_optimize_b(cm, x, plane, blk_row, blk_col, block, plane_bsize, tx_size,
- a, l, 1);
-#endif
+ // intra mode needs decoded result such that the next transform block
+ // can use it for prediction.
+ if (cpi->sf.optimize_coefficients != FULL_TRELLIS_OPT) {
+ av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize,
+ tx_size, AV1_XFORM_QUANT_B);
+ } else {
+ av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize,
+ tx_size, AV1_XFORM_QUANT_FP);
+ av1_optimize_b(cm, x, plane, blk_row, blk_col, block, plane_bsize,
+ tx_size, a, l, 1);
+ }
av1_inverse_transform_block_facade(xd, plane, block, blk_row, blk_col,
x->plane[plane].eobs[block],