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

Mats Peterson matsp888 at yahoo.com
Wed Feb 10 10:12:40 CET 2016


The stride will be calculated incorrectly for the attached 3 x 3 pixel 
pal8 nut file, since there is some padding in the packet after the video 
data and before the palette. It will be properly rounded down to the 
real width of the video data for larger sizes, but this one will be 4 
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all. 
Anyway, run ffplay with "-v debug" to output the packet size and the stride.

If you have a better solution, feel free to change the stride 
calculation code.

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.

For black & white AVI or QuickTime files, in order to produce a 
monochrome nut file, force the pixel format with "-pix_fmt monow" or 
"-pix_fmt monob".

Unfortunately, there is a problem with converting from pal8 to monow, 
and I know what it is now. There seems to be some weird dithering going 
on of the white color, so there will be black pixels here and there in 
the monow output. A better way is to use "ffmpeg -i 1bpp.avi -vcodec 
copy -vtag B1W0 1bpp.nut". The "-vtag" option is currently needed, 
otherwise FFmpeg will use a RGB[15] codec tag for some reason.

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

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: 6329 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160210/7e7ecb06/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3x3.nut
Type: application/octet-stream
Size: 1331 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160210/7e7ecb06/attachment.obj>


More information about the ffmpeg-devel mailing list