edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-kf900 r4 HANDOFF
Tip 12c3c7c on lane-kf900 (parent 08c9a35). Full detail in
lanes/kf900-r4.report.md. The work is DONE and committed; the only open item is the
suite, which was still running at the turn cap.
1. Suite state -- INCOMPLETE, ZERO FAILURES SO FAR
Unit kf900-suite-r4-1788330592.service, log $HOME/.cache/kf900-suite-r4.log.
At the cap: 245 ok, 0 FAILED, no test result line yet (r3's baseline was
383 passed; 0 failed; 33 ignored in 1029 s; this run is slower because 10 lanes share
the box). Resolve the unit with systemctl --user list-units --all | grep kf900 before
believing it finished, then
grep -E "^test result|FAILED" $HOME/.cache/kf900-suite-r4.log.
Expect 384 passed (383 + the new gate). If something is RED, the behavioural changes on
this commit are only: rect-strip palette reconstruction, the chroma palette map size, the
palette cache mi keying, and record_strip_palette -- so look at the four existing
palette gates first (a_real_aomenc_stream_with_palette_y_..., ..._palette_uv_...,
..._rect_palette_..., a_real_aomenc_multi_tile_palette_stream_...).
2. The patch that shipped (all sites are current crates/ec-av1/src/decode.rs)
Grep the symbol, not the line number -- the file moved by ~300 lines.
| hook | site | what |
|---|---|---|
| palette mode ctx + Y colour cache | decode_block_rect4 (32x8/8x32), just after modes_above_left_mi |
let pal_at = (mi_r / (SUB / MI), mi_c / (SUB / MI)); neighbours.palette_ctx_and_cache_mi(pal_at, mi_r) -> passed as Some((palette_ctx, &palette_cache)) where None used to go |
| UV colour cache | same | neighbours.palette_uv_cache_mi(pal_at, mi_r) replaces &[] |
| same two | decode_rect4_16 (16x4/4x16), inside the 4-strip loop, at16 + lmi.0 |
per strip, not per cell |
| same two | decode_leaf_rect (16x8/8x16) |
already had the ctx/cache; switched to the _mi variants with leaf_mi.0 |
| palette_size ctx | palette_bsize_ctx_wh -- UNCHANGED, already correct |
num_pels_log2_lookup[bsize] - 6; 0 for BLOCK_16X4/4X16 (64 px), 2 for BLOCK_32X8 |
| colours | read_palette_colors_y / _uv -- UNCHANGED (r3 fixed the bit depth) |
|
| colour index map read point | read_intra_mode_rect, after use_filter_intra -- UNCHANGED |
av1_visit_palette order: Y map then chroma map, both AFTER all mode info |
| colour index map SIZE (fixed) | read_intra_mode_rect, the palette_uv_pending.map(..) closure |
((bw / 2).max(4), (bh / 2).max(4)), was (bw / 2, bh / 2) |
| chroma on the odd strip | decode_rect4_16's has_chroma (i % 2 == 1) -- UNCHANGED gating; the pair's 8x4/4x8 chroma now gets set_palette_pred per plane in both the skip and the coded arm |
|
| reconstruction | all three fns | palette_y_buf / palette_uv_bufs (index map through the base colours) handed to each reconstruct_rect via set_palette_pred; the split-tx walks slice the block buffer per transform unit (RectStripModes.palette_y in decode_rect_split, an inline window in decode_rect4_16) |
| neighbour state | new free fn record_strip_palette |
split axis only until the closing strip (mi_r % 8 == 6 / mi_c % 8 == 6 for 32x8/8x32, i == 3 for 16x4/4x16, leaf_mi.0 % 4 == 2 for 16x8/8x16) |
| counter | RECT4_PALETTE_HITS / pub(crate) fn rect4_palette_hits() |
rect strips that ACTUALLY use a palette |
libaom cited: decodemv.c read_palette_mode_info (av1_allow_palette -- sb_type >= BLOCK_8X8 is an ENUM-INDEX test that BLOCK_4X16/16X4 pass; av1_get_palette_bsize_ctx;
av1_get_palette_mode_ctx), read_palette_colors_y decodemv.c:478,
read_palette_colors_uv :509, pred_common.c:73 av1_get_palette_cache (SB-top-row
guard at :76, row = -xd->mb_to_top_edge >> 3 = the block's PIXEL row, hence
mi_r % 16 != 0), decodeframe.c decode_color_map_tokens reached from
av1_visit_palette, and ss_size_lookup (BLOCK_16X4 -> BLOCK_8X4, BLOCK_4X16 ->
BLOCK_4X8) for the chroma map size.
3. Refusals dropped (both from decode.rs and refusal_inventory.rs, 47 -> 45)
a 1:4 rect strip that actually uses a palette (reconstruction is not ported at this shape)a palette block on a HORZ/VERT intra strip below 16x16 (reconstruction not ported)
gate_coverage.rs needed no change (it pins aomenc FLAGS, and
enable-palette / enable-1to4-partitions were already in its list).
4. Gate
crates/ec-av1/src/stream.rs::a_real_aomenc_rect_strip_palette_decodes_pixel_exact.
Base recipe (arm 0 = the r3 pin): --codec=av1 --bit-depth=N --input-bit-depth=N --passes=1 --end-usage=q --cq-level=59 --cpu-used=0 --lag-in-frames=0 --kf-max-dist=1 --limit=1 --threads=1 --tile-columns=0 --enable-tx-size-search=1 --min-partition-size=8 --enable-rect-partitions=1 on testsrc2=s=256x192:r=25, y4m over stdin, -t 0.2.
Arms 1-2 append --tune-content=screen --enable-palette=1 --enable-1to4-partitions=1 --min-partition-size=8 (testsrc2 / smptebars=size=256x192:rate=25). 8-bit arms append
--sb-size=64 (the 8-bit twin otherwise lands on the open 128-root HORZ refusal).
cargo test -p ec-av1 --lib a_real_aomenc_rect_strip_palette_decodes_pixel_exact -- --nocapture
-> 1 passed: 2 attempt(s) with a rect-strip palette block, 0 out of scope (0 mismatched), 4 refused, 2 frames compared, fired 8-bit=0 10-bit=2.
5. Measured facts
- The test's own 10-bit arm-0 encode reproduces the pin BYTE FOR BYTE:
md5
e5f033d8fe34e4418d8cca3ac9d2b595. - That stream went
REFUSED: ... a 1:4 rect strip that actually uses a palette->OK: 1 frames decoded, 256x192;rect4_32wenthorz=8 vert=0 coded=8->horz=12 vert=16 coded=28. - The charter/r3 premise that this stream fires
skip_split_txis WRONG: decoded in full,decode_probeprintsskip_split_tx: 0. The gate asserts the palette counter. - 64x16/16x64 needed nothing:
decode_block_rect64already passes the real ctx/cache and reconstructs; its remaining palette refusal is the separate corner-cropped-luma one. - No 8-bit recipe reaches a rect-strip palette. At 8 bit aomenc palettes SQUARE
blocks; every 8-bit variant tried lands on
a block that actually uses a palette (Y)(8x8 square leaf) ora palette block with a real transform on a superblock-level HORZ/VERT strip. Lifting either unblocks 8-bit coverage of this shape. - NEW pre-existing 8-bit 1:4 mismatch, not palette -- 8-bit
testsrc2=s=256x192:r=25, base recipe +--tune-content=screen --enable-palette=1 --enable-1to4-partitions=1 --max-partition-size=32 --sb-size=64: decodesOK,rect4_32: horz=8 vert=8 coded=16, frame 0 differs from ffmpeg. The stream reads ZERO palette symbols (EC_AV1_TRACE=1 decode_probe | grep -c "^EC_PAL "== 0), so every change in this commit is inert on it. Needs its own lane.
6. EXACT NEXT STEP
- Read the suite result (above). If green, merge
12c3c7cinto main. - Then, in order: (a) the new 8-bit 1:4 non-palette mismatch in 5; (b) palette on an 8x8
SQUARE leaf (
decode_leaf8discards_palette_y), which is what blocks 8-bit rect-strip coverage; (c) palette + real transform on a 64x32/32x64 SB-level strip.