tests: Remove disabled code.
[libav.git] / tests / lavfi-regression.sh
CommitLineData
77f66963
SS
1#!/bin/sh
2#
3# automatic regression test for libavfilter
4#
5#
6#set -x
7
8set -e
9
10. $(dirname $0)/regression-funcs.sh
11
12eval do_$test=y
13
14rm -f "$logfile"
15rm -f "$benchfile"
16
f4b1e21a
MR
17do_video_filter() {
18 label=$1
19 filters=$2
20 shift 2
21 printf '%-20s' $label >>$logfile
22 run_ffmpeg -f image2 -vcodec pgmyuv -i $raw_src \
23 -vf "$filters" -vcodec rawvideo $* -f nut md5: >>$logfile
24}
25
77f66963 26do_lavfi() {
1400bd5a 27 vfilters="slicify=random,$2"
77f66963 28
e6e3069b 29 if [ $test = $1 ] ; then
f4b1e21a 30 do_video_filter $test "$vfilters"
77f66963
SS
31 fi
32}
33
75b67a8a
SS
34do_lavfi "crop" "crop=iw-100:ih-100:100:100"
35do_lavfi "crop_scale" "crop=iw-100:ih-100:100:100,scale=400:-1"
36do_lavfi "crop_scale_vflip" "null,null,crop=iw-200:ih-200:200:200,crop=iw-20:ih-20:20:20,scale=200:200,scale=250:250,vflip,vflip,null,scale=200:200,crop=iw-100:ih-100:100:100,vflip,scale=200:200,null,vflip,crop=iw-100:ih-100:100:100,null"
37do_lavfi "crop_vflip" "crop=iw-100:ih-100:100:100,vflip"
cec96e8d
SS
38do_lavfi "null" "null"
39do_lavfi "scale200" "scale=200:200"
40do_lavfi "scale500" "scale=500:500"
41do_lavfi "vflip" "vflip"
75b67a8a 42do_lavfi "vflip_crop" "vflip,crop=iw-100:ih-100:100:100"
cec96e8d 43do_lavfi "vflip_vflip" "vflip,vflip"
77f66963 44
73177b6c
SS
45do_lavfi_pixfmts(){
46 test ${test%_[bl]e} = pixfmts_$1 || return 0
47 filter=$1
48 filter_args=$2
e34d5db5 49
43d2c6a5 50 showfiltfmts="$target_exec $target_path/tools/lavfi-showfiltfmts"
9c87c037
MR
51 exclude_fmts=${outfile}${1}_exclude_fmts
52 out_fmts=${outfile}${1}_out_fmts
8456d947 53
7e7fc4e9
MR
54 # exclude pixel formats which are not supported as input
55 $ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^\..\.' | cut -d' ' -f2 | sort >$exclude_fmts
42907c6a 56 $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ print $3 }' | sort | comm -23 - $exclude_fmts >$out_fmts
e34d5db5 57
42907c6a 58 pix_fmts=$($showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ print $3 }' | sort | comm -12 - $out_fmts)
04307697 59 for pix_fmt in $pix_fmts; do
f4b1e21a 60 do_video_filter $pix_fmt "slicify=random,format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt
04307697 61 done
7e7fc4e9
MR
62
63 rm $exclude_fmts $out_fmts
73177b6c
SS
64}
65
66# all these filters have exactly one input and exactly one output
b5670209 67do_lavfi_pixfmts "copy" ""
73177b6c 68do_lavfi_pixfmts "crop" "100:100:100:100"
a1e171df 69do_lavfi_pixfmts "hflip" ""
73177b6c
SS
70do_lavfi_pixfmts "null" ""
71do_lavfi_pixfmts "pad" "500:400:20:20"
72do_lavfi_pixfmts "scale" "200:100"
73do_lavfi_pixfmts "vflip" ""
e34d5db5 74
7c1bb914 75if [ -n "$do_pixdesc_be" ] || [ -n "$do_pixdesc_le" ]; then
546017fc 76 pix_fmts="$($ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^IO' | cut -d' ' -f2 | sort)"
ce2e4ae3 77 for pix_fmt in $pix_fmts; do
f4b1e21a 78 do_video_filter $pix_fmt "slicify=random,format=$pix_fmt,pixdesctest" -pix_fmt $pix_fmt
ce2e4ae3
SS
79 done
80fi
81
77f66963
SS
82# TODO: add tests for
83# direct rendering,
77f66963 84# chains with feedback loops