X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ffate-run.sh;h=ccd04a310871853ddb2332a169d5b59342f27bfa;hb=11a1033c9fcae380f4da06b2b0253ab0eb82b026;hp=126f2ce46de4a17656079597e3904d249e2e266f;hpb=31f3c94760b42e16e998dcc0b34e677d1aa431bc;p=ffmpeg diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 126f2ce46de..ccd04a31087 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -21,6 +21,7 @@ cpuflags=${11:-all} cmp_shift=${12:-0} cmp_target=${13:-0} size_tolerance=${14:-0} +cmp_unit=${15:-2} outdir="tests/data/fate" outfile="${outdir}/${test}" @@ -40,7 +41,7 @@ compare(){ } do_tiny_psnr(){ - psnr=$(tests/tiny_psnr "$1" "$2" 2 $cmp_shift 0) + psnr=$(tests/tiny_psnr "$1" "$2" $cmp_unit $cmp_shift 0) val=$(expr "$psnr" : ".*$3: *\([0-9.]*\)") size1=$(expr "$psnr" : '.*bytes: *\([0-9]*\)') size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)') @@ -70,31 +71,37 @@ run(){ } probefmt(){ - run ffprobe -show_format_entry format_name -print_format default=nw=1 -v 0 "$@" + run ffprobe -show_format_entry format_name -print_format default=nw=1:nk=1 -v 0 "$@" } -avconv(){ - run ffmpeg -nostats -threads $threads -thread_type $thread_type -cpuflags $cpuflags "$@" +ffmpeg(){ + dec_opts="-threads $threads -thread_type $thread_type" + ffmpeg_args="-nostats -cpuflags $cpuflags" + for arg in $@; do + [ ${arg} = -i ] && ffmpeg_args="${ffmpeg_args} ${dec_opts}" + ffmpeg_args="${ffmpeg_args} ${arg}" + done + run ffmpeg ${ffmpeg_args} } framecrc(){ - avconv "$@" -f framecrc - + ffmpeg "$@" -f framecrc - } framemd5(){ - avconv "$@" -f framemd5 - + ffmpeg "$@" -f framemd5 - } crc(){ - avconv "$@" -f crc - + ffmpeg "$@" -f crc - } md5(){ - avconv "$@" md5: + ffmpeg "$@" md5: } pcm(){ - avconv "$@" -vn -f s16le - + ffmpeg "$@" -vn -f s16le - } enc_dec_pcm(){ @@ -106,8 +113,36 @@ enc_dec_pcm(){ encfile="${outdir}/${test}.${out_fmt}" cleanfiles=$encfile encfile=$(target_path ${encfile}) - avconv -i $src_file "$@" -f $out_fmt -y ${encfile} || return - avconv -i ${encfile} -c:a pcm_${pcm_fmt} -f ${dec_fmt} - + ffmpeg -i $src_file "$@" -f $out_fmt -y ${encfile} || return + ffmpeg -flags +bitexact -i ${encfile} -c:a pcm_${pcm_fmt} -f ${dec_fmt} - +} + +FLAGS="-flags +bitexact -sws_flags +accurate_rnd+bitexact" +DEC_OPTS="-threads $threads -idct simple $FLAGS" +ENC_OPTS="-threads 1 -idct simple -dct fastint" + +enc_dec(){ + src_fmt=$1 + srcfile=$2 + enc_fmt=$3 + enc_opt=$4 + dec_fmt=$5 + dec_opt=$6 + encfile="${outdir}/${test}.${enc_fmt}" + decfile="${outdir}/${test}.out.${dec_fmt}" + cleanfiles="$cleanfiles $decfile" + test "$7" = -keep || cleanfiles="$cleanfiles $encfile" + tsrcfile=$(target_path $srcfile) + tencfile=$(target_path $encfile) + tdecfile=$(target_path $decfile) + ffmpeg -f $src_fmt $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt $FLAGS \ + -f $enc_fmt -y $tencfile || return + do_md5sum $encfile + echo $(wc -c $encfile) + ffmpeg $8 $DEC_OPTS -i $tencfile $ENC_OPTS $dec_opt $FLAGS \ + -f $dec_fmt -y $tdecfile || return + do_md5sum $decfile + tests/tiny_psnr $srcfile $decfile $cmp_unit $cmp_shift } regtest(){ @@ -116,10 +151,6 @@ regtest(){ ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags" "$samples" } -codectest(){ - regtest codec $1 tests/$1 -} - lavffatetest(){ regtest lavf lavf-fate tests/vsynth1 } @@ -139,10 +170,10 @@ seektest(){ case $t in image_*) file="tests/data/images/${t#image_}/%02d.${t#image_}" ;; *) file=$(echo $t | tr _ '?') - for d in acodec vsynth2 lavf; do - test -f tests/data/$d/$file && break + for d in fate/acodec- fate/vsynth2- lavf/; do + test -f tests/data/$d$file && break done - file=$(echo tests/data/$d/$file) + file=$(echo tests/data/$d$file) ;; esac run libavformat/seek-test $target_path/$file @@ -151,7 +182,7 @@ seektest(){ mkdir -p "$outdir" exec 3>&2 -$command > "$outfile" 2>$errfile +eval $command >"$outfile" 2>$errfile err=$? if [ $err -gt 128 ]; then