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
// Parallel-array index loops are idiomatic in codec code; skip the lint.
//! JPEG / Motion-JPEG codec, pure Rust.
//!
//! Each video packet is a standalone JPEG (one full SOI..EOI). The decoder
//! recognises both baseline (SOF0) and progressive (SOF2) 8-bit JPEGs with
//! 4:2:0 / 4:2:2 / 4:4:4 chroma subsampling and outputs `VideoFrame`s in
//! the corresponding `Yuv*P` pixel format (or `Gray8` for 1-component
//! streams). Progressive scans accumulate DCT coefficients across multiple
//! SOS segments using both spectral selection and successive
//! approximation; the inverse DCT runs once after EOI. The encoder accepts
//! the same pixel formats and produces a standalone baseline JPEG using
//! the Annex K "typical" Huffman tables, so its output is interoperable
//! with any compliant JPEG decoder.
//!
//! **Not supported** (will return `Error::Unsupported`):
//! - Hierarchical, arithmetic coding, lossless
//! - 12-bit precision
//! - CMYK / 4-component scans
//! - Non-interleaved baseline scans (progressive permits them, as
//! required by the spec)
use CodecRegistry;
use ContainerRegistry;
use ;
pub const CODEC_ID_STR: &str = "mjpeg";
/// Register the still-image JPEG container (`.jpg` / `.jpeg`). Must be
/// called alongside [`register`] when wiring up a pipeline that expects
/// to read or write raw JPEG files.