Redo banding for all transforms.
Now that the first AC coefficient in both directions use the same DC as their context, there no longer is a purpose in letting both have their own band. Merging these two bands allows us to split bands for some of the very high-frequency AC bands. In addition, I'm redoing the banding for the 1D-ADST col/row scans. I don't think the old banding made any sense at all (it merged the last coefficient of the first row/col in the same band as the first two of the second row/col), which was clearly an oversight from the band being applied in scan-order (rather than in their actual position). Now, coefficients at the same position will be in the same band, regardless what scan order is used. I think this makes most sense for the purpose of banding, which is basically "predict energy for this coefficient depending on the energy of context coefficients" (i.e. pt). After full re-training, together with previous patch, derf gains about 1.2-1.3%, and hd/stdhd gain about 0.9-1.0%. Change-Id: I7a0cc12ba724e88b278034113cb4adaaebf87e0c
This commit is contained in:
@@ -565,12 +565,12 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
|
||||
nzc += (v != 0);
|
||||
#endif
|
||||
token_cache[c] = t;
|
||||
cost += token_costs[get_coef_band(tx_size, c)][pt][t];
|
||||
cost += token_costs[get_coef_band(scan, tx_size, c)][pt][t];
|
||||
cost += vp9_dct_value_cost_ptr[v];
|
||||
#if !CONFIG_CODE_NONZEROCOUNT
|
||||
if (!c || token_cache[c - 1])
|
||||
cost += vp9_cost_bit(coef_probs[type][ref]
|
||||
[get_coef_band(tx_size, c)]
|
||||
[get_coef_band(scan, tx_size, c)]
|
||||
[pt][0], 1);
|
||||
#endif
|
||||
pt = vp9_get_coef_context(scan, nb, pad, token_cache, c, default_eob);
|
||||
@@ -579,8 +579,9 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
|
||||
cost += nzc_cost[nzc];
|
||||
#else
|
||||
if (c < seg_eob)
|
||||
cost += mb->token_costs[tx_size][type][ref][get_coef_band(tx_size, c)]
|
||||
[pt][DCT_EOB_TOKEN];
|
||||
cost += mb->token_costs[tx_size][type][ref]
|
||||
[get_coef_band(scan, tx_size, c)]
|
||||
[pt][DCT_EOB_TOKEN];
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user