edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! HEVC on the software seat: `ec-h265` through the engine's own span, with the |
| 2 | //! VA-API plugin forced off (`VE_SW=1`), the way VP9 and VP8 already run there. |
| 3 | //! |
| 4 | //! The fixtures are encoded by ffmpeg's libx265 (`scripts/gen_fixtures.sh`); the |
| 5 | //! plane-for-plane check against ffmpeg's own decode lives beside the seat, in |
| 6 | //! `decode/hevc.rs`. Here the seat as a whole: what a file opens as, what a span |
| 7 | //! delivers, and whether a seek lands on the very bytes a linear decode gave. |
| 8 | //! |
| 9 | //! `VE_SW` is process-wide, so every test that pins it holds [`SW`] for as long |
| 10 | //! as it is set: the span reads the pin when it opens on its worker. |
| 11 | |
| 12 | use ; |
| 13 | use Mutex; |
| 14 | use ; |
| 15 | |
| 16 | use Decoder; |
| 17 | use ; |
| 18 | use ; |
| 19 | |
| 20 | /// 352x288@30, 1 s -- see `scripts/gen_fixtures.sh`. |
| 21 | const FRAMES: u32 = 30; |
| 22 | /// 1920x1080@30, 2 s. |
| 23 | const FRAMES_1080: u32 = 60; |
| 24 | |
| 25 | static SW: = new; |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | /// Runs `f` with the plugin forced off, holding [`SW`] so no other test here sees |
| 34 | /// the pin under it. |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | /// Opens a clip on the software seat and drains it. |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// The container half: an HEVC track is found in both containers, at its size, |
| 52 | /// its length and its bit depth, which is what picks the 10-bit path. |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | /// With the plugin off, an HEVC file probes as the software seat, not as a |
| 70 | /// refusal naming the plugin. This is the answer a box without VA-API gets. |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | /// The seat end to end, for 8-bit and Main 10, both containers, an odd size and a |
| 79 | /// GOP that starts on an open CRA: every frame comes out in display order at the |
| 80 | /// clip's size with a picture in it, and a seek lands on the bytes a linear decode |
| 81 | /// delivered. |
| 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 | /// A clip of `pix_fmt` encoded by ffmpeg's libx265 into the temp dir: 30 frames |
| 138 | /// of 352x288. `assets/` is gitignored, so the clips these tests need are made here. |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | /// A 4:2:2 HEVC file opens on the software seat at 8 and 10 bits and every frame |
| 158 | /// comes out: the chroma is averaged to 4:2:0 on the way in, and the plane check |
| 159 | /// against ffmpeg lives beside the seat, in `decode/hevc.rs`. |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | /// 4:4:4 opens on the software seat at 8 and 10 bits, and every frame comes out. |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | /// The per-frame cost at 1080p, 8-bit: `ec-h265` alone (decode, no conversion) |
| 191 | /// and the whole software seat (decode, crop, narrow, BGRA). Printed for the |
| 192 | /// lane report; every frame must come out. |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 |