Skip to content

Add AAC-ELD support (ELD frame lengths, tables, MDCT/FFT/TNS updates)#1

Open
skrashevich wants to merge 1 commit intomainfrom
cdx/add-aac-eld-decoder-support-to-go-aac
Open

Add AAC-ELD support (ELD frame lengths, tables, MDCT/FFT/TNS updates)#1
skrashevich wants to merge 1 commit intomainfrom
cdx/add-aac-eld-decoder-support-to-go-aac

Conversation

@skrashevich
Copy link
Copy Markdown
Owner

Motivation

  • Add decoding support for AAC-ELD streams which use 512/480-based frame lengths and ELD-specific signaling and tables.
  • Reuse existing decoder pipeline and extend components to handle ELD frame-size variants, scalefactor bands and TNS limits.

Description

  • Parse AAC-ELD AudioSpecificConfig (AOT_ER_AAC_ELD / profile 39) in pkg/decoder/decoder.go and set FrameLength to 512 or 480, including basic ELD extension skipping and SBR detection.
  • Add ELD scalefactor band offsets and sample-rate (7350 Hz) entries and window-band counts in pkg/tables/tables.go, and expose SWBOffset512/SWBOffset480 and corresponding band-count arrays.
  • Make ICS/TNS frame-length-aware: pkg/ics uses FrameLength to pick SWB tables and disallow short-window sequences on unsupported lengths, and pkg/tns now builds TNS with frame-length-aware maxBands for 1024/512/480.
  • Make filterbank configurable for arbitrary supported frame lengths via NewWithFrameLength in pkg/filterbank and generate matching long/short windows dynamically.
  • Extend MDCT (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.
  • Update unit tests and test helpers to reflect new supported FFT/MDCT sizes and expanded table dimensions.

Testing

  • Ran the full test suite with go test ./... and all package tests passed successfully (unit tests for fft, mdct, filterbank, ics, tns, tables, decoder, etc.).
  • Ran gofmt on modified files as part of local validation prior to testing.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkg/mdct/mdct.go
Comment on lines +88 to 90
case 1024, 128, 960, 120:
useGenerated = true
default:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant