diff mbox series

[FFmpeg-devel,v3,2/5] avcodec/dovi_rpuenc - guard metadata compression

Message ID 0101018fa701338b-9788938f-7752-4af2-b15b-f90d1d3f4e0c-000000@us-west-2.amazonses.com
State New
Headers show
Series avcodec/dovi - disable metadata compression by default | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Cosmin Stejerean May 23, 2024, 7:50 p.m. UTC
From: Cosmin Stejerean <cosmin@cosmin.at>

Guard use_prev_vdr_rpu by the new enable_compression field since not all
clients support this.

Separately output when vdr_dm_metadata_changed == 0 fails the DV verifier so
turn that off unconditionally for now.


---
 libavcodec/dovi_rpuenc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c
index 3c3e0f84c0..26ed25733a 100644
--- a/libavcodec/dovi_rpuenc.c
+++ b/libavcodec/dovi_rpuenc.c
@@ -512,8 +512,12 @@  int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata,
         }
     }
 
-    vdr_dm_metadata_changed = !s->color || memcmp(s->color, color, sizeof(*color));
-    use_prev_vdr_rpu = !memcmp(&s->vdr[vdr_rpu_id]->mapping, mapping, sizeof(*mapping));
+    // the output when vdr_dm_metadata_changed is 0 fails the DV verifier
+    // force it to 1 until we can get some samples or documentation on correct syntax
+    vdr_dm_metadata_changed = 1; // !s->color || memcmp(s->color, color, sizeof(*color));
+
+    // not all clients support metadata compression
+    use_prev_vdr_rpu = s->enable_compression && !memcmp(&s->vdr[vdr_rpu_id]->mapping, mapping, sizeof(*mapping));
 
     buffer_size = 12 /* vdr seq info */ + 5 /* CRC32 + terminator */;
     buffer_size += num_ext_blocks_v1 * 13;