lavc/rawdec: Use AV_PIX_FMT_PAL8 for raw 1 bpp video in AVI
authorMats Peterson <matsp888-at-yahoo.com@ffmpeg.org>
Thu, 28 Jan 2016 05:15:29 +0000 (06:15 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 29 Jan 2016 13:52:30 +0000 (14:52 +0100)
 From
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318229%28v=vs.85%29.aspx:

"If biCompression equals BI_RGB and the bitmap uses 8 bpp or less, the
bitmap has a color table immediatelly following the BITMAPINFOHEADER
structure. The color table consists of an array of RGBQUAD values. The
size of the array is given by the biClrUsed member. If biClrUsed is
zero, the array contains the maximum number of colors for the given
bitdepth; that is, 2^biBitCount colors."

Nothing about "monochrome" here. Unfortunately, pal8 to monow conversion
seems a bit flaky, but that's another story.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/raw.c
tests/ref/vsynth/vsynth1-bpp1
tests/ref/vsynth/vsynth2-bpp1
tests/ref/vsynth/vsynth3-bpp1
tests/ref/vsynth/vsynth_lena-bpp1

index 888f554..4f7417a 100644 (file)
@@ -282,7 +282,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt)
 }
 
 const PixelFormatTag avpriv_pix_fmt_bps_avi[] = {
-    { AV_PIX_FMT_MONOWHITE, 1 },
+    { AV_PIX_FMT_PAL8,    1 },
     { AV_PIX_FMT_PAL8,    2 },
     { AV_PIX_FMT_PAL8,    4 },
     { AV_PIX_FMT_PAL8,    8 },
index 32dab11..378f990 100644 (file)
@@ -1,4 +1,4 @@
 3e5e0f4afb3a0350440e86b1ea56cec9 *tests/data/fate/vsynth1-bpp1.avi
 640452 tests/data/fate/vsynth1-bpp1.avi
-ccef5f5d5b0392f1d01c200499dac657 *tests/data/fate/vsynth1-bpp1.out.rawvideo
-stddev:   97.30 PSNR:  8.37 MAXDIFF:  237 bytes:  7603200/  7603200
+853694f3c1aa3ef3807ab1fccbeefe7b *tests/data/fate/vsynth1-bpp1.out.rawvideo
+stddev:   84.44 PSNR:  9.60 MAXDIFF:  221 bytes:  7603200/  7603200
index d010bbd..ae8fd27 100644 (file)
@@ -1,4 +1,4 @@
 771437c9038b44f4e2d4ff764c1c3821 *tests/data/fate/vsynth2-bpp1.avi
 640452 tests/data/fate/vsynth2-bpp1.avi
-ba70b5aebc786e625af6bd7f7ec82717 *tests/data/fate/vsynth2-bpp1.out.rawvideo
-stddev:   81.63 PSNR:  9.89 MAXDIFF:  237 bytes:  7603200/  7603200
+94261fc8aa20130cbd4361e15b742ef7 *tests/data/fate/vsynth2-bpp1.out.rawvideo
+stddev:   70.29 PSNR: 11.19 MAXDIFF:  221 bytes:  7603200/  7603200
index f84808a..6f71248 100644 (file)
@@ -1,4 +1,4 @@
 a5e6d1eff2f6fc3bba31e3bb8753b905 *tests/data/fate/vsynth3-bpp1.avi
 15352 tests/data/fate/vsynth3-bpp1.avi
-75e8ee0c0b0ada4515455d9f29377a16 *tests/data/fate/vsynth3-bpp1.out.rawvideo
-stddev:   97.70 PSNR:  8.33 MAXDIFF:  248 bytes:    86700/    86700
+79076b5fc43ee2a2284c0cde991d21f3 *tests/data/fate/vsynth3-bpp1.out.rawvideo
+stddev:   84.88 PSNR:  9.55 MAXDIFF:  232 bytes:    86700/    86700
index d4570c7..3e250a8 100644 (file)
@@ -1,4 +1,4 @@
 d53d08c755ffde5fca744f0f941bfcb1 *tests/data/fate/vsynth_lena-bpp1.avi
 640452 tests/data/fate/vsynth_lena-bpp1.avi
-9a66df9009670b0a593d889975246c00 *tests/data/fate/vsynth_lena-bpp1.out.rawvideo
-stddev:   96.36 PSNR:  8.45 MAXDIFF:  233 bytes:  7603200/  7603200
+dce624117fcd2b16f38e0a0a62b13fa7 *tests/data/fate/vsynth_lena-bpp1.out.rawvideo
+stddev:   83.18 PSNR:  9.73 MAXDIFF:  217 bytes:  7603200/  7603200