[FFmpeg-devel] [RFC] LIBMPEG2_BITSTREAM_READER oddities
Justin Ruggles
justin.ruggles
Wed Mar 4 03:39:32 CET 2009
Hi,
While getting the FLAC decoder to work with the A32_BITSTREAM_READER, I
decided to also try to make it work with the LIBMPEG2_BITSTREAM_READER.
However, I ran into some strange problems. Decodes do not fail, but
they do not generate lossless output. The regression tests fail
miserably with many codecs (see attached).
The first thing I did was to make sure no calls to get/skip/show_bits()
were more than 17 bits. That didn't help, however crafting a FLAC
stream that I knew would not read 17 bits worked ok. So it seems there
is a bug somewhere in the LIBMPEG2_BITSTREAM_READER for 17-bit reads.
After applying the attached patch, all regression tests pass.
I'm not recommending applying the patch though, as it is not the root of
the problem, and there would still be issues if get_bits() is called
directly with 17 bits. It just seems that the decoders in the regtests
either do not do this or just happen not to trigger the bug if they do.
-Justin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libmpeg2_bitstream_reader.diff
Type: text/x-diff
Size: 1007 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090303/b2895385/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regtests.diff
Type: text/x-diff
Size: 5834 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090303/b2895385/attachment-0001.diff>
More information about the ffmpeg-devel
mailing list