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
//! A VP8 video decoder in pure, safe Rust (RFC 6386).
//!
//! It decodes every VP8 bitstream version (0 to 3): keyframes and
//! interframes, all intra and inter prediction modes including split motion
//! vectors, segmentation, the normal and simple loop filters, token
//! partitions, probability updates and persistence, and the last, golden and
//! alt-ref reference frames with their sign bias and buffer copies. Its
//! output matches the WebM project's VP8 test vectors bit for bit.
//!
//! Input is one raw VP8 frame at a time, starting at the frame tag (no IVF,
//! WebM or RTP framing). Output is a borrowed I420 [`Picture`].
//!
//! ```no_run
//! let frames: Vec<Vec<u8>> = Vec::new(); // raw VP8 frames, in order
//! let mut decoder = vp8_decoder::Decoder::new();
//! for frame in &frames {
//! match decoder.decode(frame) {
//! Ok(Some(picture)) => { let _i420 = picture.to_i420(); }
//! Ok(None) => {} // a frame that only updates references
//! Err(vp8_decoder::DecodeError::NeedKeyframe) => {} // wait for a keyframe
//! Err(_) => {} // corrupt: ask the sender for a keyframe
//! }
//! }
//! ```
//!
//! See PROVENANCE.md for how this crate was written.
// Shared with the vp8-encoder crate. Not a stable API: it may change in any
// release, and vp8-encoder pins this crate's exact version. Lockstep rule:
// any vp8-decoder release that touches these modules ships with a matching
// vp8-encoder release that bumps its `=` pin.
pub use ;
pub use Picture;
// The README's examples are compiled as doc tests.
;