Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Cosmin Stejerean <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] dovi: fix L11 metadata (PR #20962)
Date: Tue, 18 Nov 2025 23:53:28 -0000
Message-ID: <176351000857.59.17738278266713090673@2cb04c0e5124> (raw)

PR #20962 opened by Cosmin Stejerean (cosmin)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20962
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20962.patch

The handling of L11 dolby vision metadata was based on an old version of `dovi_tool` 
however the structure does not match the spec and it has been fixed in `dovi_tool` for almost 4 years.

This brings the ffmpeg handling of L11 metadata inline with the latest version of the spec, 
the official DolbyVision verifier and aligns with latest `dovi_tool` L11 definition as well.


>From ae8cfe9fd38f0d31cad64de5e8ee2abd11b7f0b3 Mon Sep 17 00:00:00 2001
From: Cosmin Stejerean <cosmin@cosmin.at>
Date: Tue, 18 Nov 2025 13:45:37 -0800
Subject: [PATCH 1/2] avutil/dovi_meta - fix L11 dovi metadata definition

the current fields in AVDOVIDmLevel11 are based on an out-of-date
version of dovi_tool, these fields never made it into any spec and
were cleaned up in dovi_tool almost 4 years ago
---
 libavutil/dovi_meta.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavutil/dovi_meta.h b/libavutil/dovi_meta.h
index 5e8a1e43d7..2cb105ee40 100644
--- a/libavutil/dovi_meta.h
+++ b/libavutil/dovi_meta.h
@@ -279,12 +279,8 @@ typedef struct AVDOVIDmLevel11 {
     uint8_t content_type;
     uint8_t whitepoint;
     uint8_t reference_mode_flag;
-    uint8_t sharpness;
-    uint8_t noise_reduction;
-    uint8_t mpeg_noise_reduction;
-    uint8_t frame_rate_conversion;
-    uint8_t brightness;
-    uint8_t color;
+    uint8_t reserved_byte2;
+    uint8_t reserved_byte3;
 } AVDOVIDmLevel11;
 
 typedef struct AVDOVIDmLevel254 {
-- 
2.49.1


>From 1d587bb378a8a714774401bbdba3818502f9bf64 Mon Sep 17 00:00:00 2001
From: Cosmin Stejerean <cosmin@cosmin.at>
Date: Tue, 18 Nov 2025 13:47:22 -0800
Subject: [PATCH 2/2] avcodec/dovi_rpu(enc|dec) - fix parsing and writing of
 L11 DoVi metadata

---
 libavcodec/dovi_rpudec.c | 8 ++------
 libavcodec/dovi_rpuenc.c | 8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
index 4750d48337..1f1544578b 100644
--- a/libavcodec/dovi_rpudec.c
+++ b/libavcodec/dovi_rpudec.c
@@ -261,12 +261,8 @@ static int parse_ext_v2(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm,
         dm->l11.whitepoint = get_bits(gb, 4);
         dm->l11.reference_mode_flag = get_bits1(gb);
         skip_bits(gb, 3); /* reserved */
-        dm->l11.sharpness = get_bits(gb, 2);
-        dm->l11.noise_reduction = get_bits(gb, 2);
-        dm->l11.mpeg_noise_reduction = get_bits(gb, 2);
-        dm->l11.frame_rate_conversion = get_bits(gb, 2);
-        dm->l11.brightness = get_bits(gb, 2);
-        dm->l11.color = get_bits(gb, 2);
+        dm->l11.reserved_byte2 = get_bits(gb, 8);
+        dm->l11.reserved_byte3 = get_bits(gb, 8);
         break;
     case 254:
         dm->l254.dm_mode = get_bits(gb, 8);
diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c
index fa351c2b55..da6cf45753 100644
--- a/libavcodec/dovi_rpuenc.c
+++ b/libavcodec/dovi_rpuenc.c
@@ -546,12 +546,8 @@ static void generate_ext_v2(PutBitContext *pb, const AVDOVIDmData *dm)
         put_bits(pb, 4, dm->l11.whitepoint);
         put_bits(pb, 1, dm->l11.reference_mode_flag);
         put_bits(pb, 3, 0); /* reserved */
-        put_bits(pb, 2, dm->l11.sharpness);
-        put_bits(pb, 2, dm->l11.noise_reduction);
-        put_bits(pb, 2, dm->l11.mpeg_noise_reduction);
-        put_bits(pb, 2, dm->l11.frame_rate_conversion);
-        put_bits(pb, 2, dm->l11.brightness);
-        put_bits(pb, 2, dm->l11.color);
+        put_bits(pb, 8, dm->l11.reserved_byte2);
+        put_bits(pb, 8, dm->l11.reserved_byte3);
         break;
     case 254:
         put_bits(pb, 8, dm->l254.dm_mode);
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-11-18 23:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176351000857.59.17738278266713090673@2cb04c0e5124 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git