1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Converts between VapourSynth's strided plane buffers and the tightly
//! packed rows core's converters accept, plus the frame window core
//! windowed algorithms request around each output frame.
/// Copies `src`, a plane with row stride `stride` bytes, into a new
/// tightly packed buffer of `width_bytes * height` bytes.
///
/// `width_bytes` is `width * bytes_per_sample`, not a pixel count, so
/// this works the same at any bit depth. Passing a pixel count here
/// packs the wrong number of bytes per row.
/// Writes a tightly packed plane, `src`, back into `dst`, a strided
/// buffer with row stride `stride` bytes. The reverse of [`pack_plane`].
///
/// `width_bytes` is `width * bytes_per_sample`, not a pixel count, so
/// this works the same at any bit depth. `dst`'s padding bytes, if any,
/// are left untouched.
/// The `behind + 1 + ahead` source frame indices for the window around
/// output frame `n`, `behind` older and `ahead` newer, clamped so
/// nothing runs off either end of a clip whose last valid index is
/// `last_frame`.
///
/// `behind` and `ahead` come from the denoiser's own
/// [`av_denoise_core::PlanarDenoiser::window_span`], so this stays
/// correct for whichever algorithm the denoiser is running rather than
/// assuming every algorithm needs the same symmetric window.
///
/// Frame requests and window builds both call this, so the two always
/// agree on which frames a window at `n` pulls in.