New default coefficient/band probabilities.
Gives 0.5-0.6% improvement on derf and stdhd, and 1.1% on hd. The old tables basically derive from times that we had only 4x4 or only 4x4 and 8x8 DCTs. Note that some values are filled with 128, because e.g. ADST ever only occurs as Y-with-DC, as does 32x32; 16x16 ever only occurs as Y-with-DC or as UV (as complement of 32x32 Y); and 8x8 Y2 ever only has 4 coefficients max. If preferred, I can add values of other tables in their place (e.g. use 4x4 2nd order high-frequency probabilities for 8x8 2nd order), so that they make at least some sense if we ever implement a larger 2nd order transform for the 8x8 DCT (etc.), please let me know Change-Id: I917db356f2aff8865f528eb873c56ef43aa5ce22
This commit is contained in:
Родитель
4d0ec7aacd
Коммит
5a5df19de3
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -577,7 +577,7 @@ static void print_counter(FILE *f, vp9_coeff_accum *context_counters,
|
|||
|
||||
fprintf(f, "static const vp9_coeff_count %s = {\n", header);
|
||||
|
||||
# define Comma( X) (X? ",":"")
|
||||
#define Comma(X) (X ? "," : "")
|
||||
type = 0;
|
||||
do {
|
||||
fprintf(f, "%s\n { /* block Type %d */", Comma(type), type);
|
||||
|
@ -590,7 +590,7 @@ static void print_counter(FILE *f, vp9_coeff_accum *context_counters,
|
|||
|
||||
t = 0;
|
||||
do {
|
||||
const INT64 x = context_counters [type] [band] [pt] [t];
|
||||
const INT64 x = context_counters[type][band][pt][t];
|
||||
const int y = (int) x;
|
||||
|
||||
assert(x == (INT64) y); /* no overflow handling yet */
|
||||
|
@ -609,17 +609,20 @@ static void print_probs(FILE *f, vp9_coeff_accum *context_counters,
|
|||
int block_types, const char *header) {
|
||||
int type, band, pt, t;
|
||||
|
||||
fprintf(f, "static const vp9_coeff_probs %s = {\n", header);
|
||||
fprintf(f, "static const vp9_coeff_probs %s = {", header);
|
||||
|
||||
type = 0;
|
||||
#define Newline(x, spaces) (x ? " " : "\n" spaces)
|
||||
do {
|
||||
fprintf(f, "%s\n { /* block Type %d */", Comma(type), type);
|
||||
fprintf(f, "%s%s{ /* block Type %d */",
|
||||
Comma(type), Newline(type, " "), type);
|
||||
band = 0;
|
||||
do {
|
||||
fprintf(f, "%s\n { /* Coeff Band %d */", Comma(band), band);
|
||||
fprintf(f, "%s%s{ /* Coeff Band %d */",
|
||||
Comma(band), Newline(band, " "), band);
|
||||
pt = 0;
|
||||
do {
|
||||
unsigned int branch_ct [ENTROPY_NODES] [2];
|
||||
unsigned int branch_ct[ENTROPY_NODES][2];
|
||||
unsigned int coef_counts[MAX_ENTROPY_TOKENS];
|
||||
vp9_prob coef_probs[ENTROPY_NODES];
|
||||
|
||||
|
@ -632,10 +635,10 @@ static void print_probs(FILE *f, vp9_coeff_accum *context_counters,
|
|||
|
||||
t = 0;
|
||||
do {
|
||||
fprintf(f, "%s %d", Comma(t), coef_probs[t]);
|
||||
fprintf(f, "%s %3d", Comma(t), coef_probs[t]);
|
||||
} while (++t < ENTROPY_NODES);
|
||||
|
||||
fprintf(f, "}");
|
||||
fprintf(f, " }");
|
||||
} while (++pt < PREV_COEF_CONTEXTS);
|
||||
fprintf(f, "\n }");
|
||||
} while (++band < COEF_BANDS);
|
||||
|
@ -670,20 +673,20 @@ void print_context_counters() {
|
|||
|
||||
/* print coefficient probabilities */
|
||||
print_probs(f, context_counters_4x4, BLOCK_TYPES_4X4,
|
||||
"vp9_default_coef_probs_4x4[BLOCK_TYPES_4X4]");
|
||||
"default_coef_probs_4x4[BLOCK_TYPES_4X4]");
|
||||
print_probs(f, hybrid_context_counters_4x4, BLOCK_TYPES_4X4,
|
||||
"vp9_default_hybrid_coef_probs_4x4[BLOCK_TYPES_4X4]");
|
||||
"default_hybrid_coef_probs_4x4[BLOCK_TYPES_4X4]");
|
||||
print_probs(f, context_counters_8x8, BLOCK_TYPES_8X8,
|
||||
"vp9_default_coef_probs_8x8[BLOCK_TYPES_8X8]");
|
||||
"default_coef_probs_8x8[BLOCK_TYPES_8X8]");
|
||||
print_probs(f, hybrid_context_counters_8x8, BLOCK_TYPES_8X8,
|
||||
"vp9_default_hybrid_coef_probs_8x8[BLOCK_TYPES_8X8]");
|
||||
"default_hybrid_coef_probs_8x8[BLOCK_TYPES_8X8]");
|
||||
print_probs(f, context_counters_16x16, BLOCK_TYPES_16X16,
|
||||
"vp9_default_coef_probs_16x16[BLOCK_TYPES_16X16]");
|
||||
"default_coef_probs_16x16[BLOCK_TYPES_16X16]");
|
||||
print_probs(f, hybrid_context_counters_16x16, BLOCK_TYPES_16X16,
|
||||
"vp9_default_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16]");
|
||||
"default_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16]");
|
||||
#if CONFIG_TX32X32
|
||||
print_probs(f, context_counters_32x32, BLOCK_TYPES_32X32,
|
||||
"vp9_default_coef_probs_32x32[BLOCK_TYPES_32X32]");
|
||||
"default_coef_probs_32x32[BLOCK_TYPES_32X32]");
|
||||
#endif
|
||||
|
||||
fclose(f);
|
||||
|
|
Загрузка…
Ссылка в новой задаче