forge
Explore
Log in

Don't you dare go Hollow

The 128 residual arm's parking comment closes its filter bug and the native gate prints the arm's residual fires -- bars 2160p re-measures three-way exact through the cdef owner map, long-GOP BD -0.1/+0.1 and 12-frame rows within 0.1 at 0.7-1.9 writer fires/frame, so EC_AV1_B128RES stays off

Browse files at this commit

2ed5165b574012e5ce0ee831f0fd9c476255c78dAhmet Kaan GümüşParent: 4b37b0c
  • fix
    • the 128 residual arm's parking comment closes its filter bug and the native gate prints the arm's residual fires -- bars 2160p re-measures three-way exact through the cdef owner map, long-GOP BD -0.1/+0.1 and 12-frame rows within 0.1 at 0.7-1.9 writer fires/frame, so EC_AV1_B128RES stays off
    • the pan residual witness re-vitalizes at q=60 after lane-rectdq's delta_q pricing made the forced root lose every partition
Show full message
fix(av1): the 128 residual arm's parking comment closes its filter bug and the native gate prints the arm's residual fires -- bars 2160p re-measures three-way exact through the cdef owner map, long-GOP BD -0.1/+0.1 and 12-frame rows within 0.1 at 0.7-1.9 writer fires/frame, so EC_AV1_B128RES stays off; the pan residual witness re-vitalizes at q=60 after lane-rectdq's delta_q pricing made the forced root lose every partition
crates/ec-av1/src/encode.rsmodified+30 -17
@@ -738,22 +738,23 @@ fn b128_root() -> bool {
738738 /// pair per 64x64 mu chunk, var-tx depth 0 (the shape
739739 /// [`crate::tile::write_inter_block_128`] codes and `decode_inter_block`
740740 /// reads). Written, witnessed and byte-exact through both decoders, and
741-/// **off by default** (`EC_AV1_B128RES=1` turns it on) for two measured
742-/// reasons:
741+/// **off by default** (`EC_AV1_B128RES=1` turns it on) because it is INERT
742+/// on content: the RD takes it 0.7-1.9 times per frame against thousands of
743+/// whole 128 roots (lane-b128res census, native 12-frame gate, every clip),
744+/// and the BD effect is inside the noise on both gates -- long-GOP films
745+/// -0.1/+0.1 and all five 12-frame rows within 0.1 of the off default.
743746 ///
744-/// * it is INERT on content: over the native 12-frame gate the RD takes it
745-/// 0-2 times per frame against ~90 whole 128 roots, so the BD effect is
746-/// inside the noise either way;
747-/// * with it on, `bd_rate_screen_native`'s bars 2160p row q=90 frame 11
748-/// reads 8 luma samples (rows 126..127, cols 1611..1616 -- the two rows
749-/// above a 128-superblock horizontal edge) where ffmpeg and this
750-/// encoder's own reconstruction disagree. The residual arm's own witness
751-/// clip is byte-exact through ffmpeg over 420 forced blocks at 1280x768,
752-/// so the open half is a FILTER-stage interaction (deblock/CDEF at a 128
753-/// block's own edge), not the coefficient path.
754-///
755-/// An inert candidate does not buy a live filter mismatch, so the default
756-/// stays off until that is root-caused; the knob is the gate for it.
747+/// The historical reason for the parking is CLOSED: the bars 2160p q=90
748+/// frame 11 disagreement with ffmpeg (8 luma samples at the rows above a
749+/// 128-superblock horizontal edge) was the CDEF search pricing a preset per
750+/// 64x64 unit under a root that codes ONE literal for all four -- lane-
751+/// edge128's `crate::tile::cdef_unit_owner` collapses the four to the one
752+/// the decoder derives, and on this HEAD the same row re-measures three-way
753+/// EXACT (encoder reconstruction == ffmpeg == `decode_stream`, every frame,
754+/// every plane, both gates). The knob stays as the arm's gate, not as a
755+/// defect flag; the residual arm is also what
756+/// [`crate::tile::write_inter_block_128_rect`]'s skip-only halves would
757+/// share if they ever carry one.
757758 fn b128_residual() -> bool {
758759 static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| {
759760 crate::envflags::var("EC_AV1_B128RES").ok().map(|v| v != "0")
@@ -17095,6 +17096,15 @@ mod tests {
1709517096 /// `skip = true` for a block that carries a residual -- the next root's
1709617097 /// `skip` symbol then took CDF row 1 where the reader takes row 0.
1709717098 ///
17099+ /// lane-b128res: the fixture's q moved 150 -> 60. The forced arm replaces
17100+ /// the skip arm's cost unconditionally (that is what makes the writer see
17101+ /// the residual), and the cost model moved under it since lane-b128r --
17102+ /// lane-rectdq made every non-skipped root pay its delta_q group and the
17103+ /// pyramid re-prices the leaves -- so at q=150, then q=90, the NONE root
17104+ /// lost its partition at ALL 420 roots and the writer coded none. q=60
17105+ /// puts 52 written blocks back on this clip; the `coded > 0` assert below
17106+ /// is the guard that catches the next such drift.
17107+ ///
1709817108 /// cargo test -p ec-av1 --release --lib -- --ignored \
1709917109 /// a_128_root_block_with_a_real_residual --nocapture
1710017110 #[test]
@@ -17125,7 +17135,7 @@ mod tests {
1712517135 let _ = take_b128_residual_hits();
1712617136 let _ = crate::tile::take_sb128_residual_hits();
1712717137 force_b128_residual(true);
17128- let encoded = encode_sequence(&pictures, 150, 0.5).unwrap();
17138+ let encoded = encode_sequence(&pictures, 60, 0.5).unwrap();
1712917139 let (won, coded) =
1713017140 (take_b128_residual_hits(), crate::tile::take_sb128_residual_hits());
1713117141 eprintln!("128x128 blocks WITH a residual: search won {won}, writer coded {coded}");
@@ -20239,9 +20249,12 @@ mod tests {
2023920249 100.0 * i64_whole as f64 / i64_offered.max(1) as f64,
2024020250 );
2024120251 eprintln!(
20242- "{name}: 128x128 roots {} (search) / {} (writer)",
20252+ "{name}: 128x128 roots {} (search) / {} (writer), with a residual \
20253+ {} (search) / {} (writer)",
2024320254 take_b128_none_hits(),
2024420255 crate::tile::take_sb128_none_hits(),
20256+ take_b128_residual_hits(),
20257+ crate::tile::take_sb128_residual_hits(),
2024520258 );
2024620259 eprintln!(
2024720260 "{name}: 64x64 roots {} (with a residual {}, split luma {}, compound {})",