[vlc-commits] [Git][videolan/vlc][3.0.x] packetizer: h264: fix reading prediction weight tables

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jul 8 07:18:48 UTC 2024



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
f9990a46 by François Cartegnie at 2024-07-05T17:21:57+02:00
packetizer: h264: fix reading prediction weight tables

(cherry picked from commit f878115e184a4d896e4df39bccbde32ea6d9357c)

- - - - -


3 changed files:

- modules/packetizer/h264_nal.c
- modules/packetizer/h264_nal.h
- modules/packetizer/h264_slice.c


Changes:

=====================================
modules/packetizer/h264_nal.c
=====================================
@@ -591,8 +591,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
=====================================
@@ -150,6 +150,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
=====================================
@@ -101,7 +101,8 @@ bool 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/f9990a466eb1753c1187ae5d9eb6b158e31aff6e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f9990a466eb1753c1187ae5d9eb6b158e31aff6e
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