[FFmpeg-devel] [PATCH v2] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

Mats Peterson matsp888 at yahoo.com
Mon Feb 8 06:19:38 CET 2016


Well, what do you know. Suddenly the nut packets are alright. Something 
is going on behind the scenes.... original description follows:

This patch removes the monowhite switching code for 1 bpp raw AVI 
without a palette. I don't see any reason to keep it, since it's 
semantically incorrect to use monowhite for palettized data in my book, 
it adds unnecessary noise to the code, and it's inconsistent with the 
rest of the code in FFmpeg.

Regarding not being able to produce a working nut file with "ffmpeg -i 
in.avi -vcodec rawvideo out.nut", it's no more of a regression than not 
being able to produce a working nut file with the same command line from 
a 2, 4 or 8 bpp file, since nut currently doesn't have a pal8 mode.

In order to produce a working nut file from a 1, 2, 4 or 8 bpp AVI or 
QuickTime file, force the pixel format with "-pix_fmt rgb24" or similar. 
For black & white files in order to save space, use "-pix_fmt monow" or 
"-pix_fmt monob" (give or take the slightly erratic conversion from pal8 
to monow/monob in FFmpeg).

I have also updated the 1 bpp FATE test files (once again).

I deliberately kept the pal8 placeholders for the future in case you 
wonder, Michael.

AVI (and BMP indirectly) doesn't have a dedicated grayscale mode like 
PNG, or explicit black & white mode like TIFF's bilevel mode or nut's 
B1W0 or B0W1 mode. Hence it should not use monowhite under any 
circumstances in my book. The BMP code in FFmpeg handles this correctly 
by using pal8 exclusively for 1 bpp.

Speaking of BMP, "ffmpeg -i 1bpp.bmp -vcodec rawvideo out.nut" will fail 
as well (since BMP correctly uses pal8). The same goes for any input 
file that is stored as pal8 internally. Since nut doesn't have a pal8 
mode, it will incorrectly use the RGB[15] codec tag for some reason, but 
the data in the file will still be 8 bpp. So, if there ever was a 
"regression", it was there before this patch.

Mats

-- 
Mats Peterson
http://matsp888.no-ip.org/~mats/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-rawdec-Remove-monowhite-switching-code-for-1-bp.patch
Type: text/x-patch
Size: 5318 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160208/ac674fab/attachment.bin>


More information about the ffmpeg-devel mailing list