From 899c672ed15a522fe2391ff81eef682e0a9d89a9 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Tue, 19 Oct 2021 10:16:04 +0300 Subject: [PATCH] Make sure the dpb is more than max_num_reorder_pics --- src/encoder_state-bitstream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index 50fa74fc..707103ad 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -146,6 +146,7 @@ static void encoder_state_write_bitstream_vid_parameter_set(bitstream_t* stream, int max_buffer = max_required_dpb_size(encoder); int max_reorder = max_num_reorder_pics(encoder); + if (max_buffer - 1 < max_reorder) max_buffer = max_reorder + 1; WRITE_UE(stream, max_buffer - 1, "vps_max_dec_pic_buffering_minus1"); WRITE_UE(stream, max_reorder, "vps_max_num_reorder_pics"); @@ -417,6 +418,7 @@ static void encoder_state_write_bitstream_seq_parameter_set(bitstream_t* stream, //for each layer int max_buffer = max_required_dpb_size(encoder); int max_reorder = max_num_reorder_pics(encoder); + if (max_buffer - 1 < max_reorder) max_buffer = max_reorder + 1; WRITE_UE(stream, max_buffer - 1, "sps_max_dec_pic_buffering_minus1"); WRITE_UE(stream, max_reorder, "sps_max_num_reorder_pics");