use memcpy for copying stuff around to fix alignment problems

This commit is contained in:
Ludwig Nussel 2005-12-06 23:11:25 +00:00
parent 9bd6709e10
commit 81c15bc41d

View file

@ -333,28 +333,14 @@ long RllDecodeStereoToMono(unsigned char *from,short *to,unsigned int size,char
static void move8_32( byte *src, byte *dst, int spl )
{
double *dsrc, *ddst;
int dspl;
int i;
dsrc = (double *)src;
ddst = (double *)dst;
dspl = spl>>3;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
for(i = 0; i < 8; ++i)
{
memcpy(dst, src, 32);
src += spl;
dst += spl;
}
}
/******************************************************************************
@ -367,20 +353,14 @@ static void move8_32( byte *src, byte *dst, int spl )
static void move4_32( byte *src, byte *dst, int spl )
{
double *dsrc, *ddst;
int dspl;
int i;
dsrc = (double *)src;
ddst = (double *)dst;
dspl = spl>>3;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
dsrc += dspl; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
for(i = 0; i < 4; ++i)
{
memcpy(dst, src, 16);
src += spl;
dst += spl;
}
}
/******************************************************************************
@ -393,28 +373,14 @@ static void move4_32( byte *src, byte *dst, int spl )
static void blit8_32( byte *src, byte *dst, int spl )
{
double *dsrc, *ddst;
int dspl;
int i;
dsrc = (double *)src;
ddst = (double *)dst;
dspl = spl>>3;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
dsrc += 4; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
for(i = 0; i < 8; ++i)
{
memcpy(dst, src, 32);
src += 32;
dst += spl;
}
}
/******************************************************************************
@ -424,23 +390,16 @@ static void blit8_32( byte *src, byte *dst, int spl )
* Description:
*
******************************************************************************/
#define movs double
static void blit4_32( byte *src, byte *dst, int spl )
{
movs *dsrc, *ddst;
int dspl;
int i;
dsrc = (movs *)src;
ddst = (movs *)dst;
dspl = spl>>3;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
dsrc += 2; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
dsrc += 2; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
dsrc += 2; ddst += dspl;
ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
for(i = 0; i < 4; ++i)
{
memmove(dst, src, 16);
src += 16;
dst += spl;
}
}
/******************************************************************************
@ -453,15 +412,8 @@ static void blit4_32( byte *src, byte *dst, int spl )
static void blit2_32( byte *src, byte *dst, int spl )
{
double *dsrc, *ddst;
int dspl;
dsrc = (double *)src;
ddst = (double *)dst;
dspl = spl>>3;
ddst[0] = dsrc[0];
ddst[dspl] = dsrc[1];
memcpy(dst, src, 8);
memcpy(dst+spl, src+8, 8);
}
/******************************************************************************