]> git.sesse.net Git - vlc/commitdiff
Put some static tables const
authorRémi Denis-Courmont <rem@videolan.org>
Thu, 4 Oct 2007 16:57:42 +0000 (16:57 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 4 Oct 2007 16:57:42 +0000 (16:57 +0000)
modules/codec/adpcm.c
modules/codec/araw.c

index 830093fbd0c2d47b860027b15b76e75ff20ba4cc..909ac4f656e2deca1a25e1cf716fa709c6314d18 100644 (file)
@@ -77,7 +77,7 @@ static void DecodeAdpcmDk4   ( decoder_t *, int16_t *, uint8_t * );
 static void DecodeAdpcmDk3   ( decoder_t *, int16_t *, uint8_t * );
 static void DecodeAdpcmEA    ( decoder_t *, int16_t *, uint8_t * );
 
-static int pi_channels_maps[6] =
+static const int pi_channels_maps[6] =
 {
     0,
     AOUT_CHAN_CENTER,
@@ -89,13 +89,13 @@ static int pi_channels_maps[6] =
 };
 
 /* Various table from http://www.pcisys.net/~melanson/codecs/adpcm.txt */
-static int i_index_table[16] =
+static const int i_index_table[16] =
 {
     -1, -1, -1, -1, 2, 4, 6, 8,
     -1, -1, -1, -1, 2, 4, 6, 8
 };
 
-static int i_step_table[89] =
+static const int i_step_table[89] =
 {
     7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
     19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
@@ -108,18 +108,18 @@ static int i_step_table[89] =
     15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
 };
 
-static int i_adaptation_table[16] =
+static const int i_adaptation_table[16] =
 {
     230, 230, 230, 230, 307, 409, 512, 614,
     768, 614, 512, 409, 307, 230, 230, 230
 };
 
-static int i_adaptation_coeff1[7] =
+static const int i_adaptation_coeff1[7] =
 {
     256, 512, 0, 192, 240, 460, 392
 };
 
-static int i_adaptation_coeff2[7] =
+static const int i_adaptation_coeff2[7] =
 {
     0, -256, 0, 64, 0, -208, -232
 };
index 478bb5a3a559039843cf74f0c7b8cdb6756a420e..aae12a30a2641eb54feb9963ca8a48b80fe87a67 100644 (file)
@@ -66,12 +66,12 @@ static block_t *EncoderEncode( encoder_t *, aout_buffer_t * );
 
 struct decoder_sys_t
 {
-    int16_t *p_logtos16;  /* used with m/alaw to int16_t */
+    const int16_t *p_logtos16;  /* used with m/alaw to int16_t */
 
     audio_date_t end_date;
 };
 
-static int pi_channels_maps[] =
+static const int pi_channels_maps[] =
 {
     0,
     AOUT_CHAN_CENTER,
@@ -91,7 +91,7 @@ static int pi_channels_maps[] =
      | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE
 };
 
-static int16_t ulawtos16[256] =
+static const int16_t ulawtos16[256] =
 {
     -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956,
     -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764,
@@ -127,7 +127,7 @@ static int16_t ulawtos16[256] =
         56,     48,     40,     32,     24,     16,      8,      0
 };
 
-static int16_t alawtos16[256] =
+static const int16_t alawtos16[256] =
 {
      -5504,  -5248,  -6016,  -5760,  -4480,  -4224,  -4992,  -4736,
      -7552,  -7296,  -8064,  -7808,  -6528,  -6272,  -7040,  -6784,