diff options
author | Måns Rullgård <mans@mansr.com> | 2009-05-05 18:44:10 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-05-05 18:44:10 +0000 |
commit | bf030c887fa03f1149bc9d2f79cd94d933355788 (patch) | |
tree | 91ef58573eb2f0e3ca43e326b06eb96c4a0557d6 /libavcodec | |
parent | adb206c238d3e9ad73c8b01f608fe92ae2bb33fe (diff) | |
download | ffmpeg-bf030c887fa03f1149bc9d2f79cd94d933355788.tar.gz |
mpegaudio: avoid unnecessary copy in high-precision mode
Originally committed as revision 18745 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 4d1129fcaf..4c0d34a116 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -846,31 +846,31 @@ void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { - int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; - int j, offset, v; + int j, offset; OUT_INT *samples2; #if FRAC_BITS <= 15 + int32_t tmp[32]; int sum, sum2; #else int64_t sum, sum2; #endif - dct32(tmp, sb_samples); - offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; - for(j=0;j<32;j++) { - v = tmp[j]; #if FRAC_BITS <= 15 + dct32(tmp, sb_samples); + for(j=0;j<32;j++) { /* NOTE: can cause a loss in precision if very high amplitude sound */ - v = av_clip_int16(v); -#endif - synth_buf[j] = v; + synth_buf[j] = av_clip_int16(tmp[j]); } +#else + dct32(synth_buf, sb_samples); +#endif + /* copy to avoid wrap */ memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); |