avcodec/vvc/refs: export in-band LCEVC side data in frames

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-12-09 14:36:22 -03:00
parent 94c491287c
commit 9c14527f1a
2 changed files with 12 additions and 2 deletions

View File

@@ -807,11 +807,11 @@ static int frame_start(VVCContext *s, VVCFrameContext *fc, SliceContext *sc)
if (!s->temporal_id && !ph->r->ph_non_ref_pic_flag && !(IS_RASL(s) || IS_RADL(s)))
s->poc_tid0 = ph->poc;
decode_prefix_sei(fc, s);
if ((ret = ff_vvc_set_new_ref(s, fc, &fc->frame)) < 0)
goto fail;
decode_prefix_sei(fc, s);
ret = set_side_data(s, fc);
if (ret < 0)
goto fail;
@@ -1225,6 +1225,7 @@ static av_cold void vvc_decode_flush(AVCodecContext *avctx)
if (s->fcs) {
VVCFrameContext *last = get_frame_context(s, s->fcs, s->nb_frames - 1);
ff_vvc_sei_reset(&last->sei);
ff_vvc_flush_dpb(last);
}

View File

@@ -133,6 +133,15 @@ static VVCFrame *alloc_frame(VVCContext *s, VVCFrameContext *fc)
frame->sps = av_refstruct_ref_c(fc->ps.sps);
frame->pps = av_refstruct_ref_c(fc->ps.pps);
// Add LCEVC SEI metadata here, as it's needed in get_buffer()
if (fc->sei.common.lcevc.info) {
HEVCSEILCEVC *lcevc = &fc->sei.common.lcevc;
ret = ff_frame_new_side_data_from_buf(s->avctx, frame->frame,
AV_FRAME_DATA_LCEVC, &lcevc->info);
if (ret < 0)
goto fail;
}
ret = ff_thread_get_buffer(s->avctx, frame->frame, AV_GET_BUFFER_FLAG_REF);
if (ret < 0)
return NULL;