FS#6848 - Optimizations to Vorbis codec
I made some optimizations to the Vorbis codec. vector.patch is only for ARM (it shouldn’t change anything for Coldfire), others should make the codec slightly faster on all targets. I would like someone to check how these patches affect CPU boost ratio on Ipod and Coldfire based targets.
Please note bug FS#6847 when testing this (make sometimes needs to be run twice to relink the codec).
Closed by tmal
2007-09-25 21:02
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
2007-09-25 21:02
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
Two of the patches were committed.
I'll take a look at coupling.patch
and possibly resubmit it later.
Meanwhile I have some new patches.
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
I just did a short comparison on my mini. I looked at the boost ratio in the audio thread debug screen, and after a while it settled at around 46% with patch as well as without the path. File is -q 5 and I waited for the buffer to get filled completely before I looked at the screen. Playback was running for about 5 minutes.
D’oh! I got the rebuild issue of
FS#6847and didn’t notice it :(Ok, ran the test again and boost ration now drops to 36%. Nice improvement!
I tested the coupling and codebook patches on my h300, the coupling patch did not affect boost ratio at all (i think i saw a slight decrease but it could just as easily have been my imagination) i verified that the patch had taken by diffing the vorbis.codec files between testing and did reboot my player.
The codebook patch had a problem, all music had turned into horrible noise, but the boost dropped about 10% on one test track with both patches
edit: it works fine in the sim, maybe an endian issue?
Adding endian swap to both reads from ptr[] seems to fix it. Gains also for Coldfire, but not so much as for ARM.
coupling.patch seems to have an adverse effect on decoding of very low quality (-q -1) vorbis encoded with both libvorbis or libvorbis + aotuv; once applied, output is more choppy, and channel discontinuity more noticeable (at least on the Sansa E200 target).
Here is an updated version of the codebook patch that works on coldfire, I used
the letoh32() macro when ptr[] is accessed like preglow suggested so it should
still work fine on little endian devices too.
I did a little testing on my h300.
The firs number is boost ratio with a current svn build and the second is with the codebook patch.
Jewel of the summertime (q4) 16% 11%
Sabbath bloody sabbath (q6) 21% 12%
Ölstugan som inte finns (q4) 10% 6%
Thanks for catching and correcting endianess issue. I commited codebook and vector patches.
Sylvain, did you notice the difference with only the coupling patch applied? I looked at the patch and could not find any bug, I also checked the output with and without the patch and could not see the difference. Could you provide me with a file that exposes the problem?
Tomasz,
applying only codebook.patch and vector.patch does not seem to affect the audio output quality; applying coupling.patch, alone or at the same time than the two others had a significant impact in my case. Here are a few clips for you to listen to:
http://www.filesend.net/download.php?f=0cd14e2767ea406ba54d45e4bcad96dc
I am not sure how much of the real hardware rockboxui emulates or simulates (I am pretty new to Rockbox), but the audiodump it generates is flawless, unlike what I hear on the real thing unfortunately, so I am not sure any of your code is even wrong… I should probably point out that the decoding of a vorbis stream encoded at higher quality (-q 3 for instance) is not affected by your patch from an audio standpoint… I wish I could help you more.
What happens if mag>0 and ang= -2^31? Won’t d=-d result in overflow? It looks like the original code would not overflow in this case. Maybe Sylvain’s bug report results from the different ways the target and the sim behave in this situation.
I wonder if using ARM’s conditional instructions could result in smaller/faster coupling code. (I haven’t seen the output of gcc for the coupling code though)
afaict this has been submitted to svn except the coupling stuff. Does that still apply or can this task be closed?
I just applied coupling.patch against rockbox trunk rev. 14120: on my sansa e280, the chopiness it initially caused (audible, vinyl-like scratches) is gone, but channel loss still occurs a few times per song on low quality (-q -1) libvorbis+aotuv.