diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-06-05 07:14:06 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-09-06 13:59:29 +0200 |
commit | 4c0d669b20e89ba4e4ac1e05195cf1634c8945cc (patch) | |
tree | 41422fb4c6242c4737a2c1265735dfdcf74d100f /libavcodec/nvdec_hevc.c | |
parent | c35a51f4bb1b143a24d38e09967da0ecb0b58231 (diff) | |
download | ffmpeg-4c0d669b20e89ba4e4ac1e05195cf1634c8945cc.tar.gz |
lavc/hevcdec: add a per-layer context
Start by moving the DPB to it.
Only one context exists for now, so decoder behaviour should not change
with this commit, but that will change in the future.
Diffstat (limited to 'libavcodec/nvdec_hevc.c')
-rw-r--r-- | libavcodec/nvdec_hevc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/nvdec_hevc.c b/libavcodec/nvdec_hevc.c index ce66ddcfb7..6888507535 100644 --- a/libavcodec/nvdec_hevc.c +++ b/libavcodec/nvdec_hevc.c @@ -73,6 +73,7 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { const HEVCContext *s = avctx->priv_data; + const HEVCLayerContext *l = &s->layers[s->cur_layer]; const HEVCPPS *pps = s->pps; const HEVCSPS *sps = pps->sps; @@ -225,8 +226,8 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, } dpb_size = 0; - for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { - const HEVCFrame *ref = &s->DPB[i]; + for (i = 0; i < FF_ARRAY_ELEMS(l->DPB); i++) { + const HEVCFrame *ref = &l->DPB[i]; if (!(ref->flags & (HEVC_FRAME_FLAG_SHORT_REF | HEVC_FRAME_FLAG_LONG_REF))) continue; if (dpb_size >= FF_ARRAY_ELEMS(ppc->RefPicIdx)) { |