[FFmpeg-cvslog] avcodec/dovi_rpu: attach ext blocks to frames

Niklas Haas git at videolan.org
Wed Apr 3 17:33:43 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Sat Mar 23 16:53:14 2024 +0100| [9073f49e6e0403a6709d0daa93e9b978c3c15a2b] | committer: Niklas Haas

avcodec/dovi_rpu: attach ext blocks to frames

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9073f49e6e0403a6709d0daa93e9b978c3c15a2b
---

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

diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c
index 499d8bab4f..9f7a6b0066 100644
--- a/libavcodec/dovi_rpu.c
+++ b/libavcodec/dovi_rpu.c
@@ -95,7 +95,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 */
@@ -121,6 +121,10 @@ 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);
+    dovi->num_ext_blocks = s->num_ext_blocks;
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list