From cec96e8de36dfb8943dea49b918e09139f30dbca Mon Sep 17 00:00:00 2001
From: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Date: Wed, 17 Mar 2010 23:23:44 +0000
Subject: [PATCH] Add some ad-hoc tests for libavfilter.

A patched version of ffmpeg supporting video filters is required for
getting this working; thus make lavfitest is supposed to work only in
the libavfilter repository for now.

Originally committed as revision 22586 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 Makefile                         | 15 ++++++++++++---
 tests/lavfi-regression.sh        | 16 +++++++++++-----
 tests/ref/lavfi/crop             |  2 ++
 tests/ref/lavfi/crop_scale       |  2 ++
 tests/ref/lavfi/crop_scale_vflip |  2 ++
 tests/ref/lavfi/crop_vflip       |  2 ++
 tests/ref/lavfi/null             |  2 ++
 tests/ref/lavfi/scale200         |  2 ++
 tests/ref/lavfi/scale500         |  2 ++
 tests/ref/lavfi/vflip            |  2 ++
 tests/ref/lavfi/vflip_crop       |  2 ++
 tests/ref/lavfi/vflip_vflip      |  2 ++
 12 files changed, 43 insertions(+), 8 deletions(-)
 create mode 100644 tests/ref/lavfi/crop
 create mode 100644 tests/ref/lavfi/crop_scale
 create mode 100644 tests/ref/lavfi/crop_scale_vflip
 create mode 100644 tests/ref/lavfi/crop_vflip
 create mode 100644 tests/ref/lavfi/null
 create mode 100644 tests/ref/lavfi/scale200
 create mode 100644 tests/ref/lavfi/scale500
 create mode 100644 tests/ref/lavfi/vflip
 create mode 100644 tests/ref/lavfi/vflip_crop
 create mode 100644 tests/ref/lavfi/vflip_vflip

diff --git a/Makefile b/Makefile
index 2d37c0a440f..48df7670c33 100644
--- a/Makefile
+++ b/Makefile
@@ -250,7 +250,17 @@ LAVF_TESTS-$(call MUXDEM,VOC)                += voc
 LAVF_TESTS-$(call MUXDEM,WAV)                += wav
 LAVF_TESTS-$(call MUXDEM,YUV4MPEGPIPE)       += yuv4mpeg
 
-LAVFI_TESTS =
+LAVFI_TESTS =           \
+    crop                \
+    crop_scale          \
+    crop_scale_vflip    \
+    crop_vflip          \
+    null                \
+    scale200            \
+    scale500            \
+    vflip               \
+    vflip_crop          \
+    vflip_vflip         \
 
 ACODEC_TESTS := $(addprefix regtest-, $(ACODEC_TESTS) $(ACODEC_TESTS-yes))
 VCODEC_TESTS := $(addprefix regtest-, $(VCODEC_TESTS) $(VCODEC_TESTS-yes))
@@ -261,8 +271,7 @@ CODEC_TESTS = $(VCODEC_TESTS) $(ACODEC_TESTS)
 
 codectest: $(CODEC_TESTS)
 lavftest:  $(LAVF_TESTS)
-
-# lavfitest: $(LAVFI_TESTS)
+lavfitest: $(LAVFI_TESTS)
 
 $(ACODEC_TESTS): regtest-aref
 $(VCODEC_TESTS): regtest-vref
diff --git a/tests/lavfi-regression.sh b/tests/lavfi-regression.sh
index 1f52fd7eee0..6f82eb94755 100755
--- a/tests/lavfi-regression.sh
+++ b/tests/lavfi-regression.sh
@@ -20,14 +20,20 @@ do_lavfi() {
     vfilters=$2
 
     if [ -n "$test" ] ; then
-        do_video_encoding ${test_name}.avi "" "-vcodec rawvideo -vfilters $vfilters"
+        do_video_encoding ${test_name}.nut "" "-vcodec rawvideo -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"
+do_lavfi "crop"               "crop=100:100"
+do_lavfi "crop_scale"         "crop=100:100,scale=400:-1"
+do_lavfi "crop_scale_vflip"   "null,null,crop=200:200,crop=20:20,scale=200:200,scale=250:250,vflip,vflip,null,scale=200:200,crop=100:100,vflip,scale=200:200,null,vflip,crop=100:100,null"
+do_lavfi "crop_vflip"         "crop=100:100,vflip"
+do_lavfi "null"               "null"
+do_lavfi "scale200"           "scale=200:200"
+do_lavfi "scale500"           "scale=500:500"
+do_lavfi "vflip"              "vflip"
+do_lavfi "vflip_crop"         "vflip,crop=100:100"
+do_lavfi "vflip_vflip"        "vflip,vflip"
 
 # TODO: add tests for
 # direct rendering,
diff --git a/tests/ref/lavfi/crop b/tests/ref/lavfi/crop
new file mode 100644
index 00000000000..75c39f71172
--- /dev/null
+++ b/tests/ref/lavfi/crop
@@ -0,0 +1,2 @@
+3d163f156eaddf41d2be20736f973539 *./tests/data/lavfi/crop.nut
+3554654 ./tests/data/lavfi/crop.nut
diff --git a/tests/ref/lavfi/crop_scale b/tests/ref/lavfi/crop_scale
new file mode 100644
index 00000000000..48a0734f693
--- /dev/null
+++ b/tests/ref/lavfi/crop_scale
@@ -0,0 +1,2 @@
+4ffe30abe99931bc9989f40ae65654b7 *./tests/data/lavfi/crop_scale.nut
+8941454 ./tests/data/lavfi/crop_scale.nut
diff --git a/tests/ref/lavfi/crop_scale_vflip b/tests/ref/lavfi/crop_scale_vflip
new file mode 100644
index 00000000000..314f407b8eb
--- /dev/null
+++ b/tests/ref/lavfi/crop_scale_vflip
@@ -0,0 +1,2 @@
+3b1c81bb6ce7575f5ee3088ea165dbe7 *./tests/data/lavfi/crop_scale_vflip.nut
+750727 ./tests/data/lavfi/crop_scale_vflip.nut
diff --git a/tests/ref/lavfi/crop_vflip b/tests/ref/lavfi/crop_vflip
new file mode 100644
index 00000000000..96fc9bd0453
--- /dev/null
+++ b/tests/ref/lavfi/crop_vflip
@@ -0,0 +1,2 @@
+628542e17b6900ee79b1429183ae01b0 *./tests/data/lavfi/crop_vflip.nut
+3554654 ./tests/data/lavfi/crop_vflip.nut
diff --git a/tests/ref/lavfi/null b/tests/ref/lavfi/null
new file mode 100644
index 00000000000..b4d006e28c6
--- /dev/null
+++ b/tests/ref/lavfi/null
@@ -0,0 +1,2 @@
+eba2f135a08829387e2f698ff72a2939 *./tests/data/lavfi/null.nut
+7604654 ./tests/data/lavfi/null.nut
diff --git a/tests/ref/lavfi/scale200 b/tests/ref/lavfi/scale200
new file mode 100644
index 00000000000..115e250d016
--- /dev/null
+++ b/tests/ref/lavfi/scale200
@@ -0,0 +1,2 @@
+f7325609fdb8992bcea0cf3712ea2afc *./tests/data/lavfi/scale200.nut
+3001204 ./tests/data/lavfi/scale200.nut
diff --git a/tests/ref/lavfi/scale500 b/tests/ref/lavfi/scale500
new file mode 100644
index 00000000000..c8ba15b2a1f
--- /dev/null
+++ b/tests/ref/lavfi/scale500
@@ -0,0 +1,2 @@
+7e194861897fb42e20771711fe1aace3 *./tests/data/lavfi/scale500.nut
+18751503 ./tests/data/lavfi/scale500.nut
diff --git a/tests/ref/lavfi/vflip b/tests/ref/lavfi/vflip
new file mode 100644
index 00000000000..977f2d25586
--- /dev/null
+++ b/tests/ref/lavfi/vflip
@@ -0,0 +1,2 @@
+2e6d6062e8cad37fb3ab2c433b55f382 *./tests/data/lavfi/vflip.nut
+7604654 ./tests/data/lavfi/vflip.nut
diff --git a/tests/ref/lavfi/vflip_crop b/tests/ref/lavfi/vflip_crop
new file mode 100644
index 00000000000..bd198945fa2
--- /dev/null
+++ b/tests/ref/lavfi/vflip_crop
@@ -0,0 +1,2 @@
+72ee0d0dfc8af0cd94a466760313654d *./tests/data/lavfi/vflip_crop.nut
+3554654 ./tests/data/lavfi/vflip_crop.nut
diff --git a/tests/ref/lavfi/vflip_vflip b/tests/ref/lavfi/vflip_vflip
new file mode 100644
index 00000000000..55595dd5b61
--- /dev/null
+++ b/tests/ref/lavfi/vflip_vflip
@@ -0,0 +1,2 @@
+eba2f135a08829387e2f698ff72a2939 *./tests/data/lavfi/vflip_vflip.nut
+7604654 ./tests/data/lavfi/vflip_vflip.nut
-- 
GitLab