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

Cosmin Stejerean cosmin at cosmin.at
Thu May 23 22:50:24 EEST 2024


From: Cosmin Stejerean <cosmin at 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 --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;
-- 
2.42.1




More information about the ffmpeg-devel mailing list