On Thu, Feb 06, 2020 at 02:59:03PM +0530, Jai Luthra wrote: > On Tue, Feb 04, 2020 at 10:24:50PM +0100, Michael Niedermayer wrote: > >On Mon, Feb 03, 2020 at 12:33:00AM +0530, Jai Luthra wrote: > >>When no codebook is used, huff_lsbs can be more than 24 and still decode to > >>original values once filters are applied. > > > >huff_lsbs can but get_bits() is limited to 25, you need get_bits_long() > >beyond > > I see, thx Michael! > > There are two ways to deal with this: > > 1) Use get_bits_long() where get_bits() is used to read the lsb_bits from > the bitstream as it is certainly going to be within 32. > > 2) Limit huff_lsbs to 25 bits even if no codebook. > > I tested encoding various samples and it does not go above 25 bits. It hits > 25 in mlpenc because at the matrixing stage L+R channels get added together > in a single channel, but I am not sure if other encoders would also adhere > to that. > > (I was previously wrong in assuming that it hits more than 24 at the > filtering stage, I tested it [1] and it does so after the re-matrixing > stage, before any FIR filters) > > I prefer (1) as it is cleaner. Let me know if that is OK and I'll send a > patch.
whatever you prefer that fixes the issue thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".