A recorded inter write carries its own transform unit, not the block
Browse files at this commit89f1aa33d7d11ee3e7750257fa49bf9bb8cad8e7Parent: c027c27- perf
- a recorded inter write carries its own transform unit, not the block
1 changed file +13 -1
- crates/ec-av1/src/decode.rs +13 -1
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 | } |