edith_codecs
Clone
0 watching0 forksRust370.3 MiB00c1b3fTahinli2 months ago1999 commits
VERDICT: GREEN — decode_inter_block/decode_inter_block8's intra-sub-block branches now consume PALETTE_Y_MODE/PALETTE_UV_MODE the same way read_intra_mode does for key frames; stream.rs:169's frame_type != Key && allow_screen_content_tools whole-frame refusal is removed entirely; 231/0 lib suite unchanged.
What landed (commit daa6934, on top of merged lane-screen r1 at 42af470)
libaom's inter-frame intra-sub-block reader is read_intra_block_mode_info
(decodemv.c:1065-1107) — confirmed by reading it directly, NOT the
key-frame read_intra_frame_mode_info the charter warned might not
transfer. Two findings that changed scope from what the charter assumed:
- Its
mbmi->moderead already usesec_ctx->y_mode_cdf[size_group_lookup[bsize]], neverkf_y_mode_cdf— and this decoder'sdecode_inter_block/decode_inter_block8intra branches already readcdfs.y_mode[size_group]/cdfs.y_mode[SIZE_GROUP_8]respectively (pre-existing code, unrelated to this lane). No CDF-selection bug to fix here. read_intra_block_mode_infohas nouse_intrabccall at all.av1_read_mode_infodispatchesuse_intrabc = 0then branches onframe_is_intra_only(cm): only that branch callsread_intra_frame_mode_info(which readsuse_intrabc); the inter-frame branch callsread_inter_frame_mode_info→read_intra_block_mode_infofor an intra sub-block, with no intrabc symbol at all — it's an intra-frame-only bit by spec construction, not something this decoder was ever missing here. So this round's whole job collapsed to palette only.
What was added, mirroring read_intra_mode's existing r1 wiring exactly
(same av1_allow_palette gate reused via the existing palette_bsize_ctx
helper, same palette_mode_ctx/palette_uv_mode_ctx hardcoded-0
corner-cut — still safe, unchanged reasoning):
decode_inter_block's square-intra branch: afteruv_mode/alphaare read (same pointread_palette_mode_infosits at in libaom, right afterxd->cfl.store_y), readspalette_y_mode[bsize_ctx][0]whenmode == DC_PREDandpalette_uv_mode[0]whenuv_mode == DC_PRED, refusing by name on either firing nonzero.decode_inter_block8's 8x8-leaf intra branch: same two reads,bsize_ctxfixed at 0 (BLOCK_8X8is alwaysav1_allow_palette-eligible; the leaf's own existing refusal already forcesuv_mode == DC_PRED, so the UV read is unconditional there, matching libaom's own always-true gate for this shape).- Both functions gained a trailing
allow_screen_content_tools: boolparam;decode_inter_frame_tile_with_cdfsgained the same param, threaded to all 19decode_inter_blockand 1decode_inter_block8call sites (the publicdecode_inter_frame_tilewrapper and one test call site passfalse, matching the existing key-frame wrapper convention). stream.rs's production call passesheader.allow_screen_content_tools.stream.rs:169's remainingframe_type != Key && allow_screen_content_toolsrefusal is deleted (comment left explaining why no whole-frame refusal is needed anymore — genuine palette use still refuses deeper in the block readers, same as key frames). Thedelta.q_present || delta.lf_presentrefusal on the lines below is untouched, per charter.
No new CDF tables — palette_y_mode/palette_uv_mode/palette_y_size/
palette_uv_size already exist and were already 4-site-wired in r1
(reset2/reset3 length-generic, save/restore whole-struct, defaults
checked then). This round only reused them from a second call site.
Rect intra strips inside a screen-content frame still refuse by name ("a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)") — untouched, per charter.
Verification
cargo check -p ec-av1 --lib --tests: clean (pre-existing warnings only).
cargo test -p ec-av1 --release --lib: 231 passed, 0 failed, 17 ignored
— identical to the pre-change baseline; the bit is clear on every existing
stream, so the new palette reads are unreached (inert) for all of them.
allow_screen_content_tools refusal count, before (commit 42af470) vs after
(daa6934), same seed range, same test:
a_real_aomenc_stream_with_ab_partitions_decodes_pixel_exact: before 6/40 refusing specifically on"a non-key frame with allow_screen_content_tools set"(34 named refusals total, 6 pixel-exact matches, partab_hits=3) → after 0/40 on that string (31 named refusals — same partition/rect-transform/ rect-screen-content-strip reasons as before minus the 6 whole-frame ones, 9 pixel-exact matches, partab_hits=5).a_real_aomenc_stream_with_interintra_wedge_decodes_pixel_exact: 0/40 on that string both before and after in this fixed-seed run — every refusal here is"more than one concurrently active ROTZOOM/AFFINE global-motion ref slot"(unrelated, pre-existing gap), 20/40 pixel-exact both times (wii_hits 8-9, consistent with the documented aomenc-RD-nondeterminism attempt-selection class). The charter's "9 of 40" estimate for this gate did not reproduce in this measurement — noted rather than silently dropped; the AB-partitions gate is the one that actually carried this refusal in both rounds.
What still refuses
- Genuine palette use (nonzero
palette_size) or genuine intrabc use, on any frame type — reconstruction is out of scope, by design (spec-correct named refusal, not a desync). - A HORZ/VERT (rect) intra strip in a screen-content frame — the square-only
palette_bsize_ctxdoesn't cover rect strips; unchanged from r1. SMOOTH_PRED/PAETH_PREDchroma, directional chroma on the general intra-in-inter path, non-angle-zero deltas,mode >= 13— all pre-existing, unrelated round-2 gaps this lane didn't touch.