16 ref=${7:-"${base}/ref/fate/${test}"}
19 thread_type=${10:-frame+slice}
22 outdir="tests/data/fate"
23 outfile="${outdir}/${test}"
24 errfile="${outdir}/${test}.err"
25 cmpfile="${outdir}/${test}.diff"
26 repfile="${outdir}/${test}.rep"
29 psnr=$(tests/tiny_psnr "$1" "$2" 2 0 0)
30 val=$(expr "$psnr" : ".*$3: *\([0-9.]*\)")
31 size1=$(expr "$psnr" : '.*bytes: *\([0-9]*\)')
32 size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)')
33 res=$(echo "if ($val $4 $5) 1" | bc)
34 if [ "$res" != 1 ] || [ $size1 != $size2 ]; then
41 do_tiny_psnr "$1" "$2" MAXDIFF '<=' ${fuzz:-1}
45 do_tiny_psnr "$1" "$2" stddev '<=' ${fuzz:-1}
49 test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3
50 $target_exec $target_path/"$@"
54 run ffmpeg -nostats -threads $threads -thread_type $thread_type -cpuflags $cpuflags "$@"
58 avconv "$@" -f framecrc -
62 avconv "$@" -f framemd5 -
74 avconv "$@" -vn -f s16le -
80 ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags" "$samples"
84 regtest codec $1 tests/$1
88 regtest lavf lavf-fate tests/vsynth1
92 regtest lavf lavf tests/vsynth1
96 cleanfiles="tests/data/lavfi/${test#lavfi-}.nut"
97 regtest lavfi lavfi tests/vsynth1
102 ref=${base}/ref/seek/$t
104 image_*) file="tests/data/images/${t#image_}/%02d.${t#image_}" ;;
105 *) file=$(echo $t | tr _ '?')
106 for d in acodec vsynth2 lavf; do
107 test -f tests/data/$d/$file && break
109 file=$(echo tests/data/$d/$file)
112 run libavformat/seek-test $target_path/$file
118 $command > "$outfile" 2>$errfile
121 if [ $err -gt 128 ]; then
122 sig=$(kill -l $err 2>/dev/null)
123 test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
126 if test -e "$ref"; then
128 diff) diff -u -w "$ref" "$outfile" >$cmpfile ;;
129 oneoff) oneoff "$ref" "$outfile" "$fuzz" >$cmpfile ;;
130 stddev) stddev "$ref" "$outfile" "$fuzz" >$cmpfile ;;
131 null) cat "$outfile" >$cmpfile ;;
134 test $err = 0 && err=$cmperr
135 test $err = 0 || cat $cmpfile
137 echo "reference file '$ref' not found"
141 echo "${test}:${sig:-$err}:$($base64 <$cmpfile):$($base64 <$errfile)" >$repfile
143 if test $err = 0; then
144 rm -f $outfile $errfile $cmpfile $cleanfiles
146 echo "Test $test failed. Look at $errfile for details."