forge
Explore
Log in

Don't you dare go Hollow

ec-av1: fix the transposed 4:2:0 odd-dimension figures in the gap note

Browse files at this commit

49b9fe2de2cfba86549a8873008681959bc1d3cbAhmet Kaan GümüşParent: ce4a898
Second re-review pass, doc and report only, no behaviour change.

The previous commit reported the under-declaration count as 12160 of the
16256 pairs with w >= 2 (and a phantom 12288 of 16384). The figures are
transposed: running every 4:2:0 count over the 1..=128 square through the
shipping helper, 12160 of the **16384** pairs under-declare, 12033 of them
with w >= 2, and 127 in the w == 1 column (at 1x1 the 4:4:4 arm catches
the count and (1, 1) is exact). The phantom 12288 is deleted.

Also stated explicitly: under-declaration at h == 1 is zero over the whole
square -- there the 4:2:0 count equals the 4:2:2 count, routes into the
4:2:2 arm, and lands on the correct (round_ss(w, 1), 1). h == 1 belongs
to the parent-difference sentence alone, not to the under-declaration one.

And the code doc's absolute "byte-identical to what the two-way test
produced" is softened to "is what the two-way test produced" with the
h == 1 exception carried alongside, so it no longer contradicts the
report in the same commit.

`cargo check -p ec-av1 --all-targets`: 0 warnings, 0 errors.
crates/ec-av1/src/decode.rsmodified+16 -13
@@ -30425,20 +30425,23 @@ fn whole_plane(data: &[u16], width: usize, height: usize) -> PlaneBuf<'_> {
30425 /// 1-pixel chroma plane; the pinned fixture's chroma is 128x144.30425 /// 1-pixel chroma plane; the pinned fixture's chroma is 128x144.
30426 ///30426 ///
30427 /// **Open gap, 4:2:0 at odd dimensions (pre-existing).** The 4:2:0 arm is30427 /// **Open gap, 4:2:0 at odd dimensions (pre-existing).** The 4:2:0 arm is
30428-/// left at the old `(width / 2, height / 2)` floor, which is byte-identical30428+/// left at the old `(width / 2, height / 2)` floor, which is what the
30429-/// to what the two-way test this replaces produced -- that was the point,30429+/// two-way test this replaces produced -- that was the point, since no
30430-/// since no 4:2:0 stream changed shape. It is nevertheless the wrong shape30430+/// 4:2:0 stream changed shape. It is nevertheless the wrong shape for an
30431-/// for an odd-dimension 4:2:0 reference: the producer stored30431+/// odd-dimension 4:2:0 reference: the producer stored
30432 /// `round_ss(w, 1) x round_ss(h, 1)`, so the floor arm under-declares.30432 /// `round_ss(w, 1) x round_ss(h, 1)`, so the floor arm under-declares.
30433-/// Measured over the `1..=128` square: the floor under-declares in30433+/// Measured over the `1..=128` square, running each 4:2:0 count through
30434-/// 12160 of the 16256 pairs with `w >= 2` (12288 of all 16384, the extra30434+/// this very function: 12160 of the 16384 pairs come back smaller than the
30435-/// 128 being the `w == 1` column, where the arm declares a 0-wide plane).30435+/// plane actually holds, 12033 of those with `w >= 2` and 127 in the
30436-/// It is a *shape* error, not a misroute: a 4:2:0 count at `w == 1` and30436+/// `w == 1` column (at `w == 1, h == 1` the 4:4:4 arm catches the count
30437-/// `h >= 2` collides with neither the 4:4:4 nor the 4:2:2 count, so the30437+/// and `(1, 1)` is exact). Under-declaration at `h == 1` is **zero** over
30438-/// length test does put it in the right arm -- the floor fallback simply30438+/// the whole square: there the 4:2:0 count equals the 4:2:2 count, routes
30439-/// cannot express `(1, round_ss(h, 1))`. It is left alone because it30439+/// into the 4:2:2 arm, and lands on the correct
30440-/// predates this lane, is identical to the parent, and no in-tree coverage30440+/// `(round_ss(w, 1), 1)`. The `w == 1` residue is a *shape* error, not a
30441-/// exercises an odd-dimension 4:2:0 reference. A ceil fallback30441+/// misroute -- the floor fallback simply cannot express
30442+/// `(1, round_ss(h, 1))`. It is left alone because it predates this lane,
30443+/// is identical to the parent, and no in-tree coverage exercises an
30444+/// odd-dimension 4:2:0 reference. A ceil fallback
30442 /// (`(round_ss(w, 1), round_ss(h, 1))`) would close it, at the cost of30445 /// (`(round_ss(w, 1), round_ss(h, 1))`) would close it, at the cost of
30443 /// departing from the parent on every odd-dimension 4:2:0 shape with30446 /// departing from the parent on every odd-dimension 4:2:0 shape with
30444 /// nothing in the tree to justify the change; that call belongs to a lane30447 /// nothing in the tree to justify the change; that call belongs to a lane
lanes/av1422stripwrite.report.mdmodified+17 -13
@@ -148,19 +148,23 @@ REVERTED).
148 frame produces falls outside that (the pinned fixture's chroma is148 frame produces falls outside that (the pinned fixture's chroma is
149 128x144).149 128x144).
150 *4:2:0 at odd dimensions — an open, pre-existing gap, not a clean bill.*150 *4:2:0 at odd dimensions — an open, pre-existing gap, not a clean bill.*
151- The floor arm is byte-identical to the parent, but it is the wrong shape151+ The floor arm is what the parent produced, but it is the wrong shape for
152- for an odd-dimension 4:2:0 reference: the producer stored152+ an odd-dimension 4:2:0 reference: the producer stored
153- `round_ss(w, 1) x round_ss(h, 1)`, so the floor under-declares. Over the153+ `round_ss(w, 1) x round_ss(h, 1)`, so the floor under-declares. Running
154- `1..=128` square that is 12160 of the 16256 pairs with `w >= 2` (12288 of154+ every 4:2:0 count over the `1..=128` square through the shipping helper:
155- all 16384; the extra 128 are the `w == 1` column, where the arm declares155+ **12160 of the 16384 pairs** come back smaller than the plane holds —
156- a 0-wide plane), and it differs from the parent's floor at `h == 1` for156+ **12033** of them with `w >= 2` and **127** in the `w == 1` column (at
157- the 127 pairs with `w >= 2` — there only by *correcting* the parent,157+ `1x1` the 4:4:4 arm catches the count and `(1, 1)` is exact).
158- which claimed zero rows. At `w == 1` and `h >= 2` the 4:2:0 count158+ Under-declaration at `h == 1` is **zero**: there the 4:2:0 count equals
159- collides with neither other count, so the length test puts it in the159+ the 4:2:2 count, routes into the 4:2:2 arm and lands on the correct
160- right arm; the floor fallback simply cannot express160+ `(round_ss(w, 1), 1)`, which is also the one place the new arm departs
161- `(1, round_ss(h, 1))`. A ceil fallback would close the whole gap, at161+ from the parent's floor — for the 127 pairs with `w >= 2`, and there
162- the cost of departing from the parent on every odd-dimension 4:2:0162+ only by *correcting* the parent, which claimed zero rows. The `w == 1,
163- shape with no in-tree coverage to justify it. Recorded, not taken.163+ h >= 2` residue is a shape error, not a misroute: the floor fallback
164+ simply cannot express `(1, round_ss(h, 1))`. A ceil fallback would close
165+ the whole gap, at the cost of departing from the parent on every
166+ odd-dimension 4:2:0 shape with no in-tree coverage to justify it.
167+ Recorded, not taken.
164 *Gated:* `cargo test -p ec-av1 --lib -- lossless decodes_sample_exact168 *Gated:* `cargo test -p ec-av1 --lib -- lossless decodes_sample_exact
165 444 reference_chroma` in its own target dir169 444 reference_chroma` in its own target dir
166 `~/.cache/cargo-target-av1422stripwrite-gate` — see below for what that170 `~/.cache/cargo-target-av1422stripwrite-gate` — see below for what that