edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | #!/usr/bin/env bash |
| 2 | # Deterministic HE-AAC v1 fixture matrix for tests/sbr_real_library.rs's |
| 3 | # `synthetic_heaac_matrix`: two sample-rate families (48000, 44100) x four |
| 4 | # bitrates (32k/48k/64k/96k) x two profiles (aac_he, aac_low control) = 16 |
| 5 | # .m4a files, sweeping the SBR crossover (kx/k2) that bitrate controls |
| 6 | # without depending on any one real file's content. |
| 7 | # |
| 8 | # `ffmpeg`'s system libfdk_aac (the `fdk-aac-free` package) has SBR/PS |
| 9 | # encoding compiled out (patent-restricted tools) -- `-profile:a aac_he` |
| 10 | # fails with "Unable to set the AOT 5: Invalid config" against it. RPM |
| 11 | # Fusion's full `fdk-aac` package carries the SBR-capable encoder but |
| 12 | # installs to its OWN /usr/lib64/fdk-aac dir specifically so it doesn't |
| 13 | # clobber the system one; this script fetches (no root) and extracts just |
| 14 | # that .so into a local cache and points ffmpeg at it via |
| 15 | # LD_LIBRARY_PATH for the encode step only, never touching the system |
| 16 | # library. |
| 17 | |
| 18 | |
| 19 | SCRATCH="" |
| 20 | |
| 21 | CACHE="/.fdk-aac-full" |
| 22 | |
| 23 | |
| 24 | fdk_libdir="/usr/lib64/fdk-aac" |
| 25 | if [; then |
| 26 | |
| 27 | ( && ) |
| 28 | rpm_file= |
| 29 | ( && | ) |
| 30 | fi |
| 31 | |
| 32 | |
| 33 | # Three summed sweeps 100 Hz -> 18 kHz over the full 30 s (phase(t) = |
| 34 | # 2*pi*(f0*t + (f1-f0)/(2T)*t^2), f0=100 f1=18000 T=30 -> |
| 35 | # (f1-f0)/(2T)=298.333), offset in phase per partial and per channel so |
| 36 | # left/right are correlated but not identical -- plus low-level pink noise |
| 37 | # (seeded, so every run of this script reproduces bit-identical fixtures). |
| 38 | |
| 39 | L= |
| 40 | R= |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | for; do |
| 54 | src="/src_.wav" |
| 55 | [ || |
| 56 | for; do |
| 57 | he="/heaac__.m4a" |
| 58 | lc="/lc__.m4a" |
| 59 | [ || |
| 60 | |
| 61 | [ || |
| 62 | |
| 63 | done |
| 64 | done |
| 65 | |
| 66 | |
| 67 |