]> git.sesse.net Git - ffmpeg/blobdiff - tests/fate-run.sh
Merge commit 'accde1bd8756936e1757b42fc9bad2eb5d192f8a'
[ffmpeg] / tests / fate-run.sh
index ed99387b157810f0a65d120975a43db0a95c3ba6..ab1b8bb26e0b984ff2f87762625f6bf281521064 100755 (executable)
@@ -160,9 +160,50 @@ lavftest(){
     regtest lavf lavf tests/vsynth1
 }
 
-lavfitest(){
-    cleanfiles="tests/data/lavfi/${test#lavfi-}.nut"
-    regtest lavfi lavfi tests/vsynth1
+video_filter(){
+    filters=$1
+    shift
+    label=${test#filter-}
+    raw_src="${target_path}/tests/vsynth1/%02d.pgm"
+    printf '%-20s' $label
+    ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
+        $FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5:
+}
+
+pixdesc(){
+    pix_fmts="$(ffmpeg -pix_fmts list 2>/dev/null | awk 'NR > 8 && /^IO/ { print $2 }' | sort)"
+    for pix_fmt in $pix_fmts; do
+        test=$pix_fmt
+        video_filter "format=$pix_fmt,pixdesctest" -pix_fmt $pix_fmt
+    done
+}
+
+pixfmts(){
+    filter=${test#filter-pixfmts-}
+    filter=${filter%_*}
+    filter_args=$1
+    prefilter_chain=$2
+
+    showfiltfmts="$target_exec $target_path/libavfilter/filtfmts-test"
+    scale_exclude_fmts=${outfile}_scale_exclude_fmts
+    scale_in_fmts=${outfile}_scale_in_fmts
+    scale_out_fmts=${outfile}_scale_out_fmts
+    in_fmts=${outfile}_in_fmts
+
+    # exclude pixel formats which are not supported as input
+    $showfiltfmts scale | awk -F '[ \r]' '/^INPUT/{ fmt=substr($3, 5); print fmt }' | sort >$scale_in_fmts
+    $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ fmt=substr($3, 5); print fmt }' | sort >$scale_out_fmts
+    comm -12 $scale_in_fmts $scale_out_fmts >$scale_exclude_fmts
+
+    $showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ fmt=substr($3, 5); print fmt }' | sort >$in_fmts
+    pix_fmts=$(comm -12 $scale_exclude_fmts $in_fmts)
+
+    for pix_fmt in $pix_fmts; do
+        test=$pix_fmt
+        video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt
+    done
+
+    rm $in_fmts $scale_in_fmts $scale_out_fmts $scale_exclude_fmts
 }
 
 mkdir -p "$outdir"