This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11759 - Rearrange libmad synthesis memory acceses for arm
Attached to Project:
Rockbox
Opened by MichaelGiacomelli (saratoga) - Monday, 15 November 2010, 05:55 GMT+2
Opened by MichaelGiacomelli (saratoga) - Monday, 15 November 2010, 05:55 GMT+2
|
DetailsWork in progress patch. Currently decodes audio but with some glitches. Has a small mountain of debug code included.
The basic idea is to rearrange the D filter coefficients in the synthesis filter so that pairs of them are used sequentially. This is not easy because the taps need to be loaded in the seemingly random order needed by the audio samples. However, this rearrangement seems to be possible: 0 1 2 3 4 5 6 7 (original sequence) 0 2 1 3 4 6 5 7 (new sequence) The complication is that the code assumes that it can start a new filter at any offset, even odd ones, which means each and every filter needs to be rewritten 4 times, one for each of the 4 possible alignments. This patch does that. Once I'm certain that it works, I intend to convert the D coefficients to packed 16 bit values, then use packed 16 bit multiply instructions on ARMv5E+. This should lead to a small speed up on armv4 (just because ldm instructions can be used instead of ldr) and a very large speed up on arm9E and arm11 (because packed multiplies are tremendously faster and much easier to pipeline). |
This task depends upon
Edit: Note that volume is off in that patch. I'll correct this later.
As a result, all memory accesses are now fully sequential, each D coefficient can be packed into a 32 bit pair, and all windowed sample data are used to generate 2 samples for each time they are loaded.
TODO:
Remove about 50KB of debug code from that patch.
Write ASM version.
* Reintroduce macros for code that won't be moved into the .S file
*Finish reordering the body of for loop
Pretty much all thats left is actually converting the core each loop to ASM.
* Wrote the first half of the first sb_sample function in assembly