[FFmpeg-devel] [PATCH v2 8/8] avcodec/dovi_rpu: attach ext blocks to frames

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


From: Niklas Haas <git at haasn.dev>

---
 libavcodec/dovi_rpu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c
index b3defd87bda..2b4d2b470c2 100644
--- a/libavcodec/dovi_rpu.c
+++ b/libavcodec/dovi_rpu.c
@@ -94,7 +94,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame)
     AVFrameSideData *sd;
     AVBufferRef *buf;
     AVDOVIMetadata *dovi;
-    size_t dovi_size;
+    size_t dovi_size, ext_sz;
 
     if (!s->mapping || !s->color)
         return 0; /* incomplete dovi metadata */
@@ -120,6 +120,9 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame)
     COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag);
     COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots);
     COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal);
+    ext_sz = FFMIN(sizeof(AVDOVIDmData), dovi->ext_block_size);
+    for (int i = 0; i < s->num_ext_blocks; i++)
+        memcpy(av_dovi_get_ext(dovi, i), &s->ext_blocks[i], ext_sz);
     return 0;
 }
 
-- 
2.44.0



More information about the ffmpeg-devel mailing list