summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2015-11-11 17:38:43 +0100
committerDiego Biurrun <diego@biurrun.de>2016-05-05 10:48:34 +0200
commit5afb94c817abffad030c6b94d7003dca8aace3d5 (patch)
tree517222058bab9a1b2ba41abd4a38280388dbf57a /libavcodec
parent1f1ad8ace040a08edc2646ff638ca42a8828779f (diff)
Mark read-only tables as static
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dnxhdenc.c2
-rw-r--r--libavcodec/hevc.c2
-rw-r--r--libavcodec/mdec.c2
-rw-r--r--libavcodec/opus_silk.c6
-rw-r--r--libavcodec/texturedspenc.c6
-rw-r--r--libavcodec/vp8.c8
6 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index f3182c97d6..c02b51ebbe 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -398,7 +398,7 @@ fail: // for FF_ALLOCZ_OR_GOTO
static int dnxhd_write_header(AVCodecContext *avctx, uint8_t *buf)
{
DNXHDEncContext *ctx = avctx->priv_data;
- const uint8_t header_prefix[5] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
+ static const uint8_t header_prefix[5] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
memset(buf, 0, 640);
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 3bc730a68e..177cf93ada 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -902,7 +902,7 @@ static void hls_residual_coding(HEVCContext *s, int x0, int y0,
int trafo_size = 1 << log2_trafo_size;
int i, qp, shift, add, scale, scale_m;
- const uint8_t level_scale[] = { 40, 45, 51, 57, 64, 72 };
+ static const uint8_t level_scale[] = { 40, 45, 51, 57, 64, 72 };
const uint8_t *scale_matrix;
uint8_t dc_scale;
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 39395e2ea9..4b6056e15c 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -129,7 +129,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
static inline int decode_mb(MDECContext *a, int16_t block[6][64])
{
int i, ret;
- const int block_index[6] = { 5, 4, 0, 1, 2, 3 };
+ static const int block_index[6] = { 5, 4, 0, 1, 2, 3 };
a->bdsp.clear_blocks(block[0]);
diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 583801d65c..d83fb373c6 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -1323,7 +1323,7 @@ static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc,
if (lag_absolute) {
/* primary lag is coded absolute */
int highbits, lowbits;
- const uint16_t *model[] = {
+ static const uint16_t *model[] = {
silk_model_pitch_lowbits_nb, silk_model_pitch_lowbits_mb,
silk_model_pitch_lowbits_wb
};
@@ -1357,11 +1357,11 @@ static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc,
ltpfilter = opus_rc_getsymbol(rc, silk_model_ltp_filter);
for (i = 0; i < s->subframes; i++) {
int index, j;
- const uint16_t *filter_sel[] = {
+ static const uint16_t *filter_sel[] = {
silk_model_ltp_filter0_sel, silk_model_ltp_filter1_sel,
silk_model_ltp_filter2_sel
};
- const int8_t (*filter_taps[])[5] = {
+ static const int8_t (*filter_taps[])[5] = {
silk_ltp_filter0_taps, silk_ltp_filter1_taps, silk_ltp_filter2_taps
};
index = opus_rc_getsymbol(rc, filter_sel[ltpfilter]);
diff --git a/libavcodec/texturedspenc.c b/libavcodec/texturedspenc.c
index 6fdf9c8c6b..27aaa78d53 100644
--- a/libavcodec/texturedspenc.c
+++ b/libavcodec/texturedspenc.c
@@ -181,7 +181,7 @@ static unsigned int match_colors(const uint8_t *block, ptrdiff_t stride,
int x, y, k = 0;
int c0_point, half_point, c3_point;
uint8_t color[16];
- const int indexMap[8] = {
+ static const int indexMap[8] = {
0 << 30, 2 << 30, 0 << 30, 2 << 30,
3 << 30, 3 << 30, 1 << 30, 1 << 30,
};
@@ -359,8 +359,8 @@ static int refine_colors(const uint8_t *block, ptrdiff_t stride,
/* Additional magic to save a lot of multiplies in the accumulating loop.
* The tables contain precomputed products of weights for least squares
* system, accumulated inside one 32-bit register */
- const int w1tab[4] = { 3, 0, 2, 1 };
- const int prods[4] = { 0x090000, 0x000900, 0x040102, 0x010402 };
+ static const int w1tab[4] = { 3, 0, 2, 1 };
+ static const int prods[4] = { 0x090000, 0x000900, 0x040102, 0x010402 };
/* Check if all pixels have the same index */
if ((mask ^ (mask << 2)) < 4) {
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index d5f8fbb666..cd7f6923fb 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1131,10 +1131,10 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
uint8_t *segment, uint8_t *ref, int layout, int is_vp7)
{
VP56RangeCoder *c = &s->c;
- const char *vp7_feature_name[] = { "q-index",
- "lf-delta",
- "partial-golden-update",
- "blit-pitch" };
+ static const char *vp7_feature_name[] = { "q-index",
+ "lf-delta",
+ "partial-golden-update",
+ "blit-pitch" };
if (is_vp7) {
int i;
*segment = 0;