Expand description
Block-rate audio ops at f32. See crate::ops64 for the
f64 mirror.
Two implementations per op when wide-backend is enabled:
a scalar fallback (the *_scalar variant, also the body when
the feature is off) and a vector path that processes f32x8
chunks. The scalar variants are kept pub so the Criterion
benches can compare pre-/post-vectorization on exactly the
same operation.
Functions§
- abs_
max_ block max(buf[i].abs()). Returns0.0for an empty slice; returnsf32::NANon first NaN (so meters can flag a runaway plugin instead of silently reporting in-range peaks).- copy_
block out[i] = src[i]. Equivalent tocopy_from_slicebut exposed in the same surface as the other ops for code that wires up its inner loops from this module.- gain_
block buf[i] *= gainfor every element. Vectorized whenwide-backendis on, otherwise identical to the scalar path.- gain_
block_ scalar buf[i] *= gainfor every element. Scalar.- mac_
block out[i] += src[i] * scale. Vectorized whenwide-backendis on.- mac_
block_ scalar - Multiply-accumulate:
out[i] += src[i] * scale. Scalar. - mix_
block out[i] = a[i] * gain_a + b[i] * gain_b. Vectorized whenwide-backendis on.- mix_
block_ scalar out[i] = a[i] * gain_a + b[i] * gain_b. Scalar.- mul_
block out[i] = a[i] * b[i]. Vectorized whenwide-backendis on.- mul_
block_ scalar out[i] = a[i] * b[i](length:min(out, a, b)). Scalar.- scale_
block out[i] = src[i] * scale. Vectorized whenwide-backendis on.- scale_
block_ scalar out[i] = src[i] * scale(length:min(out, src)). Scalar. The non-aliased counterpart togain_block- fills the “copy then gain” hole in the API so a single line covers what would otherwise need two calls and a discarded intermediate.- zero_
block out[i] = 0.0for alli.