forked from len0rd/rockbox
Fuzev2: don't reinvent the wheel: swap pixels with existing swap_odd_even32
It is equally fast and doesn't need an additional mask Thanks to amiconn for pointing to it git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25477 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
69186f6f85
commit
5b8aca84dc
1 changed files with 1 additions and 15 deletions
|
|
@ -144,23 +144,9 @@ static void dbop_write_data(const int16_t* p_bytes, int count)
|
||||||
dbop_set_mode(32);
|
dbop_set_mode(32);
|
||||||
data = (int32_t*)p_bytes;
|
data = (int32_t*)p_bytes;
|
||||||
|
|
||||||
const unsigned int mask = 0xff00ff;
|
|
||||||
while (count > 1)
|
while (count > 1)
|
||||||
{
|
{
|
||||||
register unsigned int pixels = *data++;
|
DBOP_DOUT32 = swap_odd_even32(*data++);
|
||||||
register unsigned int tmp;
|
|
||||||
|
|
||||||
/* pixels == ABCD */
|
|
||||||
asm(
|
|
||||||
"and %[tmp], %[pixels], %[mask] \n" /* tmp = 0B0D */
|
|
||||||
"and %[pixels], %[pixels], %[mask], lsl #8\n" /* %[pixels] = A0C0 */
|
|
||||||
"mov %[pixels], %[pixels], lsr #8 \n" /* %[pixels] = 0A0C */
|
|
||||||
"orr %[pixels], %[pixels], %[tmp], lsl #8 \n" /* %[pixels] = BADC */
|
|
||||||
: [pixels]"+r"(pixels), [tmp]"=r"(tmp) /* output */
|
|
||||||
: [mask]"r"(mask) /* input */
|
|
||||||
);
|
|
||||||
|
|
||||||
DBOP_DOUT32 = pixels;
|
|
||||||
count -= 2;
|
count -= 2;
|
||||||
|
|
||||||
/* Wait if push fifo is full */
|
/* Wait if push fifo is full */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue