forge
Explore
Log in

Don't you dare go Hollow

A recorded inter write carries its own transform unit, not the block

Browse files at this commit

89f1aa33d7d11ee3e7750257fa49bf9bb8cad8e7Ahmet Kaan GümüşParent: c027c27
  • perf
    • a recorded inter write carries its own transform unit, not the block
Show full message
perf(av1): a recorded inter write carries its own transform unit, not the block

reconstruct_mc_rect reads exactly rows 0..h and columns 0..w of the two
buffers, so recording the whole block prediction copied 64*64 samples on
the parsing thread for a 4x4 unit. The record now holds that window
densely at stride w, and the deferred residual is produced dense to match
(TxParams::stride = 0) -- the same numbers in the same places.

Byte-exact at recon 4 on all four probe inputs.
crates/ec-av1/src/decode.rsmodified+13 -1
@@ -2647,8 +2647,20 @@ fn push_mc_rect_tx(
2647 inline_mc(plane, x, y, stride, w, h, prediction, &tx.run(grid), fctx);2647 inline_mc(plane, x, y, stride, w, h, prediction, &tx.run(grid), fctx);
2648 return;2648 return;
2649 }2649 }
2650+ // `reconstruct_mc_rect` reads exactly rows `0..h`, columns `0..w` of the
2651+ // two buffers at `stride`, so the record carries that window densely
2652+ // rather than the whole block's prediction: a 4x4 unit of a 64x64 block
2653+ // copied 64*64 samples on the PARSING thread before. The residual is then
2654+ // produced dense too (`TxParams::stride = 0`), which is the same numbers
2655+ // in the same places at stride `w`.
2656+ let mut window = Vec::with_capacity(w * h);
2657+ for row in 0..h {
2658+ window.extend_from_slice(&prediction[row * stride..][..w]);
2659+ }
2660+ let mut tx = tx;
2661+ tx.stride = 0;
2650 push_op(fctx, ReconOp::Mc {2662 push_op(fctx, ReconOp::Mc {
2651- plane, x, y, stride, w, h, prediction: prediction.to_vec(),2663+ plane, x, y, stride: w, w, h, prediction: window,
2652 residual: Residual::Coeffs(tx, grid.to_vec()),2664 residual: Residual::Coeffs(tx, grid.to_vec()),
2653 });2665 });
2654 }2666 }