summaryrefslogtreecommitdiff
path: root/silk/resampler_rom.h
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2012-09-10 01:48:25 -0700
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-09-12 15:54:33 -0400
commit02c653fa0c60e348f5a09f82f66935c5bc470583 (patch)
treef86552c6c0d8be6e0f5e84260be1e45ae6b1bc78 /silk/resampler_rom.h
parent3f2efcbf3d7c58f6e328d8c4ba75554f1661bcf5 (diff)
downloadopus-02c653fa0c60e348f5a09f82f66935c5bc470583.tar.gz
silk: move down- and upsamplers constants to the header file.
These are only being used outside if the translation unit and only in a few codepaths; by making them static in the header, the compiler can optimize them quickly. This avoids GOT-based access to the external symbol on Unix, and can allow for constant propagation to optimize the code. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Diffstat (limited to 'silk/resampler_rom.h')
-rw-r--r--silk/resampler_rom.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/silk/resampler_rom.h b/silk/resampler_rom.h
index 0ad0686b..473b24a2 100644
--- a/silk/resampler_rom.h
+++ b/silk/resampler_rom.h
@@ -42,12 +42,12 @@ extern "C"
#define RESAMPLER_ORDER_FIR_12 8
/* Tables for 2x downsampler */
-extern const opus_int16 silk_resampler_down2_0;
-extern const opus_int16 silk_resampler_down2_1;
+static const opus_int16 silk_resampler_down2_0 = 9872;
+static const opus_int16 silk_resampler_down2_1 = 39809 - 65536;
/* Tables for 2x upsampler, high quality */
-extern const opus_int16 silk_resampler_up2_hq_0[ 3 ];
-extern const opus_int16 silk_resampler_up2_hq_1[ 3 ];
+static const opus_int16 silk_resampler_up2_hq_0[ 3 ] = { 1746, 14986, 39083 - 65536 };
+static const opus_int16 silk_resampler_up2_hq_1[ 3 ] = { 6854, 25769, 55542 - 65536 };
/* Tables with IIR and FIR coefficients for fractional downsamplers */
extern const opus_int16 silk_Resampler_3_4_COEFS[ 2 + 3 * RESAMPLER_DOWN_ORDER_FIR0 / 2 ];