OSDN Git Service

avienc: Fix rawvideo 32bit
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Dec 2011 02:25:46 +0000 (03:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Dec 2011 02:25:46 +0000 (03:25 +0100)
Bug found by: Rik Maes <rik.maes54@gmail.com>
Change based on suggestion by Rik Maes

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/riff.c
tests/ref/vsynth1/huffyuv
tests/ref/vsynth1/yuv
tests/ref/vsynth2/huffyuv
tests/ref/vsynth2/yuv

index ea598d2..4f475ba 100644 (file)
@@ -519,7 +519,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t
     avio_wl16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24); /* depth */
     /* compression type */
     avio_wl32(pb, enc->codec_tag);
-    avio_wl32(pb, enc->width * enc->height * 3);
+    avio_wl32(pb, (enc->width * enc->height * (enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24)+7) / 8);
     avio_wl32(pb, 0);
     avio_wl32(pb, 0);
     avio_wl32(pb, 0);
index fefc84a..9ec091e 100644 (file)
@@ -1,4 +1,4 @@
-ace2536fa169d835d0fb332abde28d51 *./tests/data/vsynth1/huffyuv.avi
+f5f2e109af0612694ff3cd6464063e82 *./tests/data/vsynth1/huffyuv.avi
 7933800 ./tests/data/vsynth1/huffyuv.avi
 c5ccac874dbf808e9088bc3107860042 *./tests/data/huffyuv.vsynth1.out.yuv
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
index b98dda5..6d8b143 100644 (file)
@@ -1,4 +1,4 @@
-aa6b9e862aebcf8902a6d770e7729d59 *./tests/data/vsynth1/yuv.avi
+eaa66c3b27a2602e882befe154a8b119 *./tests/data/vsynth1/yuv.avi
 7610060 ./tests/data/vsynth1/yuv.avi
 c5ccac874dbf808e9088bc3107860042 *./tests/data/yuv.vsynth1.out.yuv
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
index 740862a..e59b53c 100644 (file)
@@ -1,4 +1,4 @@
-56cd44907a48990e06bd065e189ff461 *./tests/data/vsynth2/huffyuv.avi
+ed66182be0d515e8b6cb970ad63162da *./tests/data/vsynth2/huffyuv.avi
 6455232 ./tests/data/vsynth2/huffyuv.avi
 dde5895817ad9d219f79a52d0bdfb001 *./tests/data/huffyuv.vsynth2.out.yuv
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
index 6593ce9..699ebc9 100644 (file)
@@ -1,4 +1,4 @@
-30a400773ab26f2c83e469198b156f1d *./tests/data/vsynth2/yuv.avi
+3d5ee6d2023bc15bba898819e4977e46 *./tests/data/vsynth2/yuv.avi
 7610060 ./tests/data/vsynth2/yuv.avi
 dde5895817ad9d219f79a52d0bdfb001 *./tests/data/yuv.vsynth2.out.yuv
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200