Add AAC-ELD support (ELD frame lengths, tables, MDCT/FFT/TNS updates)#1
Add AAC-ELD support (ELD frame lengths, tables, MDCT/FFT/TNS updates)#1skrashevich wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d929a98b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case 1024, 128, 960, 120: | ||
| useGenerated = true | ||
| default: |
There was a problem hiding this comment.
Add FFT support for 30/32 or skip short MDCT init
Allowing MDCT lengths 128/120 for ELD means m.N4 becomes 32/30, but fft.New still only supports lengths 64, 512, 256, 60, 480, and 240 (see pkg/fft/fft.go around the switch in New). As a result, mdct.New(128|120) fails at fft.New(m.N4), and filterbank.NewWithFrameLength always builds the short MDCT, so AAC‑ELD 512/480 frame lengths will error during decoder initialization even though short windows are disallowed. This blocks all ELD decoding unless you add FFT support for 32/30 or avoid constructing the short MDCT for those frame lengths.
Useful? React with 👍 / 👎.
Motivation
Description
pkg/decoder/decoder.goand setFrameLengthto 512 or 480, including basic ELD extension skipping and SBR detection.pkg/tables/tables.go, and exposeSWBOffset512/SWBOffset480and corresponding band-count arrays.pkg/icsusesFrameLengthto pick SWB tables and disallow short-window sequences on unsupported lengths, andpkg/tnsnow buildsTNSwith frame-length-awaremaxBandsfor 1024/512/480.NewWithFrameLengthinpkg/filterbankand generate matching long/short windows dynamically.pkg/mdct) and FFT (pkg/fft) to support ELD-related transform sizes (1024/128 and 960/120 via generated twiddle tables and additional FFT lengths) by generating sine/cos tables at runtime when precomputed tables are not present.Testing
go test ./...and all package tests passed successfully (unit tests forfft,mdct,filterbank,ics,tns,tables,decoder, etc.).gofmton modified files as part of local validation prior to testing.Codex Task