[FFmpeg-devel] [PATCH] lavc/rawdec: Use 16-byte line alignment for 1, 2, 4 and 8 bpp

Mats Peterson matsp888 at yahoo.com
Mon Jan 25 04:42:44 CET 2016

Alright Michael, I'm currently rather ambivalent regarding whether 1 bpp in AVI should be just black & white or any color. But the term "monochrome" has to mean black & white after all. Windows Paint forces black & white when saving a 1 bpp BMP file, for example. So does several Mac programs when saving 1-bit files, but the QuickTime File Format Specification explicitly says that 1-bit mode is palettized, and mentions nothing about its being "monochrome" or black & white.

So, here's a patch that doesn't touch the AVI part, but fixes the line alignment of 1 bpp for QuickTime, and 2, 4 and 8 bpp for AVI and QuickTime. It also caters for the packet row stride at the same time. These two issues together are rather atomic by nature, and not easily split, as you can probably understand.

1 bpp AVI, when using monow, will still be "incorrectly" aligned on 4-byte boundaries when using odd-width files, but that's another matter. I don't want to touch the default 4-byte alignment, since I'm not entirely sure of how it will affect other depths.

Should it later on be desirable to use pal8 for AVI as well, it's just a matter of changing one line in raw.c. But then FATE will fail, unless the pal8 to yuv420p conversion discrepancies are fixed. As I wrote to you by e-mail, it currently produces different output from using monow as the source.


Mats Peterson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-rawdec-Use-16-byte-line-alignment-for-1-2-4-and.patch
Type: text/x-patch
Size: 7501 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160125/9d41fdda/attachment.bin>

More information about the ffmpeg-devel mailing list