[FFmpeg-cvslog] avformat/vvc: fix parsing some early VPS bitstream values
James Almer
git at videolan.org
Mon May 20 20:28:56 EEST 2024
ffmpeg | branch: release/7.0 | James Almer <jamrial at gmail.com> | Fri May 17 16:23:41 2024 -0300| [a8b8b1042f9959416c8b08d3099a8e9bb6407deb] | committer: James Almer
avformat/vvc: fix parsing some early VPS bitstream values
vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit a48203d51aa4836150f9379448f6b2a1d5ca9d36)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8b8b1042f9959416c8b08d3099a8e9bb6407deb
---
libavformat/vvc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 12a8ef6b0e..b1b519c92c 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -268,6 +268,8 @@ static int vvcc_parse_vps(GetBitContext *gb,
if (vps_max_layers_minus1 > 0 && vps_max_sublayers_minus1 > 0)
vps_default_ptl_dpb_hrd_max_tid_flag = get_bits1(gb);
+ else
+ vps_default_ptl_dpb_hrd_max_tid_flag = 0;
if (vps_max_layers_minus1 > 0)
vps_all_independent_layers_flag = get_bits1(gb);
else
@@ -276,10 +278,11 @@ static int vvcc_parse_vps(GetBitContext *gb,
for (int i = 0; i <= vps_max_layers_minus1; i++) {
skip_bits(gb, 6); //vps_layer_id[i]
if (i > 0 && !vps_all_independent_layers_flag) {
- if (get_bits1(gb)) { // vps_independent_layer_flag[i]
+ if (!get_bits1(gb)) { // vps_independent_layer_flag[i]
unsigned int vps_max_tid_ref_present_flag = get_bits1(gb);
for (int j = 0; j < i; j++) {
- if (vps_max_tid_ref_present_flag && get_bits1(gb)) // vps_direct_ref_layer_flag[i][j]
+ unsigned int vps_direct_ref_layer_flag = get_bits1(gb);
+ if (vps_max_tid_ref_present_flag && vps_direct_ref_layer_flag)
skip_bits(gb, 3); // vps_max_tid_il_ref_pics_plus1
}
}
More information about the ffmpeg-cvslog
mailing list