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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! # rusty_h264
//!
//! A ground-up, **pure-Rust** H.264 codec — a *Remade With Rust* rebuild of
//! Cisco's [openh264](https://github.com/cisco/openh264). Unlike the FFI
//! bindings in `openh264-rs`, there is no C in the dependency tree: the codec
//! core is `#![forbid(unsafe_code)]`, BSD-2 licensed, and embeddable anywhere.
//!
//! The **encoder** produces compressed Constrained Baseline streams (intra
//! `I_16x16`/`I_4x4`/`I_PCM`, inter P-frames with quarter-pel motion
//! compensation, in-loop deblocking, and rate control) that decode bit-exactly
//! under reference decoders. The **decoder** handles the full Constrained
//! Baseline subset and is validated bit-exact against Cisco's `h264dec`.
//!
//! This facade re-exports the encoder, decoder, and shared types so downstream
//! users depend on a single crate.
//!
//! ## Decoding a whole stream
//!
//! [`Decoder::decode_stream`] is the one-call entry point — it splits access
//! units, assembles multi-slice pictures, and returns frames in **display order**:
//!
//! ```
//! use rusty_h264::{Encoder, EncoderConfig, Decoder, YuvFrame};
//!
//! // Encode three frames. The default config carries a lookahead (mb-tree),
//! // so `encode()` may buffer — always `flush()` at end of stream.
//! let mut enc = Encoder::new(EncoderConfig::new(32, 32)).unwrap();
//! let mut stream = Vec::new();
//! for _ in 0..3 {
//! stream.extend_from_slice(&enc.encode(&YuvFrame::black(32, 32)));
//! }
//! stream.extend_from_slice(&enc.flush());
//!
//! let frames = Decoder::new().decode_stream(&stream).unwrap();
//! assert_eq!(frames.len(), 3);
//! assert_eq!((frames[0].width, frames[0].height), (32, 32));
//! ```
//!
//! For streaming use, the lower-level [`Decoder::decode`] returns one picture per
//! access unit in decode order (pair it with [`Decoder::last_poc`] to reorder).
pub use ;
pub use ;
pub use bitacct;
pub use prometheus_telemetry;
/// The SUPERFAST-CLASS shape rung (WHYS-speed-gap H-11/H-12): the current
/// preset at P16×16-only partition shape. Measured 1.81× faster than default
/// quality at −0.9% BD vs x264 superfast. Composable with any [`Preset`].
pub use set_turbo;
/// Gate-regression instruments (Great Gate P4 — see `bench/examples/gatecheck.rs`):
/// the fire-rate census and the deterministic work counts every gate verdict
/// must report alongside its quality number (the dual-verdict law).
pub use ;
pub use ;
/// The crate version string.
pub const VERSION: &str = env!;
/// B-slice mode census (`RFF_BSTATS=1`). Re-exported so the CLI can print it on the
/// same flags a comparison is being judged on.