FS#9285 - Unified IMDCT library for Vorbis, WMA, and AAC

Attached to Project: Rockbox
Opened by MichaelGiacomelli (saratoga) - Saturday, 16 August 2008, 07:00 GMT
Last edited by MichaelGiacomelli (saratoga) - Thursday, 04 September 2008, 19:29 GMT
Task Type Patches
Category Codecs
Status Closed
Assigned To No-one
Operating System SW-codec
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I've removed the Vorbis, WMA and AAC IMDCT code and replaced it with a single IMDCT called from the codeclib which is based on the IMDCT used by Vorbis. Because Vorbis and WMA already used this code, there should be no functional changes for these codecs. AAC gains a surprisingly small increase in speed (178%->202% realtime or a savings of about 5.3MHz on the 192k test track from the CodecPerformanceComparison page with Sansa e200). Unless I'm missing something, the enormously complex FFT used in FAAD may not have been so slow afterall, though the the Vorbis IMDCT is faster still.

My 1 test album sounds fine on PP, but I'd appreciate any testing on Coldfire. Benchmarks would also be nice.
This task depends upon

Closed by  MichaelGiacomelli (saratoga)
Thursday, 04 September 2008, 19:29 GMT
Reason for closing:  Accepted
Additional comments about closing:  r18412+r18413.
Comment by Nils Wallménius (nls) - Saturday, 16 August 2008, 08:17 GMT
Hi i tried this out on my h300.
First two small problems, there's a mistake in lib/SOURCES which makes it assemble the arm assembler version for everything and there's a warning about discarded qualifiers in mdc2.c

It does sound fine on ogg and aac on my player, i seem to have lost my wma track.
Performance in ogg didn't change and my aac track went from 140.9 % realtime to 184.7% a nice 31% speedup :) (the file is ~300kbps)

I also tried building the codeclib with O2 but that made no difference (codeclib is built with the same -O as the core so -Os for coldfire and -O for arm)
Comment by Nils Wallménius (nls) - Saturday, 16 August 2008, 08:21 GMT
one more little thing, building a sim fails in lib/misc.h, seems like just a missed ogg_uint32_t.
Comment by MichaelGiacomelli (saratoga) - Saturday, 16 August 2008, 20:02 GMT
Fixed the issues listed by nls.
Added some additional clean up of filterbank.c and decoder.c to avoid allocating memory for structures that were no longer needed.