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 LSBs.
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 patchset 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 LSBs; 3) Providing a decoder option allowing to decode losslessly the incorrect files. Christophe Gisquet (3): alacenc: increase predictor buffer alacenc: fix extra bits extraction alac: add option to decode incorrect ALAC libavcodec/alac.c | 26 +++++++++++++++++++++++++- libavcodec/alacenc.c | 35 ++++++++++++++++++++++++----------- 2 files changed, 49 insertions(+), 12 deletions(-) -- 1.9.2.msysgit.0 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
