edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBca4790fTahinli3 months ago1157 commits
| 1 | //! HEVC bitstream syntax: NAL framing, parameter sets, slice headers, SEI. |
| 2 | //! |
| 3 | //! This crate is the half of H.265 that both a software encoder and a *stateless |
| 4 | //! hardware* decoder need, and it is deliberately the same code for both |
| 5 | //! directions: every structure here is written and parsed, so a round trip is a |
| 6 | //! test rather than an article of faith. |
| 7 | //! |
| 8 | //! What that buys, concretely: |
| 9 | //! |
| 10 | //! - The conformance window is a field on [`Sps`], not a caller's padding |
| 11 | //! problem. 1920x1080 in 64x64 coding tree blocks is coded 1920x1088 and |
| 12 | //! cropped by the SPS; [`Sps::display_size`] gives back what a player shows. |
| 13 | //! - Every field of `VAPictureParameterBufferHEVC` and |
| 14 | //! `VASliceParameterBufferHEVC` is either a field on [`Sps`], [`Pps`] or |
| 15 | //! [`SliceHeader`], or a named method on one of them — |
| 16 | //! [`Sps::pic_width_in_ctbs`], [`ParsePositions::slice_data_byte_offset`], |
| 17 | //! [`ParsePositions::st_rps_bits`]. A hardware decode path built on this crate |
| 18 | //! should never need to re-parse a header itself. |
| 19 | //! - [`sei::decoded_picture_hash_rbsp`] writes the MD5 of the reconstruction, so |
| 20 | //! any conformant decoder can be asked whether the encoder was right. |
| 21 | //! |
| 22 | //! Malformed input is an [`Error`](ec_core::Error), never a panic: truncation is |
| 23 | //! `NeedMore`, a rule violation is `Corrupt`, and the two constructs the family |
| 24 | //! genuinely does not implement (scaling lists, and short-term reference picture |
| 25 | //! sets predicted from an SPS set that a caller did not keep) are `Unsupported` |
| 26 | //! with the reason stated. |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | pub use ; |
| 39 | pub use |
| 40 | |
| 41 | ; |
| 42 | pub use |
| 43 | |
| 44 | |
| 45 | ; |
| 46 | pub use ; |