[vlc-commits] [Git][videolan/vlc][master] 5 commits: packetizer: h266: replace unused bs_read() with bs_skip()

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Aug 23 12:27:38 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
793ebba1 by Steve Lhomme at 2026-08-23T12:15:48+00:00
packetizer: h266: replace unused bs_read() with bs_skip()

That should be slightly faster.

- - - - -
65cf80d2 by Steve Lhomme at 2026-08-23T12:15:48+00:00
demux: mpeg4: replace unused bs_read() with bs_skip()

That should be slightly faster.

- - - - -
0883d15a by Steve Lhomme at 2026-08-23T12:15:48+00:00
packetize: hevc_nal: replace unused bs_read() with bs_skip()

That should be slightly faster.

- - - - -
60a650da by Steve Lhomme at 2026-08-23T12:15:48+00:00
packetize: hxxx_sei: replace unused bs_read() with bs_skip()

That should be slightly faster.

- - - - -
3a49e793 by Steve Lhomme at 2026-08-23T12:15:48+00:00
packetize: mpeg4audio: replace unused bs_read() with bs_skip()

That should be slightly faster.

- - - - -


6 changed files:

- modules/demux/mpeg/mpeg4_iod.c
- modules/packetizer/h266_nal.c
- modules/packetizer/hevc_nal.c
- modules/packetizer/hxxx_sei.c
- modules/packetizer/mpeg4audio.c
- modules/packetizer/mpeg4audio.h


Changes:

=====================================
modules/demux/mpeg/mpeg4_iod.c
=====================================
@@ -580,20 +580,20 @@ sl_header_data DecodeSLHeader( unsigned i_data, const uint8_t *p_data,
             vlc_tick_t *p_t;
         } const timestamps[2] = { { &b_has_dts, &ret.i_dts }, { &b_has_cts, &ret.i_pts } };
 
-        bs_read( &s, sl->i_packet_seqnum_length );
+        bs_skip( &s, sl->i_packet_seqnum_length );
 
         if( sl->i_degradation_priority_length && bs_read1( &s ) )
-            bs_read( &s, sl->i_degradation_priority_length );
+            bs_skip( &s, sl->i_degradation_priority_length );
 
         if( b_has_ocr )
-            bs_read( &s, sl->i_OCR_length );
+            bs_skip( &s, sl->i_OCR_length );
 
         if ( ret.b_au_start )
         {
             if( sl->i_flags & USE_RANDOM_ACCESS_POINT_FLAG )
                 bs_read1( &s );
 
-            bs_read( &s, sl->i_AU_seqnum_length );
+            bs_skip( &s, sl->i_AU_seqnum_length );
 
             if ( sl->i_flags & USE_TIMESTAMPS_FLAG )
             {
@@ -620,10 +620,10 @@ sl_header_data DecodeSLHeader( unsigned i_data, const uint8_t *p_data,
                         vlc_tick_from_samples(i_read, sl->i_timestamp_resolution);
             }
 
-            bs_read( &s, sl->i_AU_length );
+            bs_skip( &s, sl->i_AU_length );
 
             if( b_has_instant_bitrate )
-                bs_read( &s, sl->i_instant_bitrate_length );
+                bs_skip( &s, sl->i_instant_bitrate_length );
         }
 
         /* more to read if ExtSLConfigDescrTag */


=====================================
modules/packetizer/h266_nal.c
=====================================
@@ -50,7 +50,7 @@ static bool h266_parse_general_constraint_info(bs_t *p_bs, h266_profile_tier_lev
         nal_u8_t gci_num_additional_bits = bs_read(p_bs, 8);
         if(gci_num_additional_bits > 5)
         {
-            bs_read(p_bs, 6);
+            bs_skip(p_bs, 6);
             gci_num_additional_bits -= 6;
         }
         bs_skip(p_bs, gci_num_additional_bits);
@@ -602,15 +602,15 @@ static bool h266_parse_sequence_parameter_set_rbsp(bs_t *p_bs,
                 uint8_t readsizeW = ceil(vlc_log2(tmpWidthVal));
                 uint8_t readsizeH = ceil(vlc_log2(tmpHeightVal));
                 if(i > 0 && p_sps->pic_width_max_in_luma_samples > CtbSizeY)
-                    bs_read(p_bs, readsizeW);
+                    bs_skip(p_bs, readsizeW);
                 if(i > 0 && p_sps->pic_height_max_in_luma_samples > CtbSizeY)
-                    bs_read(p_bs, readsizeH);
+                    bs_skip(p_bs, readsizeH);
                 if(i < sps_num_subpics_minus1 &&
                     p_sps->pic_width_max_in_luma_samples > CtbSizeY)
-                    bs_read(p_bs, readsizeW);
+                    bs_skip(p_bs, readsizeW);
                 if(i < sps_num_subpics_minus1 &&
                     p_sps->pic_height_max_in_luma_samples > CtbSizeY)
-                    bs_read(p_bs, readsizeH);
+                    bs_skip(p_bs, readsizeH);
             }
             if(!sps_independent_subpics_flag)
             {
@@ -993,7 +993,7 @@ static bool h266_parse_picture_header_rbsp(bs_t *p_bs,
     ph->ph_pic_order_cnt_lsb = bs_read(p_bs, p_sps->sps_log2_max_pic_order_cnt_lsb_minus4 + 4);
     if(ph->ph_gdr_pic_flag)
         ph->ph_recovery_poc_cnt = bs_read_ue(p_bs);
-    bs_read(p_bs, p_sps->sps_num_extra_ph_bits);
+    bs_skip(p_bs, p_sps->sps_num_extra_ph_bits);
     if(p_sps->sps_poc_msb_cycle_flag)
     {
         ph->ph_poc_msb_cycle_present_flag = bs_read(p_bs, 1);


=====================================
modules/packetizer/hevc_nal.c
=====================================
@@ -561,7 +561,7 @@ static bool hevc_parse_inner_profile_tier_level_rbsp( bs_t *p_bs,
     }
     else
     {
-        bs_read( p_bs, 43 );
+        bs_skip( p_bs, 43 );
     }
 
     if( ( p_in->profile_idc >= 1 && p_in->profile_idc <= 5 ) ||
@@ -601,7 +601,7 @@ static bool hevc_parse_profile_tier_level_rbsp( bs_t *p_bs, bool profile_present
                     p_ptl->sublayer_level_present_flag |= (0x80 >> i);
             }
             else
-                bs_read( p_bs, 2 );
+                bs_skip( p_bs, 2 );
         }
 
         for( uint8_t i=0; i < max_num_sub_layers_minus1; i++ )


=====================================
modules/packetizer/hxxx_sei.c
=====================================
@@ -155,7 +155,7 @@ void HxxxParseSEI(const uint8_t *p_buf, size_t i_buf,
                 if ( !bs_read1( &s ) )
                 {
                     sei_data.frame_packing.type = bs_read( &s, 7 );
-                    bs_read( &s, 1 );
+                    bs_skip( &s, 1 );
                     if( bs_read( &s, 6 ) == 2 ) /*intpr type*/
                         sei_data.frame_packing.b_left_first = false;
                     else


=====================================
modules/packetizer/mpeg4audio.c
=====================================
@@ -580,7 +580,7 @@ static int LOASParse(decoder_t *p_dec, uint8_t *p_buffer, int i_buffer)
                 } else if ((st->i_frame_length_type == 3) ||
                          (st->i_frame_length_type == 5) ||
                          (st->i_frame_length_type == 7)) {
-                    bs_read(&s, 2); // muxSlotLengthCoded
+                    bs_skip(&s, 2); // muxSlotLengthCoded
                 }
             }
 #if 0


=====================================
modules/packetizer/mpeg4audio.h
=====================================
@@ -233,13 +233,13 @@ static inline int MPEG4_read_ELDSpecificConfig(MPEG4_asc_t *p_cfg, bs_t *s)
         for( ; numSbrHeader; numSbrHeader-- )
         {
             /* sbr_header() Table 4.63 */
-            bs_read(s, 14);
+            bs_skip(s, 14);
             bool header_extra_1 = bs_read1(s);
             bool header_extra_2 = bs_read1(s);
             if(header_extra_1)
-                bs_read(s, 5);
+                bs_skip(s, 5);
             if(header_extra_2)
-                bs_read(s, 6);
+                bs_skip(s, 6);
         }
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7e36acb27fa6fa253677799c606f04c28b27645c...3a49e79349810c908a375ab752384c7206388ce0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7e36acb27fa6fa253677799c606f04c28b27645c...3a49e79349810c908a375ab752384c7206388ce0
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list