开发者Aikku93自2019年起开始开发名为ULC(Ultra Low Complexity Codec)的音频编码器,该格式基于变换原理,类似于MP3但摒弃了复杂的设计包袱,转而使用简单的nibble-based语法来存储系数 1。为了在任天堂64平台上实现高效播放,团队将逆变换部分卸载到主机的矢量协处理器(RSP)上运行,并针对硬件限制进行了深度优化 1。
具体实施中,开发者将IMDCT算法从浮点数转换为16位定点数(Q1.14),并将块大小调整为1024样本以充分利用RSP仅有的4096字节数据内存(DMEM),同时需注意RSP拥有4096字节的指令内存(IMEM)且N64主CPU频率为93 MHz 1。经过这些调整,最终的解码器仅需占用约4%的CPU时间和5%的RSP时间,即可流畅播放44,100 Hz立体声音频,其音质表现接近Opus格式 1。目前,这一采用宽松许可证发布的解决方案已合并入开源库Libdragon的预览分支,并在《半条命》N64移植版中得到实际应用,成功将2,500个音效和27首音乐曲目容纳进64MB的卡带存储空间中 1。
A developer has successfully ported the Ultra Low Complexity (ULC) audio codec to the Nintendo 64 platform, enabling high-quality stereo audio playback while consuming only approximately 4% of the main CPU’s processing time 1. The ULC codec is a transform-based encoder similar to MP3 but designed without complex overhead, utilizing a simple nibble-based syntax to store coefficients 1. To adapt the system to the N64’s hardware constraints, specifically its 93 MHz main CPU and the Reality Signal Processor (RSP) with 4096 bytes each of data memory (DMEM) and instruction memory (IMEM), the development team optimized the decoder’s performance by offloading the inverse transform part to the RSP 1. This optimization involved converting the Inverse Modified Discrete Cosine Transform (IMDCT) algorithm from floating-point to 16-bit fixed-point Q1.14 format and adjusting the block size to 1024 samples to effectively utilize the available DMEM space 1.
The resulting implementation requires about 5% of RSP resources alongside the low CPU usage to play 44,100 Hz stereo audio, achieving quality levels comparable to the Opus format 1. This solution has been integrated into the preview branch of the open-source Libdragon library 1. Aikku93 has been developing the ULC codec since 2019, releasing the code under a permissive license 1. The codec addresses significant storage limitations on cartridge-based systems, as demonstrated in the N64 port of "Half-Life," where it enabled the inclusion of 2,500 sound effects and 27 music tracks within a 64 MB cartridge 1.
评论
还没有评论,欢迎留下第一条。