[FFmpeg-devel] [PATCH] wmapro decoder

Sascha Sommer saschasommer
Mon Jun 22 22:11:11 CEST 2009


On Sonntag, 21. Juni 2009, Vitor Sessak wrote:
> Sascha Sommer wrote:
> > Hi Vitor,
> >
> > thanks for your comments.
> >
> >>> The code still outputs shorts. Float produced clicks all around the
> >>> place. I'm not sure yet if the problem is in my code or in ffmpeg.
> >>
> >> It looks like it works for me, see attached.
> >
> > So your code does not produce clicks at second 16-18 for you with the
> > sample file you mentioned below? It does for me when I'm using ffmpeg to
> > produce a 16-bit wav file and play that back with MPlayer.
> That's due to the lack of clipping. The attached patch is bit-exact for
> wav output for me for the sample
> http://samples.mplayerhq.hu/A-codecs/WMA9/wmapro/Beethovens%20nionde%20symf
>oni%20(Scherzo)-2.wma .
>Note that outputting floats can make the "Output buffer too small" error 
>twice as bad, since the decoder will need an output buffer twice the size.

The patch is similar to the one you submitted the first time, isn't it? 
Shouldn't it add clipping for audioconvert.c ?

The problem here is that float audio ranges from -1.0 to 1.0 and the converter 
multiplies with 1<<15 so the audio will be from -32768 to 32768. The later 
value written as int16 becomes -32768. This causes the annoying clicks.
That means we need to clip the float values in the wmapro decoder and we need 
to clip the integer values in audioconvert.c

The output buffer too small problem also needs to be fixed some day. Will it 
be ok to increase the audio buffer or is this also a candidate for 



More information about the ffmpeg-devel mailing list