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:
Ronald S. Bultje
2013-03-25 12:28:24 -07:00
parent 790fb13215
commit 3120dbddb1
7 changed files with 567 additions and 554 deletions

View File

@@ -126,17 +126,20 @@ static INLINE void vp9_reset_sb64_tokens_context(MACROBLOCKD* const xd) {
vpx_memset(xd->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) * 4);
}
extern const int vp9_coef_bands[32];
extern const int vp9_coef_bands8x8[64];
extern const int vp9_coef_bands4x4[16];
static int get_coef_band(TX_SIZE tx_size, int coef_index) {
static int get_coef_band(const int *scan, TX_SIZE tx_size, int coef_index) {
if (tx_size == TX_4X4) {
return vp9_coef_bands4x4[coef_index];
return vp9_coef_bands4x4[scan[coef_index]];
} else {
if (coef_index < 32)
return vp9_coef_bands[coef_index];
else
const int pos = scan[coef_index];
const int sz = 1 << (2 + tx_size);
const int x = pos & (sz - 1), y = pos >> (2 + tx_size);
if (x >= 8 || y >= 8)
return 5;
else
return vp9_coef_bands8x8[y * 8 + x];
}
}
extern int vp9_get_coef_context(const int *scan, const int *neighbors,