--- a/third_party/aom/av1/common/quant_common.c
+++ b/third_party/aom/av1/common/quant_common.c
@@ -337,32 +337,32 @@ int av1_get_qindex(const struct segmenta
seg->abs_delta == SEGMENT_ABSDATA ? data : base_qindex + data;
return clamp(seg_qindex, 0, MAXQ);
} else {
return base_qindex;
}
}
#if CONFIG_AOM_QM
-qm_val_t *aom_iqmatrix(AV1_COMMON *cm, int qmlevel, int is_chroma,
+const qm_val_t *aom_iqmatrix(AV1_COMMON *cm, int qmlevel, int is_chroma,
TX_SIZE tx_size, int is_intra) {
return &cm->giqmatrix[qmlevel][!!is_chroma][!!is_intra][tx_size][0];
}
-qm_val_t *aom_qmatrix(AV1_COMMON *cm, int qmlevel, int is_chroma,
+const qm_val_t *aom_qmatrix(AV1_COMMON *cm, int qmlevel, int is_chroma,
TX_SIZE tx_size, int is_intra) {
return &cm->gqmatrix[qmlevel][!!is_chroma][!!is_intra][tx_size][0];
}
#if CONFIG_CHROMA_2X2
#define QM_TOTAL_SIZE 3348
#else
#define QM_TOTAL_SIZE 3344
#endif
-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];
+static const uint16_t wt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE];
+static const uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE];
void aom_qm_init(AV1_COMMON *cm) {
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;
@@ -394,17 +394,17 @@ void aom_qm_init(AV1_COMMON *cm) {
defined here for convenience. Intra and inter matrix sets are the
same but changing DEFAULT_QM_INTER_OFFSET from zero allows
for different matrices for inter and intra blocks in the same
frame.
Matrices for different QM levels have been rescaled in the
frequency domain according to different nominal viewing
distances.
*/
-static uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = {
+static const uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = {
{
{ /* Luma */
#if CONFIG_CHROMA_2X2
/* Size 2x2 */
43, 86, 86, 166,
#endif
/* Size 4x4 */
32, 43, 73, 97, 43, 67, 94, 110, 73, 94, 137, 150, 97, 110, 150, 200,
@@ -7290,17 +7290,17 @@ static uint16_t iwt_matrix_ref[NUM_QM_LE
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32 },
},
};
-static uint16_t wt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = {
+static const uint16_t wt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = {
{
{ /* Luma */
#if CONFIG_CHROMA_2X2
/* Size 2x2 */
24, 12, 12, 6,
#endif
/* Size 4x4 */
32, 24, 14, 11, 24, 15, 11, 9, 14, 11, 7, 7, 11, 9, 7, 5,