Commit 7191272f authored by romansh's avatar romansh

   * fixing a bug in avpicture_layout (PAL8 wasn't handled properly)
   * adding regression tests for all pix_fmt conversions
   * making libavtest part of the default testsuite


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1855 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1a15a464
...@@ -324,12 +324,15 @@ int avpicture_layout(AVPicture* src, int pix_fmt, int width, int height, ...@@ -324,12 +324,15 @@ int avpicture_layout(AVPicture* src, int pix_fmt, int width, int height,
if (size > dest_size) if (size > dest_size)
return -1; return -1;
if (pf->pixel_type == FF_PIXEL_PACKED) { if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) {
if (pix_fmt == PIX_FMT_YUV422 || pix_fmt == PIX_FMT_RGB565 || if (pix_fmt == PIX_FMT_YUV422 || pix_fmt == PIX_FMT_RGB565 ||
pix_fmt == PIX_FMT_RGB555) pix_fmt == PIX_FMT_RGB555)
w = width * 2; w = width * 2;
else if (pix_fmt == PIX_FMT_PAL8)
w = width;
else else
w = width * (pf->depth * pf->nb_channels / 8); w = width * (pf->depth * pf->nb_channels / 8);
data_planes = 1; data_planes = 1;
h = height; h = height;
} else { } else {
...@@ -350,7 +353,10 @@ int avpicture_layout(AVPicture* src, int pix_fmt, int width, int height, ...@@ -350,7 +353,10 @@ int avpicture_layout(AVPicture* src, int pix_fmt, int width, int height,
s += src->linesize[i]; s += src->linesize[i];
} }
} }
if (pf->pixel_type == FF_PIXEL_PALETTE)
memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4);
return size; return size;
} }
......
...@@ -14,7 +14,7 @@ SERVER_REFFILE=$(SRC_PATH)/tests/ffserver.regression.ref ...@@ -14,7 +14,7 @@ SERVER_REFFILE=$(SRC_PATH)/tests/ffserver.regression.ref
LIBAV_REFFILE=$(SRC_PATH)/tests/libav.regression.ref LIBAV_REFFILE=$(SRC_PATH)/tests/libav.regression.ref
all: test test-server all: test libavtest test-server
test-server: vsynth1/0.pgm asynth1.sw test-server: vsynth1/0.pgm asynth1.sw
@$(SRC_PATH)/tests/server-regression.sh $(SERVER_REFFILE) @$(SRC_PATH)/tests/server-regression.sh $(SERVER_REFFILE)
......
ffmpeg regression test ffmpeg regression test
5094822b269fcbad417e22cd99e3988d *./data/a-libav.avi 55e7e5626717ced8d8709c43bd669fc1 *./data/a-libav.avi
./data/a-libav.avi CRC=0ddb1e18 ./data/a-libav.avi CRC=665adc14
a409939656b9eb6e9a39712a60ec404b *./data/a-libav.asf f34176ef4f8577c93d51d7c403c8776d *./data/a-libav.asf
./data/a-libav.asf CRC=0ddb1e18 ./data/a-libav.asf CRC=cf51c3de
7ee3ebfbcd0ae82f59b683ec18d09042 *./data/a-libav.rm 59c71a1bef09beb4a4e6f203967d12de *./data/a-libav.rm
11c39c84b3aa4c6305fdc700f4407a66 *./data/a-libav.mpg 271603c17313031c17d424364f33f86f *./data/a-libav.mpg
./data/a-libav.mpg CRC=61471a80 ./data/a-libav.mpg CRC=a892f96f
976a303a3f2f3c262d52b6dd5e744328 *./data/a-libav.swf 976a303a3f2f3c262d52b6dd5e744328 *./data/a-libav.swf
./data/a-libav.swf CRC=d813a4a6 ./data/a-libav.swf CRC=d813a4a6
30bde35dc73eeb7658b93cbecb4a08f8 *./data/a-libav.ffm 3d0ea8f9cc0f9c4ed096381de3ab7d53 *./data/a-libav.ffm
./data/a-libav.ffm CRC=8a5b1654 ./data/a-libav.ffm CRC=2a4bfa20
27dff20bbab9a65b41fffe5233eb9ac7 *./data/a-libav.mjpeg 9a9da315747599f7718cc9a9a09c21ff *./data/a-libav.pbm
./data/a-libav.mjpeg CRC=fd137c0e ./data/a-libav.pbm CRC=a1057fd1
925b133612fda60c7b95136847e78681 *./data/a-libav.pbm 6ea0e1faf08f6fcdb44db4a104361b57 *./data/a-libav.pgm
./data/a-libav.pbm CRC=91ae93e8 ./data/a-libav.pgm CRC=f4aa7c47
aff140ce80a1c86c1bf54118ad23da7b *./data/a-libav.pgm 0c5fe86621b7377705837f304d4ba1e9 *./data/a-libav.ppm
./data/a-libav.pgm CRC=50151823 ./data/a-libav.ppm CRC=b2bb8e92
e690ec91467990bcf31a338bc55a7281 *./data/a-libav.ppm 1cac531652ea2ff2fb141d5ae992caa8 *./data/a-libav.gif
./data/a-libav.ppm CRC=e4799106
268421842abae52d1f0346e07401fe0d *./data/a-libav.gif
bf66705fbeee5355d8ff021d1e88fa6f *./data/a-libav.yuv4mpeg bf66705fbeee5355d8ff021d1e88fa6f *./data/a-libav.yuv4mpeg
./data/a-libav%d.pgm CRC=07f57a1a ./data/a-libav%d.pgm CRC=84c09106
./data/a-libav%d.ppm CRC=755c4b6a ./data/a-libav%d.ppm CRC=25c06ecf
./data/a-libav%d.jpg CRC=ed64ec39
4b7690747c49e4e8e910359768e4a77e *./data/a-libav.wav 4b7690747c49e4e8e910359768e4a77e *./data/a-libav.wav
./data/a-libav.wav CRC=2a09519c ./data/a-libav.wav CRC=2a09519c
e2a6d6fae17394dfe87cb5bb8ae11837 *./data/a-libav.al e2a6d6fae17394dfe87cb5bb8ae11837 *./data/a-libav.al
...@@ -31,3 +28,21 @@ e2a6d6fae17394dfe87cb5bb8ae11837 *./data/a-libav.al ...@@ -31,3 +28,21 @@ e2a6d6fae17394dfe87cb5bb8ae11837 *./data/a-libav.al
./data/a-libav.ul CRC=6064b2f8 ./data/a-libav.ul CRC=6064b2f8
7a21ff174e3cca1702e0826c4ca0eccf *./data/a-libav.au 7a21ff174e3cca1702e0826c4ca0eccf *./data/a-libav.au
./data/a-libav.au CRC=2a09519c ./data/a-libav.au CRC=2a09519c
ce356ce2708cb6033ab5d762da93cfd4 *./data/a-libav-yuv420p.yuv
ce356ce2708cb6033ab5d762da93cfd4 *./data/a-libav-yuv422p.yuv
ce356ce2708cb6033ab5d762da93cfd4 *./data/a-libav-yuv444p.yuv
ce356ce2708cb6033ab5d762da93cfd4 *./data/a-libav-yuv422.yuv
545f61c353a8b4419808785cb4f0069d *./data/a-libav-yuv410p.yuv
d6c03f930018ff859bd43f52b92e9321 *./data/a-libav-yuv411p.yuv
14117c4d7956775a7bbceabfc38da808 *./data/a-libav-yuvj420p.yuv
14117c4d7956775a7bbceabfc38da808 *./data/a-libav-yuvj422p.yuv
14117c4d7956775a7bbceabfc38da808 *./data/a-libav-yuvj444p.yuv
deb2f7ebe297df2c1fe264d19b34d2fb *./data/a-libav-rgb24.yuv
deb2f7ebe297df2c1fe264d19b34d2fb *./data/a-libav-bgr24.yuv
deb2f7ebe297df2c1fe264d19b34d2fb *./data/a-libav-rgba32.yuv
5d395f62bff8ac475f743268c772ca3a *./data/a-libav-rgb565.yuv
2ffd6871fcbfe9570454e8703ac8ea01 *./data/a-libav-rgb555.yuv
0b62dcf9b57b294dbaa5d9e99b1ee192 *./data/a-libav-gray.yuv
d5a686494c2ded1d211937ef8e22b56b *./data/a-libav-monow.yuv
d5a686494c2ded1d211937ef8e22b56b *./data/a-libav-monob.yuv
7a319375916cae4e691ecb74295e5d2a *./data/a-libav-pal8.yuv
...@@ -67,8 +67,8 @@ do_ffmpeg() ...@@ -67,8 +67,8 @@ do_ffmpeg()
{ {
f="$1" f="$1"
shift shift
echo $ffmpeg -bitexact -dct_algo 1 -idct_algo 2 $* echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
$ffmpeg -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$ $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
egrep -v "^(Stream|Press|Input|Output|frame| Stream)" /tmp/ffmpeg$$ || true egrep -v "^(Stream|Press|Input|Output|frame| Stream)" /tmp/ffmpeg$$ || true
rm -f /tmp/ffmpeg$$ rm -f /tmp/ffmpeg$$
md5sum -b $f >> $logfile md5sum -b $f >> $logfile
...@@ -84,17 +84,20 @@ do_ffmpeg_crc() ...@@ -84,17 +84,20 @@ do_ffmpeg_crc()
f="$1" f="$1"
shift shift
echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
$ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
echo -n "$f " >> $logfile egrep -v "^(Stream|Press|Input|Output|frame| Stream)" /tmp/ffmpeg$$ || true
cat $datadir/ffmpeg.crc >> $logfile rm -f /tmp/ffmpeg$$
echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
} }
do_ffmpeg_nocheck() do_ffmpeg_nocheck()
{ {
f="$1" f="$1"
shift shift
echo $ffmpeg -bitexact -dct_algo 1 -idct_algo 2 $* echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
$ffmpeg -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
egrep -v "^(Stream|Press|Input|Output|frame| Stream)" /tmp/ffmpeg$$ || true
rm -f /tmp/ffmpeg$$
expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
echo `cat $datadir/bench2.tmp` $f >> $benchfile echo `cat $datadir/bench2.tmp` $f >> $benchfile
} }
...@@ -312,9 +315,9 @@ do_ffmpeg_crc $file -i $file ...@@ -312,9 +315,9 @@ do_ffmpeg_crc $file -i $file
#################### ####################
# streamed images # streamed images
# mjpeg # mjpeg
file=${outfile}libav.mjpeg #file=${outfile}libav.mjpeg
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file #do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
do_ffmpeg_crc $file -i $file #do_ffmpeg_crc $file -i $file
# pbmpipe # pbmpipe
file=${outfile}libav.pbm file=${outfile}libav.pbm
...@@ -354,9 +357,9 @@ $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file ...@@ -354,9 +357,9 @@ $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
do_ffmpeg_crc $file -i $file do_ffmpeg_crc $file -i $file
# jpeg (we do not do md5 on image files yet) # jpeg (we do not do md5 on image files yet)
file=${outfile}libav%d.jpg #file=${outfile}libav%d.jpg
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file #$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
do_ffmpeg_crc $file -i $file #do_ffmpeg_crc $file -i $file
#################### ####################
# audio only # audio only
...@@ -381,6 +384,19 @@ file=${outfile}libav.au ...@@ -381,6 +384,19 @@ file=${outfile}libav.au
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file do_ffmpeg_crc $file -i $file
####################
# pix_fmt conversions
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
monob pal8"
for pix_fmt in $conversions ; do
file=${outfile}libav-${pix_fmt}.yuv
do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
-f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
-f rawvideo -s 352x288 -pix_fmt yuv444p $file
done
fi fi
......
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