From a70eac7a9b193e8434b5bed90bd72aa4cb688363 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 8 Aug 2018 22:17:49 +0200 Subject: tests: Convert image2pipe tests to non-legacy test scripts --- tests/fate-run.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'tests/fate-run.sh') diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 8c6adf1..0221e5c 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -152,6 +152,51 @@ enc_dec(){ tests/tiny_psnr $srcfile $decfile $cmp_unit $cmp_shift } +# FIXME: There is a certain duplication between the avconv-related helper +# functions above and below that should be refactored. +avconv2="$target_exec ${target_path}/avconv" +raw_src="${target_path}/tests/vsynth1/%02d.pgm" +crcfile="tests/data/$test.lavf.crc" +target_crcfile="${target_path}/$crcfile" + +echov(){ + echo "$@" >&3 +} + +AVCONV_OPTS="-nostats -y -cpuflags $cpuflags -threads $threads" +DEC_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact" +ENC_OPTS="$DEC_OPTS -threads 1 -dct fastint" + +run_avconv(){ + $echov $avconv2 $AVCONV_OPTS $* + $avconv2 $AVCONV_OPTS $* +} + +do_avconv(){ + f="$1" + shift + set -- $* ${target_path}/$f + run_avconv $* + do_md5sum $f + echo $(wc -c $f) +} + +do_avconv_crc(){ + f="$1" + shift + run_avconv $* -f crc "$target_crcfile" + echo "$f $(cat $crcfile)" +} + +lavf_image2pipe(){ + t="${test#lavf-}" + t="${t%pipe}" + outdir="tests/data/lavf" + file=${outdir}/${t}pipe.$t + do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src -f image2pipe $ENC_OPTS -t 1 -qscale 10 + do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file +} + lavftest(){ t="${test#lavf-}" ref=${base}/ref/lavf/$t -- cgit v1.1