From c26ae41db21d6a7d5092b3cb51ce2e4866b076ae Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 1 Jun 2005 21:19:00 +0000 Subject: [PATCH] adding a few const Originally committed as revision 4337 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/adpcm.c | 8 ++++---- libavcodec/h263data.h | 2 +- libavcodec/i386/dsputil_mmx.c | 2 +- libavcodec/i386/vp3dsp_mmx.c | 2 +- libavcodec/i386/vp3dsp_sse2.c | 6 +++--- libavcodec/mpeg12data.h | 10 ++++----- libavcodec/mpeg4data.h | 4 ++-- libavcodec/mpegaudiodec.c | 2 +- libavcodec/mpegaudiodectab.h | 4 ++-- libavcodec/mpegaudiotab.h | 2 +- libavcodec/mpegvideo.h | 12 +++++------ libavcodec/msmpeg4data.h | 8 ++++---- libavcodec/sp5x.h | 12 +++++------ libavcodec/truemotion1.c | 8 ++++---- libavcodec/truemotion1data.h | 38 +++++++++++++++++------------------ libavcodec/ulti_cb.h | 2 +- 16 files changed, 61 insertions(+), 61 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 043c4d4b25..0c44121d59 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -99,18 +99,18 @@ static const int xa_adpcm_table[5][2] = { { 122, -60 } }; -static int ea_adpcm_table[] = { +static const int ea_adpcm_table[] = { 0, 240, 460, 392, 0, 0, -208, -220, 0, 1, 3, 4, 7, 8, 10, 11, 0, -1, -3, -4 }; -static int ct_adpcm_table[8] = { +static const int ct_adpcm_table[8] = { 0x00E6, 0x00E6, 0x00E6, 0x00E6, 0x0133, 0x0199, 0x0200, 0x0266 }; // padded to zero where table size is less then 16 -static int swf_index_tables[4][16] = { +static const int swf_index_tables[4][16] = { /*2*/ { -1, 2 }, /*3*/ { -1, -1, 2, 4 }, /*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 }, @@ -911,7 +911,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, case CODEC_ID_ADPCM_SWF: { GetBitContext gb; - int *table; + const int *table; int k0, signmask; int size = buf_size*8; diff --git a/libavcodec/h263data.h b/libavcodec/h263data.h index 4da105ffc5..f380378409 100644 --- a/libavcodec/h263data.h +++ b/libavcodec/h263data.h @@ -251,7 +251,7 @@ static const uint16_t h263_format[8][2] = { { 1408, 1152 }, }; -uint8_t ff_aic_dc_scale_table[32]={ +const uint8_t ff_aic_dc_scale_table[32]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62 }; diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c index 7b905f6448..e2c84ab403 100644 --- a/libavcodec/i386/dsputil_mmx.c +++ b/libavcodec/i386/dsputil_mmx.c @@ -299,7 +299,7 @@ void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size :"memory"); } -static unsigned char __align8 vector128[8] = +static const unsigned char __align8 vector128[8] = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) diff --git a/libavcodec/i386/vp3dsp_mmx.c b/libavcodec/i386/vp3dsp_mmx.c index ea0405717c..3d220c1d45 100644 --- a/libavcodec/i386/vp3dsp_mmx.c +++ b/libavcodec/i386/vp3dsp_mmx.c @@ -32,7 +32,7 @@ * idct_constants[44..47] = 8 */ static uint16_t idct_constants[(4 + 7 + 1) * 4]; -static uint16_t idct_cosine_table[7] = { +static const uint16_t idct_cosine_table[7] = { 64277, 60547, 54491, 46341, 36410, 25080, 12785 }; diff --git a/libavcodec/i386/vp3dsp_sse2.c b/libavcodec/i386/vp3dsp_sse2.c index 9c69ddb214..97937651a3 100644 --- a/libavcodec/i386/vp3dsp_sse2.c +++ b/libavcodec/i386/vp3dsp_sse2.c @@ -24,7 +24,7 @@ #include "../dsputil.h" #include "mmx.h" -static unsigned short __align16 SSE2_dequant_const[] = +static const unsigned short __align16 SSE2_dequant_const[] = { 0,65535,65535,0,0,0,0,0, // 0x0000 0000 0000 0000 0000 FFFF FFFF 0000 0,0,0,0,65535,65535,0,0, // 0x0000 0000 FFFF FFFF 0000 0000 0000 0000 @@ -35,7 +35,7 @@ static unsigned short __align16 SSE2_dequant_const[] = 0,0,65535,65535, 0,0,0,0 // 0x0000 0000 0000 0000 FFFF FFFF 0000 0000 }; -static unsigned int __align16 eight_data[] = +static const unsigned int __align16 eight_data[] = { 0x00080008, 0x00080008, @@ -43,7 +43,7 @@ static unsigned int __align16 eight_data[] = 0x00080008 }; -static unsigned short __align16 SSE2_idct_data[7 * 8] = +static const unsigned short __align16 SSE2_idct_data[7 * 8] = { 64277,64277,64277,64277,64277,64277,64277,64277, 60547,60547,60547,60547,60547,60547,60547,60547, diff --git a/libavcodec/mpeg12data.h b/libavcodec/mpeg12data.h index 82e2ab6a1e..d9c09001ec 100644 --- a/libavcodec/mpeg12data.h +++ b/libavcodec/mpeg12data.h @@ -359,7 +359,7 @@ static const uint8_t non_linear_qscale[32] = { 56,64,72,80,88,96,104,112, }; -uint8_t ff_mpeg1_dc_scale_table[128]={ +const uint8_t ff_mpeg1_dc_scale_table[128]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -367,7 +367,7 @@ uint8_t ff_mpeg1_dc_scale_table[128]={ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; -static uint8_t mpeg2_dc_scale_table1[128]={ +const static uint8_t mpeg2_dc_scale_table1[128]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, @@ -375,7 +375,7 @@ static uint8_t mpeg2_dc_scale_table1[128]={ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }; -static uint8_t mpeg2_dc_scale_table2[128]={ +static const uint8_t mpeg2_dc_scale_table2[128]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -383,7 +383,7 @@ static uint8_t mpeg2_dc_scale_table2[128]={ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, }; -static uint8_t mpeg2_dc_scale_table3[128]={ +static const uint8_t mpeg2_dc_scale_table3[128]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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, 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, @@ -391,7 +391,7 @@ static 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 uint8_t *mpeg2_dc_scale_table[4]={ +static const uint8_t *mpeg2_dc_scale_table[4]={ ff_mpeg1_dc_scale_table, mpeg2_dc_scale_table1, mpeg2_dc_scale_table2, diff --git a/libavcodec/mpeg4data.h b/libavcodec/mpeg4data.h index 0092a9f5e0..0ceef90b7a 100644 --- a/libavcodec/mpeg4data.h +++ b/libavcodec/mpeg4data.h @@ -383,11 +383,11 @@ const int16_t ff_mpeg4_default_non_intra_matrix[64] = { 23, 24, 25, 27, 28, 30, 31, 33, }; -uint8_t ff_mpeg4_y_dc_scale_table[32]={ +const uint8_t ff_mpeg4_y_dc_scale_table[32]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46 }; -uint8_t ff_mpeg4_c_dc_scale_table[32]={ +const uint8_t ff_mpeg4_c_dc_scale_table[32]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25 }; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 106c9fe689..708d355360 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -190,7 +190,7 @@ static int32_t scale_factor_mult[15][3]; #define SCALE_GEN(v) \ { FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) } -static int32_t scale_factor_mult2[3][3] = { +static const int32_t scale_factor_mult2[3][3] = { SCALE_GEN(4.0 / 3.0), /* 3 steps */ SCALE_GEN(4.0 / 5.0), /* 5 steps */ SCALE_GEN(4.0 / 9.0), /* 9 steps */ diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodectab.h index 8a13127ad9..a60edb6461 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodectab.h @@ -719,12 +719,12 @@ const uint8_t mpa_huff_data[32][2] = { /* huffman tables for quadrules */ -static uint8_t mpa_quad_codes[2][16] = { +static const uint8_t mpa_quad_codes[2][16] = { { 1, 5, 4, 5, 6, 5, 4, 4, 7, 3, 6, 0, 7, 2, 3, 1, }, { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, }, }; -static uint8_t mpa_quad_bits[2][16] = { +static const uint8_t mpa_quad_bits[2][16] = { { 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }, }; diff --git a/libavcodec/mpegaudiotab.h b/libavcodec/mpegaudiotab.h index 59bf868932..d2c13edd60 100644 --- a/libavcodec/mpegaudiotab.h +++ b/libavcodec/mpegaudiotab.h @@ -77,7 +77,7 @@ static unsigned short total_quant_bits[17]; /* signal to noise ratio of each quantification step (could be computed from quant_steps[]). The values are dB multiplied by 10 */ -static unsigned short quant_snr[17] = { +static const unsigned short quant_snr[17] = { 70, 110, 160, 208, 253, 316, 378, 439, 499, 559, 620, 680, diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index df67a469cd..e0c5e8f23e 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -340,8 +340,8 @@ typedef struct MpegEncContext { int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous int16_t dc_cache[4*5]; int y_dc_scale, c_dc_scale; - uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table - uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table + const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table + const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (h263) uint8_t *coded_block_base; uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1) @@ -819,7 +819,7 @@ int inline ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index, /* mpeg12.c */ extern const int16_t ff_mpeg1_default_intra_matrix[64]; extern const int16_t ff_mpeg1_default_non_intra_matrix[64]; -extern uint8_t ff_mpeg1_dc_scale_table[128]; +extern const uint8_t ff_mpeg1_dc_scale_table[128]; void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); void mpeg1_encode_mb(MpegEncContext *s, @@ -859,9 +859,9 @@ static inline int get_rl_index(const RLTable *rl, int last, int run, int level) return index + level - 1; } -extern uint8_t ff_mpeg4_y_dc_scale_table[32]; -extern uint8_t ff_mpeg4_c_dc_scale_table[32]; -extern uint8_t ff_aic_dc_scale_table[32]; +extern const uint8_t ff_mpeg4_y_dc_scale_table[32]; +extern const uint8_t ff_mpeg4_c_dc_scale_table[32]; +extern const uint8_t ff_aic_dc_scale_table[32]; extern const int16_t ff_mpeg4_default_intra_matrix[64]; extern const int16_t ff_mpeg4_default_non_intra_matrix[64]; extern const uint8_t ff_h263_chroma_qscale_table[32]; diff --git a/libavcodec/msmpeg4data.h b/libavcodec/msmpeg4data.h index bc4b454ac7..3b69406951 100644 --- a/libavcodec/msmpeg4data.h +++ b/libavcodec/msmpeg4data.h @@ -1799,20 +1799,20 @@ static const uint8_t v2_intra_cbpc[4][2] = { {1, 1}, {0, 3}, {1, 3}, {1, 2}, }; -static uint8_t wmv1_y_dc_scale_table[32]={ +static const uint8_t wmv1_y_dc_scale_table[32]={ // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 0, 8, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21 }; -static uint8_t wmv1_c_dc_scale_table[32]={ +static const uint8_t wmv1_c_dc_scale_table[32]={ // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22 }; -static uint8_t old_ff_y_dc_scale_table[32]={ +static const uint8_t old_ff_y_dc_scale_table[32]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39 }; -static uint8_t old_ff_c_dc_scale_table[32]={ +static const uint8_t old_ff_c_dc_scale_table[32]={ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22 }; diff --git a/libavcodec/sp5x.h b/libavcodec/sp5x.h index 469d1b46db..dee3591bc7 100644 --- a/libavcodec/sp5x.h +++ b/libavcodec/sp5x.h @@ -20,7 +20,7 @@ #ifndef SP5X_H #define SP5X_H -static uint8_t sp5x_data_sof[] = +static const uint8_t sp5x_data_sof[] = { 0xFF, 0xC0, /* SOF */ 0x00, 0x11, /* len */ @@ -33,7 +33,7 @@ static uint8_t sp5x_data_sof[] = 0x03, 0x11, 0x01 }; -static uint8_t sp5x_data_sos[] = +static const uint8_t sp5x_data_sos[] = { 0xFF, 0xDA, /* SOS */ 0x00, 0x0C, /* len */ @@ -46,7 +46,7 @@ static uint8_t sp5x_data_sos[] = 0x00 /* Ah/Al */ }; -static uint8_t sp5x_data_dqt[] = +static const uint8_t sp5x_data_dqt[] = { 0xFF, 0xDB, /* DQT */ 0x00, 0x84, /* len */ @@ -70,7 +70,7 @@ static uint8_t sp5x_data_dqt[] = 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }; -static uint8_t sp5x_data_dht[] = { +static const uint8_t sp5x_data_dht[] = { 0xFF, 0xC4, /* DHT */ 0x01, 0xA2, /* len */ 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, @@ -128,7 +128,7 @@ static uint8_t sp5x_data_dht[] = { }; -static uint8_t sp5x_quant_table[20][64]= +static const uint8_t sp5x_quant_table[20][64]= { /* index 0, Q50 */ { 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40, @@ -233,7 +233,7 @@ static uint8_t sp5x_quant_table[20][64]= #if 0 /* 4NF-M, not ZigZag */ -static uint8_t sp5x_quant_table_orig[18][64] = +static const uint8_t sp5x_quant_table_orig[18][64] = { /* index 0, Q50 */ { 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index 0c3bb09cf1..b382e2cfa5 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -248,7 +248,7 @@ static int make_cdt24_entry(int p1, int p2, int16_t *cdt) return ((b+r) << 1); } -static void gen_vector_table15(TrueMotion1Context *s, uint8_t *sel_vector_table) +static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_table) { int len, i, j; unsigned char delta_pair; @@ -269,7 +269,7 @@ static void gen_vector_table15(TrueMotion1Context *s, uint8_t *sel_vector_table) } } -static void gen_vector_table16(TrueMotion1Context *s, uint8_t *sel_vector_table) +static void gen_vector_table16(TrueMotion1Context *s, const uint8_t *sel_vector_table) { int len, i, j; unsigned char delta_pair; @@ -290,7 +290,7 @@ static void gen_vector_table16(TrueMotion1Context *s, uint8_t *sel_vector_table) } } -static void gen_vector_table24(TrueMotion1Context *s, uint8_t *sel_vector_table) +static void gen_vector_table24(TrueMotion1Context *s, const uint8_t *sel_vector_table) { int len, i, j; unsigned char delta_pair; @@ -324,7 +324,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s) int i; struct frame_header header; uint8_t header_buffer[128]; /* logical maximum size of the header */ - uint8_t *sel_vector_table; + const uint8_t *sel_vector_table; /* There is 1 change bit per 4 pixels, so each change byte represents * 32 pixels; divide width by 4 to obtain the number of change bits and diff --git a/libavcodec/truemotion1data.h b/libavcodec/truemotion1data.h index d56e015a4f..59b863713b 100644 --- a/libavcodec/truemotion1data.h +++ b/libavcodec/truemotion1data.h @@ -10,29 +10,29 @@ #define TRUEMOTION1DATA_H /* Y delta tables, skinny and fat */ -static int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; -static int16_t ydt2[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; -static int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 }; -static int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 }; -static int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 }; -static int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; +static const int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; +static const int16_t ydt2[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; +static const int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 }; +static const int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 }; +static const int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 }; +static const int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; /* C delta tables, skinny and fat */ -static int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 }; -static int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 }; -static int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 }; -static int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 }; +static const int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 }; +static const int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 }; +static const int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 }; +static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 }; /* NOTE: This table breaks the [+,-] pattern that the rest of the * tables maintain. Is this intentional? */ -static int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; +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 int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL }; -static int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL }; -static int16_t *cdts[] = { cdt1, cdt2, cdt3, cdt3, NULL }; -static int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL }; +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, cdt2, cdt3, cdt3, NULL }; +static const int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL }; -static uint8_t pc_tbl2[] = { +static const uint8_t pc_tbl2[] = { 0x8,0x00,0x00,0x00,0x00, 0x8,0x00,0x00,0x00,0x00, 0x8,0x10,0x00,0x00,0x00, @@ -291,7 +291,7 @@ static uint8_t pc_tbl2[] = { 0x2,0x66 }; -static uint8_t pc_tbl3[] = { +static const uint8_t pc_tbl3[] = { 0x6,0x00,0x00,0x00, 0x6,0x00,0x00,0x00, 0x6,0x00,0x00,0x01, @@ -550,7 +550,7 @@ static uint8_t pc_tbl3[] = { 0x2,0x77 }; -static uint8_t pc_tbl4[] = { +static const uint8_t pc_tbl4[] = { 0x8,0x00,0x00,0x00,0x00, 0x8,0x00,0x00,0x00,0x00, 0x8,0x20,0x00,0x00,0x00, @@ -809,5 +809,5 @@ static uint8_t pc_tbl4[] = { 0x2,0x77 }; -static uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; +static const uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; #endif diff --git a/libavcodec/ulti_cb.h b/libavcodec/ulti_cb.h index d059439dc8..835910f6d7 100644 --- a/libavcodec/ulti_cb.h +++ b/libavcodec/ulti_cb.h @@ -1,4 +1,4 @@ -static unsigned char ulti_codebook[16384]={ +static const unsigned char ulti_codebook[16384]={ 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x03, 0x00, 0x02, 0x03, 0x04,