Commit 89d5dfd5 authored by Fabrice Bellard's avatar Fabrice Bellard

added libav regression tests

Originally committed as revision 537 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b5a40dc6
......@@ -7,6 +7,7 @@ include ../config.mak
VPATH=$(SRC_PATH)/tests
CFLAGS=-O2 -Wall -g
REFFILE=$(SRC_PATH)/tests/ffmpeg.regression.ref
LIBAV_REFFILE=$(SRC_PATH)/tests/libav.regression.ref
all: test
......@@ -14,9 +15,9 @@ all: test
test mpeg4 mpeg: vsynth1/0.pgm asynth1.sw
@$(SRC_PATH)/tests/regression.sh $@ $(REFFILE)
# update the regression test with the current results
updatetest:
cp /tmp/ffmpeg.regression $(REFFILE)
# fast regression for libav formats
libavtest: vsynth1/0.pgm asynth1.sw
@$(SRC_PATH)/tests/regression.sh $@ $(LIBAV_REFFILE)
# video generation
......
ffmpeg regression test
ef90f12bc797e5e5a1b861842337ea07 /tmp/a-libav.avi
/tmp/a-libav.avi CRC=3a24751b
1b4c24ad5186d7f636a3ef9e94fa0d0c /tmp/a-libav.asf
/tmp/a-libav.asf CRC=3a24751b
4508a1cbbe65a42e7da42b680b8ef7e5 /tmp/a-libav.rm
e5956eba346efaf8d485c8e595672f15 /tmp/a-libav.mpg
/tmp/a-libav.mpg CRC=917d4442
bb02e59ef519ef72bcfcfc0265ac2965 /tmp/a-libav.ffm
7a03394d82a1437a45143768b7544116 /tmp/a-libav.mjpeg
aff140ce80a1c86c1bf54118ad23da7b /tmp/a-libav.pgmpipe
/tmp/a-libav.pgmpipe CRC=50151823
5f50d148d57d25a900a071a5c471df9e /tmp/a-libav.ppmpipe
/tmp/a-libav.ppmpipe CRC=12f0c2c6
5f50d148d57d25a900a071a5c471df9e /tmp/a-libav.gif
/tmp/a-libav%d.pgm CRC=50151823
/tmp/a-libav%d.ppm CRC=b24e0c74
8854ea97f2d2172383941b001c69228b /tmp/a-libav.wav
/tmp/a-libav.wav CRC=f1ae5536
8bce9c3758b0d38da2e0718b6ab57fb4 /tmp/a-libav.al
/tmp/a-libav.al CRC=5e6d372b
e64027a96ad5907ee281deff3286da0a /tmp/a-libav.ul
/tmp/a-libav.ul CRC=e028b50a
dbd11f783219485cae32024e47c19dfb /tmp/a-libav.au
/tmp/a-libav.au CRC=f1ae5536
......@@ -6,18 +6,23 @@
#set -x
set -e
logfile="/tmp/ffmpeg.regression"
# tests to do
if [ "$1" = "mpeg4" ] ; then
do_mpeg4=y
elif [ "$1" = "mpeg" ] ; then
do_mpeg=y
elif [ "$1" = "libavtest" ] ; then
do_libav=y
logfile="/tmp/libav.regression"
else
do_mpeg=y
do_msmpeg4=y
do_h263=y
do_mpeg4=y
do_mjpeg=y
#do_rv10=y #broken!
#do_rv10=y #broken
do_mp2=y
do_ac3=y
fi
......@@ -27,7 +32,6 @@ fi
ffmpeg="../ffmpeg"
outfile="/tmp/a-"
reffile="$2"
logfile="/tmp/ffmpeg.regression"
benchfile="/tmp/ffmpeg.bench"
raw_src="vsynth1/%d.pgm"
raw_dst="/tmp/out.yuv"
......@@ -38,13 +42,22 @@ function do_ffmpeg ()
{
f="$1"
shift
echo $ffmpeg $*
$ffmpeg -benchmark $* > /tmp/bench.tmp
echo $ffmpeg -bitexact $*
$ffmpeg -bitexact -benchmark $* > /tmp/bench.tmp
md5sum $f >> $logfile
expr match "`cat /tmp/bench.tmp`" '.*utime=\(.*s\)' > /tmp/bench2.tmp
echo `cat /tmp/bench2.tmp` $f >> $benchfile
}
function do_ffmpeg_crc ()
{
f="$1"
shift
echo $ffmpeg -y -bitexact $* -f crc /tmp/ffmpeg.crc
$ffmpeg -y -bitexact $* -f crc /tmp/ffmpeg.crc
echo -n "$f " >> $logfile
cat /tmp/ffmpeg.crc >> $logfile
}
echo "ffmpeg regression test" > $logfile
echo "ffmpeg benchmarks" > $benchfile
......@@ -53,10 +66,10 @@ echo "ffmpeg benchmarks" > $benchfile
if [ -n "$do_mpeg" ] ; then
# mpeg1 encoding
file=${outfile}mpeg1.mpg
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpegvideo $file
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
# mpeg1 decoding
do_ffmpeg $raw_dst -y -f mpegvideo -i $file -f rawvideo $raw_dst
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
# mpeg2 decoding
#do_ffmpeg /tmp/out-mpeg2.yuv -y -f mpegvideo -i a.vob \
......@@ -133,6 +146,108 @@ do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
fi
###################################
# libav testing
###################################
if [ -n "$do_libav" ] ; then
# avi
file=${outfile}libav.avi
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
# asf
file=${outfile}libav.asf
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
# rm
file=${outfile}libav.rm
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
# broken
#do_ffmpeg_crc $file -i $file
# mpegps
file=${outfile}libav.mpg
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
# swf (decode audio only)
file=${outfile}libav.swf
# broken
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
#do_ffmpeg_crc $file -i $file
# ffm
file=${outfile}libav.ffm
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
# broken
#do_ffmpeg_crc $file -i $file
# XXX: need mov and mpegts tests (add bitstreams or add output capability in ffmpeg)
####################
# streamed images
# mjpeg
file=${outfile}libav.mjpeg
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
# broken
#do_ffmpeg_crc $file -i $file
# pgmpipe
file=${outfile}libav.pgmpipe
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f pgmpipe $file
do_ffmpeg_crc $file -f pgmpipe -i $file
# ppmpipe
file=${outfile}libav.ppmpipe
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f ppmpipe $file
do_ffmpeg_crc $file -f ppmpipe -i $file
# gif
file=${outfile}libav.gif
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f ppmpipe $file
#do_ffmpeg_crc $file -f ppmpipe -i $file
####################
# image formats
# pgm (we do not do md5 on image files yet)
file=${outfile}libav%d.pgm
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
do_ffmpeg_crc $file -i $file
# ppm (we do not do md5 on image files yet)
file=${outfile}libav%d.ppm
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
do_ffmpeg_crc $file -i $file
####################
# audio only
# wav
file=${outfile}libav.wav
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
# alaw
file=${outfile}libav.al
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
# mulaw
file=${outfile}libav.ul
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
# au
file=${outfile}libav.au
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
do_ffmpeg_crc $file -i $file
fi
if diff -u $logfile $reffile ; then
echo
......
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