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

Mats Peterson matsp888 at yahoo.com
Sun Feb 7 02:45:56 CET 2016


On 02/07/2016 02:39 AM, Mats Peterson wrote:
> On 02/06/2016 05:17 AM, Mats Peterson wrote:
>> On 02/06/2016 05:05 AM, Mats Peterson wrote:
>>> 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".
>>>
>>> I have also updated the 1 bpp FATE test files (once again).
>>>
>>> Mats
>>>
>>
>> And I deliberately kept the pal8 placeholders for the future in case you
>> wonder, Michael.
>>
>> Mats
>>
>
> Yet another argument for removing this code is that AVI (and BMP
> indirectly) doesn't have a dedicated grayscale mode like PNG, or
> explicit black & white mode like TIFF's bilevel mode. Hence it should
> not use monowhite under any circumstances in my book.
>
> Mats
>

The BMP code in FFmpeg handles this correctly by using pal8 exclusively 
for 1 bpp.

Mats



More information about the ffmpeg-devel mailing list