[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: packetizer: h264: use num_slice_groups_minus1 as stored
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Tue Dec 2 22:25:23 UTC 2025
Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC
Commits:
d4271389 by Steve Lhomme at 2025-12-01T21:55:37+01:00
packetizer: h264: use num_slice_groups_minus1 as stored
And also as the specs compare it. The loop for slice_group_map_type was bogus.
(cherry picked from commit 486e2e67ff9ee3db3f11b4da427b946b20fc58fd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
- - - - -
89c0c3ef by Steve Lhomme at 2025-12-01T21:55:45+01:00
packetizer: h264: simplify sliceGroupSize computation
num_slice_groups_minus1 can only be in the [1,7] range when reaching this code.
(cherry picked from commit 52e0d1a6ea51f194821d6b3ad9792f1b73c6a0b6)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
- - - - -
64e7f15c by Steve Lhomme at 2025-12-01T21:55:52+01:00
packetizer: h264: skip all slice group ID's at once
(cherry picked from commit 1327a621feed33b5156bcbea701c1023355d5931)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
- - - - -
1 changed file:
- modules/packetizer/h264_nal.c
Changes:
=====================================
modules/packetizer/h264_nal.c
=====================================
@@ -553,20 +553,20 @@ static bool h264_parse_picture_parameter_set_rbsp( bs_t *p_bs,
bs_skip( p_bs, 1 ); // entropy coding mode flag
p_pps->i_pic_order_present_flag = bs_read( p_bs, 1 );
- unsigned num_slice_groups = bs_read_ue( p_bs ) + 1;
- if( num_slice_groups > 8 ) /* never has value > 7. Annex A, G & J */
+ unsigned num_slice_groups_minus1 = bs_read_ue( p_bs );
+ if( num_slice_groups_minus1 > 7 ) /* never has value > 7. Annex A, G & J */
return false;
- if( num_slice_groups > 1 )
+ if( num_slice_groups_minus1 > 0 )
{
unsigned slice_group_map_type = bs_read_ue( p_bs );
if( slice_group_map_type == 0 )
{
- for( unsigned i = 0; i < num_slice_groups; i++ )
+ for( unsigned i = 0; i <= num_slice_groups_minus1; i++ )
bs_read_ue( p_bs ); /* run_length_minus1[group] */
}
else if( slice_group_map_type == 2 )
{
- for( unsigned i = 0; i < num_slice_groups; i++ )
+ for( unsigned i = 0; i < num_slice_groups_minus1; i++ )
{
bs_read_ue( p_bs ); /* top_left[group] */
bs_read_ue( p_bs ); /* bottom_right[group] */
@@ -580,16 +580,14 @@ static bool h264_parse_picture_parameter_set_rbsp( bs_t *p_bs,
else if( slice_group_map_type == 6 )
{
unsigned pic_size_in_maps_units = bs_read_ue( p_bs ) + 1;
- unsigned sliceGroupSize = 1;
- while(num_slice_groups > 1)
+ // Ceil( Log2( num_slice_groups_minus1 + 1 ) )
+ static const int ceil_log2_table[8] =
{
- sliceGroupSize++;
- num_slice_groups = ((num_slice_groups - 1) >> 1) + 1;
- }
- for( unsigned i = 0; i < pic_size_in_maps_units; i++ )
- {
- bs_skip( p_bs, sliceGroupSize );
- }
+ 0,1,2,2,3,3,3,3
+ };
+ unsigned sliceGroupSize = ceil_log2_table[num_slice_groups_minus1];
+ // slice_group_id[]
+ bs_skip( p_bs, sliceGroupSize * pic_size_in_maps_units );
}
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f9020c4df073c861a28f0cda5c6c5dccb58a49ef...64e7f15c694065d9b55f37b327464e609a959282
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f9020c4df073c861a28f0cda5c6c5dccb58a49ef...64e7f15c694065d9b55f37b327464e609a959282
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