diff options
author | trav90 <travawine@palemoon.org> | 2018-10-18 21:53:44 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2018-10-18 21:53:44 -0500 |
commit | ec910d81405c736a4490383a250299a7837c2e64 (patch) | |
tree | 4f27cc226f93a863121aef6c56313e4153a69b3e /third_party/aom/av1/common/quant_common.c | |
parent | 01eb57073ba97b2d6cbf20f745dfcc508197adc3 (diff) | |
download | UXP-ec910d81405c736a4490383a250299a7837c2e64.tar UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.gz UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.lz UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.xz UXP-ec910d81405c736a4490383a250299a7837c2e64.zip |
Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614
Diffstat (limited to 'third_party/aom/av1/common/quant_common.c')
-rw-r--r-- | third_party/aom/av1/common/quant_common.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/third_party/aom/av1/common/quant_common.c b/third_party/aom/av1/common/quant_common.c index 5210ba812..ea7140cdc 100644 --- a/third_party/aom/av1/common/quant_common.c +++ b/third_party/aom/av1/common/quant_common.c @@ -360,21 +360,28 @@ static uint16_t wt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE]; static uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE]; void aom_qm_init(AV1_COMMON *cm) { - int q, c, f, t, size; + int q, c, f, t; int current; for (q = 0; q < NUM_QM_LEVELS; ++q) { for (c = 0; c < 2; ++c) { for (f = 0; f < 2; ++f) { current = 0; for (t = 0; t < TX_SIZES_ALL; ++t) { - size = tx_size_2d[t]; - cm->gqmatrix[q][c][f][t] = &wt_matrix_ref[AOMMIN( - NUM_QM_LEVELS - 1, f == 0 ? q + DEFAULT_QM_INTER_OFFSET : q)][c] - [current]; - cm->giqmatrix[q][c][f][t] = &iwt_matrix_ref[AOMMIN( - NUM_QM_LEVELS - 1, f == 0 ? q + DEFAULT_QM_INTER_OFFSET : q)][c] + const int size = tx_size_2d[t]; + // Don't use QM for sizes > 32x32 + if (q == NUM_QM_LEVELS - 1 || size > 1024) { + cm->gqmatrix[q][c][f][t] = NULL; + cm->giqmatrix[q][c][f][t] = NULL; + } else { + assert(current + size <= QM_TOTAL_SIZE); + cm->gqmatrix[q][c][f][t] = &wt_matrix_ref[AOMMIN( + NUM_QM_LEVELS - 1, f == 0 ? q + DEFAULT_QM_INTER_OFFSET : q)][c] [current]; - current += size; + cm->giqmatrix[q][c][f][t] = &iwt_matrix_ref[AOMMIN( + NUM_QM_LEVELS - 1, f == 0 ? q + DEFAULT_QM_INTER_OFFSET : q)][c] + [current]; + current += size; + } } } } @@ -14039,7 +14046,7 @@ static uint16_t wt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = { }; #endif -#if CONFIG_PVQ || CONFIG_DAALA_DIST +#if CONFIG_PVQ /* Quantization matrices for 8x8. For other block sizes, we currently just do resampling. */ /* Flat quantization, i.e. optimize for PSNR. */ |