Remove trellis_eob_fast speed feature This speed feature has poor quality/speed trade-off and is never enabled. On speed 6 lowres testset, this provides 2% speed @ 1% bitrate increase. BUG=aomedia:2694 Change-Id: I37e12b7ae087045e1c8fc30cb474be94556e9a49
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c index df729aa..ae7a83f 100644 --- a/av1/encoder/encodemb.c +++ b/av1/encoder/encodemb.c
@@ -84,8 +84,7 @@ int av1_optimize_b(const struct AV1_COMP *cpi, MACROBLOCK *x, int plane, int block, TX_SIZE tx_size, TX_TYPE tx_type, - const TXB_CTX *const txb_ctx, int fast_mode, - int *rate_cost) { + const TXB_CTX *const txb_ctx, int *rate_cost) { MACROBLOCKD *const xd = &x->e_mbd; struct macroblock_plane *const p = &x->plane[plane]; const int eob = p->eobs[block]; @@ -98,8 +97,7 @@ } return av1_optimize_txb_new(cpi, x, plane, block, tx_size, tx_type, txb_ctx, - rate_cost, cpi->oxcf.algo_cfg.sharpness, - fast_mode); + rate_cost, cpi->oxcf.algo_cfg.sharpness); } // Hyper-parameters for dropout optimization, based on following logics. @@ -411,7 +409,7 @@ TXB_CTX txb_ctx; get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx); av1_optimize_b(args->cpi, x, plane, block, tx_size, tx_type, &txb_ctx, - args->cpi->sf.rd_sf.trellis_eob_fast, &dummy_rate_cost); + &dummy_rate_cost); } if (!quant_param.use_optimize_b && do_dropout) { av1_dropout_qcoeff(x, plane, block, tx_size, tx_type, @@ -755,7 +753,7 @@ TXB_CTX txb_ctx; get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx); av1_optimize_b(args->cpi, x, plane, block, tx_size, tx_type, &txb_ctx, - args->cpi->sf.rd_sf.trellis_eob_fast, &dummy_rate_cost); + &dummy_rate_cost); } if (do_dropout) { av1_dropout_qcoeff(x, plane, block, tx_size, tx_type,
diff --git a/av1/encoder/encodemb.h b/av1/encoder/encodemb.h index b74c5ea..14761db 100644 --- a/av1/encoder/encodemb.h +++ b/av1/encoder/encodemb.h
@@ -93,7 +93,7 @@ int av1_optimize_b(const struct AV1_COMP *cpi, MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size, TX_TYPE tx_type, - const TXB_CTX *const txb_ctx, int fast_mode, int *rate_cost); + const TXB_CTX *const txb_ctx, int *rate_cost); // This function can be used as (i) a further optimization to reduce the // redundancy of quantized coefficients (a.k.a., `qcoeff`) after trellis
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c index fd327ad..af847ee 100644 --- a/av1/encoder/encodetxb.c +++ b/av1/encoder/encodetxb.c
@@ -1121,7 +1121,7 @@ int av1_optimize_txb_new(const struct AV1_COMP *cpi, MACROBLOCK *x, int plane, int block, TX_SIZE tx_size, TX_TYPE tx_type, const TXB_CTX *const txb_ctx, int *rate_cost, - int sharpness, int fast_mode) { + int sharpness) { MACROBLOCKD *xd = &x->e_mbd; const struct macroblock_plane *p = &x->plane[plane]; const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type); @@ -1140,15 +1140,6 @@ // This function is not called if eob = 0. assert(eob > 0); - if (fast_mode) { - update_coeff_eob_fast(&eob, shift, dequant, scan, tcoeff, qcoeff, dqcoeff); - p->eobs[block] = eob; - if (eob == 0) { - *rate_cost = av1_cost_skip_txb(coeff_costs, txb_ctx, plane, tx_size); - return eob; - } - } - const AV1_COMMON *cm = &cpi->common; const PLANE_TYPE plane_type = get_plane_type(plane); const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); @@ -1223,7 +1214,7 @@ #define UPDATE_COEFF_EOB_CASE(tx_class_literal) \ case tx_class_literal: \ - for (; si >= 0 && nz_num <= max_nz_num && !fast_mode; --si) { \ + for (; si >= 0 && nz_num <= max_nz_num; --si) { \ update_coeff_eob(&accu_rate, &accu_dist, &eob, &nz_num, nz_ci, si, \ tx_size, tx_class_literal, bwl, height, \ txb_ctx->dc_sign_ctx, rdmult, shift, dequant, scan, \
diff --git a/av1/encoder/encodetxb.h b/av1/encoder/encodetxb.h index 686de75..2cd3160 100644 --- a/av1/encoder/encodetxb.h +++ b/av1/encoder/encodetxb.h
@@ -328,16 +328,15 @@ * \param[out] rate_cost The entropy cost of coding the transform block * after adjustment of coefficients. * \param[in] sharpness When sharpness == 1, the function will be less - * aggresive toward lowering the magnitude of coefficients. + * aggressive toward lowering the magnitude of coefficients. * In this way, the transform block will contain more high-frequency coefficients * and therefore preserve the sharpness of the reconstructed block. - * \param[in] fast_mode Faster mode */ int av1_optimize_txb_new(const struct AV1_COMP *cpi, MACROBLOCK *x, int plane, int block, TX_SIZE tx_size, TX_TYPE tx_type, const TXB_CTX *const txb_ctx, int *rate_cost, - int sharpness, int fast_mode); + int sharpness); /*!\brief Get the corresponding \ref CB_COEFF_BUFFER of the current macro block. *
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c index 940f074..f6c7fb9 100644 --- a/av1/encoder/speed_features.c +++ b/av1/encoder/speed_features.c
@@ -1132,8 +1132,6 @@ } else { assert(0 && "Invalid disable_trellis_quant value"); } - // TODO(sarahparker) Pair this with a speed setting once experiments are done - rd_sf->trellis_eob_fast = 0; rd_sf->use_mb_rd_hash = 1; rd_sf->optimize_b_precheck = 0; rd_sf->simple_model_rd_from_var = 0;
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h index 0f7df4a..4c0de3d 100644 --- a/av1/encoder/speed_features.h +++ b/av1/encoder/speed_features.h
@@ -832,9 +832,6 @@ // to avoid repeated search on the same residue signal. int use_mb_rd_hash; - // Flag used to control the speed of the eob selection in trellis. - int trellis_eob_fast; - // Calculate RD cost before doing optimize_b, and skip if the cost is large. int optimize_b_precheck;
diff --git a/av1/encoder/tx_search.c b/av1/encoder/tx_search.c index 4dca06b..a138459 100644 --- a/av1/encoder/tx_search.c +++ b/av1/encoder/tx_search.c
@@ -1123,7 +1123,7 @@ &txfm_param_intra, &quant_param_intra); if (quant_param_intra.use_optimize_b) { av1_optimize_b(cpi, x, plane, block, tx_size, best_tx_type, txb_ctx, - cpi->sf.rd_sf.trellis_eob_fast, rate_cost); + rate_cost); } } @@ -2299,7 +2299,7 @@ if (dist_cost_estimate - (dist_cost_estimate >> 3) > best_rd_) continue; } av1_optimize_b(cpi, x, plane, block, tx_size, tx_type, txb_ctx, - cpi->sf.rd_sf.trellis_eob_fast, &rate_cost); + &rate_cost); } else { rate_cost = cost_coeffs(x, plane, block, tx_size, tx_type, txb_ctx, cm->features.reduced_tx_set_used);