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

Michael Niedermayer michaelni
Wed Mar 31 01:11:45 CEST 2010


On Tue, Mar 30, 2010 at 05:47:14PM -0400, Ronald S. Bultje wrote:
> 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:

i think they look better without extra linebreaks, 103 chars in a line
shold be no problem. If someone really has a 80 char width his editor
will add the random linebreaks that you suggest we commit.
[put bikeshed here]

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100331/f09a7d16/attachment.pgp>



More information about the ffmpeg-devel mailing list