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

Ronald S. Bultje rsbultje
Tue Mar 30 23:47:14 CEST 2010


Hi,

On Tue, Mar 30, 2010 at 5:29 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Tue, Mar 30, 2010 at 04:53:08PM -0400, Ronald S. Bultje wrote:
>> 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?
>
> error "really long" is not an integer

Characters between each 0xA in a line where a CONV occurs.
80
89
92
103
103
93
80
84
96
96
92
84
80
96
96
[etc.]

So it's usually over 80. The bottom few lines are under 80, though:

78
78

Ronald



More information about the ffmpeg-devel mailing list