FS#7833 - Optimizations to Vorbis codec
I attach a few patches that improve efficiency of the Vorbis codec. I would like them to be tested on various targets. The patches are independent.
codebook.patch includes a faster vorbis_book_decodevv_add function for one common case. It also doesn’t inline decode_packed_block, because inlining such a big function confuses gcc making it fail to allocate registers properly in the loop after the call to decode_packed_block.
mdct_arm.patch contains a part of mdct.c rewritten in ARM assembly. It saves some cycles, mostly by using ldm/stm where possible (gcc is not very good at it). It also does less inlining which makes it more cache friendly and easier to fit in IRAM.
vbpcm.patch tries to put the output of the codec in vb→pcm, which is usually in IRAM, unlike v→pcm.
2008-01-25 18:53
Reason for closing: Accepted
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
The crash on gigabeat if the code is
enabled is fixed now (gigabeat uses no
IRAM), but the asm mdct is kept disabled
because the C code is slightly
faster.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Very nice work!
I tested on my h300
vbpcm.patch 300% → 333% realtime
codebook.patch 300% → 312% realtime
(minor nitpick though, there’s an unused variable in vorbis_book_decodevv_add_2ch_even)
both 300% → 341% realtime
Thank you very much.
Using all three patches reduces boost ratio on my e200 from 30-35% to ~15%, for ~96kbps Vorbis files.
Nice, 262.21% to 282.03% on H120 and 203.72% to 232.02% on Ipod Nano, both on a 202kbps file.
I see no reason not to commit this :)
Reopening the task was not really necessary, as the crash fix for gigabeat disabled the assembler optimisations for gigabeat *only*. All other arm targets use the optimised code. I have prepared a patch that enables the assembler code for gigabeat as well, hopefully without crashing. Needs testing, and I don’t own a gigabeat.