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

Ronald S. Bultje rsbultje
Tue Mar 16 16:35:27 CET 2010


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.

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aconv-prevent-overflow.patch
Type: text/x-patch
Size: 9940 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100316/2a4b753c/attachment.bin>



More information about the ffmpeg-devel mailing list