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 (SBR) and v2 (PS) fixtures for crates/ec-aac/tests/it/he_parity.rs. |
| 3 | # Each fixture is written as ADTS (.aac) and MP4 (.m4a). The reference is FFmpeg's own decode |
| 4 | # of the ADTS file, as signed 16-bit little-endian PCM at the decoded rate, in FFmpeg's own |
| 5 | # channel count and order (`ffmpeg -i x.aac -f s16le`). s16 keeps 5.1 under the 300 KB cap. |
| 6 | # |
| 7 | # libfdk_aac in the system ffmpeg may need the full fdk-aac library for SBR/PS encoding: |
| 8 | # pass its directory as $1 (it is prepended to LD_LIBRARY_PATH). Pass "" to use the system one. |
| 9 | # Usage: scripts/aac-tables/make-he-fixtures.sh <fdk-lib-dir-or-empty> <out-dir> |
| 10 | |
| 11 | LIBDIR=; OUT=; |
| 12 | if [; then |
| 13 | |
| 14 | fi |
| 15 | FF="ffmpeg -v error -y -hide_banner" |
| 16 | RATE=22050 |
| 17 | |
| 18 | # Mono: a tone plus a chirp (the chirp exercises the SBR patch range), with pink noise above it. |
| 19 | MONO="aevalsrc=0.35*sin(2*PI*220*t)+0.15*sin(2*PI*(300*t+700*t*t)):d=2:s=[t];anoisesrc=d=2:c=pink:a=0.12:r=:seed=7[n];[t][n]amix=inputs=2:normalize=0[a]" |
| 20 | |
| 21 | # Stereo: each side a different tone, chirp and noise, so a swapped channel fails the parity test. |
| 22 | STEREO="aevalsrc=0.3*sin(2*PI*330*t)+0.1*sin(2*PI*(500*t+600*t*t)):d=2:s=[l];aevalsrc=0.3*sin(2*PI*470*t)+0.1*sin(2*PI*(900*t+400*t*t)):d=2:s=[r];anoisesrc=d=2:c=pink:a=0.1:r=:seed=11[n];[l][r][n]amerge=inputs=3,pan=stereo|c0=c0+0.6*c2|c1=c1+0.4*c2[a]" |
| 23 | |
| 24 | # 5.1 (0.6 s): one distinct tone per channel plus pink noise on the rear pair, in FL FR FC LFE BL BR. |
| 25 | # The LFE tone is 40 Hz: real LFE content sits below 120 Hz, and a tone at the encoder cutoff is ill-conditioned. |
| 26 | SURROUND="aevalsrc=0.25*sin(2*PI*200*t):d=1:s=[c0];aevalsrc=0.25*sin(2*PI*300*t):d=1:s=[c1];aevalsrc=0.25*sin(2*PI*400*t):d=1:s=[c2];aevalsrc=0.4*sin(2*PI*40*t):d=1:s=[c3];aevalsrc=0.25*sin(2*PI*(500*t+400*t*t)):d=1:s=[c4];aevalsrc=0.25*sin(2*PI*(650*t+300*t*t)):d=1:s=[c5];anoisesrc=d=1:c=pink:a=0.08:r=:seed=13[n];[c0][c1][c2][c3][c4][c5][n]amerge=inputs=7,pan=5.1|c0=c0+0.5*c6|c1=c1+0.5*c6|c2=c2|c3=c3|c4=c4+0.3*c6|c5=c5+0.3*c6,channelmap=channel_layout=5.1[a]" |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 |