@@ -142,11 +142,12 @@ impl H264Encoder {
142142 caps. video_caps. picture_access_granularity. height
143143 ) ;
144144
145- let mb_size = caps. video_caps . picture_access_granularity . width ;
146- trace ! ( "mb size: {}" , mb_size) ;
145+ let mb_width = caps. video_caps . picture_access_granularity . width ;
146+ let mb_height = caps. video_caps . picture_access_granularity . height ;
147+ trace ! ( "mb size: {mb_width}x{mb_height}" ) ;
147148
148- let aligned_width = params. width . next_multiple_of ( mb_size ) ;
149- let aligned_height = params. height . next_multiple_of ( mb_size ) ;
149+ let aligned_width = params. width . next_multiple_of ( mb_width ) ;
150+ let aligned_height = params. height . next_multiple_of ( mb_height ) ;
150151
151152 trace ! (
152153 "aligned width: {}, height: {}" ,
@@ -202,8 +203,8 @@ impl H264Encoder {
202203 pic_order_cnt_type : StdVideoH264PocType_STD_VIDEO_H264_POC_TYPE_0 ,
203204 log2_max_pic_order_cnt_lsb_minus4 : log2_max_frame_num_minus4,
204205 log2_max_frame_num_minus4,
205- pic_width_in_mbs_minus1 : ( aligned_width / mb_size ) - 1 ,
206- pic_height_in_map_units_minus1 : ( aligned_height / mb_size ) - 1 ,
206+ pic_width_in_mbs_minus1 : ( aligned_width / mb_width ) - 1 ,
207+ pic_height_in_map_units_minus1 : ( aligned_height / mb_height ) - 1 ,
207208 frame_crop_right_offset : crop_right,
208209 frame_crop_bottom_offset : crop_bottom,
209210
0 commit comments