@@ -3335,14 +3335,13 @@ unsafe fn decode_b(
33353335 if b. skip_mode != 0 {
33363336 b. intra = 0 ;
33373337 } else if is_inter_or_switch ( frame_hdr) {
3338- if let Some ( seg) = seg && ( seg. r#ref >= 0 || seg. globalmv != 0 ) {
3338+ if let Some ( seg) = seg. filter ( |seg| seg. r#ref >= 0 || seg. globalmv != 0 ) {
33393339 b. intra = ( seg. r#ref == 0 ) as uint8_t ;
33403340 } else {
33413341 let ictx = get_intra_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
3342- b. intra = ( !dav1d_msac_decode_bool_adapt (
3343- & mut ts. msac ,
3344- & mut ts. cdf . m . intra [ ictx. into ( ) ] ,
3345- ) ) as uint8_t ;
3342+ b. intra =
3343+ ( !dav1d_msac_decode_bool_adapt ( & mut ts. msac , & mut ts. cdf . m . intra [ ictx. into ( ) ] ) )
3344+ as uint8_t ;
33463345
33473346 if DEBUG_BLOCK_INFO ( f, t) {
33483347 println ! ( "Post-intra[{}]: r={}" , b. intra, ts. msac. rng) ;
@@ -4266,139 +4265,64 @@ unsafe fn decode_b(
42664265 }
42674266 } else {
42684267 b. c2rust_unnamed . c2rust_unnamed_0 . comp_type = COMP_INTER_NONE as libc:: c_int as uint8_t ;
4269- if let Some ( seg) = seg && seg. r#ref > 0 {
4270- b
4271- . c2rust_unnamed
4272- . c2rust_unnamed_0
4273- . r#ref [ 0 as libc:: c_int
4274- as usize ] = seg. r#ref as i8 - 1 ;
4275- } else if let Some ( seg) = seg && ( seg. globalmv != 0 || seg. skip != 0 ) {
4276- b
4277- . c2rust_unnamed
4278- . c2rust_unnamed_0
4279- . r#ref [ 0 ] = 0 as libc:: c_int as int8_t ;
4268+ if let Some ( seg) = seg. filter ( |seg| seg. r#ref > 0 ) {
4269+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 as libc:: c_int as usize ] =
4270+ seg. r#ref as i8 - 1 ;
4271+ } else if let Some ( _) = seg. filter ( |seg| seg. globalmv != 0 || seg. skip != 0 ) {
4272+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 ] = 0 as libc:: c_int as int8_t ;
42804273 } else {
4281- let ctx1_0 = av1_get_ref_ctx (
4282- & * t. a ,
4283- & t. l ,
4284- by4,
4285- bx4,
4286- have_top,
4287- have_left,
4288- ) ;
4274+ let ctx1_0 = av1_get_ref_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
42894275 if dav1d_msac_decode_bool_adapt (
42904276 & mut ts. msac ,
42914277 & mut ts. cdf . m . r#ref [ 0 ] [ ctx1_0 as usize ] ,
4292- )
4293- {
4294- let ctx2_1 = av1_get_bwd_ref_ctx (
4295- & * t. a ,
4296- & t. l ,
4297- by4,
4298- bx4,
4299- have_top,
4300- have_left,
4301- ) ;
4278+ ) {
4279+ let ctx2_1 = av1_get_bwd_ref_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
43024280 if dav1d_msac_decode_bool_adapt (
43034281 & mut ts. msac ,
43044282 & mut ts. cdf . m . r#ref [ 1 ] [ ctx2_1 as usize ] ,
4305- )
4306- {
4307- b
4308- . c2rust_unnamed
4309- . c2rust_unnamed_0
4310- . r#ref [ 0 as libc:: c_int
4311- as usize ] = 6 as libc:: c_int as int8_t ;
4283+ ) {
4284+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 as libc:: c_int as usize ] =
4285+ 6 as libc:: c_int as int8_t ;
43124286 } else {
4313- let ctx3_0 = av1_get_bwd_ref_1_ctx (
4314- & * t. a ,
4315- & t. l ,
4316- by4,
4317- bx4,
4318- have_top,
4319- have_left,
4320- ) ;
4321- b
4322- . c2rust_unnamed
4323- . c2rust_unnamed_0
4324- . r#ref [ 0 as libc:: c_int
4325- as usize ] = ( 4 as libc:: c_int as libc:: c_uint )
4326- . wrapping_add (
4287+ let ctx3_0 =
4288+ av1_get_bwd_ref_1_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
4289+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 as libc:: c_int as usize ] =
4290+ ( 4 as libc:: c_int as libc:: c_uint ) . wrapping_add (
43274291 dav1d_msac_decode_bool_adapt (
43284292 & mut ts. msac ,
4329- & mut ts
4330- . cdf
4331- . m
4332- . r#ref [ 5 ] [ ctx3_0 as usize ] ,
4293+ & mut ts. cdf . m . r#ref [ 5 ] [ ctx3_0 as usize ] ,
43334294 ) as libc:: c_uint ,
43344295 ) as int8_t ;
43354296 }
43364297 } else {
4337- let ctx2_2 = av1_get_fwd_ref_ctx (
4338- & * t. a ,
4339- & t. l ,
4340- by4,
4341- bx4,
4342- have_top,
4343- have_left,
4344- ) ;
4298+ let ctx2_2 = av1_get_fwd_ref_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
43454299 if dav1d_msac_decode_bool_adapt (
43464300 & mut ts. msac ,
43474301 & mut ts. cdf . m . r#ref [ 2 ] [ ctx2_2 as usize ] ,
4348- )
4349- {
4350- let ctx3_1 = av1_get_fwd_ref_2_ctx (
4351- & * t. a ,
4352- & t. l ,
4353- by4,
4354- bx4,
4355- have_top,
4356- have_left,
4357- ) ;
4358- b
4359- . c2rust_unnamed
4360- . c2rust_unnamed_0
4361- . r#ref [ 0 as libc:: c_int
4362- as usize ] = ( 2 as libc:: c_int as libc:: c_uint )
4363- . wrapping_add (
4302+ ) {
4303+ let ctx3_1 =
4304+ av1_get_fwd_ref_2_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
4305+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 as libc:: c_int as usize ] =
4306+ ( 2 as libc:: c_int as libc:: c_uint ) . wrapping_add (
43644307 dav1d_msac_decode_bool_adapt (
43654308 & mut ts. msac ,
4366- & mut ts
4367- . cdf
4368- . m
4369- . r#ref [ 4 ] [ ctx3_1 as usize ] ,
4309+ & mut ts. cdf . m . r#ref [ 4 ] [ ctx3_1 as usize ] ,
43704310 ) as libc:: c_uint ,
43714311 ) as int8_t ;
43724312 } else {
4373- let ctx3_2 = av1_get_fwd_ref_1_ctx (
4374- & * t. a ,
4375- & t. l ,
4376- by4,
4377- bx4,
4378- have_top,
4379- have_left,
4380- ) ;
4381- b
4382- . c2rust_unnamed
4383- . c2rust_unnamed_0
4384- . r#ref [ 0 as libc:: c_int
4385- as usize ] = dav1d_msac_decode_bool_adapt (
4386- & mut ts. msac ,
4387- & mut ts
4388- . cdf
4389- . m
4390- . r#ref [ 3 ] [ ctx3_2 as usize ] ,
4391- ) as int8_t ;
4313+ let ctx3_2 =
4314+ av1_get_fwd_ref_1_ctx ( & * t. a , & t. l , by4, bx4, have_top, have_left) ;
4315+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 as libc:: c_int as usize ] =
4316+ dav1d_msac_decode_bool_adapt (
4317+ & mut ts. msac ,
4318+ & mut ts. cdf . m . r#ref [ 3 ] [ ctx3_2 as usize ] ,
4319+ ) as int8_t ;
43924320 }
43934321 }
4394- if DEBUG_BLOCK_INFO ( f, t)
4395- {
4322+ if DEBUG_BLOCK_INFO ( f, t) {
43964323 printf (
43974324 b"Post-ref[%d]: r=%d\n \0 " as * const u8 as * const libc:: c_char ,
4398- b
4399- . c2rust_unnamed
4400- . c2rust_unnamed_0
4401- . r#ref [ 0 ] as libc:: c_int ,
4325+ b. c2rust_unnamed . c2rust_unnamed_0 . r#ref [ 0 ] as libc:: c_int ,
44024326 ts. msac . rng ,
44034327 ) ;
44044328 }
0 commit comments