From 68a858fcc913c4939798c7b6580a814184a1089b Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 7 Mar 2023 09:03:26 -0300 Subject: [PATCH] avcodec/av1dec: make CBS parse only the OBU types we care about Signed-off-by: James Almer --- libavcodec/av1dec.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 314c721ac2..a80e37e33f 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -752,6 +752,16 @@ static int update_context_with_frame_header(AVCodecContext *avctx, return 0; } +static const CodedBitstreamUnitType decompose_unit_types[] = { + AV1_OBU_FRAME, + AV1_OBU_FRAME_HEADER, + AV1_OBU_METADATA, + AV1_OBU_REDUNDANT_FRAME_HEADER, + AV1_OBU_SEQUENCE_HEADER, + AV1_OBU_TEMPORAL_DELIMITER, + AV1_OBU_TILE_GROUP, +}; + static av_cold int av1_decode_init(AVCodecContext *avctx) { AV1DecContext *s = avctx->priv_data; @@ -781,6 +791,9 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; + s->cbc->decompose_unit_types = decompose_unit_types; + s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types); + s->itut_t35_fifo = av_fifo_alloc2(1, sizeof(AV1RawMetadataITUTT35), AV_FIFO_FLAG_AUTO_GROW); if (!s->itut_t35_fifo)