]> git.sesse.net Git - ffmpeg/blobdiff - tests/fate-run.sh
hevcdsp_template: Templatize IDCT
[ffmpeg] / tests / fate-run.sh
index 91de177a2ae20e4a4d31833bf305f42bb616b98c..d11ca3c1f7c23af230219fe0e3a8022d4ad35493 100755 (executable)
@@ -23,6 +23,7 @@ cmp_target=${13:-0}
 size_tolerance=${14:-0}
 cmp_unit=${15:-2}
 gen=${16:-no}
+hwaccel=${17:-none}
 
 outdir="tests/data/fate"
 outfile="${outdir}/${test}"
@@ -38,7 +39,7 @@ target_path(){
 # $1=value1, $2=value2, $3=threshold
 # prints 0 if absolute difference between value1 and value2 is <= threshold
 compare(){
-    echo "scale=2; v = $1 - $2; if (v < 0) v = -v; if (v > $3) r = 1; r" | bc
+    awk "BEGIN { v = $1 - $2; printf ((v < 0 ? -v : v) > $3) }"
 }
 
 do_tiny_psnr(){
@@ -76,7 +77,7 @@ probefmt(){
 }
 
 avconv(){
-    dec_opts="-threads $threads -thread_type $thread_type"
+    dec_opts="-hwaccel $hwaccel -threads $threads -thread_type $thread_type"
     avconv_args="-nostats -cpuflags $cpuflags"
     for arg in $@; do
         [ x${arg} = x-i ] && avconv_args="${avconv_args} ${dec_opts}"
@@ -159,14 +160,14 @@ video_filter(){
     raw_src="${target_path}/tests/vsynth1/%02d.pgm"
     printf '%-20s' $label
     avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
-        $FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5:
+        $FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo -frames:v 5 $* -f nut md5:
 }
 
 pixfmts(){
     filter=${test#filter-pixfmts-}
     filter_args=$1
 
-    showfiltfmts="$target_exec $target_path/libavfilter/filtfmts-test"
+    showfiltfmts="$target_exec $target_path/libavfilter/tests/filtfmts"
     exclude_fmts=${outfile}${filter}_exclude_fmts
     out_fmts=${outfile}${filter}_out_fmts
 
@@ -175,12 +176,15 @@ pixfmts(){
     $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ print $3 }' | sort | comm -23 - $exclude_fmts >$out_fmts
 
     pix_fmts=$($showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ print $3 }' | sort | comm -12 - $out_fmts)
+
+    outertest=$test
     for pix_fmt in $pix_fmts; do
         test=$pix_fmt
-        video_filter "format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt
+        video_filter "format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt -frames:v 1
     done
 
     rm $exclude_fmts $out_fmts
+    test=$outertest
 }
 
 mkdir -p "$outdir"
@@ -210,7 +214,13 @@ else
     err=1
 fi
 
-echo "${test}:${sig:-$err}:$($base64 <$cmpfile):$($base64 <$errfile)" >$repfile
+if [ $err -eq 0 ]; then
+    unset cmpo erro
+else
+    cmpo="$($base64 <$cmpfile)"
+    erro="$($base64 <$errfile)"
+fi
+echo "${test}:${sig:-$err}:$cmpo:$erro" >$repfile
 
 if test $err != 0 && test $gen != "no" ; then
     echo "GEN     $ref"