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

Mats Peterson matsp888 at yahoo.com
Thu Feb 11 03:46:38 CET 2016


On 02/11/2016 03:20 AM, Mats Peterson wrote:
> Updated the FATE test files for the latest checkout.
>
> 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. I suppose it's not that bad after all, since there
> aren't too many users who use 3 x 3 pixel videos out there. But it's a
> bit irritating nevertheless. Life would be easier if there were no
> padding between the video data and the palette, but I guess it's done
> for memory alignment purposes.
>
> Just remember this: When using "-vcodec copy" with nut as the output,
> FFmpeg will happily copy the video to the file without ever considering
> the stride of it. Therefore, it's not possible to base the stride on
> avctx->width for nut. It would of course be much easier. One will have
> to divide the packet size (minus the palette size, 1024 bytes, in the
> case of pal8 nut) with the height, in the same way as the stride is
> calculated for AVI and QuickTime. They don't contain any palette in the
> packets, of course.
>
> 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".
>
> Another 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
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Nice. The patch fails on tests/ref/fate/sub2video, since you JUST 
changed it over there. Can you fix that on your side?

Mats

-- 
Mats Peterson
http://matsp888.no-ip.org/~mats/


More information about the ffmpeg-devel mailing list