edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB70849e0Tahinli2 months ago3122 commits
| 1 | //! The superframe index (spec Annex B). |
| 2 | //! |
| 3 | //! A VP9 "chunk" — one sample in an MP4 or Matroska file, one IVF frame — may |
| 4 | //! hold several coded frames, at most one of which is shown. That is how a |
| 5 | //! hidden ALTREF travels: it is packed ahead of the frame that references it, |
| 6 | //! and the frame that eventually displays it is a bodiless |
| 7 | //! `show_existing_frame` header. The packing is described by an index appended |
| 8 | //! *after* the frames, whose first and last bytes are the same marker byte, so |
| 9 | //! it can be found by reading the chunk backwards. |
| 10 | |
| 11 | use ; |
| 12 | |
| 13 | /// Split a chunk into its coded frames. |
| 14 | /// |
| 15 | /// A chunk without a superframe index is one frame, returned as a single slice |
| 16 | /// borrowing the whole input — so callers never need to branch on "is this a |
| 17 | /// superframe". Sizes that do not add up to the chunk length are |
| 18 | /// [`Error::Corrupt`]: a decoder that trusted them would read another frame's |
| 19 | /// bytes. |
| 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 | /// True if `chunk` carries a superframe index, i.e. holds more than one frame. |
| 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 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 |