Commit e5a9b381 authored by Ola Hugosson's avatar Ola Hugosson Committed by Ola Hugosson

lv_map_multi: optimize_txb improvement

Corrected the nz_rate which is used to estimate the cost of changing
the current coeff to EOB (as part of optimize_txb).
(patch suggested by Dake He)

Change-Id: I60d38d86744826e5c3bbc9eaea9ba6c520145f0b
parent d2352ecb
......@@ -248,13 +248,19 @@ static void get_dist_cost_stats(LevelDownStats *stats, int scan_idx,
stats->rd_low = RDCOST(txb_info->rdmult, stats->rate_low, stats->dist_low);
#if CONFIG_LV_MAP_MULTI
int coeff_ctx = get_nz_map_ctx(levels, scan_idx, scan, txb_info->bwl,
txb_info->height, txb_info->tx_type, is_eob);
(void)levels;
if ((stats->rd_low < stats->rd) && (stats->low_qc == 0)) {
stats->nz_rate = txb_costs->base_cost[coeff_ctx][0];
stats->nz_rate = low_qc_cost;
} else {
// TODO(olah): revisit what non-zero cost should be used here
stats->nz_rate = txb_costs->base_cost[coeff_ctx][1];
if (stats->rd_low < stats->rd) {
const int low_qc_eob_cost =
get_coeff_cost(stats->low_qc, scan_idx, 1, txb_info, txb_costs);
stats->nz_rate = low_qc_cost - low_qc_eob_cost;
} else {
const int qc_eob_cost =
get_coeff_cost(qc, scan_idx, 1, txb_info, txb_costs);
stats->nz_rate = qc_cost - qc_eob_cost;
}
}
#else
int coeff_ctx = get_nz_map_ctx(levels, scan_idx, scan, txb_info->bwl,
......
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