Mercurial > libavcodec.hg
comparison atrac3.c @ 9666:c80df3181479 libavcodec
Change from INIT_VLC_USE_STATIC to INIT_VLC_USE_NEW_STATIC in atrac3
author | banan |
---|---|
date | Sun, 17 May 2009 16:12:07 +0000 |
parents | 67a20f0eb42c |
children | 6f80791c9195 |
comparison
equal
deleted
inserted
replaced
9665:87d4e5e27d9f | 9666:c80df3181479 |
---|---|
931 static av_cold int atrac3_decode_init(AVCodecContext *avctx) | 931 static av_cold int atrac3_decode_init(AVCodecContext *avctx) |
932 { | 932 { |
933 int i; | 933 int i; |
934 const uint8_t *edata_ptr = avctx->extradata; | 934 const uint8_t *edata_ptr = avctx->extradata; |
935 ATRAC3Context *q = avctx->priv_data; | 935 ATRAC3Context *q = avctx->priv_data; |
936 static VLC_TYPE atrac3_vlc_table[4096][2]; | |
937 static int vlcs_initialized = 0; | |
936 | 938 |
937 /* Take data from the AVCodecContext (RM container). */ | 939 /* Take data from the AVCodecContext (RM container). */ |
938 q->sample_rate = avctx->sample_rate; | 940 q->sample_rate = avctx->sample_rate; |
939 q->channels = avctx->channels; | 941 q->channels = avctx->channels; |
940 q->bit_rate = avctx->bit_rate; | 942 q->bit_rate = avctx->bit_rate; |
1021 if ((q->decoded_bytes_buffer = av_mallocz((avctx->block_align+(4-avctx->block_align%4) + FF_INPUT_BUFFER_PADDING_SIZE))) == NULL) | 1023 if ((q->decoded_bytes_buffer = av_mallocz((avctx->block_align+(4-avctx->block_align%4) + FF_INPUT_BUFFER_PADDING_SIZE))) == NULL) |
1022 return AVERROR(ENOMEM); | 1024 return AVERROR(ENOMEM); |
1023 | 1025 |
1024 | 1026 |
1025 /* Initialize the VLC tables. */ | 1027 /* Initialize the VLC tables. */ |
1028 if (!vlcs_initialized) { | |
1026 for (i=0 ; i<7 ; i++) { | 1029 for (i=0 ; i<7 ; i++) { |
1030 spectral_coeff_tab[i].table = &atrac3_vlc_table[atrac3_vlc_offs[i]]; | |
1031 spectral_coeff_tab[i].table_allocated = atrac3_vlc_offs[i + 1] - atrac3_vlc_offs[i]; | |
1027 init_vlc (&spectral_coeff_tab[i], 9, huff_tab_sizes[i], | 1032 init_vlc (&spectral_coeff_tab[i], 9, huff_tab_sizes[i], |
1028 huff_bits[i], 1, 1, | 1033 huff_bits[i], 1, 1, |
1029 huff_codes[i], 1, 1, INIT_VLC_USE_STATIC); | 1034 huff_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); |
1035 } | |
1036 vlcs_initialized = 1; | |
1030 } | 1037 } |
1031 | 1038 |
1032 init_atrac3_transforms(q); | 1039 init_atrac3_transforms(q); |
1033 | 1040 |
1034 /* Generate the scale factors. */ | 1041 /* Generate the scale factors. */ |