[FFmpeg-devel] [PATCH] Bugfix: decoding 8- and 24-bit FLAC files

Michael Donaghy md401
Mon Jun 11 22:13:50 CEST 2007

On Monday 11 June 2007 16:40:28 Michael Niedermayer wrote:
> Hi
> On Sun, Jun 10, 2007 at 03:48:56PM +0100, Michael Donaghy wrote:
> > Attached is a patch to fix two problems relating to decoding of FLAC
> > files with 8 and 24 (and I believe 20, though am unable to test this) bit
> > samples; also attached is a 5-second example of each for verification
> > (test by "ffplay file.flac" for ffplay built with and without this
> > patch).
> iam not sure if all subscribers are happy with receiving large sample files
> over ffmpeg-dev ...

I read the "patch submission checklist" in the FAQ on the website as meaning 
it was necessary to attach a sample for any bugfix; my apologies if I 

> why not replace all the shifts and shift_to_16_bits by
> (x<<8)>>(24-bps)
> ?

You have your bitshifts the wrong way around, but yes, this works; the  
downsides are slightly reduced readability (and a compiler warning to go with 
this), but it shortens the code and presumably increases performance; I took 
the approach I did in order to fix the problem with the minimum of changes to 
existing code as per the FAQ, but I prefer this way. Attached is a patch to 
do it as you suggest.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flac_non_16bit_v2.patch
Type: text/x-diff
Size: 1357 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070611/b975210f/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070611/b975210f/attachment.pgp>

More information about the ffmpeg-devel mailing list