shithub: opus

Download patch

ref: 5f6be0c1c198bdafc036854597e2f45572aaa919
parent: d006b781ca528fa7d9da7b02480846fedd3b82a1
author: Diego Elio Pettenò <[email protected]>
date: Sun Sep 9 21:48:23 EDT 2012

Mark tables static when not used outside of their translation unit.

This is similar to the change for functions, but is only used to
perform DCE.

Signed-off-by: Diego Elio Pettenò <[email protected]>

--- a/silk/tables_LTP.c
+++ b/silk/tables_LTP.c
@@ -35,16 +35,16 @@
        179,     99,      0
 };
 
-const opus_uint8 silk_LTP_gain_iCDF_0[8] = {
+static const opus_uint8 silk_LTP_gain_iCDF_0[8] = {
         71,     56,     43,     30,     21,     12,      6,      0
 };
 
-const opus_uint8 silk_LTP_gain_iCDF_1[16] = {
+static const opus_uint8 silk_LTP_gain_iCDF_1[16] = {
        199,    165,    144,    124,    109,     96,     84,     71,
         61,     51,     42,     32,     23,     15,      8,      0
 };
 
-const opus_uint8 silk_LTP_gain_iCDF_2[32] = {
+static const opus_uint8 silk_LTP_gain_iCDF_2[32] = {
        241,    225,    211,    199,    187,    175,    164,    153,
        142,    132,    123,    114,    105,     96,     88,     80,
         72,     64,     57,     50,     44,     38,     33,     29,
@@ -53,16 +53,16 @@
 
 const opus_int16 silk_LTP_gain_middle_avg_RD_Q14 = 12304;
 
-const opus_uint8 silk_LTP_gain_BITS_Q5_0[8] = {
+static const opus_uint8 silk_LTP_gain_BITS_Q5_0[8] = {
         15,    131,    138,    138,    155,    155,    173,    173
 };
 
-const opus_uint8 silk_LTP_gain_BITS_Q5_1[16] = {
+static const opus_uint8 silk_LTP_gain_BITS_Q5_1[16] = {
         69,     93,    115,    118,    131,    138,    141,    138,
        150,    150,    155,    150,    155,    160,    166,    160
 };
 
-const opus_uint8 silk_LTP_gain_BITS_Q5_2[32] = {
+static const opus_uint8 silk_LTP_gain_BITS_Q5_2[32] = {
        131,    128,    134,    141,    141,    141,    145,    145,
        145,    150,    155,    155,    155,    155,    160,    160,
        160,    160,    166,    166,    173,    173,    182,    192,
@@ -81,7 +81,7 @@
     silk_LTP_gain_BITS_Q5_2
 };
 
-const opus_int8 silk_LTP_gain_vq_0[8][5] =
+static const opus_int8 silk_LTP_gain_vq_0[8][5] =
 {
 {
          4,      6,     24,      7,      5
@@ -109,7 +109,7 @@
 }
 };
 
-const opus_int8 silk_LTP_gain_vq_1[16][5] =
+static const opus_int8 silk_LTP_gain_vq_1[16][5] =
 {
 {
         13,     22,     39,     23,     12
@@ -161,7 +161,7 @@
 }
 };
 
-const opus_int8 silk_LTP_gain_vq_2[32][5] =
+static const opus_int8 silk_LTP_gain_vq_2[32][5] =
 {
 {
         -6,     27,     61,     39,      5
--- a/silk/tables_NLSF_CB_NB_MB.c
+++ b/silk/tables_NLSF_CB_NB_MB.c
@@ -31,7 +31,7 @@
 
 #include "tables.h"
 
-const opus_uint8 silk_NLSF_CB1_NB_MB_Q8[ 320 ] = {
+static const opus_uint8 silk_NLSF_CB1_NB_MB_Q8[ 320 ] = {
         12,     35,     60,     83,    108,    132,    157,    180,
        206,    228,     15,     32,     55,     77,    101,    125,
        151,    175,    201,    225,     19,     42,     66,     89,
@@ -74,7 +74,7 @@
         64,     84,    104,    118,    156,    177,    201,    230
 };
 
-const opus_uint8 silk_NLSF_CB1_iCDF_NB_MB[ 64 ] = {
+static const opus_uint8 silk_NLSF_CB1_iCDF_NB_MB[ 64 ] = {
        212,    178,    148,    129,    108,     96,     85,     82,
         79,     77,     61,     59,     57,     56,     51,     49,
         48,     45,     42,     41,     40,     38,     36,     34,
@@ -85,7 +85,7 @@
         28,     20,     19,     18,     12,     11,      5,      0
 };
 
-const opus_uint8 silk_NLSF_CB2_SELECT_NB_MB[ 160 ] = {
+static const opus_uint8 silk_NLSF_CB2_SELECT_NB_MB[ 160 ] = {
         16,      0,      0,      0,      0,     99,     66,     36,
         36,     34,     36,     34,     34,     34,     34,     83,
         69,     36,     52,     34,    116,    102,     70,     68,
@@ -108,7 +108,7 @@
        171,    137,    139,    137,    155,    218,    219,    139
 };
 
-const opus_uint8 silk_NLSF_CB2_iCDF_NB_MB[ 72 ] = {
+static const opus_uint8 silk_NLSF_CB2_iCDF_NB_MB[ 72 ] = {
        255,    254,    253,    238,     14,      3,      2,      1,
          0,    255,    254,    252,    218,     35,      3,      2,
          1,      0,    255,    254,    250,    208,     59,      4,
@@ -120,7 +120,7 @@
        254,    236,    173,     95,     37,      7,      1,      0
 };
 
-const opus_uint8 silk_NLSF_CB2_BITS_NB_MB_Q5[ 72 ] = {
+static const opus_uint8 silk_NLSF_CB2_BITS_NB_MB_Q5[ 72 ] = {
        255,    255,    255,    131,      6,    145,    255,    255,
        255,    255,    255,    236,     93,     15,     96,    255,
        255,    255,    255,    255,    194,     83,     25,     71,
@@ -132,13 +132,13 @@
        251,    123,     65,     55,     68,    100,    171,    255
 };
 
-const opus_uint8 silk_NLSF_PRED_NB_MB_Q8[ 18 ] = {
+static const opus_uint8 silk_NLSF_PRED_NB_MB_Q8[ 18 ] = {
        179,    138,    140,    148,    151,    149,    153,    151,
        163,    116,     67,     82,     59,     92,     72,    100,
         89,     92
 };
 
-const opus_int16 silk_NLSF_DELTA_MIN_NB_MB_Q15[ 11 ] = {
+static const opus_int16 silk_NLSF_DELTA_MIN_NB_MB_Q15[ 11 ] = {
        250,      3,      6,      3,      3,      3,      4,      3,
          3,      3,    461
 };
--- a/silk/tables_NLSF_CB_WB.c
+++ b/silk/tables_NLSF_CB_WB.c
@@ -31,7 +31,7 @@
 
 #include "tables.h"
 
-const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = {
+static const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = {
          7,     23,     38,     54,     69,     85,    100,    116,
        131,    147,    162,    178,    193,    208,    223,    239,
         13,     25,     41,     55,     69,     83,     98,    112,
@@ -98,7 +98,7 @@
        110,    119,    129,    141,    175,    198,    218,    237
 };
 
-const opus_uint8 silk_NLSF_CB1_iCDF_WB[ 64 ] = {
+static const opus_uint8 silk_NLSF_CB1_iCDF_WB[ 64 ] = {
        225,    204,    201,    184,    183,    175,    158,    154,
        153,    135,    119,    115,    113,    110,    109,     99,
         98,     95,     79,     68,     52,     50,     48,     45,
@@ -109,7 +109,7 @@
         24,     21,     11,      6,      5,      4,      3,      0
 };
 
-const opus_uint8 silk_NLSF_CB2_SELECT_WB[ 256 ] = {
+static const opus_uint8 silk_NLSF_CB2_SELECT_WB[ 256 ] = {
          0,      0,      0,      0,      0,      0,      0,      1,
        100,    102,    102,     68,     68,     36,     34,     96,
        164,    107,    158,    185,    180,    185,    139,    102,
@@ -144,7 +144,7 @@
        100,    107,    120,    119,     36,    197,     24,      0
 };
 
-const opus_uint8 silk_NLSF_CB2_iCDF_WB[ 72 ] = {
+static const opus_uint8 silk_NLSF_CB2_iCDF_WB[ 72 ] = {
        255,    254,    253,    244,     12,      3,      2,      1,
          0,    255,    254,    252,    224,     38,      3,      2,
          1,      0,    255,    254,    251,    209,     57,      4,
@@ -156,7 +156,7 @@
        248,    227,    177,    100,     19,      2,      1,      0
 };
 
-const opus_uint8 silk_NLSF_CB2_BITS_WB_Q5[ 72 ] = {
+static const opus_uint8 silk_NLSF_CB2_BITS_WB_Q5[ 72 ] = {
        255,    255,    255,    156,      4,    154,    255,    255,
        255,    255,    255,    227,    102,     15,     92,    255,
        255,    255,    255,    255,    213,     83,     24,     72,
@@ -168,7 +168,7 @@
        166,    116,     76,     55,     53,    125,    255,    255
 };
 
-const opus_uint8 silk_NLSF_PRED_WB_Q8[ 30 ] = {
+static const opus_uint8 silk_NLSF_PRED_WB_Q8[ 30 ] = {
        175,    148,    160,    176,    178,    173,    174,    164,
        177,    174,    196,    182,    198,    192,    182,     68,
         62,     66,     60,     72,    117,     85,     90,    118,
@@ -175,7 +175,7 @@
        136,    151,    142,    160,    142,    155
 };
 
-const opus_int16 silk_NLSF_DELTA_MIN_WB_Q15[ 17 ] = {
+static const opus_int16 silk_NLSF_DELTA_MIN_WB_Q15[ 17 ] = {
        100,      3,     40,      3,      3,      3,      5,     14,
         14,     10,     11,      3,      8,      9,      7,      3,
        347
--- a/silk/tables_other.c
+++ b/silk/tables_other.c
@@ -67,8 +67,8 @@
 const opus_uint8  silk_stereo_only_code_mid_iCDF[ 2 ] = { 64, 0 };
 
 /* Tables for LBRR flags */
-const opus_uint8 silk_LBRR_flags_2_iCDF[ 3 ] = { 203, 150, 0 };
-const opus_uint8 silk_LBRR_flags_3_iCDF[ 7 ] = { 215, 195, 166, 125, 110, 82, 0 };
+static const opus_uint8 silk_LBRR_flags_2_iCDF[ 3 ] = { 203, 150, 0 };
+static const opus_uint8 silk_LBRR_flags_3_iCDF[ 7 ] = { 215, 195, 166, 125, 110, 82, 0 };
 const opus_uint8 * const silk_LBRR_flags_iCDF_ptr[ 2 ] = {
     silk_LBRR_flags_2_iCDF,
     silk_LBRR_flags_3_iCDF