edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! The H.264 software decode seat's witnesses, after the swap that made |
| 2 | //! `ec-h264` -- the in-project decoder -- the seat. The independent one is |
| 3 | //! ffmpeg: 8-bit H.264 decode is bit-exact by conformance, so a correct decoder |
| 4 | //! handed a file must return the pictures the outside decoder returns, byte for |
| 5 | //! byte. (The witness these tests were first written against, `rusty_h264`, |
| 6 | //! retired with the crate on 2026-09-12 when the encode seat moved too; ffmpeg |
| 7 | //! took the outside role.) The seat's own two output orders must also agree: |
| 8 | //! display order is a reordering, not a rewrite. |
| 9 | //! |
| 10 | //! ```text |
| 11 | //! cargo test -p engine --test sw_backends -- --test-threads=1 |
| 12 | //! ``` |
| 13 | |
| 14 | use DefaultHasher; |
| 15 | use ; |
| 16 | use ; |
| 17 | |
| 18 | use ; |
| 19 | use ; |
| 20 | use H264Decoder; |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | /// Every access unit of the file, in container (decode) order. |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | /// One decoded picture as plain planes, whatever the decoder calls them. |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | /// `ec-h264` in the requested output order, drained to end of stream. |
| 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 | /// Every picture ffmpeg releases for the file, in display order, as I420 |
| 97 | /// planes. `None` where ffmpeg is not installed -- the same skip the export |
| 98 | /// suite's `ffmpeg_complaints` takes. |
| 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 | /// The seat against the outside decoder, byte for byte, on both a CAVLC |
| 149 | /// Baseline and a CABAC High stream with B pictures. Display order on both |
| 150 | /// sides: ffmpeg releases pictures as they play, and so does the seat. |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | /// Display order is a reordering, not a rewrite: the same multiset of |
| 169 | /// pictures the decode-order run releases, possibly in a different sequence. |
| 170 | /// On the B-picture fixture the sequences genuinely differ -- the reordering |
| 171 | /// is the point of the DPB -- and on the Baseline fixture they cannot (no |
| 172 | /// B pictures, nothing to reorder). |
| 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 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | /// The seat, wired through `DecodeSession`, labels every picture with its |
| 211 | /// timeline position: a full run to EOF delivers `0..frame_count` in order on |
| 212 | /// a B-picture stream -- the contract the transport reads (`frame.index` is a |
| 213 | /// timeline index) and the one the hardware backend already kept. |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 |