1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avcodec/av1dec: make CBS parse only the OBU types we care about

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2023-03-07 09:03:26 -03:00
parent d6d5765051
commit 68a858fcc9

View File

@ -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)