Author: cmcq
Date: Fri Jul 31 03:45:05 2009
New Revision: 4851

Log:
Clip the final output samples because the postfilter can create overflows

Modified:
   amr/amrnbdec.c

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c      Fri Jul 31 03:41:40 2009        (r4850)
+++ amr/amrnbdec.c      Fri Jul 31 03:45:05 2009        (r4851)
@@ -1179,8 +1179,10 @@ static int amrnb_decode_frame(AVCodecCon
 
     for (i = 0; i < AMR_BLOCK_SIZE; i++)
         // Post-processing up-scales by 2. It's convenient to
-        // scale from PCM values to [-1,1] here too.
-        buf_out[i] *= 2.0 * AMR_SAMPLE_SCALE;
+        // scale from PCM values to [-1,1) here too.
+        // FIXME: merge with qcelpdec.c
+        buf_out[i] = av_clipf(buf_out[i] * 2.0 * AMR_SAMPLE_SCALE,
+                              -1.0, 32767.0/32768.0);
 
     /* Update averaged lsf vector (used for fixed gain smoothing).
      *
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to