Commit 9965021b66 for ffmpeg
commit 9965021b66d2d1620acf92963c155f1b97764b3e
Author: marcos ashton <marcosashiglesias@gmail.com>
Date: Tue Dec 1 16:36:55 2026 +0000
tests/fate/filter-video: add morpho tests
Coverage for libavfilter/vf_morpho.c: 0.0% -> 90.5%
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 7973045c7d..98dba8a4e1 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -481,6 +481,17 @@ FATE_FILTER-$(call FILTERFRAMECRC, TESTSRC2 CHROMASHIFT) += fate-filter-chromash
fate-filter-chromashift-smear: CMD = framecrc -lavfi testsrc2=r=5:d=1,chromashift=cbh=-1:cbv=1:crh=2:crv=-2:edge=smear -pix_fmt yuv420p
fate-filter-chromashift-wrap: CMD = framecrc -lavfi testsrc2=r=5:d=1,chromashift=cbh=-1:cbv=1:crh=2:crv=-2:edge=wrap -pix_fmt yuv420p
+# $(call FATE_TSRC2,pix_fmt[,size[,duration]]): testsrc2 converted to pix_fmt, two frames by default
+FATE_TSRC2 = testsrc2=s=$(or $(2),64x48):r=5:d=$(or $(3),0.4),scale=flags=accurate_rnd+bitexact,format=$(1)
+FATE_TARGET_WORD = $(word $(1),$(subst -, ,$(@)))
+# native-endian name of a pix_fmt written with le, for filters that only take native formats
+FATE_NE = $(patsubst %le,%,$(1))
+
+FATE_FILTER-$(call FILTERFRAMECRC, TESTSRC2 SCALE FORMAT MORPHO) += $(addprefix fate-filter-morpho-, gradient-gray16le tophat-gray tophat-gray16le blackhat-gray erode-gbrap open-planes)
+fate-filter-morpho-%: FMT = $(call FATE_TARGET_WORD,5)
+fate-filter-morpho-%: CMD = framecrc -lavfi "$(call FATE_TSRC2,$(call FATE_NE,$(FMT)))[a];$(call FATE_TSRC2,$(call FATE_NE,$(FMT)),8x8)[b];[a][b]morpho=mode=$(call FATE_TARGET_WORD,4),scale" -pix_fmt $(FMT)
+fate-filter-morpho-open-planes: CMD = framecrc -lavfi "$(call FATE_TSRC2,yuv444p)[a];$(call FATE_TSRC2,yuv444p,32x32)[b];[a][b]morpho=mode=open:planes=1"
+
FATE_FILTER-$(call FILTERFRAMECRC, TESTSRC2 FPS DECIMATE) += fate-filter-decimate
fate-filter-decimate: CMD = framecrc -lavfi testsrc2=r=24:d=10,fps=60,decimate=5,decimate=4,decimate=3 -pix_fmt yuv420p
diff --git a/tests/ref/fate/filter-morpho-blackhat-gray b/tests/ref/fate/filter-morpho-blackhat-gray
new file mode 100644
index 0000000000..1d27708cbb
--- /dev/null
+++ b/tests/ref/fate/filter-morpho-blackhat-gray
@@ -0,0 +1,7 @@
+#tb 0: 1/5
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 64x48
+#sar 0: 1/1
+0, 0, 0, 1, 3072, 0x0e20bfc9
+0, 1, 1, 1, 3072, 0x2de4bfc0
diff --git a/tests/ref/fate/filter-morpho-erode-gbrap b/tests/ref/fate/filter-morpho-erode-gbrap
new file mode 100644
index 0000000000..fd183e567c
--- /dev/null
+++ b/tests/ref/fate/filter-morpho-erode-gbrap
@@ -0,0 +1,7 @@
+#tb 0: 1/5
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 64x48
+#sar 0: 1/1
+0, 0, 0, 1, 12288, 0x45ad6d4e
+0, 1, 1, 1, 12288, 0x0cd568a6
diff --git a/tests/ref/fate/filter-morpho-gradient-gray16le b/tests/ref/fate/filter-morpho-gradient-gray16le
new file mode 100644
index 0000000000..23a8a4efc8
--- /dev/null
+++ b/tests/ref/fate/filter-morpho-gradient-gray16le
@@ -0,0 +1,7 @@
+#tb 0: 1/5
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 64x48
+#sar 0: 1/1
+0, 0, 0, 1, 6144, 0x70cff840
+0, 1, 1, 1, 6144, 0x328a056b
diff --git a/tests/ref/fate/filter-morpho-open-planes b/tests/ref/fate/filter-morpho-open-planes
new file mode 100644
index 0000000000..2e609e6aad
--- /dev/null
+++ b/tests/ref/fate/filter-morpho-open-planes
@@ -0,0 +1,7 @@
+#tb 0: 1/5
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 64x48
+#sar 0: 1/1
+0, 0, 0, 1, 9216, 0xa732b624
+0, 1, 1, 1, 9216, 0x02a7b961
diff --git a/tests/ref/fate/filter-morpho-tophat-gray b/tests/ref/fate/filter-morpho-tophat-gray
new file mode 100644
index 0000000000..8ef166f1b1
--- /dev/null
+++ b/tests/ref/fate/filter-morpho-tophat-gray
@@ -0,0 +1,7 @@
+#tb 0: 1/5
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 64x48
+#sar 0: 1/1
+0, 0, 0, 1, 3072, 0xda7fdf7d
+0, 1, 1, 1, 3072, 0x5c86e06b
diff --git a/tests/ref/fate/filter-morpho-tophat-gray16le b/tests/ref/fate/filter-morpho-tophat-gray16le
new file mode 100644
index 0000000000..07eaedb191
--- /dev/null
+++ b/tests/ref/fate/filter-morpho-tophat-gray16le
@@ -0,0 +1,7 @@
+#tb 0: 1/5
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 64x48
+#sar 0: 1/1
+0, 0, 0, 1, 6144, 0x5d3bf923
+0, 1, 1, 1, 6144, 0xacd80242