From 40e024091d70f335337b0490c91a5e31c4874b6b Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 27 Sep 2009 09:33:37 +0000 Subject: [PATCH] Implement a lavfitest target for testing regressions in libavfilter. The target is disabled. See the thread: "[PATCH] libavfilter-soc: regression test for libavfilter". Originally committed as revision 20057 to svn://svn.ffmpeg.org/ffmpeg/trunk --- Makefile | 18 ++++++++++++++++-- tests/codec-regression.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 373aa8fed0..ed81397581 100644 --- a/Makefile +++ b/Makefile @@ -144,6 +144,7 @@ fulltest test: codectest lavftest seektest FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref LAVF_REFFILE = $(SRC_PATH)/tests/lavf.regression.ref +LAVFI_REFFILE = $(SRC_PATH)/tests/lavfi.regression.ref ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref VSYNTH_REFFILE = $(SRC_PATH)/tests/vsynth.regression.ref @@ -237,14 +238,19 @@ LAVF_TESTS = $(addprefix regtest-, \ pcx \ ) +LAVFI_TESTS = $(addprefix regtest-, \ + ) + RESFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%))) ROTOZOOM_RESFILES = $(call RESFILES,rotozoom.regression,$(CODEC_TESTS)) VSYNTH_RESFILES = $(call RESFILES,vsynth.regression,$(CODEC_TESTS)) LAVF_RESFILES = $(call RESFILES,lavf.regression,$(LAVF_TESTS)) +LAVFI_RESFILES = $(call RESFILES,lavfi.regression,$(LAVFI_TESTS)) LAVF_RESFILE = tests/data/lavf.regression +LAVFI_RESFILE = tests/data/lavfi.regression ROTOZOOM_RESFILE = tests/data/rotozoom.regression VSYNTH_RESFILE = tests/data/vsynth.regression @@ -264,18 +270,23 @@ codectest: $(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) lavftest: $(LAVF_RESFILE) diff -u -w $(LAVF_REFFILE) $(LAVF_RESFILE) -$(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) $(LAVF_RESFILE): +# lavfitest: $(LAVFI_RESFILE) +# diff -u -w $(LAVFI_REFFILE) $(LAVFI_RESFILE) + +$(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) $(LAVF_RESFILE) $(LAVFI_RESFILE): cat $^ > $@ $(LAVF_RESFILE): $(LAVF_RESFILES) +$(LAVFI_RESFILE): $(LAVFI_RESFILES) $(ROTOZOOM_RESFILE): $(ROTOZOOM_RESFILES) $(VSYNTH_RESFILE): $(VSYNTH_RESFILES) $(VSYNTH_RESFILES) $(ROTOZOOM_RESFILES): $(CODEC_TESTS) $(LAVF_RESFILES): $(LAVF_TESTS) +$(LAVFI_RESFILES): $(LAVFI_TESTS) -$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref +$(CODEC_TESTS) $(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw @@ -286,6 +297,9 @@ $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF) $(LAVF_TESTS): $(SRC_PATH)/tests/codec-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)" +$(LAVFI_TESTS): + $(SRC_PATH)/tests/codec-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)" + seektest: codectest lavftest tests/seek_test$(EXESUF) $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)" diff --git a/tests/codec-regression.sh b/tests/codec-regression.sh index e50106f55e..c00c97799f 100755 --- a/tests/codec-regression.sh +++ b/tests/codec-regression.sh @@ -660,4 +660,42 @@ for pix_fmt in $conversions ; do done fi +# libavfilter testing + +function do_lavfi() { + test_name=$1 + eval test=\$do_$test_name + vfilters=$2 + + if [ -n "$test" ] ; then + do_video_encoding ${test_name}.avi "-qscale 10" "-vcodec huffyuv -vfilters $vfilters" + fi +} + +# do_lavfi "crop" "crop=100:100:-1:-1" +# do_lavfi "crop_scale" "crop=100:100,scale=200:-1" +# do_lavfi "scale" "scale=200:200" + +# libavfilter testing + +function do_lavfi() { + test_name=$1 + eval test=\$do_$test_name + vfilters=$2 + + if [ -n "$test" ] ; then + do_video_encoding ${test_name}.avi "-qscale 10" "-vcodec huffyuv -vfilters $vfilters" + fi +} + +# example tests: +# do_lavfi "crop" "crop=100:100:-1:-1" +# do_lavfi "crop_scale" "crop=100:100,scale=200:-1" +# do_lavfi "scale" "scale=200:200" + +# TODO: add tests for +# direct rendering, +# slices +# chains with feedback loops + rm -f "$bench" "$bench2"