edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! The software VP8 decoder: `ec-vp8`, this project's own implementation of |
| 2 | //! RFC 6386 -- the reason a VP8 file decodes on a machine whose GPU has no |
| 3 | //! VP8 profile, or whose GPU is absent altogether. |
| 4 | //! |
| 5 | //! The seat was `libvpx`, resolved at runtime behind a hand-written FFI; the |
| 6 | //! native crate replaces it outright, and with it the whole dlopen layer |
| 7 | //! goes: the plugin links the decoder as ordinary Rust, so there is no |
| 8 | //! library to look for, no ABI to pin, and no machine where the codec is |
| 9 | //! absent from a build that carries this plugin. What survives from the FFI |
| 10 | //! days is the seat's shape -- the five verbs the session above lives on: |
| 11 | //! |
| 12 | //! - `init` -- a fresh [`Decoder`], infallible now that there is no ABI to |
| 13 | //! negotiate; |
| 14 | //! - `decode` -- one access unit in, the picture (if any) held for the next |
| 15 | //! `get_frame`; |
| 16 | //! - `get_frame` -- the picture the last `decode` produced, taken once; |
| 17 | //! - `flush` -- a formality: VP8 reorders nothing and holds nothing back, so |
| 18 | //! end of stream has nothing to release (libvpx wanted the empty |
| 19 | //! `vpx_codec_decode`; the native decoder has no equivalent need, and the |
| 20 | //! verb stays because the session's pump is written around it); |
| 21 | //! - `destroy` -- now simply the drop of an owned value, which is why a |
| 22 | //! seek is `self.decoder = Decoder::new()` where the FFI seat paid a |
| 23 | //! destroy + re-init round trip. |
| 24 | |
| 25 | use decode; |
| 26 | |
| 27 | /// The VP8 decoder: [`decode::Decoder`] plus the one-picture slot between |
| 28 | /// `decode` and `get_frame`. |
| 29 | pub |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | /// One decoded picture: the visible frame's planes, 8-bit 4:2:0, strided |
| 35 | /// (`stride` may exceed `width`) and owned by whoever holds it -- what |
| 36 | /// [`crate::VhFrame`] hands on is the packed copy the session makes. |
| 37 | pub use Picture; |
| 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 |