Commit b7a7170e authored by Jingning Han's avatar Jingning Han

Avoid overwriting low_qc in soft quantization

When the last coeff is at level 1, do not overwrite the low_qc
with qc. This avoids the use of a wrong value to compute rd_eob_low
later in the same function.

Change-Id: I44bdd8e39cf669593bc734c6557761498ad4f67f
parent 5ab4e7c8
......@@ -333,8 +333,6 @@ static void get_dist_cost_stats(LevelDownStats *const stats, const int scan_idx,
#if CONFIG_LV_MAP_MULTI
if (is_eob && stats->low_qc == 0) {
stats->low_qc = qc;
stats->low_dqc = dqc;
low_qc_cost = qc_cost;
stats->rd_low = stats->rd; // disable selection of low_qc in this case.
} else {
......@@ -375,6 +373,7 @@ static void get_dist_cost_stats(LevelDownStats *const stats, const int scan_idx,
RDCOST(txb_info->rdmult, low_qc_eob_cost, stats->dist_low);
rd_eob = (rd_eob > rd_eob_low) ? rd_eob_low : rd_eob;
}
stats->nz_rd = AOMMIN(stats->rd_low, stats->rd) - rd_eob;
#else
const int is_nz = (stats->rd_low < stats->rd && stats->low_qc == 0) ? 0 : 1;
......
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