edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! HE-AAC v2 (AAC with Parametric Stereo) is decoded through `ec-aac`, not refused. |
| 2 | //! |
| 3 | //! The stream is encoded here by ffmpeg's `libfdk_aac` from a stereo source, so |
| 4 | //! the core is mono and the second channel comes from PS. Three wrappings are |
| 5 | //! covered: an mp4 with the explicit v2 config ffmpeg writes on encode, a bare |
| 6 | //! ADTS stream (implicit signalling), and an mp4 remuxed from that ADTS. Each is |
| 7 | //! held to ffmpeg's own decode, per channel. A machine whose ffmpeg has no |
| 8 | //! `libfdk_aac` that can encode v2 skips the test loudly, as the other reference |
| 9 | //! tests do. Some builds of `libfdk_aac` have SBR and PS compiled out, so the |
| 10 | //! encoder is probed with a real v2 encode, not just looked up by name. |
| 11 | |
| 12 | use Path; |
| 13 | use Command; |
| 14 | |
| 15 | use AudioSession; |
| 16 | use Scratch; |
| 17 | |
| 18 | /// The ffmpeg arguments that encode the test source as HE-AAC v2 into `out`. |
| 19 | |
| 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 | /// Whether this machine's ffmpeg can encode HE-AAC v2: a short real encode, so a |
| 48 | /// `libfdk_aac` without PS support counts as absent. |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | /// Runs `ffmpeg` with `args`, panicking with its stderr on failure. |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | /// The interleaved samples of `path`'s first audio track, with its metadata. |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | /// One channel out of an interleaved buffer. |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | /// Normalised correlation of two runs over their common length. |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | /// ffmpeg's own decode of `path`'s first audio track, stereo at 44.1 kHz. |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | /// Encodes a 2 s stereo source (440 Hz left, 880 Hz right) as HE-AAC v2 at |
| 130 | /// 24 kbps into `out`, in the container `out` names. |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | /// Checks `ours` against ffmpeg's decode of `path`, channel by channel. |
| 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 | |
| 207 |