[vlc-commits] [Git][videolan/vlc][master] packetizer: h264: fix reading prediction weight tables
    Steve Lhomme (@robUx4) 
    gitlab at videolan.org
       
    Wed Jul  3 16:43:58 UTC 2024
    
    
  
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
f878115e by François Cartegnie at 2024-07-03T16:28:17+00:00
packetizer: h264: fix reading prediction weight tables
- - - - -
3 changed files:
- modules/packetizer/h264_nal.c
- modules/packetizer/h264_nal.h
- modules/packetizer/h264_slice.c
Changes:
=====================================
modules/packetizer/h264_nal.c
=====================================
@@ -598,8 +598,8 @@ static bool h264_parse_picture_parameter_set_rbsp( bs_t *p_bs,
         }
     }
 
-    bs_read_ue( p_bs ); /* num_ref_idx_l0_default_active_minus1 */
-    bs_read_ue( p_bs ); /* num_ref_idx_l1_default_active_minus1 */
+    p_pps->num_ref_idx_l01_default_active_minus1[0] = bs_read_ue( p_bs );
+    p_pps->num_ref_idx_l01_default_active_minus1[1] = bs_read_ue( p_bs );
     p_pps->weighted_pred_flag = bs_read( p_bs, 1 );
     p_pps->weighted_bipred_idc = bs_read( p_bs, 2 );
     bs_read_se( p_bs ); /* pic_init_qp_minus26 */
=====================================
modules/packetizer/h264_nal.h
=====================================
@@ -165,6 +165,7 @@ struct h264_picture_parameter_set_t
     uint8_t i_redundant_pic_present_flag;
     uint8_t weighted_pred_flag;
     uint8_t weighted_bipred_idc;
+    uint32_t num_ref_idx_l01_default_active_minus1[2];
 };
 
 struct h264_sequence_parameter_set_extension_t
=====================================
modules/packetizer/h264_slice.c
=====================================
@@ -177,7 +177,8 @@ h264_slice_t * h264_decode_slice( const uint8_t *p_buffer, size_t i_buffer,
     if( p_pps->i_redundant_pic_present_flag )
         bs_read_ue( &s ); /* redudant_pic_count */
 
-    unsigned num_ref_idx_l01_active_minus1[2] = {0 , 0};
+    uint32_t num_ref_idx_l01_active_minus1[2] = { p_pps->num_ref_idx_l01_default_active_minus1[0],
+                                                  p_pps->num_ref_idx_l01_default_active_minus1[1] };
 
     if( i_slice_type == 1 || i_slice_type == 6 ) /* B slices */
         bs_read1( &s ); /* direct_spatial_mv_pred_flag */
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f878115e184a4d896e4df39bccbde32ea6d9357c
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f878115e184a4d896e4df39bccbde32ea6d9357c
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
    
    
More information about the vlc-commits
mailing list