Commit 3ba57bfe authored by Mats Peterson's avatar Mats Peterson Committed by Michael Niedermayer

lavf/riffenc: Handle AV_PIX_FMT_MONOBLACK

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6eb4021d
......@@ -241,9 +241,14 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
avio_w8(pb, 0);
} else if (raw_pal_avi) {
int i;
enum AVPixelFormat pix_fmt = enc->pix_fmt;
if (pix_fmt == AV_PIX_FMT_NONE && enc->bits_per_coded_sample == 1)
pix_fmt = AV_PIX_FMT_MONOWHITE;
for (i = 0; i < 1 << enc->bits_per_coded_sample; i++) {
/* Initialize 1 bpp palette to black & white */
if (!i && enc->bits_per_coded_sample == 1)
if (i == 0 && pix_fmt == AV_PIX_FMT_MONOWHITE)
avio_wl32(pb, 0xffffff);
else if (i == 1 && pix_fmt == AV_PIX_FMT_MONOBLACK)
avio_wl32(pb, 0xffffff);
else
avio_wl32(pb, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment