From 3a1916c38aa44374fbcc24ec647d0beaf6152deb Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 23 Mar 2024 16:52:41 +0100 Subject: [PATCH] avcodec/dovi_rpu: add ext_blocks array to DOVIContext --- 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 85aded52bd..ce9be19ed0 100644 --- a/libavcodec/dovi_rpu.c +++ b/libavcodec/dovi_rpu.c @@ -48,6 +48,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) { @@ -59,6 +60,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, @@ -77,6 +79,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 8dcc65bb40..9f26f332ce 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 */