fate: Invoke pixdesc lavfi tests through fate-run.sh
[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
f4b1e21a
MR
14do_video_filter() {
15 label=$1
16 filters=$2
17 shift 2
ea57502c 18 printf '%-20s' $label
6291d7e4 19 run_avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
ea57502c 20 $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5:
f4b1e21a
MR
21}
22
73177b6c
SS
23do_lavfi_pixfmts(){
24 test ${test%_[bl]e} = pixfmts_$1 || return 0
25 filter=$1
26 filter_args=$2
e34d5db5 27
7c29377b 28 showfiltfmts="$target_exec $target_path/libavfilter/filtfmts-test"
9c87c037
MR
29 exclude_fmts=${outfile}${1}_exclude_fmts
30 out_fmts=${outfile}${1}_out_fmts
8456d947 31
7e7fc4e9 32 # exclude pixel formats which are not supported as input
2a222a72 33 $avconv -pix_fmts list 2>/dev/null | awk 'NR > 8 && /^\..\./ { print $2 }' | sort >$exclude_fmts
42907c6a 34 $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ print $3 }' | sort | comm -23 - $exclude_fmts >$out_fmts
e34d5db5 35
42907c6a 36 pix_fmts=$($showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ print $3 }' | sort | comm -12 - $out_fmts)
04307697 37 for pix_fmt in $pix_fmts; do
bb6c67bb 38 do_video_filter $pix_fmt "format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt
04307697 39 done
7e7fc4e9
MR
40
41 rm $exclude_fmts $out_fmts
73177b6c
SS
42}
43
44# all these filters have exactly one input and exactly one output
b5670209 45do_lavfi_pixfmts "copy" ""
73177b6c 46do_lavfi_pixfmts "crop" "100:100:100:100"
a1e171df 47do_lavfi_pixfmts "hflip" ""
73177b6c
SS
48do_lavfi_pixfmts "null" ""
49do_lavfi_pixfmts "pad" "500:400:20:20"
50do_lavfi_pixfmts "scale" "200:100"
51do_lavfi_pixfmts "vflip" ""
e34d5db5 52
77f66963
SS
53# TODO: add tests for
54# direct rendering,
77f66963 55# chains with feedback loops