Skip to main content

Crate rusty_esp_dsp

Crate rusty_esp_dsp 

Source
Expand description

rusty_esp_dsp — ESP-DSP remade for the Janus family: the scalar kernel home.

Every function package in the family carries the hot loops it needs in its own -core, scalar. The moment two packages carry the same loop, or a loop is what a chip-side speedup would be spent on, it moves here — scalar first — and the PIE twin (ESP32-S3 ee.*, ESP32-P4 esp.*) is written against that scalar version, never against the caller. The scalar version never leaves the tree: it is the oracle every twin is gated against, byte for byte, on the host, in CI.

What is here, and where it came from (D0, 2026-09-02):

  • pixel: the packed conversions a camera pipeline needs (YUYV / RGB565 / RGB888 / Gray8) and the 2× box downscales, from rusty_esp_image-core.
  • sample: the i16 reductions (dot, sum of squares, peak, dBFS) from rusty_esp_audio-core, and sample::pcm, its sample-format conversion with swresample’s rules.
  • block: the H.264 block costs (SAD, 4×4 Hadamard, SATD) written scalar to match rusty_h264-common’s transform byte for byte.
  • int: the integer square root rusty_esp_signal-core’s CSI amplitude uses.
  • probe: the work counters both arms of a measurement report, and the ceiling probe that says whether a twin is worth building at all.
  • seam: one trait per kernel family with seam::Scalar as the default and the oracle; the twins in rusty_esp_dsp-esp implement the same traits and are gated against it by seam::twin_matches_scalar.

No allocator, no drivers, no product types, no FFT (nothing needs one yet), no neural-network ops (those are FFai’s). Borrowed slices in, borrowed slices out; sizes are checked and BufferTooSmall names the need.

Part of Janus (Remade With Rust). Plan: docs/plans/rusty_esp_dsp.md.

Re-exports§

pub use rusty_esp_core as esp_core;

Modules§

block
H.264 block costs, scalar: SAD over 4×4 / 8×8 / 16×16 luma blocks, the 4×4 Hadamard and the SATD built on it.
int
Integer helpers shared by the fixed-point paths.
pixel
Pixel kernels — scalar, bounds-checked, and the oracle for every faster twin.
prelude
The names a sketch or firmware wants in scope.
probe
The measurement discipline, as code: work counters both arms of a comparison report, and the ceiling probe that prices a kernel before it is written.
sample
Reductions over 16-bit PCM — the loops an AGC, a VAD or a level meter spends its time in — and, under pcm, sample-format conversion.
seam
The seam a PIE twin plugs into: one trait per kernel family, the scalar implementation as the default and the oracle, and nothing else.

Constants§

VERSION
Crate version, for capability manifests and logs.

Functions§

expect_len_pub
[expect_len] for the twin crate, which must reject a short buffer with the same error the oracle does or a “byte-identical” claim is only true for the inputs that succeed.