← Thu, Nov 5 digest

Obscure audio codec is a perfect fit for the N64

read article ↗ hn thread ↗

Dominic Szablewski adapts the Ultra Low Complexity Codec (ULC) for the N64, achieving high-quality stereo audio using minimal CPU and RSP overhead.

read it A brilliant deep dive into retro game audio optimization, hardware constraints, and custom RSP assembly porting.

summary

Stymied by the N64's tight cartridge space and CPU limits, the author investigates the Ultra Low Complexity Codec, which was originally built for the Game Boy Advance. Unlike MP3 or Opus, ULC replaces complex entropy coding with a nibble-based syntax and includes noise fill, making it compact and fast enough for constrained hardware. By converting the decoder to 16-bit fixed point and porting the IMDCT to the N64's vector co-processor with LLM assistance, the author achieved near-Opus quality audio with negligible overhead. The codec has already been integrated into Libdragon and powers the audio for a recent N64 Half-Life port.

key points

  1. ULC is a full-band transform codec that avoids arbitrary bit reads and entropy coding by using a simple nibble-based syntax and built-in noise fill.
  2. Running ULC efficiently on the N64 required refactoring the reference code from floats to 16-bit fixed-point to fit within the RSP's restrictive 4KB data and instruction memory.
  3. The resulting RSP assembly decoder consumes only 4% of the main CPU and 5% of the RSP while delivering 44100 Hz stereo audio.

who should read it

Retro game developers, low-level programmers, and audio codec enthusiasts.

discussion warm

consensus

Commenters praise the technical achievement and highlight a broader modern explosion of impressive N64 homebrew ports like Half-Life and Duke Nukem 3D.

pushback

One user laments the reliance on AI assistants in retro game development, arguing it harms the demoscene spirit.

best comment by midnightclubbed ↗

This codec would have been great 27 years ago! I suspect it wouldn't have gotten past the patent lawyers in 1999 though. It seems cute today but the entire codec space was a patent minefield, the N64 mp3 decoder was implemented twice (once based on the reference codec, once clean) with Nintendo/Rare then paying RAD game tools to license their decoder... of which none of their code was used but they had a license from the mp3 patent holder (Fraunhofer) which then shielded Nintendo from lawsuits. Fraunhofer wanted something like $250k to license directly which wasn't going to fly.

I'll also …

Provides fascinating historical context on 1990s audio patent minefields and explains why a clean codec like ULC would have faced major legal roadblocks back then.

Generated by an LLM from the article and thread. Check the sources before relying on it.