Originally committed as revision 4337 to svn://svn.ffmpeg.org/ffmpeg/trunk
Michael Niedermayer authored on 2005/06/02 06:19:00... | ... |
@@ -99,18 +99,18 @@ static const int xa_adpcm_table[5][2] = { |
99 | 99 |
{ 122, -60 } |
100 | 100 |
}; |
101 | 101 |
|
102 |
-static int ea_adpcm_table[] = { |
|
102 |
+static const int ea_adpcm_table[] = { |
|
103 | 103 |
0, 240, 460, 392, 0, 0, -208, -220, 0, 1, |
104 | 104 |
3, 4, 7, 8, 10, 11, 0, -1, -3, -4 |
105 | 105 |
}; |
106 | 106 |
|
107 |
-static int ct_adpcm_table[8] = { |
|
107 |
+static const int ct_adpcm_table[8] = { |
|
108 | 108 |
0x00E6, 0x00E6, 0x00E6, 0x00E6, |
109 | 109 |
0x0133, 0x0199, 0x0200, 0x0266 |
110 | 110 |
}; |
111 | 111 |
|
112 | 112 |
// padded to zero where table size is less then 16 |
113 |
-static int swf_index_tables[4][16] = { |
|
113 |
+static const int swf_index_tables[4][16] = { |
|
114 | 114 |
/*2*/ { -1, 2 }, |
115 | 115 |
/*3*/ { -1, -1, 2, 4 }, |
116 | 116 |
/*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 }, |
... | ... |
@@ -911,7 +911,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, |
911 | 911 |
case CODEC_ID_ADPCM_SWF: |
912 | 912 |
{ |
913 | 913 |
GetBitContext gb; |
914 |
- int *table; |
|
914 |
+ const int *table; |
|
915 | 915 |
int k0, signmask; |
916 | 916 |
int size = buf_size*8; |
917 | 917 |
|
... | ... |
@@ -251,7 +251,7 @@ static const uint16_t h263_format[8][2] = { |
251 | 251 |
{ 1408, 1152 }, |
252 | 252 |
}; |
253 | 253 |
|
254 |
-uint8_t ff_aic_dc_scale_table[32]={ |
|
254 |
+const uint8_t ff_aic_dc_scale_table[32]={ |
|
255 | 255 |
// 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 |
256 | 256 |
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 |
257 | 257 |
}; |
... | ... |
@@ -299,7 +299,7 @@ void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size |
299 | 299 |
:"memory"); |
300 | 300 |
} |
301 | 301 |
|
302 |
-static unsigned char __align8 vector128[8] = |
|
302 |
+static const unsigned char __align8 vector128[8] = |
|
303 | 303 |
{ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; |
304 | 304 |
|
305 | 305 |
void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) |
... | ... |
@@ -24,7 +24,7 @@ |
24 | 24 |
#include "../dsputil.h" |
25 | 25 |
#include "mmx.h" |
26 | 26 |
|
27 |
-static unsigned short __align16 SSE2_dequant_const[] = |
|
27 |
+static const unsigned short __align16 SSE2_dequant_const[] = |
|
28 | 28 |
{ |
29 | 29 |
0,65535,65535,0,0,0,0,0, // 0x0000 0000 0000 0000 0000 FFFF FFFF 0000 |
30 | 30 |
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[] = |
35 | 35 |
0,0,65535,65535, 0,0,0,0 // 0x0000 0000 0000 0000 FFFF FFFF 0000 0000 |
36 | 36 |
}; |
37 | 37 |
|
38 |
-static unsigned int __align16 eight_data[] = |
|
38 |
+static const unsigned int __align16 eight_data[] = |
|
39 | 39 |
{ |
40 | 40 |
0x00080008, |
41 | 41 |
0x00080008, |
... | ... |
@@ -43,7 +43,7 @@ static unsigned int __align16 eight_data[] = |
43 | 43 |
0x00080008 |
44 | 44 |
}; |
45 | 45 |
|
46 |
-static unsigned short __align16 SSE2_idct_data[7 * 8] = |
|
46 |
+static const unsigned short __align16 SSE2_idct_data[7 * 8] = |
|
47 | 47 |
{ |
48 | 48 |
64277,64277,64277,64277,64277,64277,64277,64277, |
49 | 49 |
60547,60547,60547,60547,60547,60547,60547,60547, |
... | ... |
@@ -359,7 +359,7 @@ static const uint8_t non_linear_qscale[32] = { |
359 | 359 |
56,64,72,80,88,96,104,112, |
360 | 360 |
}; |
361 | 361 |
|
362 |
-uint8_t ff_mpeg1_dc_scale_table[128]={ |
|
362 |
+const uint8_t ff_mpeg1_dc_scale_table[128]={ |
|
363 | 363 |
// 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 |
364 | 364 |
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, |
365 | 365 |
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]={ |
367 | 367 |
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, |
368 | 368 |
}; |
369 | 369 |
|
370 |
-static uint8_t mpeg2_dc_scale_table1[128]={ |
|
370 |
+const static uint8_t mpeg2_dc_scale_table1[128]={ |
|
371 | 371 |
// 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 |
372 | 372 |
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, |
373 | 373 |
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]={ |
375 | 375 |
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, |
376 | 376 |
}; |
377 | 377 |
|
378 |
-static uint8_t mpeg2_dc_scale_table2[128]={ |
|
378 |
+static const uint8_t mpeg2_dc_scale_table2[128]={ |
|
379 | 379 |
// 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 |
380 | 380 |
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, |
381 | 381 |
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]={ |
383 | 383 |
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, |
384 | 384 |
}; |
385 | 385 |
|
386 |
-static uint8_t mpeg2_dc_scale_table3[128]={ |
|
386 |
+static const uint8_t mpeg2_dc_scale_table3[128]={ |
|
387 | 387 |
// 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 |
388 | 388 |
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, |
389 | 389 |
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]={ |
391 | 391 |
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, |
392 | 392 |
}; |
393 | 393 |
|
394 |
-static uint8_t *mpeg2_dc_scale_table[4]={ |
|
394 |
+static const uint8_t *mpeg2_dc_scale_table[4]={ |
|
395 | 395 |
ff_mpeg1_dc_scale_table, |
396 | 396 |
mpeg2_dc_scale_table1, |
397 | 397 |
mpeg2_dc_scale_table2, |
... | ... |
@@ -383,11 +383,11 @@ const int16_t ff_mpeg4_default_non_intra_matrix[64] = { |
383 | 383 |
23, 24, 25, 27, 28, 30, 31, 33, |
384 | 384 |
}; |
385 | 385 |
|
386 |
-uint8_t ff_mpeg4_y_dc_scale_table[32]={ |
|
386 |
+const uint8_t ff_mpeg4_y_dc_scale_table[32]={ |
|
387 | 387 |
// 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 |
388 | 388 |
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 |
389 | 389 |
}; |
390 |
-uint8_t ff_mpeg4_c_dc_scale_table[32]={ |
|
390 |
+const uint8_t ff_mpeg4_c_dc_scale_table[32]={ |
|
391 | 391 |
// 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 |
392 | 392 |
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 |
393 | 393 |
}; |
... | ... |
@@ -190,7 +190,7 @@ static int32_t scale_factor_mult[15][3]; |
190 | 190 |
#define SCALE_GEN(v) \ |
191 | 191 |
{ FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) } |
192 | 192 |
|
193 |
-static int32_t scale_factor_mult2[3][3] = { |
|
193 |
+static const int32_t scale_factor_mult2[3][3] = { |
|
194 | 194 |
SCALE_GEN(4.0 / 3.0), /* 3 steps */ |
195 | 195 |
SCALE_GEN(4.0 / 5.0), /* 5 steps */ |
196 | 196 |
SCALE_GEN(4.0 / 9.0), /* 9 steps */ |
... | ... |
@@ -719,12 +719,12 @@ const uint8_t mpa_huff_data[32][2] = { |
719 | 719 |
|
720 | 720 |
|
721 | 721 |
/* huffman tables for quadrules */ |
722 |
-static uint8_t mpa_quad_codes[2][16] = { |
|
722 |
+static const uint8_t mpa_quad_codes[2][16] = { |
|
723 | 723 |
{ 1, 5, 4, 5, 6, 5, 4, 4, 7, 3, 6, 0, 7, 2, 3, 1, }, |
724 | 724 |
{ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, }, |
725 | 725 |
}; |
726 | 726 |
|
727 |
-static uint8_t mpa_quad_bits[2][16] = { |
|
727 |
+static const uint8_t mpa_quad_bits[2][16] = { |
|
728 | 728 |
{ 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, }, |
729 | 729 |
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }, |
730 | 730 |
}; |
... | ... |
@@ -77,7 +77,7 @@ static unsigned short total_quant_bits[17]; |
77 | 77 |
/* signal to noise ratio of each quantification step (could be |
78 | 78 |
computed from quant_steps[]). The values are dB multiplied by 10 |
79 | 79 |
*/ |
80 |
-static unsigned short quant_snr[17] = { |
|
80 |
+static const unsigned short quant_snr[17] = { |
|
81 | 81 |
70, 110, 160, 208, |
82 | 82 |
253, 316, 378, 439, |
83 | 83 |
499, 559, 620, 680, |
... | ... |
@@ -340,8 +340,8 @@ typedef struct MpegEncContext { |
340 | 340 |
int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous |
341 | 341 |
int16_t dc_cache[4*5]; |
342 | 342 |
int y_dc_scale, c_dc_scale; |
343 |
- uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table |
|
344 |
- uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table |
|
343 |
+ const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table |
|
344 |
+ const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table |
|
345 | 345 |
const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (h263) |
346 | 346 |
uint8_t *coded_block_base; |
347 | 347 |
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, |
819 | 819 |
/* mpeg12.c */ |
820 | 820 |
extern const int16_t ff_mpeg1_default_intra_matrix[64]; |
821 | 821 |
extern const int16_t ff_mpeg1_default_non_intra_matrix[64]; |
822 |
-extern uint8_t ff_mpeg1_dc_scale_table[128]; |
|
822 |
+extern const uint8_t ff_mpeg1_dc_scale_table[128]; |
|
823 | 823 |
|
824 | 824 |
void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); |
825 | 825 |
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) |
859 | 859 |
return index + level - 1; |
860 | 860 |
} |
861 | 861 |
|
862 |
-extern uint8_t ff_mpeg4_y_dc_scale_table[32]; |
|
863 |
-extern uint8_t ff_mpeg4_c_dc_scale_table[32]; |
|
864 |
-extern uint8_t ff_aic_dc_scale_table[32]; |
|
862 |
+extern const uint8_t ff_mpeg4_y_dc_scale_table[32]; |
|
863 |
+extern const uint8_t ff_mpeg4_c_dc_scale_table[32]; |
|
864 |
+extern const uint8_t ff_aic_dc_scale_table[32]; |
|
865 | 865 |
extern const int16_t ff_mpeg4_default_intra_matrix[64]; |
866 | 866 |
extern const int16_t ff_mpeg4_default_non_intra_matrix[64]; |
867 | 867 |
extern const uint8_t ff_h263_chroma_qscale_table[32]; |
... | ... |
@@ -1799,20 +1799,20 @@ static const uint8_t v2_intra_cbpc[4][2] = { |
1799 | 1799 |
{1, 1}, {0, 3}, {1, 3}, {1, 2}, |
1800 | 1800 |
}; |
1801 | 1801 |
|
1802 |
-static uint8_t wmv1_y_dc_scale_table[32]={ |
|
1802 |
+static const uint8_t wmv1_y_dc_scale_table[32]={ |
|
1803 | 1803 |
// 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 |
1804 | 1804 |
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 |
1805 | 1805 |
}; |
1806 |
-static uint8_t wmv1_c_dc_scale_table[32]={ |
|
1806 |
+static const uint8_t wmv1_c_dc_scale_table[32]={ |
|
1807 | 1807 |
// 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 |
1808 | 1808 |
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 |
1809 | 1809 |
}; |
1810 | 1810 |
|
1811 |
-static uint8_t old_ff_y_dc_scale_table[32]={ |
|
1811 |
+static const uint8_t old_ff_y_dc_scale_table[32]={ |
|
1812 | 1812 |
// 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 |
1813 | 1813 |
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 |
1814 | 1814 |
}; |
1815 |
-static uint8_t old_ff_c_dc_scale_table[32]={ |
|
1815 |
+static const uint8_t old_ff_c_dc_scale_table[32]={ |
|
1816 | 1816 |
// 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 |
1817 | 1817 |
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 |
1818 | 1818 |
}; |
... | ... |
@@ -20,7 +20,7 @@ |
20 | 20 |
#ifndef SP5X_H |
21 | 21 |
#define SP5X_H |
22 | 22 |
|
23 |
-static uint8_t sp5x_data_sof[] = |
|
23 |
+static const uint8_t sp5x_data_sof[] = |
|
24 | 24 |
{ |
25 | 25 |
0xFF, 0xC0, /* SOF */ |
26 | 26 |
0x00, 0x11, /* len */ |
... | ... |
@@ -33,7 +33,7 @@ static uint8_t sp5x_data_sof[] = |
33 | 33 |
0x03, 0x11, 0x01 |
34 | 34 |
}; |
35 | 35 |
|
36 |
-static uint8_t sp5x_data_sos[] = |
|
36 |
+static const uint8_t sp5x_data_sos[] = |
|
37 | 37 |
{ |
38 | 38 |
0xFF, 0xDA, /* SOS */ |
39 | 39 |
0x00, 0x0C, /* len */ |
... | ... |
@@ -46,7 +46,7 @@ static uint8_t sp5x_data_sos[] = |
46 | 46 |
0x00 /* Ah/Al */ |
47 | 47 |
}; |
48 | 48 |
|
49 |
-static uint8_t sp5x_data_dqt[] = |
|
49 |
+static const uint8_t sp5x_data_dqt[] = |
|
50 | 50 |
{ |
51 | 51 |
0xFF, 0xDB, /* DQT */ |
52 | 52 |
0x00, 0x84, /* len */ |
... | ... |
@@ -70,7 +70,7 @@ static uint8_t sp5x_data_dqt[] = |
70 | 70 |
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 |
71 | 71 |
}; |
72 | 72 |
|
73 |
-static uint8_t sp5x_data_dht[] = { |
|
73 |
+static const uint8_t sp5x_data_dht[] = { |
|
74 | 74 |
0xFF, 0xC4, /* DHT */ |
75 | 75 |
0x01, 0xA2, /* len */ |
76 | 76 |
0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, |
... | ... |
@@ -128,7 +128,7 @@ static uint8_t sp5x_data_dht[] = { |
128 | 128 |
}; |
129 | 129 |
|
130 | 130 |
|
131 |
-static uint8_t sp5x_quant_table[20][64]= |
|
131 |
+static const uint8_t sp5x_quant_table[20][64]= |
|
132 | 132 |
{ |
133 | 133 |
/* index 0, Q50 */ |
134 | 134 |
{ 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]= |
233 | 233 |
|
234 | 234 |
#if 0 |
235 | 235 |
/* 4NF-M, not ZigZag */ |
236 |
-static uint8_t sp5x_quant_table_orig[18][64] = |
|
236 |
+static const uint8_t sp5x_quant_table_orig[18][64] = |
|
237 | 237 |
{ |
238 | 238 |
/* index 0, Q50 */ |
239 | 239 |
{ 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, |
... | ... |
@@ -248,7 +248,7 @@ static int make_cdt24_entry(int p1, int p2, int16_t *cdt) |
248 | 248 |
return ((b+r) << 1); |
249 | 249 |
} |
250 | 250 |
|
251 |
-static void gen_vector_table15(TrueMotion1Context *s, uint8_t *sel_vector_table) |
|
251 |
+static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_table) |
|
252 | 252 |
{ |
253 | 253 |
int len, i, j; |
254 | 254 |
unsigned char delta_pair; |
... | ... |
@@ -269,7 +269,7 @@ static void gen_vector_table15(TrueMotion1Context *s, uint8_t *sel_vector_table) |
269 | 269 |
} |
270 | 270 |
} |
271 | 271 |
|
272 |
-static void gen_vector_table16(TrueMotion1Context *s, uint8_t *sel_vector_table) |
|
272 |
+static void gen_vector_table16(TrueMotion1Context *s, const uint8_t *sel_vector_table) |
|
273 | 273 |
{ |
274 | 274 |
int len, i, j; |
275 | 275 |
unsigned char delta_pair; |
... | ... |
@@ -290,7 +290,7 @@ static void gen_vector_table16(TrueMotion1Context *s, uint8_t *sel_vector_table) |
290 | 290 |
} |
291 | 291 |
} |
292 | 292 |
|
293 |
-static void gen_vector_table24(TrueMotion1Context *s, uint8_t *sel_vector_table) |
|
293 |
+static void gen_vector_table24(TrueMotion1Context *s, const uint8_t *sel_vector_table) |
|
294 | 294 |
{ |
295 | 295 |
int len, i, j; |
296 | 296 |
unsigned char delta_pair; |
... | ... |
@@ -324,7 +324,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s) |
324 | 324 |
int i; |
325 | 325 |
struct frame_header header; |
326 | 326 |
uint8_t header_buffer[128]; /* logical maximum size of the header */ |
327 |
- uint8_t *sel_vector_table; |
|
327 |
+ const uint8_t *sel_vector_table; |
|
328 | 328 |
|
329 | 329 |
/* There is 1 change bit per 4 pixels, so each change byte represents |
330 | 330 |
* 32 pixels; divide width by 4 to obtain the number of change bits and |
... | ... |
@@ -10,29 +10,29 @@ |
10 | 10 |
#define TRUEMOTION1DATA_H |
11 | 11 |
|
12 | 12 |
/* Y delta tables, skinny and fat */ |
13 |
-static int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; |
|
14 |
-static int16_t ydt2[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; |
|
15 |
-static int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 }; |
|
16 |
-static int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 }; |
|
17 |
-static int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 }; |
|
18 |
-static int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; |
|
13 |
+static const int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; |
|
14 |
+static const int16_t ydt2[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; |
|
15 |
+static const int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 }; |
|
16 |
+static const int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 }; |
|
17 |
+static const int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 }; |
|
18 |
+static const int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; |
|
19 | 19 |
|
20 | 20 |
/* C delta tables, skinny and fat */ |
21 |
-static int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 }; |
|
22 |
-static int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 }; |
|
23 |
-static int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 }; |
|
24 |
-static int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 }; |
|
21 |
+static const int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 }; |
|
22 |
+static const int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 }; |
|
23 |
+static const int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 }; |
|
24 |
+static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 }; |
|
25 | 25 |
/* NOTE: This table breaks the [+,-] pattern that the rest of the |
26 | 26 |
* tables maintain. Is this intentional? */ |
27 |
-static int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; |
|
27 |
+static const int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; |
|
28 | 28 |
|
29 | 29 |
/* all the delta tables to choose from, at all 4 delta levels */ |
30 |
-static int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL }; |
|
31 |
-static int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL }; |
|
32 |
-static int16_t *cdts[] = { cdt1, cdt2, cdt3, cdt3, NULL }; |
|
33 |
-static int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL }; |
|
30 |
+static const int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL }; |
|
31 |
+static const int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL }; |
|
32 |
+static const int16_t *cdts[] = { cdt1, cdt2, cdt3, cdt3, NULL }; |
|
33 |
+static const int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL }; |
|
34 | 34 |
|
35 |
-static uint8_t pc_tbl2[] = { |
|
35 |
+static const uint8_t pc_tbl2[] = { |
|
36 | 36 |
0x8,0x00,0x00,0x00,0x00, |
37 | 37 |
0x8,0x00,0x00,0x00,0x00, |
38 | 38 |
0x8,0x10,0x00,0x00,0x00, |
... | ... |
@@ -291,7 +291,7 @@ static uint8_t pc_tbl2[] = { |
291 | 291 |
0x2,0x66 |
292 | 292 |
}; |
293 | 293 |
|
294 |
-static uint8_t pc_tbl3[] = { |
|
294 |
+static const uint8_t pc_tbl3[] = { |
|
295 | 295 |
0x6,0x00,0x00,0x00, |
296 | 296 |
0x6,0x00,0x00,0x00, |
297 | 297 |
0x6,0x00,0x00,0x01, |
... | ... |
@@ -550,7 +550,7 @@ static uint8_t pc_tbl3[] = { |
550 | 550 |
0x2,0x77 |
551 | 551 |
}; |
552 | 552 |
|
553 |
-static uint8_t pc_tbl4[] = { |
|
553 |
+static const uint8_t pc_tbl4[] = { |
|
554 | 554 |
0x8,0x00,0x00,0x00,0x00, |
555 | 555 |
0x8,0x00,0x00,0x00,0x00, |
556 | 556 |
0x8,0x20,0x00,0x00,0x00, |
... | ... |
@@ -809,5 +809,5 @@ static uint8_t pc_tbl4[] = { |
809 | 809 |
0x2,0x77 |
810 | 810 |
}; |
811 | 811 |
|
812 |
-static uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; |
|
812 |
+static const uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; |
|
813 | 813 |
#endif |