diff mbox series

[FFmpeg-devel] fate/png: add mDCv read and write test

Message ID 20240708165944.474761-1-leo.izen@gmail.com
State New
Headers show
Series [FFmpeg-devel] fate/png: add mDCv read and write test | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Leo Izen July 8, 2024, 4:59 p.m. UTC
This test confirms that we can write mDCv chunks and read them back via
the png decoder. It uses an HEVC conformance sample with this metadata
as the base source for the side data in the frames.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Jan Ekström <jeebjp@gmail.com>
---
 tests/fate/image.mak    |  5 +++++
 tests/ref/fate/png-mdcv | 22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 tests/ref/fate/png-mdcv
diff mbox series

Patch

diff --git a/tests/fate/image.mak b/tests/fate/image.mak
index 753936ec20..ec2375f703 100644
--- a/tests/fate/image.mak
+++ b/tests/fate/image.mak
@@ -416,6 +416,11 @@  FATE_PNG_PROBE-$(call ALLYES, LCMS2) += fate-png-icc-parse
 fate-png-icc-parse: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_frames \
     -flags2 icc_profiles $(TARGET_SAMPLES)/png1/lena-int_rgb24.png
 
+FATE_PNG_TRANSCODE-$(call TRANSCODE, PNG HEVC, IMAGE2 HEVC IMAGE_PNG_PIPE) += fate-png-mdcv
+fate-png-mdcv: CMD = transcode hevc $(TARGET_SAMPLES)/hevc/hdr10_plus_h265_sample.hevc image2 \
+    "-sws_flags +accurate_rnd+bitexact -pix_fmt rgb24 -vf scale -c png" "" \
+    "-show_frames -show_entries frame=side_data_list -of flat"
+
 FATE_PNG-$(call DEMDEC, IMAGE2, PNG) += $(FATE_PNG)
 FATE_PNG_PROBE-$(call DEMDEC, IMAGE2, PNG) += $(FATE_PNG_PROBE)
 FATE_IMAGE_FRAMECRC += $(FATE_PNG-yes)
diff --git a/tests/ref/fate/png-mdcv b/tests/ref/fate/png-mdcv
new file mode 100644
index 0000000000..b719152557
--- /dev/null
+++ b/tests/ref/fate/png-mdcv
@@ -0,0 +1,22 @@ 
+fc68fe6c8c72343b96d2695f6913995b *tests/data/fate/png-mdcv.image2
+439248 tests/data/fate/png-mdcv.image2
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 1280x720
+#sar 0: 0/1
+0,          0,          0,        1,  2764800, 0x2bfc7b42
+frames.frame.0.side_data_list.side_data.0.side_data_type="Content light level metadata"
+frames.frame.0.side_data_list.side_data.0.max_content=1000
+frames.frame.0.side_data_list.side_data.0.max_average=200
+frames.frame.0.side_data_list.side_data.1.side_data_type="Mastering display metadata"
+frames.frame.0.side_data_list.side_data.1.red_x="13250/50000"
+frames.frame.0.side_data_list.side_data.1.red_y="7500/50000"
+frames.frame.0.side_data_list.side_data.1.green_x="34000/50000"
+frames.frame.0.side_data_list.side_data.1.green_y="16000/50000"
+frames.frame.0.side_data_list.side_data.1.blue_x="2/50000"
+frames.frame.0.side_data_list.side_data.1.blue_y="0/50000"
+frames.frame.0.side_data_list.side_data.1.white_point_x="15635/50000"
+frames.frame.0.side_data_list.side_data.1.white_point_y="16450/50000"
+frames.frame.0.side_data_list.side_data.1.min_luminance="50/10000"
+frames.frame.0.side_data_list.side_data.1.max_luminance="10000000/10000"