aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/atrac3.c
diff options
context:
space:
mode:
authorBenjamin Larsson <banan@ludd.ltu.se>2009-05-17 16:12:07 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2009-05-17 16:12:07 +0000
commit031b1cbeeb1e6234607c383341a9bac6829817c9 (patch)
treea816c712a8e7a32aa92f277c7a52511d4b00ca14 /libavcodec/atrac3.c
parentfbf4d03a7c52e1060febbcada3f5db8eac878bb9 (diff)
downloadffmpeg-031b1cbeeb1e6234607c383341a9bac6829817c9.tar.gz
Change from INIT_VLC_USE_STATIC to INIT_VLC_USE_NEW_STATIC in atrac3
Originally committed as revision 18865 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r--libavcodec/atrac3.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index c0825cb5b5..205a123e29 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -933,6 +933,8 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
int i;
const uint8_t *edata_ptr = avctx->extradata;
ATRAC3Context *q = avctx->priv_data;
+ static VLC_TYPE atrac3_vlc_table[4096][2];
+ static int vlcs_initialized = 0;
/* Take data from the AVCodecContext (RM container). */
q->sample_rate = avctx->sample_rate;
@@ -1023,10 +1025,15 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
/* Initialize the VLC tables. */
+ if (!vlcs_initialized) {
for (i=0 ; i<7 ; i++) {
+ spectral_coeff_tab[i].table = &atrac3_vlc_table[atrac3_vlc_offs[i]];
+ spectral_coeff_tab[i].table_allocated = atrac3_vlc_offs[i + 1] - atrac3_vlc_offs[i];
init_vlc (&spectral_coeff_tab[i], 9, huff_tab_sizes[i],
huff_bits[i], 1, 1,
- huff_codes[i], 1, 1, INIT_VLC_USE_STATIC);
+ huff_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ }
+ vlcs_initialized = 1;
}
init_atrac3_transforms(q);