diff options
author | Stefan Gehrer <stefan.gehrer@gmx.de> | 2008-06-24 20:01:31 +0000 |
---|---|---|
committer | Stefan Gehrer <stefan.gehrer@gmx.de> | 2008-06-24 20:01:31 +0000 |
commit | cf2baeb3382283d41eac7886ea831f52262971ba (patch) | |
tree | 986724da3ac8630b2903b8edc7a89498e2baf854 /libavcodec | |
parent | 73cc419b271ac5af8c1aed36b5c0167c7016127a (diff) | |
download | ffmpeg-cf2baeb3382283d41eac7886ea831f52262971ba.tar.gz |
mark read-only data as const
Originally committed as revision 13947 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
32 files changed, 58 insertions, 58 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index b4410b3cd1..86ccb49822 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -490,7 +490,7 @@ static int compute_bit_allocation(AC3EncodeContext *s, uint8_t bap1[NB_BLOCKS][AC3_MAX_CHANNELS][N/2]; int16_t psd[NB_BLOCKS][AC3_MAX_CHANNELS][N/2]; int16_t mask[NB_BLOCKS][AC3_MAX_CHANNELS][50]; - static int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 }; + static const int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 }; /* init default parameters */ s->slow_decay_code = 2; diff --git a/libavcodec/atrac3data.h b/libavcodec/atrac3data.h index 786629d031..555a3a20d6 100644 --- a/libavcodec/atrac3data.h +++ b/libavcodec/atrac3data.h @@ -97,11 +97,11 @@ static const uint8_t huff_tab_sizes[7] = { 9, 5, 7, 9, 15, 31, 63, }; -static const uint8_t* huff_codes[7] = { +static const uint8_t* const huff_codes[7] = { huffcode1,huffcode2,huffcode3,huffcode4,huffcode5,huffcode6,huffcode7, }; -static const uint8_t* huff_bits[7] = { +static const uint8_t* const huff_bits[7] = { huffbits1,huffbits2,huffbits3,huffbits4,huffbits5,huffbits6,huffbits7, }; diff --git a/libavcodec/cookdata.h b/libavcodec/cookdata.h index 1f967bec55..c86577c6b7 100644 --- a/libavcodec/cookdata.h +++ b/libavcodec/cookdata.h @@ -422,12 +422,12 @@ static const uint16_t cvh_huffcodes6[32] = { 0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff, }; -static const uint16_t* cvh_huffcodes[7] = { +static const uint16_t* const cvh_huffcodes[7] = { cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3, cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6, }; -static const uint8_t* cvh_huffbits[7] = { +static const uint8_t* const cvh_huffbits[7] = { cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3, cvh_huffbits4, cvh_huffbits5, cvh_huffbits6, }; @@ -488,12 +488,12 @@ static const uint8_t ccpl_huffbits6[63] = { 14,14,16, }; -static const uint16_t* ccpl_huffcodes[5] = { +static const uint16_t* const ccpl_huffcodes[5] = { ccpl_huffcodes2,ccpl_huffcodes3, ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6 }; -static const uint8_t* ccpl_huffbits[5] = { +static const uint8_t* const ccpl_huffbits[5] = { ccpl_huffbits2,ccpl_huffbits3, ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6 }; @@ -556,7 +556,7 @@ static const float cplscale6[63] = { 0.142307326197624,0.109772264957428,0.0631198287010193, }; -static const float* cplscales[5] = { +static const float* const cplscales[5] = { cplscale2, cplscale3, cplscale4, cplscale5, cplscale6, }; diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index a140f3b8b8..bdb05d55d0 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -1037,7 +1037,7 @@ static const uint8_t bitalloc_maxbits[10][7] = { { 9, 9, 9, 9, 9, 9, 9 } }; -static const uint16_t* bitalloc_codes[10][8] = { +static const uint16_t* const bitalloc_codes[10][8] = { { bitalloc_3_codes, NULL }, { bitalloc_5_codes_a, bitalloc_5_codes_b, bitalloc_5_codes_c, NULL }, { bitalloc_7_codes_a, bitalloc_7_codes_b, bitalloc_7_codes_c, NULL }, @@ -1055,7 +1055,7 @@ static const uint16_t* bitalloc_codes[10][8] = { bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL } }; -static const uint8_t* bitalloc_bits[10][8] = { +static const uint8_t* const bitalloc_bits[10][8] = { { bitalloc_3_bits, NULL }, { bitalloc_5_bits_a, bitalloc_5_bits_b, bitalloc_5_bits_c, NULL }, { bitalloc_7_bits_a, bitalloc_7_bits_b, bitalloc_7_bits_c, NULL }, diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index 468a7434fc..e31f180b54 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -48,7 +48,7 @@ typedef struct DPCMContext { #define SE_16BIT(x) if (x & 0x8000) x -= 0x10000; -static int interplay_delta_table[] = { +static const int interplay_delta_table[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, diff --git a/libavcodec/eval.c b/libavcodec/eval.c index 3bb752fec2..ada353670c 100644 --- a/libavcodec/eval.c +++ b/libavcodec/eval.c @@ -59,7 +59,7 @@ typedef struct Parser{ double var[VARS]; } Parser; -static int8_t si_prefixes['z' - 'E' + 1]={ +static const int8_t si_prefixes['z' - 'E' + 1]={ ['y'-'E']= -24, ['z'-'E']= -21, ['a'-'E']= -18, diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c index d82c308400..40df142da5 100644 --- a/libavcodec/faandct.c +++ b/libavcodec/faandct.c @@ -62,7 +62,7 @@ for(i=0; i<8; i++){ #define A5 0.38268343236508977170 // cos(pi*6/16) #define A4 1.30656296487637652774 // cos(pi*2/16)sqrt(2) -static FLOAT postscale[64]={ +static const FLOAT postscale[64]={ B0*B0, B0*B1, B0*B2, B0*B3, B0*B4, B0*B5, B0*B6, B0*B7, B1*B0, B1*B1, B1*B2, B1*B3, B1*B4, B1*B5, B1*B6, B1*B7, B2*B0, B2*B1, B2*B2, B2*B3, B2*B4, B2*B5, B2*B6, B2*B7, diff --git a/libavcodec/flac.c b/libavcodec/flac.c index 5896debe31..baf47b1382 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -75,15 +75,15 @@ typedef struct FLACContext { #define METADATA_TYPE_STREAMINFO 0 -static int sample_rate_table[] = +static const int sample_rate_table[] = { 0, 0, 0, 0, 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 0, 0, 0, 0 }; -static int sample_size_table[] = +static const int sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 0 }; -static int blocksize_table[] = { +static const int blocksize_table[] = { 0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0, 256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7 }; diff --git a/libavcodec/imcdata.h b/libavcodec/imcdata.h index 75f4fd7449..966bc2789f 100644 --- a/libavcodec/imcdata.h +++ b/libavcodec/imcdata.h @@ -94,7 +94,7 @@ static const float imc_exp_tab[32] = { 1.778280e02, 3.162278e02, 5.623413e02, 1.000000e03, 1.778280e03, 3.162278e03, 5.623413e03, 1.000000e04 }; -static const float *imc_exp_tab2 = imc_exp_tab + 8; +static const float * const imc_exp_tab2 = imc_exp_tab + 8; static const uint8_t imc_cb_select[4][32] = { diff --git a/libavcodec/mpeg12decdata.h b/libavcodec/mpeg12decdata.h index 52816d4162..c6ba2bb4d9 100644 --- a/libavcodec/mpeg12decdata.h +++ b/libavcodec/mpeg12decdata.h @@ -114,7 +114,7 @@ static const uint8_t mpeg2_dc_scale_table3[128]={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; -static const uint8_t *mpeg2_dc_scale_table[4]={ +static const uint8_t * const mpeg2_dc_scale_table[4]={ ff_mpeg1_dc_scale_table, mpeg2_dc_scale_table1, mpeg2_dc_scale_table2, diff --git a/libavcodec/mpegaudiodata.c b/libavcodec/mpegaudiodata.c index 5089c95672..ee8fd9f0aa 100644 --- a/libavcodec/mpegaudiodata.c +++ b/libavcodec/mpegaudiodata.c @@ -221,5 +221,5 @@ static const unsigned char alloc_table_4[] = { 2, 0, 1, 3, }; -const unsigned char *ff_mpa_alloc_tables[5] = +const unsigned char * const ff_mpa_alloc_tables[5] = { alloc_table_0, alloc_table_1, alloc_table_2, alloc_table_3, alloc_table_4, }; diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h index 08e7570e6b..55ea4f64e8 100644 --- a/libavcodec/mpegaudiodata.h +++ b/libavcodec/mpegaudiodata.h @@ -38,6 +38,6 @@ extern const int32_t ff_mpa_enwindow[257]; extern const int ff_mpa_sblimit_table[5]; extern const int ff_mpa_quant_steps[17]; extern const int ff_mpa_quant_bits[17]; -extern const unsigned char *ff_mpa_alloc_tables[5]; +extern const unsigned char * const ff_mpa_alloc_tables[5]; #endif /* FFMPEG_MPEGAUDIODATA_H */ diff --git a/libavcodec/opt.c b/libavcodec/opt.c index 1b429ab160..321bf6cc27 100644 --- a/libavcodec/opt.c +++ b/libavcodec/opt.c @@ -94,14 +94,14 @@ static const AVOption *set_all_opt(void *v, const char *unit, double d){ return ret; } -static double const_values[]={ +static const double const_values[]={ M_PI, M_E, FF_QP2LAMBDA, 0 }; -static const char *const_names[]={ +static const char * const const_names[]={ "PI", "E", "QP2LAMBDA", diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index ecc9428082..5b9c60faee 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -361,7 +361,7 @@ static void qdm2_init_vlc(void) /* for floating point to fixed point conversion */ -static float f2i_scale = (float) (1 << (FRAC_BITS - 15)); +static const float f2i_scale = (float) (1 << (FRAC_BITS - 15)); static int qdm2_get_vlc (GetBitContext *gb, VLC *vlc, int flag, int depth) diff --git a/libavcodec/qdm2data.h b/libavcodec/qdm2data.h index 8edb246e49..8e2d87581f 100644 --- a/libavcodec/qdm2data.h +++ b/libavcodec/qdm2data.h @@ -254,17 +254,17 @@ static const int16_t fft_level_index_table[256] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, }; -static uint8_t last_coeff[3] = { +static const uint8_t last_coeff[3] = { 4, 7, 10 }; -static uint8_t coeff_per_sb_for_avg[3][30] = { +static const uint8_t coeff_per_sb_for_avg[3][30] = { { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9 } }; -static uint32_t dequant_table[3][10][30] = { +static const uint32_t dequant_table[3][10][30] = { { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 256, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 51, 102, 154, 205, 256, 238, 219, 201, 183, 165, 146, 128, 110, 91, 73, 55, 37, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -297,14 +297,14 @@ static uint32_t dequant_table[3][10][30] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 85, 128, 171, 213, 256, 213, 171, 128, 85, 43 } } }; -static uint8_t coeff_per_sb_for_dequant[3][30] = { +static const uint8_t coeff_per_sb_for_dequant[3][30] = { { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, { 0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }, { 0, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9 } }; /* first index is subband, 2nd index is 0, 1 or 3 (2 is unused) */ -static int8_t tone_level_idx_offset_table[30][4] = { +static const int8_t tone_level_idx_offset_table[30][4] = { { -50, -50, 0, -50 }, { -50, -50, 0, -50 }, { -50, -9, 0, -19 }, @@ -339,7 +339,7 @@ static int8_t tone_level_idx_offset_table[30][4] = { /* all my samples have 1st index 0 or 1 */ /* second index is subband, only indexes 0-29 seem to be used */ -static int8_t coding_method_table[5][30] = { +static const int8_t coding_method_table[5][30] = { { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, @@ -513,7 +513,7 @@ static const uint8_t fft_subpackets[32] = { }; /* first index is joined_stereo, second index is 0 or 2 (1 is unused) */ -static float dequant_1bit[2][3] = { +static const float dequant_1bit[2][3] = { {-0.920000f, 0.000000f, 0.920000f }, {-0.890000f, 0.000000f, 0.890000f } }; diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 36c864c189..f0ef1ef94c 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -108,9 +108,9 @@ static void qpeg_decode_intra(const uint8_t *src, uint8_t *dst, int size, } } -static int qpeg_table_h[16] = +static const int qpeg_table_h[16] = { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04}; -static int qpeg_table_w[16] = +static const int qpeg_table_w[16] = { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04}; /* Decodes delta frames */ diff --git a/libavcodec/ra144.h b/libavcodec/ra144.h index fb5b88442a..11e0c25f86 100644 --- a/libavcodec/ra144.h +++ b/libavcodec/ra144.h @@ -1547,7 +1547,7 @@ static const int16_t lpc_refl_cb10[4]={ -617, 190, 802, 1483 }; -static const int16_t *lpc_refl_cb[10]={ +static const int16_t * const lpc_refl_cb[10]={ lpc_refl_cb1, lpc_refl_cb2, lpc_refl_cb3, lpc_refl_cb4, lpc_refl_cb5, lpc_refl_cb6, lpc_refl_cb7, lpc_refl_cb8, lpc_refl_cb9, lpc_refl_cb10 }; diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index 67301f403d..d3bee6a457 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -67,7 +67,7 @@ int ff_rate_control_init(MpegEncContext *s) RateControlContext *rcc= &s->rc_context; int i; const char *error = NULL; - static const char *const_names[]={ + static const char * const const_names[]={ "PI", "E", "iTex", @@ -99,7 +99,7 @@ int ff_rate_control_init(MpegEncContext *s) (void *)qp2bits, NULL }; - static const char *func1_names[]={ + static const char * const func1_names[]={ "bits2qp", "qp2bits", NULL diff --git a/libavcodec/snow.c b/libavcodec/snow.c index dd736b4ba9..2f00279d69 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -363,7 +363,7 @@ static const uint8_t obmc4[16]={ //error:0.000000 }; -static const uint8_t *obmc_tab[4]={ +static const uint8_t * const obmc_tab[4]={ obmc32, obmc16, obmc8, obmc4 }; diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index ee5ecd4dc7..9d594efd7f 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -481,7 +481,7 @@ static void modified_levinson_durbin(int *window, int window_entries, } #endif /* CONFIG_ENCODERS */ -static int samplerate_table[] = +static const int samplerate_table[] = { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 }; #ifdef CONFIG_ENCODERS diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index ac9ba0af13..10b17df601 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -117,7 +117,7 @@ typedef struct comp_types { } comp_types; /* { valid for metatype }, algorithm, num of deltas, vert res, horiz res */ -static comp_types compression_types[17] = { +static const comp_types compression_types[17] = { { ALGO_NOP, 0, 0, 0 }, { ALGO_RGB16V, 4, 4, BLOCK_4x4 }, diff --git a/libavcodec/truemotion1data.h b/libavcodec/truemotion1data.h index e9662e3d04..033e25e059 100644 --- a/libavcodec/truemotion1data.h +++ b/libavcodec/truemotion1data.h @@ -46,10 +46,10 @@ static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 }; static const int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; /* all the delta tables to choose from, at all 4 delta levels */ -static const int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL }; -static const int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL }; -static const int16_t *cdts[] = { cdt1, cdt1, cdt2, cdt3, NULL }; -static const int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL }; +static const int16_t * const ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL }; +static const int16_t * const fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL }; +static const int16_t * const cdts[] = { cdt1, cdt1, cdt2, cdt3, NULL }; +static const int16_t * const fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL }; static const uint8_t pc_tbl2[] = { 0x8,0x00,0x00,0x00,0x00, @@ -828,6 +828,6 @@ static const uint8_t pc_tbl4[] = { 0x2,0x77 }; -static const uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; +static const uint8_t * const tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; #endif /* FFMPEG_TRUEMOTION1DATA_H */ diff --git a/libavcodec/truespeech_data.h b/libavcodec/truespeech_data.h index c7ca559103..572387cd7a 100644 --- a/libavcodec/truespeech_data.h +++ b/libavcodec/truespeech_data.h @@ -66,7 +66,7 @@ static const int16_t ts_cb_7[8] = { 0xCEF0, 0xE4F9, 0xF6BB, 0x0646, 0x14F5, 0x23FF, 0x356F, 0x4A8D, }; -static const int16_t *ts_codebook[8] = { +static const int16_t * const ts_codebook[8] = { ts_cb_0, ts_cb_1, ts_cb_2, ts_cb_3, ts_cb_4, ts_cb_5, ts_cb_6, ts_cb_7 }; diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 6e22bd94ff..45efdaecb0 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -76,7 +76,7 @@ static const uint32_t shift_1[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; -static const uint32_t *shift_16 = shift_1 + 4; +static const uint32_t * const shift_16 = shift_1 + 4; #endif #define MAX_ORDER 16 @@ -87,7 +87,7 @@ typedef struct TTAFilter { int32_t dl[MAX_ORDER]; } TTAFilter; -static int32_t ttafilter_configs[4][2] = { +static const int32_t ttafilter_configs[4][2] = { {10, 1}, {9, 1}, {10, 1}, diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 882d05fa1b..d2608d585b 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -56,13 +56,13 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx) return 0; } -static int block_coords[8] = // 4x4 block coords in 8x8 superblock +static const int block_coords[8] = // 4x4 block coords in 8x8 superblock { 0, 0, 0, 4, 4, 4, 4, 0}; -static int angle_by_index[4] = { 0, 2, 6, 12}; +static const int angle_by_index[4] = { 0, 2, 6, 12}; /* Lookup tables for luma and chroma - used by ulti_convert_yuv() */ -static uint8_t ulti_lumas[64] = +static const uint8_t ulti_lumas[64] = { 0x10, 0x13, 0x17, 0x1A, 0x1E, 0x21, 0x25, 0x28, 0x2C, 0x2F, 0x33, 0x36, 0x3A, 0x3D, 0x41, 0x44, 0x48, 0x4B, 0x4F, 0x52, 0x56, 0x59, 0x5C, 0x60, @@ -72,7 +72,7 @@ static uint8_t ulti_lumas[64] = 0xB7, 0xBA, 0xBE, 0xC1, 0xC5, 0xC8, 0xCC, 0xCF, 0xD3, 0xD6, 0xDA, 0xDD, 0xE1, 0xE4, 0xE8, 0xEB}; -static uint8_t ulti_chromas[16] = +static const uint8_t ulti_chromas[16] = { 0x60, 0x67, 0x6D, 0x73, 0x7A, 0x80, 0x86, 0x8D, 0x93, 0x99, 0xA0, 0xA6, 0xAC, 0xB3, 0xB9, 0xC0}; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index ed93f75050..8c180088c1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1369,7 +1369,7 @@ typedef struct { int rate_num, rate_den; } VideoFrameRateAbbr; -static VideoFrameSizeAbbr video_frame_size_abbrs[] = { +static const VideoFrameSizeAbbr video_frame_size_abbrs[] = { { "ntsc", 720, 480 }, { "pal", 720, 576 }, { "qntsc", 352, 240 }, /* VCD compliant NTSC */ @@ -1408,7 +1408,7 @@ static VideoFrameSizeAbbr video_frame_size_abbrs[] = { { "hd1080", 1920,1080 }, }; -static VideoFrameRateAbbr video_frame_rate_abbrs[]= { +static const VideoFrameRateAbbr video_frame_rate_abbrs[]= { { "ntsc", 30000, 1001 }, { "pal", 25, 1 }, { "qntsc", 30000, 1001 }, /* VCD compliant NTSC */ diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 88bf7d9e84..e3a8144b01 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -422,7 +422,7 @@ typedef struct VmdAudioContext { int predictors[2]; } VmdAudioContext; -static uint16_t vmdaudio_table[128] = { +static const uint16_t vmdaudio_table[128] = { 0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0, diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h index f5e8b7a99a..48d0030dfe 100644 --- a/libavcodec/vorbis.h +++ b/libavcodec/vorbis.h @@ -24,7 +24,7 @@ #include "avcodec.h" extern const float ff_vorbis_floor1_inverse_db_table[256]; -extern const float * ff_vorbis_vwin[8]; +extern const float * const ff_vorbis_vwin[8]; typedef struct { uint_fast16_t x; diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c index 5dc9c5f00e..3f43964d1e 100644 --- a/libavcodec/vorbis_data.c +++ b/libavcodec/vorbis_data.c @@ -2151,5 +2151,5 @@ const float ff_vorbis_floor1_inverse_db_table[256]={ 0.82788260F, 0.88168307F, 0.9389798F, 1.F, }; -const float * ff_vorbis_vwin[8] = { vwin64, vwin128, vwin256, vwin512, vwin1024, vwin2048, vwin4096, vwin8192 }; +const float * const ff_vorbis_vwin[8] = { vwin64, vwin128, vwin256, vwin512, vwin1024, vwin2048, vwin4096, vwin8192 }; diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 0a997a6b46..8e7e54f798 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -1075,7 +1075,7 @@ static av_cold int vorbis_encode_close(AVCodecContext * avccontext) return 0 ; } -AVCodec vorbis_encoder = { +const AVCodec vorbis_encoder = { "vorbis", CODEC_TYPE_AUDIO, CODEC_ID_VORBIS, diff --git a/libavcodec/vp3data.h b/libavcodec/vp3data.h index aa33b83275..b8ec3630ee 100644 --- a/libavcodec/vp3data.h +++ b/libavcodec/vp3data.h @@ -405,7 +405,7 @@ static const int16_t coeff_table_token_22[1024] = { -573, -574, -575, -576, -577, -578, -579, -580 }; -static const int16_t *coeff_tables[32] = { +static const int16_t *const coeff_tables[32] = { NULL, NULL, NULL, diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index bc5d69ae56..70c6338037 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -36,7 +36,7 @@ typedef struct WNV1Context{ GetBitContext gb; } WNV1Context; -static uint16_t code_tab[16][2]={ +static const uint16_t code_tab[16][2]={ {0x1FD,9}, {0xFD,8}, {0x7D,7}, {0x3D,6}, {0x1D,5}, {0x0D,4}, {0x005,3}, {0x000,1}, {0x004,3}, {0x0C,4}, {0x1C,5}, {0x3C,6}, {0x7C,7}, {0xFC,8}, {0x1FC,9}, {0xFF,8} |