mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-04 06:02:12 +00:00
removing ALTIVEC_USE_REFERENCE_C_CODE, since has no use anymore
Originally committed as revision 6606 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
1c2a417f6a
commit
b420448e38
2
configure
vendored
2
configure
vendored
@ -1789,8 +1789,6 @@ fi
|
||||
if test "$altivec" = "yes" ; then
|
||||
echo "TARGET_ALTIVEC=yes" >> config.mak
|
||||
echo "#define HAVE_ALTIVEC 1" >> $TMPH
|
||||
echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
|
||||
echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
|
||||
if test "$_altivec_h" = "yes" ; then
|
||||
echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
|
||||
else
|
||||
|
@ -618,21 +618,6 @@ void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1,
|
||||
}
|
||||
|
||||
void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int i;
|
||||
for(i=0; i+7<w; i++){
|
||||
dst[i+0] += src[i+0];
|
||||
dst[i+1] += src[i+1];
|
||||
dst[i+2] += src[i+2];
|
||||
dst[i+3] += src[i+3];
|
||||
dst[i+4] += src[i+4];
|
||||
dst[i+5] += src[i+5];
|
||||
dst[i+6] += src[i+6];
|
||||
dst[i+7] += src[i+7];
|
||||
}
|
||||
for(; i<w; i++)
|
||||
dst[i+0] += src[i+0];
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register int i;
|
||||
register vector unsigned char vdst, vsrc;
|
||||
|
||||
@ -649,30 +634,12 @@ void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 16) == 0) */
|
||||
void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_put_pixels16_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int i;
|
||||
|
||||
POWERPC_PERF_START_COUNT(altivec_put_pixels16_num, 1);
|
||||
|
||||
for(i=0; i<h; i++) {
|
||||
*((uint32_t*)(block)) = LD32(pixels);
|
||||
*((uint32_t*)(block+4)) = LD32(pixels+4);
|
||||
*((uint32_t*)(block+8)) = LD32(pixels+8);
|
||||
*((uint32_t*)(block+12)) = LD32(pixels+12);
|
||||
pixels+=line_size;
|
||||
block +=line_size;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register vector unsigned char pixelsv1, pixelsv2;
|
||||
register vector unsigned char pixelsv1B, pixelsv2B;
|
||||
register vector unsigned char pixelsv1C, pixelsv2C;
|
||||
@ -722,8 +689,6 @@ POWERPC_PERF_START_COUNT(altivec_put_pixels16_num, 1);
|
||||
}
|
||||
#endif
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_num, 1);
|
||||
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 16) == 0) */
|
||||
@ -731,23 +696,6 @@ POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_num, 1);
|
||||
void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_avg_pixels16_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int i;
|
||||
|
||||
POWERPC_PERF_START_COUNT(altivec_avg_pixels16_num, 1);
|
||||
|
||||
for(i=0; i<h; i++) {
|
||||
op_avg(*((uint32_t*)(block)),LD32(pixels));
|
||||
op_avg(*((uint32_t*)(block+4)),LD32(pixels+4));
|
||||
op_avg(*((uint32_t*)(block+8)),LD32(pixels+8));
|
||||
op_avg(*((uint32_t*)(block+12)),LD32(pixels+12));
|
||||
pixels+=line_size;
|
||||
block +=line_size;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels16_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
|
||||
register vector unsigned char perm = vec_lvsl(0, pixels);
|
||||
int i;
|
||||
@ -766,37 +714,12 @@ POWERPC_PERF_START_COUNT(altivec_avg_pixels16_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels16_num, 1);
|
||||
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 8) == 0) */
|
||||
void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_avg_pixels8_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int i;
|
||||
POWERPC_PERF_START_COUNT(altivec_avg_pixels8_num, 1);
|
||||
for (i = 0; i < h; i++) {
|
||||
*((uint32_t *) (block)) =
|
||||
(((*((uint32_t *) (block))) |
|
||||
((((const struct unaligned_32 *) (pixels))->l))) -
|
||||
((((*((uint32_t *) (block))) ^
|
||||
((((const struct unaligned_32 *) (pixels))->
|
||||
l))) & 0xFEFEFEFEUL) >> 1));
|
||||
*((uint32_t *) (block + 4)) =
|
||||
(((*((uint32_t *) (block + 4))) |
|
||||
((((const struct unaligned_32 *) (pixels + 4))->l))) -
|
||||
((((*((uint32_t *) (block + 4))) ^
|
||||
((((const struct unaligned_32 *) (pixels +
|
||||
4))->
|
||||
l))) & 0xFEFEFEFEUL) >> 1));
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
}
|
||||
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
|
||||
int i;
|
||||
|
||||
@ -832,52 +755,12 @@ POWERPC_PERF_START_COUNT(altivec_avg_pixels8_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_num, 1);
|
||||
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 8) == 0) */
|
||||
void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_put_pixels8_xy2_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int j;
|
||||
POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1);
|
||||
for (j = 0; j < 2; j++) {
|
||||
int i;
|
||||
const uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
const uint32_t b =
|
||||
(((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
uint32_t l0 =
|
||||
(a & 0x03030303UL) + (b & 0x03030303UL) + 0x02020202UL;
|
||||
uint32_t h0 =
|
||||
((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
uint32_t l1, h1;
|
||||
pixels += line_size;
|
||||
for (i = 0; i < h; i += 2) {
|
||||
uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
uint32_t b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l1 = (a & 0x03030303UL) + (b & 0x03030303UL);
|
||||
h1 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l0 = (a & 0x03030303UL) + (b & 0x03030303UL) + 0x02020202UL;
|
||||
h0 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
} pixels += 4 - line_size * (h + 1);
|
||||
block += 4 - line_size * h;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_pixels8_xy2_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register int i;
|
||||
register vector unsigned char
|
||||
pixelsv1, pixelsv2,
|
||||
@ -948,51 +831,12 @@ POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_pixels8_xy2_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 8) == 0) */
|
||||
void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels8_xy2_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int j;
|
||||
POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
|
||||
for (j = 0; j < 2; j++) {
|
||||
int i;
|
||||
const uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
const uint32_t b =
|
||||
(((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
uint32_t l0 =
|
||||
(a & 0x03030303UL) + (b & 0x03030303UL) + 0x01010101UL;
|
||||
uint32_t h0 =
|
||||
((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
uint32_t l1, h1;
|
||||
pixels += line_size;
|
||||
for (i = 0; i < h; i += 2) {
|
||||
uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
uint32_t b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l1 = (a & 0x03030303UL) + (b & 0x03030303UL);
|
||||
h1 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l0 = (a & 0x03030303UL) + (b & 0x03030303UL) + 0x01010101UL;
|
||||
h0 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
} pixels += 4 - line_size * (h + 1);
|
||||
block += 4 - line_size * h;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register int i;
|
||||
register vector unsigned char
|
||||
pixelsv1, pixelsv2,
|
||||
@ -1064,51 +908,12 @@ POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 16) == 0) */
|
||||
void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_put_pixels16_xy2_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int j;
|
||||
POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1);
|
||||
for (j = 0; j < 4; j++) {
|
||||
int i;
|
||||
const uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
const uint32_t b =
|
||||
(((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
uint32_t l0 =
|
||||
(a & 0x03030303UL) + (b & 0x03030303UL) + 0x02020202UL;
|
||||
uint32_t h0 =
|
||||
((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
uint32_t l1, h1;
|
||||
pixels += line_size;
|
||||
for (i = 0; i < h; i += 2) {
|
||||
uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
uint32_t b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l1 = (a & 0x03030303UL) + (b & 0x03030303UL);
|
||||
h1 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l0 = (a & 0x03030303UL) + (b & 0x03030303UL) + 0x02020202UL;
|
||||
h0 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
} pixels += 4 - line_size * (h + 1);
|
||||
block += 4 - line_size * h;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_xy2_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register int i;
|
||||
register vector unsigned char
|
||||
pixelsv1, pixelsv2, pixelsv3, pixelsv4;
|
||||
@ -1185,51 +990,12 @@ POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_xy2_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* next one assumes that ((line_size % 16) == 0) */
|
||||
void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels16_xy2_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int j;
|
||||
POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
|
||||
for (j = 0; j < 4; j++) {
|
||||
int i;
|
||||
const uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
const uint32_t b =
|
||||
(((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
uint32_t l0 =
|
||||
(a & 0x03030303UL) + (b & 0x03030303UL) + 0x01010101UL;
|
||||
uint32_t h0 =
|
||||
((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
uint32_t l1, h1;
|
||||
pixels += line_size;
|
||||
for (i = 0; i < h; i += 2) {
|
||||
uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
uint32_t b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l1 = (a & 0x03030303UL) + (b & 0x03030303UL);
|
||||
h1 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l0 = (a & 0x03030303UL) + (b & 0x03030303UL) + 0x01010101UL;
|
||||
h0 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) =
|
||||
h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL);
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
} pixels += 4 - line_size * (h + 1);
|
||||
block += 4 - line_size * h;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register int i;
|
||||
register vector unsigned char
|
||||
pixelsv1, pixelsv2, pixelsv3, pixelsv4;
|
||||
@ -1307,7 +1073,6 @@ POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
int hadamard8_diff8x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
|
||||
@ -1727,38 +1492,6 @@ static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
|
||||
void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_avg_pixels8_xy2_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
|
||||
int j;
|
||||
POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1);
|
||||
for (j = 0; j < 2; j++) {
|
||||
int i;
|
||||
const uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
const uint32_t b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
uint32_t l0 = (a & 0x03030303UL) + (b & 0x03030303UL) + 0x02020202UL;
|
||||
uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
uint32_t l1, h1;
|
||||
pixels += line_size;
|
||||
for (i = 0; i < h; i += 2) {
|
||||
uint32_t a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
uint32_t b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l1 = (a & 0x03030303UL) + (b & 0x03030303UL);
|
||||
h1 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) = rnd_avg32(*((uint32_t *) block), h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
a = (((const struct unaligned_32 *) (pixels))->l);
|
||||
b = (((const struct unaligned_32 *) (pixels + 1))->l);
|
||||
l0 = (a & 0x03030303UL) + (b & 0x03030303UL) + 0x02020202UL;
|
||||
h0 = ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2);
|
||||
*((uint32_t *) block) = rnd_avg32(*((uint32_t *) block), h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));
|
||||
pixels += line_size;
|
||||
block += line_size;
|
||||
} pixels += 4 - line_size * (h + 1);
|
||||
block += 4 - line_size * h;
|
||||
}
|
||||
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_xy2_num, 1);
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
register int i;
|
||||
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
|
||||
register vector unsigned char blockv, temp1, temp2, blocktemp;
|
||||
@ -1821,7 +1554,6 @@ POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_xy2_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx)
|
||||
|
@ -67,10 +67,6 @@ void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size,
|
||||
#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
|
||||
#endif
|
||||
|
||||
#else /* HAVE_ALTIVEC */
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
#error "I can't use ALTIVEC_USE_REFERENCE_C_CODE if I don't use HAVE_ALTIVEC"
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
#endif /* HAVE_ALTIVEC */
|
||||
|
||||
#endif /* _DSPUTIL_ALTIVEC_ */
|
||||
|
@ -291,11 +291,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
c->idct_put = idct_put_altivec;
|
||||
c->idct_add = idct_add_altivec;
|
||||
#ifndef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
c->idct_permutation_type = FF_NO_IDCT_PERM;
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,12 +198,6 @@ static vector float fdctconsts[3] = {
|
||||
void fdct_altivec(int16_t *block)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_fdct, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
POWERPC_PERF_START_COUNT(altivec_fdct, 1);
|
||||
void ff_jpeg_fdct_islow(int16_t *block);
|
||||
ff_jpeg_fdct_islow(block);
|
||||
POWERPC_PERF_STOP_COUNT(altivec_fdct, 1);
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
vector signed short *bp;
|
||||
vector float *cp;
|
||||
vector float b00, b10, b20, b30, b40, b50, b60, b70;
|
||||
@ -494,7 +488,6 @@ POWERPC_PERF_STOP_COUNT(altivec_fdct, 1);
|
||||
/* }}} */
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_fdct, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
/* vim:set foldmethod=marker foldlevel=0: */
|
||||
|
@ -65,83 +65,6 @@
|
||||
void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_fft_num, s->nbits >= 6);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
int ln = s->nbits;
|
||||
int j, np, np2;
|
||||
int nblocks, nloops;
|
||||
register FFTComplex *p, *q;
|
||||
FFTComplex *exptab = s->exptab;
|
||||
int l;
|
||||
FFTSample tmp_re, tmp_im;
|
||||
|
||||
POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6);
|
||||
|
||||
np = 1 << ln;
|
||||
|
||||
/* pass 0 */
|
||||
|
||||
p=&z[0];
|
||||
j=(np >> 1);
|
||||
do {
|
||||
BF(p[0].re, p[0].im, p[1].re, p[1].im,
|
||||
p[0].re, p[0].im, p[1].re, p[1].im);
|
||||
p+=2;
|
||||
} while (--j != 0);
|
||||
|
||||
/* pass 1 */
|
||||
|
||||
|
||||
p=&z[0];
|
||||
j=np >> 2;
|
||||
if (s->inverse) {
|
||||
do {
|
||||
BF(p[0].re, p[0].im, p[2].re, p[2].im,
|
||||
p[0].re, p[0].im, p[2].re, p[2].im);
|
||||
BF(p[1].re, p[1].im, p[3].re, p[3].im,
|
||||
p[1].re, p[1].im, -p[3].im, p[3].re);
|
||||
p+=4;
|
||||
} while (--j != 0);
|
||||
} else {
|
||||
do {
|
||||
BF(p[0].re, p[0].im, p[2].re, p[2].im,
|
||||
p[0].re, p[0].im, p[2].re, p[2].im);
|
||||
BF(p[1].re, p[1].im, p[3].re, p[3].im,
|
||||
p[1].re, p[1].im, p[3].im, -p[3].re);
|
||||
p+=4;
|
||||
} while (--j != 0);
|
||||
}
|
||||
/* pass 2 .. ln-1 */
|
||||
|
||||
nblocks = np >> 3;
|
||||
nloops = 1 << 2;
|
||||
np2 = np >> 1;
|
||||
do {
|
||||
p = z;
|
||||
q = z + nloops;
|
||||
for (j = 0; j < nblocks; ++j) {
|
||||
BF(p->re, p->im, q->re, q->im,
|
||||
p->re, p->im, q->re, q->im);
|
||||
|
||||
p++;
|
||||
q++;
|
||||
for(l = nblocks; l < np2; l += nblocks) {
|
||||
CMUL(tmp_re, tmp_im, exptab[l].re, exptab[l].im, q->re, q->im);
|
||||
BF(p->re, p->im, q->re, q->im,
|
||||
p->re, p->im, tmp_re, tmp_im);
|
||||
p++;
|
||||
q++;
|
||||
}
|
||||
|
||||
p += nloops;
|
||||
q += nloops;
|
||||
}
|
||||
nblocks = nblocks >> 1;
|
||||
nloops = nloops << 1;
|
||||
} while (nblocks != 0);
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_fft_num, s->nbits >= 6);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
#ifdef CONFIG_DARWIN
|
||||
register const vector float vczero = (const vector float)(0.);
|
||||
#else
|
||||
@ -244,6 +167,4 @@ POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6);
|
||||
} while (nblocks != 0);
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_fft_num, s->nbits >= 6);
|
||||
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
@ -34,32 +34,6 @@
|
||||
void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
const int A=(16-x16)*(16-y16);
|
||||
const int B=( x16)*(16-y16);
|
||||
const int C=(16-x16)*( y16);
|
||||
const int D=( x16)*( y16);
|
||||
int i;
|
||||
|
||||
POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
|
||||
|
||||
for(i=0; i<h; i++)
|
||||
{
|
||||
dst[0]= (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + rounder)>>8;
|
||||
dst[1]= (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + rounder)>>8;
|
||||
dst[2]= (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + rounder)>>8;
|
||||
dst[3]= (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + rounder)>>8;
|
||||
dst[4]= (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + rounder)>>8;
|
||||
dst[5]= (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + rounder)>>8;
|
||||
dst[6]= (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + rounder)>>8;
|
||||
dst[7]= (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + rounder)>>8;
|
||||
dst+= stride;
|
||||
src+= stride;
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
|
||||
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
const unsigned short __attribute__ ((aligned(16))) rounder_a[8] =
|
||||
{rounder, rounder, rounder, rounder,
|
||||
rounder, rounder, rounder, rounder};
|
||||
@ -169,6 +143,4 @@ POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
|
||||
}
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
|
||||
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
@ -169,12 +169,6 @@ static const_vector_s16_t constants[5] = {
|
||||
void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_idct_put_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1);
|
||||
void simple_idct_put(uint8_t *dest, int line_size, int16_t *block);
|
||||
simple_idct_put(dest, stride, (int16_t*)block);
|
||||
POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1);
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
vector_u8_t tmp;
|
||||
|
||||
#ifdef POWERPC_PERFORMANCE_REPORT
|
||||
@ -197,18 +191,11 @@ POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1);
|
||||
COPY (dest, vx7)
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block)
|
||||
{
|
||||
POWERPC_PERF_DECLARE(altivec_idct_add_num, 1);
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1);
|
||||
void simple_idct_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
simple_idct_add(dest, stride, (int16_t*)block);
|
||||
POWERPC_PERF_STOP_COUNT(altivec_idct_add_num, 1);
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
vector_u8_t tmp;
|
||||
vector_s16_t tmp2, tmp3;
|
||||
vector_u8_t perm0;
|
||||
@ -246,6 +233,5 @@ POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1);
|
||||
ADD (dest, vx7, perm1)
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_idct_add_num, 1);
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
|
||||
|
@ -554,19 +554,6 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1);
|
||||
nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
|
||||
}
|
||||
|
||||
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
for(;i<=nCoeffs;i++) {
|
||||
level = block[i];
|
||||
if (level) {
|
||||
if (level < 0) {
|
||||
level = level * qmul - qadd;
|
||||
} else {
|
||||
level = level * qmul + qadd;
|
||||
}
|
||||
block[i] = level;
|
||||
}
|
||||
}
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
{
|
||||
register const_vector signed short vczero = (const_vector signed short)vec_splat_s16(0);
|
||||
short __attribute__ ((aligned(16))) qmul8[] =
|
||||
@ -645,7 +632,5 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1);
|
||||
block[0] = backup_0;
|
||||
}
|
||||
}
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
|
||||
POWERPC_PERF_STOP_COUNT(altivec_dct_unquantize_h263_num, nCoeffs == 63);
|
||||
}
|
||||
|
@ -48,11 +48,7 @@ void MPV_common_init_ppc(MpegEncContext *s)
|
||||
{
|
||||
s->dsp.idct_put = idct_put_altivec;
|
||||
s->dsp.idct_add = idct_add_altivec;
|
||||
#ifndef ALTIVEC_USE_REFERENCE_C_CODE
|
||||
s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
|
||||
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
s->dsp.idct_permutation_type = FF_NO_IDCT_PERM;
|
||||
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user