Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: RE: Optimized bitswap

RE: Optimized bitswap

From: Nielsen Linus (ext) <"Nielsen>
Date: Tue, 20 Aug 2002 16:23:32 +0200

I just tried it, and it wasn't entirely correct.

It swapped from start+2 thru start+len*2 inclusive, when it should swap from
start thru start+len*2-2.

I took the liberty of correcting your (really good) code and made the loop
go forward in memory. And i also committed it to the CVS.

And guess what? It seems to be even FASTER than the 16-bit version! :-)

Nice work, Magnus!

/Linus


> I managed to fixed it, so I've attached my bitswap function.
> Both code and the flipdata array resides in the internal RAM.
> I've been using it a little while now, and it seems to be OK
> - or maybe not: I just heard an audio glitch. So more testing
> is probably needed. :)
>
> As for using it: add bitswap.S to the makefile and remove
> bitswap() (but leave a declaration for it),
> create_fliptable(), fliptable[] and big_fliptable[] from mpeg.c.
>
> Interesting detail: for the flipping to work properly
> (without audio glitches) I had to make it work from the end
> of the buffer, just like the C code...
>
> > You have to save all registers from r8 and up.
>
> Luckily I only use r0-r7. :)
>
> Magnus
>
Received on 2002-08-20

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy