diff options
author | Niklas Haas <git@haasn.dev> | 2024-03-22 21:24:43 +0100 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2024-04-22 12:17:05 +0200 |
commit | d0392619a7f63db0e70dc0cd4680e4ec1a47e2a8 (patch) | |
tree | a90271d13afdb7499ce28ba6e8f04e19747a254a /libavcodec/hevcdec.c | |
parent | 20206e14d7480d514b5e9cdda179dedd2742d4dd (diff) | |
download | ffmpeg-d0392619a7f63db0e70dc0cd4680e4ec1a47e2a8.tar.gz |
avcodec/dovi_rpu: store entire config record
And make it public.
For encoding, users may also be interested in the configured level and
compatibility ID. So generalize the dv_profile field and just expose the
whole configuration record.
This makes the already rather reductive ff_dovi_update_cfg() function
almost wholly redundant, since users can just directly assign
DOVIContext.cfg.
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r-- | libavcodec/hevcdec.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 50433957f7..fcfb275f63 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3365,14 +3365,13 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, } sd = av_packet_get_side_data(avpkt, AV_PKT_DATA_DOVI_CONF, &sd_size); - if (sd && sd_size > 0) { - int old = s->dovi_ctx.dv_profile; - - ff_dovi_update_cfg(&s->dovi_ctx, (AVDOVIDecoderConfigurationRecord *) sd); + if (sd && sd_size >= sizeof(s->dovi_ctx.cfg)) { + int old = s->dovi_ctx.cfg.dv_profile; + s->dovi_ctx.cfg = *(AVDOVIDecoderConfigurationRecord *) sd; if (old) av_log(avctx, AV_LOG_DEBUG, "New DOVI configuration record from input packet (profile %d -> %u).\n", - old, s->dovi_ctx.dv_profile); + old, s->dovi_ctx.cfg.dv_profile); } s->ref = s->collocated_ref = NULL; @@ -3660,8 +3659,8 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx) } sd = ff_get_coded_side_data(avctx, AV_PKT_DATA_DOVI_CONF); - if (sd && sd->size > 0) - ff_dovi_update_cfg(&s->dovi_ctx, (AVDOVIDecoderConfigurationRecord *) sd->data); + if (sd && sd->size >= sizeof(s->dovi_ctx.cfg)) + s->dovi_ctx.cfg = *(AVDOVIDecoderConfigurationRecord *) sd->data; } return 0; |