[FFmpeg-devel] [PATCH v2 6/8] avcodec/dovi_rpu: add ext_blocks array to DOVIContext

Niklas Haas ffmpeg at haasn.xyz
Sat Mar 23 21:19:55 EET 2024


From: Niklas Haas <git at haasn.dev>

---
 libavcodec/dovi_rpu.c | 3 +++
 libavcodec/dovi_rpu.h | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c
index d584d99590a..6097bd5422f 100644
--- a/libavcodec/dovi_rpu.c
+++ b/libavcodec/dovi_rpu.c
@@ -47,6 +47,7 @@ void ff_dovi_ctx_unref(DOVIContext *s)
 {
     for (int i = 0; i < FF_ARRAY_ELEMS(s->vdr); i++)
         ff_refstruct_unref(&s->vdr[i]);
+    ff_refstruct_unref(&s->ext_blocks);
     av_free(s->rpu_buf);
 
     *s = (DOVIContext) {
@@ -58,6 +59,7 @@ void ff_dovi_ctx_flush(DOVIContext *s)
 {
     for (int i = 0; i < FF_ARRAY_ELEMS(s->vdr); i++)
         ff_refstruct_unref(&s->vdr[i]);
+    ff_refstruct_unref(&s->ext_blocks);
 
     *s = (DOVIContext) {
         .logctx = s->logctx,
@@ -76,6 +78,7 @@ void ff_dovi_ctx_replace(DOVIContext *s, const DOVIContext *s0)
     s->dv_profile = s0->dv_profile;
     for (int i = 0; i <= DOVI_MAX_DM_ID; i++)
         ff_refstruct_replace(&s->vdr[i], s0->vdr[i]);
+    ff_refstruct_replace(&s->ext_blocks, s0->ext_blocks);
 }
 
 void ff_dovi_update_cfg(DOVIContext *s, const AVDOVIDecoderConfigurationRecord *cfg)
diff --git a/libavcodec/dovi_rpu.h b/libavcodec/dovi_rpu.h
index 8dcc65bb40a..9f26f332ceb 100644
--- a/libavcodec/dovi_rpu.h
+++ b/libavcodec/dovi_rpu.h
@@ -44,6 +44,12 @@ typedef struct DOVIContext {
     const AVDOVIDataMapping *mapping;
     const AVDOVIColorMetadata *color;
 
+    /**
+     * Currently active extension blocks, updates on every ff_dovi_rpu_parse()
+     */
+    AVDOVIDmData *ext_blocks;
+    int num_ext_blocks;
+
     /**
      * Private fields internal to dovi_rpu.c
      */
-- 
2.44.0



More information about the ffmpeg-devel mailing list