edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-tiles report
What landed
Groundwork only, commit 1231cd5 on branch lane-tiles:
crates/ec-av1/src/decode.rs
Neighboursgainedtile_row0_mi/tile_col0_mi(specMiRowStart/MiColStart), default0, andstart_tile(row0_mi, col0_mi, col1_mi)(specdecode_tile'sclear_above_contextover the tile's own column span; left-context reset per SB row was already unconditional and needed no change).- Every availability check that compared a raw mi position against literal
0now compares against the tile origin instead:skip_txfm_ctx,tx_size_context,tx_size_context_rect, anddecode_inter_block/decode_inter_block8'shas_above/has_left. - Behaviourally a no-op today: nothing calls
start_tile, so the origin stays(0, 0)everywhere and every existing test is bit-identical.
The refusal at crates/ec-av1/src/stream.rs:292-297 ("a frame with more
than one tile") is unchanged and still fires — it was not removed.
Why it stops here (turn budget)
Recon (charter + call-site tracing across decode.rs, mvstack.rs,
ec-av1-syntax/frame.rs's TileInfo/parse_tile_group) took the first
~35 tool calls to establish the real shape of the three hard parts. What
full removal of the refusal needs, none of which is done:
- Entropy per tile.
decode_key_frame_tile_with_cdfs/decode_inter_frame_tile_with_cdfseach take onedata: &[u8]and run oneSymbolDecoder/cdfsover the wholefor sb_r in 0..sb_rows { for sb_c in 0..sb_cols }walk. This needs restructuring into afor tile in &tilesouter loop: freshSymbolDecoderper tile's own byte range (Tile::offsetis relative to the OBU, already handled correctly in stream.rs for tile 0 today), freshcdfs = initial_cdfs.clone()per tile, sb range narrowed tomi_row_starts[t]/SB_MI..mi_row_starts[t+1]/ SB_MI(same for cols), and onlycontext_update_tile_id's own end-of-tilecdfsreturned as the frame's adapted table.TileInfoalready carries everything this needs (frame.rs:115); the derivation atframe.rs:1292confirmsmi_col_starts/mi_row_startsare always fully populated by the real parser, including thecols==rows==1case. - Context clipping — partially wired, NOT complete. This commit's
Neighbourschange covers the context-symbol reads it touched. Two things it does not cover:PlaneBuf::edges/edges_rect(decode.rs~2653-2696) still gate intra-prediction pixel reach onx > 0/y > 0— a block at a tile's own left/top edge would read real reconstructed pixels from the PREVIOUS tile (decoded earlier, sitting right there in the shared buffer) instead of treating them as unavailable, which is a real pixel-value bug per spec (AV1 tiles are independently decodable; intra prediction does not cross tile boundaries). Needs atile_x0/tile_y0pair onPlaneBuf(luma-pixel and chroma-pixel scaled, i.e.mi_col0*4/mi_col0*2), set before each tile, checked inedges/edges_rectin place of0.mvstack.rs'sfind_mv_stack_with_sign_bias(the actual MV neighbour scan for every inter block) still hardcodesmi_row > 0/mi_col > 0formax_row_offset/max_col_offsetandfound_above/found_left(its own doc comment at line ~690 already flags this: "clamped to the tile's near edge (single-tile-per-frame here, so that's just the frame edge at 0)").find_samples/num_proj_ref(decode.rs~5488/5617, warp-sample gathering forWARPED_CAUSAL) have the same gap. Neither was touched this round.- Deblock/CDEF were confirmed (not just assumed) to run across the
whole picture after all tiles decode (
apply_deblock/apply_cdefcalls sit after the SB loop, once, over the fully/u/v) — these need no tile clipping, matching the charter's note.
- Tile-group ordering. Not started.
ObuKind::Frame(header, tiles)'stiles: Vec<Tile>already spans every tile intg_start..tg_endfor a single OBU (parse_tile_group,ec-av1-syntax/src/frame.rs:1992), which covers the common--tile-columns/--tile-rowsaomenc case (oneOBU_FRAMEcarries every tile). The separate multi-OBU case (ObuKind::FrameHeaderfollowed by one or more standaloneObuKind::TileGroup(Vec<Tile>)OBUs) is not collected at all today —decode_stream'swhile pos < data.len()loop only matchesObuKind::Frame/FrameHeader(forshow_existing_frame) and silentlycontinues past everything else, including a bareTileGroupOBU.
No gate was added — the charter's mandatory gate asserts a tile-firing
counter > 1 on real decoded output, which requires part 1 (entropy per
tile) to exist first; writing the gate against the untouched refusal would
either be vacuous or fail immediately.
Remaining refusal strings (verbatim, unchanged)
"a frame with more than one tile (this decoder only ever decodes tile 0)"—stream.rs:294-296, still fires for everytile_info.cols > 1 || tile_info.rows > 1frame, intra or inter.
Verification
cargo test -p ec-av1 --lib (CARGO_TARGET_DIR=$HOME/.cache/cargo-target-tiles,
EC_AV1_REQUIRE_AOMENC=1): 232 passed, 0 failed, 17 ignored, 174.28s —
baseline unchanged, no regression from the groundwork commit.
Next lever (for whoever picks this up)
Land in the charter's own staged order, each its own commit:
- Restructure
decode_key_frame_tile_with_cdfsto accepttiles: &[(u32 /* tile_num */, &[u8])]+&TileInfoin place of a singledata: &[u8], wrap the existing SB double loop (currentlydecode.rslines ~4547 headerfor sb_r in 0..sb_rowsthrough its matching close ~4947) infor &(tile_num, bytes) in tiles, callneighbours.start_tile(...)(already written, unused) and setPlaneBuftile pixel origins (not yet added) at each tile's start, narrow the sb range, and capturecdfsas the returned table only whentile_num == tile_info.context_update_tile_id. Update the one caller (decode_key_frame_tile,decode.rs:4478) andstream.rs's key-frame branch to build the tile list instead oftiles.first(). Prove stage 1 (two tiles, column split, all-intra) before touching anything else. - Same restructuring for
decode_inter_frame_tile_with_cdfs, PLUS threadingtile_row0_mi/tile_col0_miintofind_mv_stack_with_sign_biasandfind_samples/num_proj_ref(both currently frame-relative-only). - Multi-tile-group OBU collection in
decode_stream's main loop (ObuKind::FrameHeader+ trailingObuKind::TileGroupaccumulation before dispatch, mirroring the existingpending: Option<FrameHeader>field already onAv1Parserinternally, though that field is private — check whether it's exposed or the collection has to happen indecode_streamitself against raw OBU events). context_update_tile_id != 0pin test once tables save correctly.- The mandatory gate:
--tile-columns=1 --tile-rows=1aomenc recipe (log2 values), thread-localTILE_HITScounter (not yet added) incremented once per tile actually decoded, hard-asserted> 1.