[FFmpeg-devel] [PATCH 0/2] Fix ALAC encoder for 24bps

Christophe Gisquet christophe.gisquet at gmail.com
Sun Aug 17 19:09:12 CEST 2014


The encoder, for content having a bitdepth higher than 16, stores the
LSBs uncompressed. To do so, it performs first channel rematrixing then
extract these MSBs.

However, these 2 steps are inverted, as can be seen in the decoder, or
in the official encoder:
http://alac.macosforge.org/trac/browser/trunk/codec/matrix_enc.c#L170

This patch set fixes that by:
1) Increasing the predictor buffer to hold 2 channels worth of data
2) Storing the extracted MSBs temporary in this buffer before performing
   rematrixing, as the rematrixing generates information that needs to
   be written before the raw MSBs.
   
It would possible to detect bitstreams before this change and achieve
correct decoding if need be.

Christophe Gisquet (2):
  alacenc: increase predictor buffer
  alacenc: fix extra bits extraction

 libavcodec/alacenc.c | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

-- 
1.9.2.msysgit.0



More information about the ffmpeg-devel mailing list