lane-av1422warp: instrument -- EC_SYMR carries the CDF table name
Browse files at this commite9a6ad820388c151d358aebd2dbcbc60505802c9Parent: 0aa598b2 changed files +18 -1
- crates/ec-av1/src/decode.rs +6 -0
- crates/ec-av1/src/msac.rs +12 -1
crates/ec-av1/src/decode.rsmodified+6 -0
| @@ -33539,6 +33539,7 @@ fn decode_inter_block( | ||
| 33539 | 33539 | && enable_masked_compound |
| 33540 | 33540 | && is_any_masked_compound_used_here(write_w, write_h) |
| 33541 | 33541 | { |
| 33542 | + crate::msac::SymbolDecoder::set_symr_cdf("comp_group_idx"); | |
| 33542 | 33543 | dec.symbol(&mut cdfs.comp_group_idx[group_ctx]) |
| 33543 | 33544 | } else { |
| 33544 | 33545 | 0 |
| @@ -33831,6 +33832,7 @@ fn decode_inter_block( | ||
| 33831 | 33832 | ref_order_hints[(ref0 - LAST_FRAME) as usize], |
| 33832 | 33833 | ref_order_hints[(ref1 - LAST_FRAME) as usize], |
| 33833 | 33834 | ); |
| 33835 | + crate::msac::SymbolDecoder::set_symr_cdf("compound_idx"); | |
| 33834 | 33836 | let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]); |
| 33835 | 33837 | if crate::envflags::env_flag!("EC_TRACE_MODE") { |
| 33836 | 33838 | eprintln!( |
| @@ -34998,6 +35000,7 @@ fn decode_inter_block( | ||
| 34998 | 35000 | // TRUE footprint -- a 16x8 strip is group 1, a 32x16 strip |
| 34999 | 35001 | // group 2, not their square `side`'s 2/3. |
| 35000 | 35002 | let bsize_group = size_group_wh(write_w, write_h); |
| 35003 | + crate::msac::SymbolDecoder::set_symr_cdf("interintra"); | |
| 35001 | 35004 | let interintra = dec.symbol(&mut cdfs.interintra[bsize_group]) == 1; |
| 35002 | 35005 | if interintra { |
| 35003 | 35006 | // lane-interintra r1 (decodemv.c 1540-1555): interintra_mode, |
| @@ -40691,6 +40694,7 @@ fn decode_inter_block8( | ||
| 40691 | 40694 | && enable_masked_compound |
| 40692 | 40695 | && is_any_masked_compound_used_here(SIDE, SIDE) |
| 40693 | 40696 | { |
| 40697 | + crate::msac::SymbolDecoder::set_symr_cdf("comp_group_idx"); | |
| 40694 | 40698 | dec.symbol(&mut cdfs.comp_group_idx[group_ctx]) |
| 40695 | 40699 | } else { |
| 40696 | 40700 | 0 |
| @@ -40747,6 +40751,7 @@ fn decode_inter_block8( | ||
| 40747 | 40751 | ref_order_hints[(ref0 - LAST_FRAME) as usize], |
| 40748 | 40752 | ref_order_hints[(ref1 - LAST_FRAME) as usize], |
| 40749 | 40753 | ); |
| 40754 | + crate::msac::SymbolDecoder::set_symr_cdf("compound_idx"); | |
| 40750 | 40755 | let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]); |
| 40751 | 40756 | if idx == 1 { |
| 40752 | 40757 | (8, 8, 1u8) |
| @@ -41498,6 +41503,7 @@ ss_y(fctx), | ||
| 41498 | 41503 | let mut interintra_mode: Option<u8> = None; |
| 41499 | 41504 | let mut wedge_mask: Option<(&'static [u8], usize)> = None; |
| 41500 | 41505 | if enable_interintra_compound && !skip_mode { |
| 41506 | + crate::msac::SymbolDecoder::set_symr_cdf("interintra"); | |
| 41501 | 41507 | let interintra = dec.symbol(&mut cdfs.interintra[SIZE_GROUP_8]) == 1; |
| 41502 | 41508 | if interintra { |
| 41503 | 41509 | // lane-interintra r1: same read pair as the 16/32 site; |
crates/ec-av1/src/msac.rsmodified+12 -1
| @@ -335,6 +335,12 @@ thread_local! { | ||
| 335 | 335 | /// the inter path; without a phase its reads are unattributable. |
| 336 | 336 | pub(crate) static SYMR_PHASE: std::cell::Cell<&'static str> = |
| 337 | 337 | const { std::cell::Cell::new("") }; |
| 338 | + /// The CDF TABLE NAME for the read about to be made, mirroring the | |
| 339 | + /// oracle's `ec_symr_cdf_tag`. `cdf0` alone cannot identify a table -- | |
| 340 | + /// two rows can share a first entry -- so this is what turns "two | |
| 341 | + /// 2-symbol reads" into a named pair. | |
| 342 | + pub(crate) static SYMR_CDF: std::cell::Cell<&'static str> = | |
| 343 | + const { std::cell::Cell::new("") }; | |
| 338 | 344 | } |
| 339 | 345 | |
| 340 | 346 | impl<'a> SymbolDecoder<'a> { |
| @@ -413,6 +419,10 @@ impl<'a> SymbolDecoder<'a> { | ||
| 413 | 419 | |
| 414 | 420 | /// `decode_symbol` (spec 8.2.6), with the adaptation of 8.3.2. |
| 415 | 421 | /// |
| 422 | + pub(crate) fn set_symr_cdf(t: &'static str) { | |
| 423 | + SYMR_CDF.with(|c| c.set(t)); | |
| 424 | + } | |
| 425 | + | |
| 416 | 426 | pub(crate) fn set_symr_phase(p: &'static str) { |
| 417 | 427 | SYMR_PHASE.with(|c| c.set(p)); |
| 418 | 428 | } |
| @@ -455,7 +465,8 @@ impl<'a> SymbolDecoder<'a> { | ||
| 455 | 465 | } |
| 456 | 466 | if symr { |
| 457 | 467 | eprintln!( |
| 458 | - "EC_SYMR ph={} mi=({},{}) pre=({},{},{}) cdf0={} n={} s={} post_rng={}", | |
| 468 | + "EC_SYMR ph={} cdf={} mi=({},{}) pre=({},{},{}) cdf0={} n={} s={} post_rng={}", | |
| 469 | + SYMR_PHASE.with(std::cell::Cell::get), | |
| 459 | 470 | SYMR_PHASE.with(std::cell::Cell::get), |
| 460 | 471 | SYMR_MI.with(std::cell::Cell::get).0, |
| 461 | 472 | SYMR_MI.with(std::cell::Cell::get).1, |