Metadata output is passed through an Awk script reducing precision of
floats to account for architecture differences (e.g x86-32 vs. x86-64).
Signed-off-by: Tobias Rapp
---
v2:
- removed CPUFLAGS work-around for ssim filter issue
- added metadata float value post-processing script
tests/fate-run.sh | 9 +++
tests/fate/filter-video.mak | 14 +++
tests/ref/fate/filter-refcmp-psnr-rgb | 45 +++
tests/ref/fate/filter-refcmp-psnr-yuv | 45 +++
tests/ref/fate/filter-refcmp-ssim-rgb | 30 +++
tests/ref/fate/filter-refcmp-ssim-yuv | 30 +++
tests/refcmp-metadata.awk | 41 +++
7 files changed, 214 insertions(+)
create mode 100644 tests/ref/fate/filter-refcmp-psnr-rgb
create mode 100644 tests/ref/fate/filter-refcmp-psnr-yuv
create mode 100644 tests/ref/fate/filter-refcmp-ssim-rgb
create mode 100644 tests/ref/fate/filter-refcmp-ssim-yuv
create mode 100644 tests/refcmp-metadata.awk
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 9aa9a22..5af9a36 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -234,6 +234,15 @@ lavftest(){
${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec"
"$target_path" "$threads" "$thread_type" "$cpuflags" "$target_samples"
}
+refcmp_metadata(){
+refcmp=$1
+pixfmt=$2
+fuzz=${3:-0.01}
+ffmpeg $FLAGS $ENC_OPTS \
+-lavfi
"testsrc2=size=300x200:rate=1:duration=5,format=${pixfmt},split[ref][tmp];[tmp]avgblur=4[enc];[enc][ref]${refcmp},metadata=print:file=-"
\
+-f null /dev/null | awk -v fuzz=${fuzz} -f ${base}/refcmp-metadata.awk
-
+}
+
video_filter(){
filters=$1
shift
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 670d9de..9f2fca7 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -717,6 +717,20 @@ FATE_FILTER_SAMPLES-$(call ALLYES, MOV_DEMUXER
H264_DECODER AAC_FIXED_DECODER PC
fate-filter-meta-4560-rotate0: tests/data/file4560-override2rotate0.mov
fate-filter-meta-4560-rotate0: CMD = framecrc -flags +bitexact -c:a aac_fixed
-i $(TARGET_PATH)/tests/data/file4560-override2rotate0.mov
+REFCMP_DEPS = FFMPEG LAVFI_INDEV TESTSRC2_FILTER AVGBLUR_FILTER METADATA_FILTER
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) PSNR_FILTER) +=
fate-filter-refcmp-psnr-rgb
+fate-filter-refcmp-psnr-rgb: CMD = refcmp_metadata psnr rgb24
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) PSNR_FILTER) +=
fate-filter-refcmp-psnr-yuv
+fate-filter-refcmp-psnr-yuv: CMD = refcmp_metadata psnr yuv422p
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) SSIM_FILTER) +=
fate-filter-refcmp-ssim-rgb
+fate-filter-refcmp-ssim-rgb: CMD = refcmp_metadata ssim rgb24
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) SSIM_FILTER) +=
fate-filter-refcmp-ssim-yuv
+fate-filter-refcmp-ssim-yuv: CMD = refcmp_metadata ssim yuv422p
+
FATE_SAMPLES_FFPROBE += $(FATE_METADATA_FILTER-yes)
FATE_SAMPLES_FFMPEG += $(FATE_FILTER_SAMPLES-yes)
FATE_FFMPEG += $(FATE_FILTER-yes)
diff --git a/tests/ref/fate/filter-refcmp-psnr-rgb
b/tests/ref/fate/filter-refcmp-psnr-rgb
new file mode 100644
index 000..16b2208
--- /dev/null
+++ b/tests/ref/fate/filter-refcmp-psnr-rgb
@@ -0,0 +1,45 @@
+frame:0pts:0 pts_time:0
+lavfi.psnr.mse.r=1380.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=896.00
+lavfi.psnr.psnr.g=18.60
+lavfi.psnr.mse.b=277.00
+lavfi.psnr.psnr.b=23.70
+lavfi.psnr.mse_avg=852.00
+lavfi.psnr.psnr_avg=18.80
+frame:1pts:1 pts_time:1
+lavfi.psnr.mse.r=1380.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=976.00
+lavfi.psnr.psnr.g=18.20
+lavfi.psnr.mse.b=436.00
+lavfi.psnr.psnr.b=21.70
+lavfi.psnr.mse_avg=931.00
+lavfi.psnr.psnr_avg=18.40
+frame:2pts:2 pts_time:2
+lavfi.psnr.mse.r=1400.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=954.00
+lavfi.psnr.psnr.g=18.30
+lavfi.psnr.mse.b=494.00
+lavfi.psnr.psnr.b=21.20
+lavfi.psnr.mse_avg=950.00
+lavfi.psnr.psnr_avg=18.40
+frame:3pts:3 pts_time:3
+lavfi.psnr.mse.r=1450.00
+lavfi.psnr.psnr.r=16.50
+lavfi.psnr.mse.g=1000.00
+lavfi.psnr.psnr.g=18.10
+lavfi.psnr.mse.b=557.00
+lavfi.psnr.psnr.b=20.70
+lavfi.psnr.mse_avg=1000.00
+lavfi.psnr.psnr_avg=18.10
+frame:4pts:4 pts_time:4
+lavfi.psnr.mse.r=1400.00
+lavfi.psnr.psnr.r=16.70
+lavfi.psnr.mse.g=1010.00
+lavfi.psnr.psnr.g=18.10
+lavfi.psnr.mse.b=602.00
+lavfi.psnr.psnr.b=20.30
+lavfi.psnr.mse_avg=1000.00
+lavfi.psnr.psnr_avg=18.10
diff --git a/tests/ref/fate/filter-refcmp-psnr-yuv
b/tests/ref/fate/filter-refcmp-psnr-yuv
new file mode 100644
index 000..b84c156
--- /dev/null
+++ b/tests/ref/fate/filter-refcmp-psnr-yuv
@@ -0,0 +1,45 @@
+frame:0pts:0 pts_time:0
+lavfi.psnr.mse.y=222.00
+lavfi.psnr.psnr.y=24.70
+lavfi.psnr.mse.u=339.00
+lavfi.psnr.psnr.u=22.80
+lavfi.psnr.mse.v=705.00