Skip to main content

Crate rusty_h264_encoder

Crate rusty_h264_encoder 

Source
Expand description

Pure-Rust H.264 (Constrained Baseline) encoder.

Status: all-intra, I_16x16 DC-predicted macroblocks with the full transform → quantization → CAVLC pipeline. The Annex-B output is bit-exactly decodable by reference decoders (verified against ffmpeg). Richer intra modes (I_4x4), inter prediction, and the in-loop deblocking filter (currently signalled disabled) are layered in by later generations behind this API.

use rusty_h264_encoder::{Encoder, EncoderConfig};
use rusty_h264_common::YuvFrame;

let cfg = EncoderConfig::new(16, 16);
let mut enc = Encoder::new(cfg).unwrap();
let frame = YuvFrame::black(16, 16);
let bitstream = enc.encode(&frame); // Annex-B bytes for one access unit
assert!(!bitstream.is_empty());

Structs§

Encoder
A Constrained Baseline H.264 encoder.
EncoderConfig
Configuration for an crate::Encoder.
Pps
Picture parameter set for a CAVLC, single-slice-group CBP encoder.
RateControl
Frame-level average-bitrate controller.
Sps
Sequence parameter set, carrying only the fields a CBP encoder emits.

Enums§

EncodeError
Errors that can arise constructing or driving the encoder.
Preset
Speed/quality trade-off, in the spirit of x264’s -preset. The bitstream is valid (and decodes bit-exactly) either way; only the encoder’s effort differs.