[FFmpeg-devel] [PATCH] audio conversion clipping/overflows

Vitor Sessak vitor1001
Tue Mar 16 19:51:02 CET 2010


Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Mar 15, 2010 at 7:07 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Mon, Mar 15, 2010 at 06:31:21PM -0400, Ronald S. Bultje wrote:
>>> Index: ffmpeg-svn/libavcodec/amrnbdec.c
>>> ===================================================================
>>> --- ffmpeg-svn.orig/libavcodec/amrnbdec.c     2010-03-15 14:30:19.000000000 -0400
>>> +++ ffmpeg-svn/libavcodec/amrnbdec.c  2010-03-15 18:10:23.000000000 -0400
>> [...]
>>> @@ -1049,8 +1047,7 @@
>>>                                               p->high_pass_mem, AMR_BLOCK_SIZE);
>>>
>>>      for (i = 0; i < AMR_BLOCK_SIZE; i++)
>>> -        buf_out[i] = av_clipf(buf_out[i] * AMR_SAMPLE_SCALE,
>>> -                              -1.0, 32767.0 / 32768.0);
>>> +        buf_out[i] *= AMR_SAMPLE_SCALE;
>> cant this be merged into something ?
> 
> Fixed in attached. Output is same. I'm still not sure if the
> interleaving-loops or history-related memcpy()s can be prevented, but
> am open to suggestions on how to achieve the same result without
> memcpy()s/loops.

Parts I maintain are fine, once you reach an agreement with Michael 
about the memcpy's.

-Vitor



More information about the ffmpeg-devel mailing list