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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//! Minimal IDR / keyframe header parsing for H.264, HEVC and AV1.
//!
//! This crate is the parser layer that the oxideav HW-accel bridge
//! crates (`oxideav-vaapi`, `oxideav-vdpau`, `oxideav-vulkan-video`)
//! call before submitting parameter buffers to the GPU. It is **not**
//! a full codec: there is no DCT, no entropy decode, no inverse
//! transform, no motion compensation. Just enough syntax parsing to
//! populate `VAPictureParameterBufferH264` / `VdpPictureInfoH264` /
//! `VkVideoDecodeH264PictureInfoKHR` and the equivalents for HEVC and
//! AV1.
//!
//! Each codec lives in its own module:
//!
//! - [`h264`] — Annex-B framing, SPS, PPS and minimal slice header.
//! - [`hevc`] — Annex-B framing, VPS, SPS, PPS and minimal slice
//! segment header.
//! - [`h266`] — Annex-B framing, 2-byte NAL header decode, VCL /
//! IRAP / parameter-set classifiers. Parameter-set parsing
//! deferred to future rounds.
//! - [`av1`] — leb128 reader/writer, OBU walker + emitter, sequence
//! header and key-frame OBU parsing.
//!
//! There is no shared cross-codec abstraction in v0 — each module
//! exposes its own `parse_*` entry points and result structs. The
//! shared [`bit_reader::BitReader`] type provides `u(n)`, `ue(v)` and
//! `se(v)` primitives; [`bit_writer::BitWriter`] is its MSB-first
//! inverse for emitting the same fields back out.
//!
//! ## No `unsafe`
//!
//! This crate contains zero `unsafe` blocks. Bit reading is software,
//! no FFI involved.
//!
//! ## Workspace clean-room policy
//!
//! Bitstream syntax is taken from the relevant ITU-T / Khronos /
//! AOMedia spec PDFs only. We deliberately do not consult ffmpeg /
//! libavcodec, x264, x265, libde265, libaom, dav1d, rav1e or libgav1
//! source. ffmpeg / aomenc are used only as black-box CLI tools to
//! generate test fixtures.
/// Errors produced by the parsers in this crate.
///
/// We deliberately do not depend on `oxideav_core::Error` — keeping
/// this crate dep-free means `oxideav-vdpau` / `oxideav-vaapi` /
/// `oxideav-vulkan-video` can pull it in without tugging on the rest
/// of the framework.