forge
Explore
Log in

Don't you dare go Hollow

An intra transform unit no longer clones its coefficient grid

Browse files at this commit

ad3e7b0591384eb0d785e8296b947c5c1930b54dAhmet Kaan GümüşParent: 8a8b3ca
  • perf
    • an intra transform unit no longer clones its coefficient grid
Show full message
perf(av1): an intra transform unit no longer clones its coefficient grid

read_plane returned residual_grid_placeholder(&levels, side) -- a to_vec of
the whole coded grid -- on the tx_side == side arm, and the levels Vec
itself on the other; both arms are the same value, so the copy was pure
waste per intra transform unit. Byte-exact: 12/12 gate hashes at 1/4/16
threads.

instructions:u on the 4K segment: 396.613 G -> 396.536 G at 1 thread,
401.464 G -> 401.371 G at (16,4,2) (the copy itself is memmove traffic
instructions:u barely sees).
crates/ec-av1/src/decode.rsmodified+6 -13
@@ -13416,19 +13416,12 @@ fn read_plane(
1341613416 filter_intra,
1341713417 smooth_neighbor, fctx,
1341813418 );
13419- Ok(if tx_side == side {
13420- residual_grid_placeholder(&levels, side)
13421- } else {
13422- levels
13423- })
13424-}
13425-
13426-/// `record`'s neighbour state only reads whether *the coded grid* (not the
13427-/// residual) has nonzero entries, so the levels this function already built
13428-/// are what it wants back; this helper exists only to name that clearly at
13429-/// the one call site where `tx_side == side`.
13430-fn residual_grid_placeholder(levels: &[i32], _tx_side: usize) -> Vec<i32> {
13431- levels.to_vec()
13419+ // `record`'s neighbour state only reads whether *the coded grid* (not the
13420+ // residual) has nonzero entries, so the levels this function already
13421+ // built are what it wants back -- both arms of the old `tx_side == side`
13422+ // branch returned exactly that, one of them through a full `to_vec` copy
13423+ // of the grid per intra transform unit (lane-coefbuf).
13424+ Ok(levels)
1343213425 }
1343313426
1343413427 /// Decodes one whole-block coded superblock/quadrant/leaf: its mode, then its