Commit 90243cf9 authored by Ralph Giles's avatar Ralph Giles Committed by Ralph Giles

Mark AOM_QM matricies const.

These large (200 KB) static stables are functionally read-only. Marking
them const moves them to the read-only section of shared libraries,
reducing memory footprint when multiple application processes are
running simultaneously.

Change-Id: I6b66ea8f512147f9762728ae01cea02a0fa71300
parent 7d56ad44
...@@ -348,13 +348,13 @@ typedef struct AV1Common { ...@@ -348,13 +348,13 @@ typedef struct AV1Common {
#if CONFIG_AOM_QM #if CONFIG_AOM_QM
// Global quant matrix tables // Global quant matrix tables
qm_val_t *giqmatrix[NUM_QM_LEVELS][3][TX_SIZES_ALL]; const qm_val_t *giqmatrix[NUM_QM_LEVELS][3][TX_SIZES_ALL];
qm_val_t *gqmatrix[NUM_QM_LEVELS][3][TX_SIZES_ALL]; const qm_val_t *gqmatrix[NUM_QM_LEVELS][3][TX_SIZES_ALL];
// Local quant matrix tables for each frame // Local quant matrix tables for each frame
qm_val_t *y_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL]; const qm_val_t *y_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL];
qm_val_t *u_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL]; const qm_val_t *u_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL];
qm_val_t *v_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL]; const qm_val_t *v_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL];
// Encoder // Encoder
int using_qmatrix; int using_qmatrix;
......
...@@ -530,17 +530,18 @@ int av1_get_qindex(const struct segmentation *seg, int segment_id, ...@@ -530,17 +530,18 @@ int av1_get_qindex(const struct segmentation *seg, int segment_id,
} }
#if CONFIG_AOM_QM #if CONFIG_AOM_QM
qm_val_t *aom_iqmatrix(AV1_COMMON *cm, int qmlevel, int plane, const qm_val_t *aom_iqmatrix(AV1_COMMON *cm, int qmlevel, int plane,
TX_SIZE tx_size) { TX_SIZE tx_size) {
return &cm->giqmatrix[qmlevel][plane][tx_size][0]; return &cm->giqmatrix[qmlevel][plane][tx_size][0];
} }
qm_val_t *aom_qmatrix(AV1_COMMON *cm, int qmlevel, int plane, TX_SIZE tx_size) { const qm_val_t *aom_qmatrix(AV1_COMMON *cm, int qmlevel, int plane,
TX_SIZE tx_size) {
return &cm->gqmatrix[qmlevel][plane][tx_size][0]; return &cm->gqmatrix[qmlevel][plane][tx_size][0];
} }
#define QM_TOTAL_SIZE 3344 #define QM_TOTAL_SIZE 3344
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];
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];
void aom_qm_init(AV1_COMMON *cm) { void aom_qm_init(AV1_COMMON *cm) {
int q, c, t; int q, c, t;
...@@ -579,7 +580,7 @@ void aom_qm_init(AV1_COMMON *cm) { ...@@ -579,7 +580,7 @@ void aom_qm_init(AV1_COMMON *cm) {
frequency domain according to different nominal viewing frequency domain according to different nominal viewing
distances. 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 */ { /* Luma */
/* Size 4x4 */ /* Size 4x4 */
...@@ -7347,7 +7348,7 @@ static uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = { ...@@ -7347,7 +7348,7 @@ static uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = {
}, },
}; };
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 */ { /* Luma */
/* Size 4x4 */ /* Size 4x4 */
......
...@@ -52,10 +52,10 @@ static INLINE int aom_get_qmlevel(int qindex, int first, int last) { ...@@ -52,10 +52,10 @@ static INLINE int aom_get_qmlevel(int qindex, int first, int last) {
return first + (qindex * (last + 1 - first)) / QINDEX_RANGE; return first + (qindex * (last + 1 - first)) / QINDEX_RANGE;
} }
void aom_qm_init(struct AV1Common *cm); void aom_qm_init(struct AV1Common *cm);
qm_val_t *aom_iqmatrix(struct AV1Common *cm, int qindex, int comp, const qm_val_t *aom_iqmatrix(struct AV1Common *cm, int qindex, int comp,
TX_SIZE tx_size); TX_SIZE tx_size);
qm_val_t *aom_qmatrix(struct AV1Common *cm, int qindex, int comp, const qm_val_t *aom_qmatrix(struct AV1Common *cm, int qindex, int comp,
TX_SIZE tx_size); TX_SIZE tx_size);
#endif // CONFIG_AOM_QM #endif // CONFIG_AOM_QM
#if CONFIG_NEW_QUANT #if CONFIG_NEW_QUANT
......
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