Mercurial > libavcodec.hg
comparison qdm2.c @ 10440:899237b1961f libavcodec
mpegaudiodec, mpc and qdm2 all use the same mpa_synth window, so make
them use the same variable/global storage.
Saves 4 kB in .bss.
author | reimar |
---|---|
date | Mon, 19 Oct 2009 17:21:02 +0000 |
parents | 87d4e5e27d9f |
children | 34a65026fa06 |
comparison
equal
deleted
inserted
replaced
10439:b4b55a3d65c9 | 10440:899237b1961f |
---|---|
216 static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]; | 216 static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]; |
217 static float noise_table[4096]; | 217 static float noise_table[4096]; |
218 static uint8_t random_dequant_index[256][5]; | 218 static uint8_t random_dequant_index[256][5]; |
219 static uint8_t random_dequant_type24[128][3]; | 219 static uint8_t random_dequant_type24[128][3]; |
220 static float noise_samples[128]; | 220 static float noise_samples[128]; |
221 | |
222 static DECLARE_ALIGNED_16(MPA_INT, mpa_window[512]); | |
223 | 221 |
224 | 222 |
225 static av_cold void softclip_table_init(void) { | 223 static av_cold void softclip_table_init(void) { |
226 int i; | 224 int i; |
227 double dfl = SOFTCLIP_THRESHOLD - 32767; | 225 double dfl = SOFTCLIP_THRESHOLD - 32767; |
1682 for (ch = 0; ch < q->nb_channels; ch++) { | 1680 for (ch = 0; ch < q->nb_channels; ch++) { |
1683 OUT_INT *samples_ptr = samples + ch; | 1681 OUT_INT *samples_ptr = samples + ch; |
1684 | 1682 |
1685 for (i = 0; i < 8; i++) { | 1683 for (i = 0; i < 8; i++) { |
1686 ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]), | 1684 ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]), |
1687 mpa_window, &dither_state, | 1685 ff_mpa_synth_window, &dither_state, |
1688 samples_ptr, q->nb_channels, | 1686 samples_ptr, q->nb_channels, |
1689 q->sb_samples[ch][(8 * index) + i]); | 1687 q->sb_samples[ch][(8 * index) + i]); |
1690 samples_ptr += 32 * q->nb_channels; | 1688 samples_ptr += 32 * q->nb_channels; |
1691 } | 1689 } |
1692 } | 1690 } |
1711 if (initialized != 0) | 1709 if (initialized != 0) |
1712 return; | 1710 return; |
1713 initialized = 1; | 1711 initialized = 1; |
1714 | 1712 |
1715 qdm2_init_vlc(); | 1713 qdm2_init_vlc(); |
1716 ff_mpa_synth_init(mpa_window); | 1714 ff_mpa_synth_init(ff_mpa_synth_window); |
1717 softclip_table_init(); | 1715 softclip_table_init(); |
1718 rnd_table_init(); | 1716 rnd_table_init(); |
1719 init_noise_samples(); | 1717 init_noise_samples(); |
1720 | 1718 |
1721 av_log(NULL, AV_LOG_DEBUG, "init done\n"); | 1719 av_log(NULL, AV_LOG_DEBUG, "init done\n"); |