diff --git a/tests/Makefile b/tests/Makefile index b26729396d..8209435501 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -66,9 +66,11 @@ FILTERDEMDECENCMUX = $(call ALLYES, $(1)_FILTER $(2)_DEMUXER $(3)_DECODER $(4)_E include $(SRC_PATH)/tests/fate/acodec.mak include $(SRC_PATH)/tests/fate/vcodec.mak include $(SRC_PATH)/tests/fate/avformat.mak -include $(SRC_PATH)/tests/fate/avfilter.mak include $(SRC_PATH)/tests/fate/seek.mak +#FIXME should be removed +include $(SRC_PATH)/tests/fate/avfilter.mak + include $(SRC_PATH)/tests/fate/aac.mak include $(SRC_PATH)/tests/fate/ac3.mak include $(SRC_PATH)/tests/fate/adpcm.mak diff --git a/tests/fate-run.sh b/tests/fate-run.sh index da4f60eda9..42b9ebb5db 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -160,6 +160,7 @@ lavftest(){ regtest lavf lavf tests/vsynth1 } +#FIXME should be removed lavfitest(){ cleanfiles="tests/data/lavfi/${test#lavfi-}.nut" regtest lavfi lavfi tests/vsynth1 @@ -183,6 +184,27 @@ pixdesc(){ done } +pixfmts(){ + filter=${test#filter-pixfmts-} + filter_args=$1 + + showfiltfmts="$target_exec $target_path/libavfilter/filtfmts-test" + exclude_fmts=${outfile}${filter}_exclude_fmts + out_fmts=${outfile}${filter}_out_fmts + + # exclude pixel formats which are not supported as input + ffmpeg -pix_fmts list 2>/dev/null | awk 'NR > 8 && /^\..\./ { print $2 }' | sort >$exclude_fmts + $showfiltfmts scale | awk -F '[ \r:]' '/^OUTPUT/{ print $5 }' | sort | comm -23 - $exclude_fmts >$out_fmts + + pix_fmts=$($showfiltfmts $filter | awk -F '[ \r:]' '/^INPUT/{ print $5 }' | sort | comm -12 - $out_fmts) + for pix_fmt in $pix_fmts; do + test=$pix_fmt + video_filter "format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt + done + + rm $exclude_fmts $out_fmts +} + mkdir -p "$outdir" # Disable globbing: command arguments may contain globbing characters and diff --git a/tests/fate/avfilter.mak b/tests/fate/avfilter.mak index 4c8c26a876..f68bf960c9 100644 --- a/tests/fate/avfilter.mak +++ b/tests/fate/avfilter.mak @@ -1,3 +1,5 @@ +#FIXME the whole file should be removed + FATE_LAVFI = fate-lavfi-alphaextract_rgb \ fate-lavfi-alphaextract_yuv \ fate-lavfi-alphamerge_rgb \ @@ -12,13 +14,6 @@ FATE_LAVFI = fate-lavfi-alphaextract_rgb \ fate-lavfi-overlay_yuv420 \ fate-lavfi-overlay_yuv444 \ fate-lavfi-pad \ - fate-lavfi-pixfmts_copy \ - fate-lavfi-pixfmts_crop \ - fate-lavfi-pixfmts_hflip \ - fate-lavfi-pixfmts_null \ - fate-lavfi-pixfmts_pad \ - fate-lavfi-pixfmts_scale \ - fate-lavfi-pixfmts_vflip \ fate-lavfi-select \ fate-lavfi-setdar \ fate-lavfi-setsar \ diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 75ac03a6b1..f1c0cf4de6 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -98,6 +98,31 @@ FATE_FILTER_VSYNTH-$(CONFIG_FORMAT_FILTER) += fate-filter-pixdesc fate-filter-pixdesc: CMD = pixdesc +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-copy +fate-filter-pixfmts-copy: CMD = pixfmts + +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-crop +fate-filter-pixfmts-crop: CMD = pixfmts "100:100:100:100" + +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-hflip +fate-filter-pixfmts-hflip: CMD = pixfmts + +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-null +fate-filter-pixfmts-null: CMD = pixfmts + +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-pad +fate-filter-pixfmts-pad: CMD = pixfmts "500:400:20:20" + +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-scale +fate-filter-pixfmts-scale: CMD = pixfmts "200:100" + +FATE_FILTER_PIXFMTS += fate-filter-pixfmts-vflip +fate-filter-pixfmts-vflip: CMD = pixfmts + +$(FATE_FILTER_PIXFMTS): libavfilter/filtfmts-test$(EXESUF) +FATE_FILTER_VSYNTH-$(CONFIG_FORMAT_FILTER) += $(FATE_FILTER_PIXFMTS) + + $(FATE_FILTER_VSYNTH-yes): $(VREF) $(FATE_FILTER_VSYNTH-yes): SRC = $(TARGET_PATH)/tests/vsynth1/%02d.pgm diff --git a/tests/lavfi-regression.sh b/tests/lavfi-regression.sh index 9301914ecb..63f991c6af 100755 --- a/tests/lavfi-regression.sh +++ b/tests/lavfi-regression.sh @@ -5,6 +5,8 @@ # #set -x +#FIXME the whole file should be removed + set -e . $(dirname $0)/regression-funcs.sh @@ -20,7 +22,6 @@ do_video_filter() { $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5: } -#should be removed do_lavfi_plain() { vfilters="$2" @@ -29,12 +30,10 @@ do_lavfi_plain() { fi } -#should be removed do_lavfi() { do_lavfi_plain $1 "$2" } -#should be removed do_lavfi_colormatrix() { do_lavfi "${1}1" "$1=$4:$5,$1=$5:$3,$1=$3:$4,$1=$4:$3,$1=$3:$5,$1=$5:$2" do_lavfi "${1}2" "$1=$2:$3,$1=$3:$2,$1=$2:$4,$1=$4:$2,$1=$2:$5,$1=$5:$4" @@ -103,14 +102,7 @@ do_lavfi_pixfmts "field" "field" "bottom" do_lavfi_pixfmts "histeq" "histeq" "antibanding=strong" do_lavfi_pixfmts "il" "il" "luma_mode=d:chroma_mode=d:alpha_mode=d" do_lavfi_pixfmts "kerndeint" "kerndeint" "" "tinterlace=interleave_top," -do_lavfi_pixfmts "pixfmts_copy" "copy" "" -do_lavfi_pixfmts "pixfmts_crop" "crop" "100:100:100:100" -do_lavfi_pixfmts "pixfmts_hflip" "hflip" "" -do_lavfi_pixfmts "pixfmts_null" "null" "" -do_lavfi_pixfmts "pixfmts_pad" "pad" "500:400:20:20" -do_lavfi_pixfmts "pixfmts_scale" "scale" "200:100" do_lavfi_pixfmts "pixfmts_super2xsai" "super2xsai" -do_lavfi_pixfmts "pixfmts_vflip" "vflip" do_lavfi_pixfmts "tinterlace_merge" "tinterlace" "merge" do_lavfi_pixfmts "tinterlace_pad" "tinterlace" "pad" diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/fate/filter-pixfmts-copy similarity index 100% rename from tests/ref/lavfi/pixfmts_copy rename to tests/ref/fate/filter-pixfmts-copy diff --git a/tests/ref/lavfi/pixfmts_crop b/tests/ref/fate/filter-pixfmts-crop similarity index 100% rename from tests/ref/lavfi/pixfmts_crop rename to tests/ref/fate/filter-pixfmts-crop diff --git a/tests/ref/lavfi/pixfmts_hflip b/tests/ref/fate/filter-pixfmts-hflip similarity index 100% rename from tests/ref/lavfi/pixfmts_hflip rename to tests/ref/fate/filter-pixfmts-hflip diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/fate/filter-pixfmts-null similarity index 100% rename from tests/ref/lavfi/pixfmts_null rename to tests/ref/fate/filter-pixfmts-null diff --git a/tests/ref/lavfi/pixfmts_pad b/tests/ref/fate/filter-pixfmts-pad similarity index 100% rename from tests/ref/lavfi/pixfmts_pad rename to tests/ref/fate/filter-pixfmts-pad diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/fate/filter-pixfmts-scale similarity index 100% rename from tests/ref/lavfi/pixfmts_scale rename to tests/ref/fate/filter-pixfmts-scale diff --git a/tests/ref/lavfi/pixfmts_vflip b/tests/ref/fate/filter-pixfmts-vflip similarity index 100% rename from tests/ref/lavfi/pixfmts_vflip rename to tests/ref/fate/filter-pixfmts-vflip