[FFmpeg-cvslog] avformat/vvc: fix parsing sps_subpic_id

James Almer git at videolan.org
Wed May 22 23:53:29 EEST 2024


ffmpeg | branch: release/7.0 | James Almer <jamrial at gmail.com> | Sun May 19 10:21:14 2024 -0300| [85d4df387347d63aee95e14a60cd9efa14e3c9d5] | committer: James Almer

avformat/vvc: fix parsing sps_subpic_id

The length of the sps_subpic_id[i] syntax element is sps_subpic_id_len_minus1 + 1 bits.

Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 2d84ee374528a8a8eed345a8147e146a0112e43a)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85d4df387347d63aee95e14a60cd9efa14e3c9d5
---

 libavformat/vvc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 20be4bd8b8..d5b3237aeb 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -392,6 +392,7 @@ static int vvcc_parse_sps(GetBitContext *gb,
         const int tmp_height_val  = AV_CEIL_RSHIFT(sps_pic_height_max_in_luma_samples, ctb_log2_size_y);
         const int wlen            = av_ceil_log2(tmp_width_val);
         const int hlen            = av_ceil_log2(tmp_height_val);
+        unsigned int sps_subpic_id_len;
         if (sps_num_subpics_minus1 > 0) {       // sps_num_subpics_minus1
             sps_independent_subpics_flag = get_bits1(gb);
             sps_subpic_same_size_flag = get_bits1(gb);
@@ -411,11 +412,11 @@ static int vvcc_parse_sps(GetBitContext *gb,
                 skip_bits(gb, 2);       // sps_subpic_treated_as_pic_flag && sps_loop_filter_across_subpic_enabled_flag
             }
         }
-        get_ue_golomb_long(gb); // sps_subpic_id_len_minus1
+        sps_subpic_id_len = get_ue_golomb_long(gb) + 1;
         if (get_bits1(gb)) {    // sps_subpic_id_mapping_explicitly_signalled_flag
             if (get_bits1(gb))  // sps_subpic_id_mapping_present_flag
                 for (int i = 0; i <= sps_num_subpics_minus1; i++) {
-                    skip_bits1(gb);     // sps_subpic_id[i]
+                    skip_bits_long(gb, sps_subpic_id_len); // sps_subpic_id[i]
                 }
         }
     }



More information about the ffmpeg-cvslog mailing list