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

Ronald S. Bultje rsbultje
Tue Mar 30 22:53:08 CEST 2010


Hi,

On Mon, Mar 29, 2010 at 7:07 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, Mar 27, 2010 at 12:19:56PM -0400, Ronald S. Bultje wrote:
>> @@ -226,14 +226,20 @@
>> ? ? ? ? ?else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_S32, ?*(const int32_t*)pi)
>> ? ? ? ? ?else CONV(SAMPLE_FMT_FLT, float ?, SAMPLE_FMT_S32, ?*(const int32_t*)pi*(1.0 / (1<<31)))
>> ? ? ? ? ?else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_S32, ?*(const int32_t*)pi*(1.0 / (1<<31)))
>> - ? ? ? ?else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_FLT, lrintf(*(const float*)pi * (1<<7)) + 0x80)
>> - ? ? ? ?else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_FLT, lrintf(*(const float*)pi * (1<<15)))
>> - ? ? ? ?else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_FLT, lrintf(*(const float*)pi * (1<<31)))
>> + ? ? ? ?else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_FLT,
>> + ? ? ? ? ? ? ? ? ?av_clip_uint8(lrintf(*(const float*)pi * (1<<7)) + 0x80))
>> + ? ? ? ?else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_FLT,
>> + ? ? ? ? ? ? ? ? ?av_clip_int16(lrintf(*(const float*)pi * (1<<15))))
>> + ? ? ? ?else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_FLT,
>> + ? ? ? ? ? ? ? ? ?av_clipl_int32(llrintf(*(const float*)pi * (1<<31))))
>
> i prefer keeping the linebreaking consistemt, aka none.

(Since some of the lines are really long,) would you like me to break
all lines (including those I don't touch in this patch) in a cosmetic
patch first?

Ronald



More information about the ffmpeg-devel mailing list