dsputil: ppc: cosmetics: pretty-print

This commit is contained in:
Justin Ruggles 2012-07-22 14:37:24 -04:00
parent 85a3c19ed1
commit a35738f424

View File

@ -23,7 +23,8 @@
#include "libavutil/ppc/util_altivec.h"
#include "dsputil_altivec.h"
static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src, float mul, int len)
static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src,
float mul, int len)
{
union {
vector float v;
@ -47,8 +48,7 @@ static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src, float
}
static vector signed short
float_to_int16_one_altivec(const float *src)
static vector signed short float_to_int16_one_altivec(const float *src)
{
vector float s0 = vec_ld(0, src);
vector float s1 = vec_ld(16, src);
@ -62,7 +62,7 @@ static void float_to_int16_altivec(int16_t *dst, const float *src, long len)
int i;
vector signed short d0, d1, d;
vector unsigned char align;
if(((long)dst)&15) //FIXME
if (((long)dst) & 15) { //FIXME
for (i = 0; i < len - 7; i += 8) {
d0 = vec_ld(0, dst+i);
d = float_to_int16_one_altivec(src + i);
@ -74,25 +74,26 @@ static void float_to_int16_altivec(int16_t *dst, const float *src, long len)
vec_st(d0, 0, dst + i);
vec_st(d1, 15, dst + i);
}
else
} else {
for (i = 0; i < len - 7; i += 8) {
d = float_to_int16_one_altivec(src + i);
vec_st(d, 0, dst + i);
}
}
}
static void
float_to_int16_interleave_altivec(int16_t *dst, const float **src,
static void float_to_int16_interleave_altivec(int16_t *dst, const float **src,
long len, int channels)
{
int i;
vector signed short d0, d1, d2, c0, c1, t0, t1;
vector unsigned char align;
if (channels == 1)
float_to_int16_altivec(dst, src[0], len);
else
else {
if (channels == 2) {
if(((long)dst)&15)
if (((long)dst) & 15) {
for (i = 0; i < len - 7; i += 8) {
d0 = vec_ld(0, dst + i);
t0 = float_to_int16_one_altivec(src[0] + i);
@ -110,7 +111,7 @@ float_to_int16_interleave_altivec(int16_t *dst, const float **src,
vec_st(d0, 31, dst + i);
dst += 8;
}
else
} else {
for (i = 0; i < len - 7; i += 8) {
t0 = float_to_int16_one_altivec(src[0] + i);
t1 = float_to_int16_one_altivec(src[1] + i);
@ -120,12 +121,13 @@ float_to_int16_interleave_altivec(int16_t *dst, const float **src,
vec_st(d1, 16, dst + i);
dst += 8;
}
}
} else {
DECLARE_ALIGNED(16, int16_t, tmp)[len];
int c, j;
for (c = 0; c < channels; c++) {
float_to_int16_altivec(tmp, src[c], len);
for (i = 0, j = c; i < len; i++, j+=channels) {
for (i = 0, j = c; i < len; i++, j+=channels)
dst[j] = tmp[i];
}
}