Op wo 30 mrt. 2022 om 16:02 schreef Martijn van Beurden <mva...@gmail.com>: > One added advantage of setting both limits for 32-bit encodings (not > allowing stereo decorrelation and limiting residuals to 32-bit) is > that libFLAC from 1.2.1 onwards and ffmpeg since May 2015 are > "forward-compatible". ffmpeg actually needs limiting the residual to > 31-bits for that to work. A working patch for the ffmpeg FLAC encoder > can be found here: > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220108142437.756529-1-mva...@gmail.com/ > In fact, the files generated with this patch play on a few hardware > devices I tested them with that use a libFLAC-derived decoder.
I just realised I forgot to mention one additional constraint this patch imposes for backwards-compatibility: those files also cannot include fixed predictors. So there are four constraints for backward-compatible 32-bit streams: no fixed subframes, no stereo decorrelation, no predictions exceeding a 32-bit int and no residuals exceeding a "31-bit int". Summing this all up, this seems to be getting out of hand just for the sake of being compatible with software that was never meant to decode these streams in the first place I'll start working on a patch to include stereo decorrelation and handling fixed subframes for 32-bit FLAC in both decoder and encoder to do some more testing. It seems that those two changes are worth the extra encoding and decoding complexity, while adding handling for > 32-bit residuals (which need new bitreader and bitwriter functions) does not. Kind regards, Martijn van Beurden _______________________________________________ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev