@@ -83,11 +83,7 @@ pub struct SubsetSps {
8383}
8484
8585/// Read a ue value and validate it fits in u16 with given max.
86- fn read_ue_bounded < R : BitRead > (
87- r : & mut R ,
88- name : & ' static str ,
89- max : u32 ,
90- ) -> Result < u16 , SpsError > {
86+ fn read_ue_bounded < R : BitRead > ( r : & mut R , name : & ' static str , max : u32 ) -> Result < u16 , SpsError > {
9187 let val = r. read_ue ( name) ?;
9288 if val > max {
9389 return Err ( SpsError :: FieldValueTooLarge { name, value : val } ) ;
@@ -167,7 +163,11 @@ fn read_svc_extension<R: BitRead>(
167163 r. read ( 2 , "chroma_phase_y_plus1" ) ?
168164 } else {
169165 // Default: 0 for Monochrome, 1 for YUV422/444
170- if chroma_array_type == 0 { 0 } else { 1 }
166+ if chroma_array_type == 0 {
167+ 0
168+ } else {
169+ 1
170+ }
171171 } ;
172172
173173 let (
@@ -186,7 +186,11 @@ fn read_svc_extension<R: BitRead>(
186186 let ref_phase_y = if chroma_array_type == 1 {
187187 r. read ( 2 , "seq_ref_layer_chroma_phase_y_plus1" ) ?
188188 } else {
189- if chroma_array_type == 0 { 0 } else { 1 }
189+ if chroma_array_type == 0 {
190+ 0
191+ } else {
192+ 1
193+ }
190194 } ;
191195 (
192196 ref_phase_x,
@@ -197,19 +201,24 @@ fn read_svc_extension<R: BitRead>(
197201 r. read_se ( "seq_scaled_ref_layer_bottom_offset" ) ?,
198202 )
199203 } else {
200- ( false , if chroma_array_type == 0 { 0 } else { 1 } , 0 , 0 , 0 , 0 )
204+ (
205+ false ,
206+ if chroma_array_type == 0 { 0 } else { 1 } ,
207+ 0 ,
208+ 0 ,
209+ 0 ,
210+ 0 ,
211+ )
201212 } ;
202213
203- let seq_tcoeff_level_prediction_flag =
204- r. read_bool ( "seq_tcoeff_level_prediction_flag" ) ?;
214+ let seq_tcoeff_level_prediction_flag = r. read_bool ( "seq_tcoeff_level_prediction_flag" ) ?;
205215 let adaptive_tcoeff_level_prediction_flag = if seq_tcoeff_level_prediction_flag {
206216 r. read_bool ( "adaptive_tcoeff_level_prediction_flag" ) ?
207217 } else {
208218 false
209219 } ;
210220 let slice_header_restriction_flag = r. read_bool ( "slice_header_restriction_flag" ) ?;
211- let svc_vui_parameters_present_flag =
212- r. read_bool ( "svc_vui_parameters_present_flag" ) ?;
221+ let svc_vui_parameters_present_flag = r. read_bool ( "svc_vui_parameters_present_flag" ) ?;
213222
214223 Ok ( SvcSpsExtension {
215224 inter_layer_deblocking_filter_control_present_flag,
@@ -315,8 +324,7 @@ fn read_mvc_extension<R: BitRead>(r: &mut R) -> Result<MvcSpsExtension, SpsError
315324 } ) ;
316325 }
317326
318- let mut level_values =
319- Vec :: with_capacity ( num_level_values_signalled_minus1 as usize + 1 ) ;
327+ let mut level_values = Vec :: with_capacity ( num_level_values_signalled_minus1 as usize + 1 ) ;
320328 for _ in 0 ..=num_level_values_signalled_minus1 {
321329 let level_idc: u8 = r. read ( 8 , "level_idc" ) ?;
322330 let num_applicable_ops_minus1 = r. read_ue ( "num_applicable_ops_minus1" ) ?;
@@ -326,20 +334,16 @@ fn read_mvc_extension<R: BitRead>(r: &mut R) -> Result<MvcSpsExtension, SpsError
326334 value : num_applicable_ops_minus1,
327335 } ) ;
328336 }
329- let mut applicable_ops =
330- Vec :: with_capacity ( num_applicable_ops_minus1 as usize + 1 ) ;
337+ let mut applicable_ops = Vec :: with_capacity ( num_applicable_ops_minus1 as usize + 1 ) ;
331338 for _ in 0 ..=num_applicable_ops_minus1 {
332339 let temporal_id: u8 = r. read ( 3 , "applicable_op_temporal_id" ) ?;
333340 let num_target_views_minus1 =
334341 read_ue_bounded ( r, "applicable_op_num_target_views_minus1" , 1023 ) ?;
335- let mut target_view_ids =
336- Vec :: with_capacity ( num_target_views_minus1 as usize + 1 ) ;
342+ let mut target_view_ids = Vec :: with_capacity ( num_target_views_minus1 as usize + 1 ) ;
337343 for _ in 0 ..=num_target_views_minus1 {
338- target_view_ids
339- . push ( read_ue_bounded ( r, "applicable_op_target_view_id" , 1023 ) ?) ;
344+ target_view_ids. push ( read_ue_bounded ( r, "applicable_op_target_view_id" , 1023 ) ?) ;
340345 }
341- let num_views_minus1 =
342- read_ue_bounded ( r, "applicable_op_num_views_minus1" , 1023 ) ?;
346+ let num_views_minus1 = read_ue_bounded ( r, "applicable_op_num_views_minus1" , 1023 ) ?;
343347 applicable_ops. push ( MvcApplicableOp {
344348 temporal_id,
345349 num_target_views_minus1,
0 commit comments