Commit 808fb28d authored by Urvang Joshi's avatar Urvang Joshi Committed by Debargha Mukherjee

Force quantization matrices to be NULL for TX64X64.

Also, do not increment the offset for cases that don't use quantization
matrices.

This prevents the offset from going beyond the array size.

BUG=aomedia:823

Change-Id: I4ca7179b4b87020e53fffa804e62dd87f521af05
parent 778023d2
......@@ -360,26 +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];
if (q == NUM_QM_LEVELS - 1) {
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];
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;
}
current += size;
}
}
}
......
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