Commit b420448e authored by Luca Barbato's avatar Luca Barbato

removing ALTIVEC_USE_REFERENCE_C_CODE, since has no use anymore

Originally committed as revision 6606 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 1c2a417f
...@@ -1789,8 +1789,6 @@ fi ...@@ -1789,8 +1789,6 @@ fi
if test "$altivec" = "yes" ; then if test "$altivec" = "yes" ; then
echo "TARGET_ALTIVEC=yes" >> config.mak echo "TARGET_ALTIVEC=yes" >> config.mak
echo "#define HAVE_ALTIVEC 1" >> $TMPH 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 if test "$_altivec_h" = "yes" ; then
echo "#define HAVE_ALTIVEC_H 1" >> $TMPH echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
else else
......
This diff is collapsed.
...@@ -67,10 +67,6 @@ void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, ...@@ -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} #define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
#endif #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 /* HAVE_ALTIVEC */
#endif /* _DSPUTIL_ALTIVEC_ */ #endif /* _DSPUTIL_ALTIVEC_ */
...@@ -291,11 +291,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) ...@@ -291,11 +291,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
{ {
c->idct_put = idct_put_altivec; c->idct_put = idct_put_altivec;
c->idct_add = idct_add_altivec; c->idct_add = idct_add_altivec;
#ifndef ALTIVEC_USE_REFERENCE_C_CODE
c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; 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] = { ...@@ -198,12 +198,6 @@ static vector float fdctconsts[3] = {
void fdct_altivec(int16_t *block) void fdct_altivec(int16_t *block)
{ {
POWERPC_PERF_DECLARE(altivec_fdct, 1); 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 signed short *bp;
vector float *cp; vector float *cp;
vector float b00, b10, b20, b30, b40, b50, b60, b70; vector float b00, b10, b20, b30, b40, b50, b60, b70;
...@@ -494,7 +488,6 @@ POWERPC_PERF_STOP_COUNT(altivec_fdct, 1); ...@@ -494,7 +488,6 @@ POWERPC_PERF_STOP_COUNT(altivec_fdct, 1);
/* }}} */ /* }}} */
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: */ /* vim:set foldmethod=marker foldlevel=0: */
...@@ -65,83 +65,6 @@ ...@@ -65,83 +65,6 @@
void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z) void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z)
{ {
POWERPC_PERF_DECLARE(altivec_fft_num, s->nbits >= 6); 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 #ifdef CONFIG_DARWIN
register const vector float vczero = (const vector float)(0.); register const vector float vczero = (const vector float)(0.);
#else #else
...@@ -244,6 +167,4 @@ POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6); ...@@ -244,6 +167,4 @@ POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6);
} while (nblocks != 0); } while (nblocks != 0);
POWERPC_PERF_STOP_COUNT(altivec_fft_num, s->nbits >= 6); POWERPC_PERF_STOP_COUNT(altivec_fft_num, s->nbits >= 6);
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
} }
...@@ -34,32 +34,6 @@ ...@@ -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) 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); 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] = const unsigned short __attribute__ ((aligned(16))) rounder_a[8] =
{rounder, rounder, rounder, rounder, {rounder, rounder, rounder, rounder,
rounder, rounder, rounder, rounder}; rounder, rounder, rounder, rounder};
...@@ -169,6 +143,4 @@ POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND); ...@@ -169,6 +143,4 @@ POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
} }
POWERPC_PERF_STOP_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] = { ...@@ -169,12 +169,6 @@ static const_vector_s16_t constants[5] = {
void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block) void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
{ {
POWERPC_PERF_DECLARE(altivec_idct_put_num, 1); 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; vector_u8_t tmp;
#ifdef POWERPC_PERFORMANCE_REPORT #ifdef POWERPC_PERFORMANCE_REPORT
...@@ -197,18 +191,11 @@ POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1); ...@@ -197,18 +191,11 @@ POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1);
COPY (dest, vx7) COPY (dest, vx7)
POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1); 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) void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block)
{ {
POWERPC_PERF_DECLARE(altivec_idct_add_num, 1); 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_u8_t tmp;
vector_s16_t tmp2, tmp3; vector_s16_t tmp2, tmp3;
vector_u8_t perm0; vector_u8_t perm0;
...@@ -246,6 +233,5 @@ POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1); ...@@ -246,6 +233,5 @@ POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1);
ADD (dest, vx7, perm1) ADD (dest, vx7, perm1)
POWERPC_PERF_STOP_COUNT(altivec_idct_add_num, 1); 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); ...@@ -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] ]; 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); register const_vector signed short vczero = (const_vector signed short)vec_splat_s16(0);
short __attribute__ ((aligned(16))) qmul8[] = short __attribute__ ((aligned(16))) qmul8[] =
...@@ -645,7 +632,5 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); ...@@ -645,7 +632,5 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1);
block[0] = backup_0; block[0] = backup_0;
} }
} }
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
POWERPC_PERF_STOP_COUNT(altivec_dct_unquantize_h263_num, nCoeffs == 63); POWERPC_PERF_STOP_COUNT(altivec_dct_unquantize_h263_num, nCoeffs == 63);
} }
...@@ -48,11 +48,7 @@ void MPV_common_init_ppc(MpegEncContext *s) ...@@ -48,11 +48,7 @@ void MPV_common_init_ppc(MpegEncContext *s)
{ {
s->dsp.idct_put = idct_put_altivec; s->dsp.idct_put = idct_put_altivec;
s->dsp.idct_add = idct_add_altivec; s->dsp.idct_add = idct_add_altivec;
#ifndef ALTIVEC_USE_REFERENCE_C_CODE
s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; 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 */
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment