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 | # MP3 fixtures beyond the family matrix in gen-fixtures.sh: every Layer III |
| 3 | # sampling frequency (MPEG-1, MPEG-2 LSF and MPEG-2.5), both channel modes, |
| 4 | # CBR and VBR, on material that forces block switching and a wide spread of |
| 5 | # Huffman tables. |
| 6 | # |
| 7 | # The family matrix only covers 44.1/48 kHz stereo and mono at one bitrate, |
| 8 | # which leaves the LSF side info, the 8 kHz band layout and the short-block |
| 9 | # path unexercised — every one of those is a separate table in the decoder. |
| 10 | # |
| 11 | # Output: fixtures/audio/mp3ext-<mode>-<rate>-<setting>.mp3 (gitignored). |
| 12 | |
| 13 | |
| 14 | here= |
| 15 | FIXTURES="/../fixtures" |
| 16 | |
| 17 | |
| 18 | src="/audio/.mp3src.wav" |
| 19 | if [; then |
| 20 | # A tone with a glide, broadband noise and a click every half second: the |
| 21 | # click is what makes an encoder switch to short blocks, and the noise is |
| 22 | # what makes it reach for the escape-coded Huffman tables. |
| 23 | left="0.35*sin(2*PI*440*t+3*sin(2*PI*1.5*t))+0.12*(random(0)-0.5)+0.7*lt(mod(t\,0.5)\,0.002)" |
| 24 | right="0.30*sin(2*PI*443*t)+0.12*(random(1)-0.5)+0.7*lt(mod(t\,0.5)\,0.002)" |
| 25 | |
| 26 | |
| 27 | fi |
| 28 | |
| 29 | # The same material as PCM, mono and stereo, for the encoder's quality table: |
| 30 | # a tone fixture cannot tell two encoders apart, and this one can. |
| 31 | for; do |
| 32 | for; do |
| 33 | channels=1 |
| 34 | [ && channels=2 |
| 35 | |
| 36 | |
| 37 | done |
| 38 | done |
| 39 | |
| 40 | RATES=(48000 44100 32000 24000 22050 16000 12000 11025 8000) |
| 41 | made=0 |
| 42 | for; do |
| 43 | for; do |
| 44 | channels=1 |
| 45 | [ && channels=2 |
| 46 | for; do |
| 47 | case "" in |
| 48 | cbr128) opts=(-b:a 128k) ;; |
| 49 | cbr320) opts=(-b:a 320k) ;; |
| 50 | vbr2) opts=(-q:a 2) ;; |
| 51 | esac |
| 52 | # MPEG-2/2.5 rates cap out well below 320 kbit/s. |
| 53 | if [ && [; then |
| 54 | continue |
| 55 | fi |
| 56 | out="/audio/mp3ext---.mp3" |
| 57 | |
| 58 | |
| 59 | made= |
| 60 | done |
| 61 | done |
| 62 | done |
| 63 | # One simple-stereo file: LAME picks joint stereo by default, so the plain |
| 64 | # left/right path would otherwise never be decoded. |
| 65 | |
| 66 | |
| 67 | made= |
| 68 | |
| 69 |