edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Decode one OBU stream and write every frame's planes as raw planar video |
| 2 | //! (`<out-prefix>.f<N>.yuv`), at the sample depth **the stream's own sequence |
| 3 | //! header carries**: 8-bit as one byte per sample, 10/12-bit as little-endian |
| 4 | //! `u16`. That is the layout `ffmpeg -pix_fmt yuv420p{,10,12}le -f rawvideo` |
| 5 | //! and `aomdec --rawvideo` write, so a byte-exact `cmp` against either is |
| 6 | //! meaningful. |
| 7 | //! |
| 8 | //! It is the high-bit-depth companion to `EC_AV1_PREFILT_DUMP`, whose `as u8` |
| 9 | //! narrowing throws away exactly the bits a 10-bit mismatch lives in |
| 10 | //! (lane-rect1d r1 found its defect by diffing this against |
| 11 | //! `ffmpeg -pix_fmt yuv420p10le -f rawvideo`). |
| 12 | //! |
| 13 | //! ```text |
| 14 | //! cargo run -p ec-av1 --example dump_yuv -- s.obu /tmp/ours |
| 15 | //! ffmpeg -v error -i s.obu -pix_fmt yuv420p10le -f rawvideo /tmp/ref.yuv |
| 16 | //! cmp /tmp/ours.f0.yuv /tmp/ref.yuv |
| 17 | //! ``` |
| 18 | //! |
| 19 | //! The depth is NEVER taken from the file name, the output extension, or the |
| 20 | //! `-pix_fmt` of a reference tool: it is parsed out of the sequence header |
| 21 | //! (spec 5.5.2 `color_config.bit_depth`) before a single byte is written. The |
| 22 | //! old version packed every sample as `u16` unconditionally, so pointing it at |
| 23 | //! an 8-bit stream silently produced a file TWICE the size of the oracle's, |
| 24 | //! and the size mismatch read like a decoder bug. `--depth N` is accepted for |
| 25 | //! the case where you already know what the stream is, and is ASSERTED against |
| 26 | //! the parsed header: a mismatch names both depths and the consequence it |
| 27 | //! would have caused, and writes nothing. |
| 28 | //! |
| 29 | //! `i` in `<out-prefix>.f<i>.yuv` indexes `decode_stream`'s output, which is |
| 30 | //! DISPLAY order and SHOWN frames only -- hidden alt-refs are never emitted. |
| 31 | //! Every other `.f{N}` in this crate (EC_AV1_FINAL_DUMP, |
| 32 | //! EC_AV1_DECODE_ORDER_DUMP, EC_AV1_PREFILT_DUMP) uses a DECODE index, so this |
| 33 | //! file does NOT line up with an aomdec dump past frame 0 on a stream with |
| 34 | //! altref. Compare against ffmpeg rawvideo, or against aomdec via |
| 35 | //! `decode_all_frames_vs_oracle`. |
| 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 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 |