Skip to main content

Module software

Module software 

Source
Expand description

CPU-based striped H.264 (libx264 or OpenH264, by build) / JPEG encoder with per-stripe change detection. CPU-based striped encoder: H.264 through the build’s software encoder — libx264 with the gpl feature, Cisco OpenH264 without it (SOFTWARE_H264_ENCODER) — and turbojpeg for JPEG.

Frames are split into horizontal stripes processed in parallel via rayon. Each stripe is independently hashed against the previous frame for change detection, and only dirty stripes are encoded. The H.264 path maintains per-stripe encoder state across frames for inter-prediction, and both libraries emit the same per-stripe wire framing; the JPEG path is stateless.

Structs§

EncodedStripe
One encoded stripe: the compressed bytes plus geometry and identity metadata.
H264EncoderWrapper
One long-lived libx264 session for a stripe, holding the raw x264_t handle alongside a mirror of its live parameters so the encoder can be retuned per frame instead of rebuilt.
StripeState
Everything one horizontal stripe must remember between frames: its reused buffers, its own live encoder, and the motion / paint-over / damage bookkeeping that drives its send decision.

Constants§

MAX_STRIPE_CAPACITY
Upper bound on the horizontal stripes the CPU encoder splits a frame into, so the persistent per-stripe state vector can be reserved to a fixed capacity once, up front.

Functions§

encode_cpu
stripe_count
How many horizontal stripes a frame of height is split into, which is the choice of how much encode parallelism to spend on it.