[FFmpeg-devel] [PATCH] avcodec/put_bits: Fix LZW warning

Steinar H. Gunderson steinar+ffmpeg at gunderson.no
Sun Jul 19 21:18:43 EEST 2020


On Sun, Jul 19, 2020 at 07:48:47PM +0200, Andreas Rheinhardt wrote:
> The reason is probably that gif and tiff (the two users of this) use
> different endianness (gif uses LE). A scenario like
> 
> #include "lzw.h"
> #define BITSTREAM_WRITER_LE
> #include "put_bits.h"
> 
> would be silently broken by this patch (the bitstream writer would be
> big-endian).
> 
> Notice that gif.c defines BITSTREAM_WRITER_LE before including anything.

Yes, it's a bit tricky. I'm not convinced having a header silently behave
differently depending on a macro being set is a good idea... Perhaps I
should simply take out BITSTREAM_WRITER_LE from gif.c and replace it with
using put_bits_le?

/* Steinar */
-- 
Homepage: https://www.sesse.net/


More information about the ffmpeg-devel mailing list