Commit be6ed6ff authored by Måns Rullgård's avatar Måns Rullgård

move some CFLAGS settings away from config.* writing section

Originally committed as revision 7043 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8233b750
...@@ -1680,6 +1680,9 @@ if test "$gprof" = "yes" ; then ...@@ -1680,6 +1680,9 @@ if test "$gprof" = "yes" ; then
add_ldflags "-p" add_ldflags "-p"
fi fi
VHOOKCFLAGS="-fPIC $CFLAGS"
test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
# find if .align arg is power-of-two or not # find if .align arg is power-of-two or not
if test $asmalign_pot = "unknown"; then if test $asmalign_pot = "unknown"; then
asmalign_pot="no" asmalign_pot="no"
...@@ -1817,9 +1820,6 @@ else ...@@ -1817,9 +1820,6 @@ else
echo "INSTALLSTRIP=" >> config.mak echo "INSTALLSTRIP=" >> config.mak
fi fi
VHOOKCFLAGS="-fPIC $CFLAGS"
test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
echo "OPTFLAGS=$CFLAGS" >> config.mak echo "OPTFLAGS=$CFLAGS" >> config.mak
echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
echo "LDFLAGS=$LDFLAGS" >> config.mak echo "LDFLAGS=$LDFLAGS" >> config.mak
......
...@@ -57,9 +57,3 @@ extern const uint16_t floortab[8]; ...@@ -57,9 +57,3 @@ extern const uint16_t floortab[8];
extern const uint16_t fgaintab[8]; extern const uint16_t fgaintab[8];
#endif #endif
void ac3_common_init(void);
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe,
int deltbae,int deltnseg,
uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba);
...@@ -119,6 +119,7 @@ static inline int calc_lowcomp(int a, int b0, int b1, int bin) ...@@ -119,6 +119,7 @@ static inline int calc_lowcomp(int a, int b0, int b1, int bin)
/* AC3 bit allocation. The algorithm is the one described in the AC3 /* AC3 bit allocation. The algorithm is the one described in the AC3
spec. */ spec. */
static
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap, void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
int8_t *exp, int start, int end, int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe, int snroffset, int fgain, int is_lfe,
...@@ -794,7 +795,7 @@ static int compute_bit_allocation(AC3EncodeContext *s, ...@@ -794,7 +795,7 @@ static int compute_bit_allocation(AC3EncodeContext *s,
return 0; return 0;
} }
void ac3_common_init(void) static void ac3_common_init(void)
{ {
int i, j, k, l, v; int i, j, k, l, v;
/* compute bndtab and masktab from bandsz */ /* compute bndtab and masktab from bandsz */
......
...@@ -128,7 +128,7 @@ static void nop(uint8_t *block, const uint8_t *pixels, int line_size, int h) ...@@ -128,7 +128,7 @@ static void nop(uint8_t *block, const uint8_t *pixels, int line_size, int h)
return; return;
} }
int mm_flags; /* multimedia extension flags */ int ff_mm_flags; /* multimedia extension flags */
int mm_support(void) int mm_support(void)
{ {
...@@ -137,16 +137,16 @@ int mm_support(void) ...@@ -137,16 +137,16 @@ int mm_support(void)
void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx) void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx)
{ {
mm_flags = mm_support(); ff_mm_flags = mm_support();
if (avctx->dsp_mask) { if (avctx->dsp_mask) {
if (avctx->dsp_mask & FF_MM_FORCE) if (avctx->dsp_mask & FF_MM_FORCE)
mm_flags |= (avctx->dsp_mask & 0xffff); ff_mm_flags |= (avctx->dsp_mask & 0xffff);
else else
mm_flags &= ~(avctx->dsp_mask & 0xffff); ff_mm_flags &= ~(avctx->dsp_mask & 0xffff);
} }
if (!(mm_flags & MM_IWMMXT)) return; if (!(ff_mm_flags & MM_IWMMXT)) return;
c->add_pixels_clamped = add_pixels_clamped_iwmmxt; c->add_pixels_clamped = add_pixels_clamped_iwmmxt;
......
...@@ -110,7 +110,7 @@ static void dct_unquantize_h263_inter_iwmmxt(MpegEncContext *s, ...@@ -110,7 +110,7 @@ static void dct_unquantize_h263_inter_iwmmxt(MpegEncContext *s,
void MPV_common_init_iwmmxt(MpegEncContext *s) void MPV_common_init_iwmmxt(MpegEncContext *s)
{ {
if (!(mm_flags & MM_IWMMXT)) return; if (!(ff_mm_flags & MM_IWMMXT)) return;
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_iwmmxt; s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_iwmmxt;
#if 0 #if 0
......
...@@ -69,7 +69,7 @@ static const unsigned short aanscales[64] = { ...@@ -69,7 +69,7 @@ static const unsigned short aanscales[64] = {
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
}; };
uint8_t cropTbl[256 + 2 * MAX_NEG_CROP]; uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
int64_t gettime(void) int64_t gettime(void)
{ {
...@@ -473,10 +473,10 @@ int main(int argc, char **argv) ...@@ -473,10 +473,10 @@ int main(int argc, char **argv)
init_fdct(); init_fdct();
idct_mmx_init(); idct_mmx_init();
for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i; for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i;
for(i=0;i<MAX_NEG_CROP;i++) { for(i=0;i<MAX_NEG_CROP;i++) {
cropTbl[i] = 0; ff_cropTbl[i] = 0;
cropTbl[i + MAX_NEG_CROP + 256] = 255; ff_cropTbl[i + MAX_NEG_CROP + 256] = 255;
} }
for(;;) { for(;;) {
......
...@@ -68,7 +68,7 @@ const uint8_t ff_zigzag248_direct[64] = { ...@@ -68,7 +68,7 @@ const uint8_t ff_zigzag248_direct[64] = {
}; };
/* not permutated inverse zigzag_direct + 1 for MMX quantizer */ /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
DECLARE_ALIGNED_8(uint16_t, inv_zigzag_direct16[64]) = {0, }; DECLARE_ALIGNED_8(uint16_t, ff_inv_zigzag_direct16[64]) = {0, };
const uint8_t ff_alternate_horizontal_scan[64] = { const uint8_t ff_alternate_horizontal_scan[64] = {
0, 1, 2, 3, 8, 9, 16, 17, 0, 1, 2, 3, 8, 9, 16, 17,
...@@ -383,11 +383,11 @@ static int w97_16_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int ...@@ -383,11 +383,11 @@ static int w97_16_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int
return w_c(v, pix1, pix2, line_size, 16, h, 0); return w_c(v, pix1, pix2, line_size, 16, h, 0);
} }
int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ int ff_w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
return w_c(v, pix1, pix2, line_size, 32, h, 1); return w_c(v, pix1, pix2, line_size, 32, h, 1);
} }
int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ int ff_w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
return w_c(v, pix1, pix2, line_size, 32, h, 0); return w_c(v, pix1, pix2, line_size, 32, h, 0);
} }
#endif #endif
...@@ -3861,7 +3861,7 @@ static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block) ...@@ -3861,7 +3861,7 @@ static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block)
static void just_return() { return; } static void just_return() { return; }
/* init static data */ /* init static data */
void dsputil_static_init(void) void ff_dsputil_static_init(void)
{ {
int i; int i;
...@@ -3875,7 +3875,7 @@ void dsputil_static_init(void) ...@@ -3875,7 +3875,7 @@ void dsputil_static_init(void)
ff_squareTbl[i] = (i - 256) * (i - 256); ff_squareTbl[i] = (i - 256) * (i - 256);
} }
for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1; for(i=0; i<64; i++) ff_inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
} }
......
...@@ -405,7 +405,7 @@ typedef struct DSPContext { ...@@ -405,7 +405,7 @@ typedef struct DSPContext {
op_pixels_func put_vc1_mspel_pixels_tab[16]; op_pixels_func put_vc1_mspel_pixels_tab[16];
} DSPContext; } DSPContext;
void dsputil_static_init(void); void ff_dsputil_static_init(void);
void dsputil_init(DSPContext* p, AVCodecContext *avctx); void dsputil_init(DSPContext* p, AVCodecContext *avctx);
/** /**
...@@ -463,6 +463,8 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){ ...@@ -463,6 +463,8 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){
one or more MultiMedia extension */ one or more MultiMedia extension */
int mm_support(void); int mm_support(void);
extern int ff_mm_flags;
#ifdef __GNUC__ #ifdef __GNUC__
#define DECLARE_ALIGNED_16(t,v) t v __attribute__ ((aligned (16))) #define DECLARE_ALIGNED_16(t,v) t v __attribute__ ((aligned (16)))
#else #else
...@@ -481,8 +483,6 @@ int mm_support(void); ...@@ -481,8 +483,6 @@ int mm_support(void);
#define MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */ #define MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
#define MM_SSE3 0x0040 /* Prescott SSE3 functions */ #define MM_SSE3 0x0040 /* Prescott SSE3 functions */
extern int mm_flags;
void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
...@@ -495,7 +495,7 @@ static inline void emms(void) ...@@ -495,7 +495,7 @@ static inline void emms(void)
#define emms_c() \ #define emms_c() \
{\ {\
if (mm_flags & MM_MMX)\ if (ff_mm_flags & MM_MMX)\
emms();\ emms();\
} }
...@@ -519,8 +519,6 @@ void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); ...@@ -519,8 +519,6 @@ void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
#define MM_IWMMXT 0x0100 /* XScale IWMMXT */ #define MM_IWMMXT 0x0100 /* XScale IWMMXT */
extern int mm_flags;
void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx); void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx);
#elif defined(HAVE_MLIB) #elif defined(HAVE_MLIB)
...@@ -549,8 +547,6 @@ void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx); ...@@ -549,8 +547,6 @@ void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
#define MM_ALTIVEC 0x0001 /* standard AltiVec */ #define MM_ALTIVEC 0x0001 /* standard AltiVec */
extern int mm_flags;
#if defined(HAVE_ALTIVEC) && !defined(CONFIG_DARWIN) #if defined(HAVE_ALTIVEC) && !defined(CONFIG_DARWIN)
#define pixel altivec_pixel #define pixel altivec_pixel
#include <altivec.h> #include <altivec.h>
......
...@@ -643,7 +643,7 @@ retry: ...@@ -643,7 +643,7 @@ retry:
#endif #endif
#if defined(HAVE_MMX) && defined(CONFIG_GPL) #if defined(HAVE_MMX) && defined(CONFIG_GPL)
if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build && avctx->idct_algo == FF_IDCT_AUTO && (mm_flags & MM_MMX)){ if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build && avctx->idct_algo == FF_IDCT_AUTO && (ff_mm_flags & MM_MMX)){
avctx->idct_algo= FF_IDCT_XVIDMMX; avctx->idct_algo= FF_IDCT_XVIDMMX;
avctx->coded_width= 0; // force reinit avctx->coded_width= 0; // force reinit
// dsputil_init(&s->dsp, avctx); // dsputil_init(&s->dsp, avctx);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
extern void ff_idct_xvid_mmx(short *block); extern void ff_idct_xvid_mmx(short *block);
extern void ff_idct_xvid_mmx2(short *block); extern void ff_idct_xvid_mmx2(short *block);
int mm_flags; /* multimedia extension flags */ int ff_mm_flags; /* multimedia extension flags */
/* pixel operations */ /* pixel operations */
static const uint64_t mm_bone attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL; static const uint64_t mm_bone attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL;
...@@ -3050,39 +3050,39 @@ extern void ff_snow_inner_add_yblock_mmx(uint8_t *obmc, const int obmc_stride, u ...@@ -3050,39 +3050,39 @@ extern void ff_snow_inner_add_yblock_mmx(uint8_t *obmc, const int obmc_stride, u
void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
{ {
mm_flags = mm_support(); ff_mm_flags = mm_support();
if (avctx->dsp_mask) { if (avctx->dsp_mask) {
if (avctx->dsp_mask & FF_MM_FORCE) if (avctx->dsp_mask & FF_MM_FORCE)
mm_flags |= (avctx->dsp_mask & 0xffff); ff_mm_flags |= (avctx->dsp_mask & 0xffff);
else else
mm_flags &= ~(avctx->dsp_mask & 0xffff); ff_mm_flags &= ~(avctx->dsp_mask & 0xffff);
} }
#if 0 #if 0
av_log(avctx, AV_LOG_INFO, "libavcodec: CPU flags:"); av_log(avctx, AV_LOG_INFO, "libavcodec: CPU flags:");
if (mm_flags & MM_MMX) if (ff_mm_flags & MM_MMX)
av_log(avctx, AV_LOG_INFO, " mmx"); av_log(avctx, AV_LOG_INFO, " mmx");
if (mm_flags & MM_MMXEXT) if (ff_mm_flags & MM_MMXEXT)
av_log(avctx, AV_LOG_INFO, " mmxext"); av_log(avctx, AV_LOG_INFO, " mmxext");
if (mm_flags & MM_3DNOW) if (ff_mm_flags & MM_3DNOW)
av_log(avctx, AV_LOG_INFO, " 3dnow"); av_log(avctx, AV_LOG_INFO, " 3dnow");
if (mm_flags & MM_SSE) if (ff_mm_flags & MM_SSE)
av_log(avctx, AV_LOG_INFO, " sse"); av_log(avctx, AV_LOG_INFO, " sse");
if (mm_flags & MM_SSE2) if (ff_mm_flags & MM_SSE2)
av_log(avctx, AV_LOG_INFO, " sse2"); av_log(avctx, AV_LOG_INFO, " sse2");
av_log(avctx, AV_LOG_INFO, "\n"); av_log(avctx, AV_LOG_INFO, "\n");
#endif #endif
if (mm_flags & MM_MMX) { if (ff_mm_flags & MM_MMX) {
const int idct_algo= avctx->idct_algo; const int idct_algo= avctx->idct_algo;
#ifdef CONFIG_ENCODERS #ifdef CONFIG_ENCODERS
const int dct_algo = avctx->dct_algo; const int dct_algo = avctx->dct_algo;
if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){
if(mm_flags & MM_SSE2){ if(ff_mm_flags & MM_SSE2){
c->fdct = ff_fdct_sse2; c->fdct = ff_fdct_sse2;
}else if(mm_flags & MM_MMXEXT){ }else if(ff_mm_flags & MM_MMXEXT){
c->fdct = ff_fdct_mmx2; c->fdct = ff_fdct_mmx2;
}else{ }else{
c->fdct = ff_fdct_mmx; c->fdct = ff_fdct_mmx;
...@@ -3097,7 +3097,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3097,7 +3097,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->idct_permutation_type= FF_SIMPLE_IDCT_PERM; c->idct_permutation_type= FF_SIMPLE_IDCT_PERM;
#ifdef CONFIG_GPL #ifdef CONFIG_GPL
}else if(idct_algo==FF_IDCT_LIBMPEG2MMX){ }else if(idct_algo==FF_IDCT_LIBMPEG2MMX){
if(mm_flags & MM_MMXEXT){ if(ff_mm_flags & MM_MMXEXT){
c->idct_put= ff_libmpeg2mmx2_idct_put; c->idct_put= ff_libmpeg2mmx2_idct_put;
c->idct_add= ff_libmpeg2mmx2_idct_add; c->idct_add= ff_libmpeg2mmx2_idct_add;
c->idct = ff_mmxext_idct; c->idct = ff_mmxext_idct;
...@@ -3111,7 +3111,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3111,7 +3111,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
}else if(idct_algo==FF_IDCT_VP3 && }else if(idct_algo==FF_IDCT_VP3 &&
avctx->codec->id!=CODEC_ID_THEORA && avctx->codec->id!=CODEC_ID_THEORA &&
!(avctx->flags & CODEC_FLAG_BITEXACT)){ !(avctx->flags & CODEC_FLAG_BITEXACT)){
if(mm_flags & MM_SSE2){ if(ff_mm_flags & MM_SSE2){
c->idct_put= ff_vp3_idct_put_sse2; c->idct_put= ff_vp3_idct_put_sse2;
c->idct_add= ff_vp3_idct_add_sse2; c->idct_add= ff_vp3_idct_add_sse2;
c->idct = ff_vp3_idct_sse2; c->idct = ff_vp3_idct_sse2;
...@@ -3126,7 +3126,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3126,7 +3126,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
}else if(idct_algo==FF_IDCT_CAVS){ }else if(idct_algo==FF_IDCT_CAVS){
c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM; c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM;
}else if(idct_algo==FF_IDCT_XVIDMMX){ }else if(idct_algo==FF_IDCT_XVIDMMX){
if(mm_flags & MM_MMXEXT){ if(ff_mm_flags & MM_MMXEXT){
c->idct_put= ff_idct_xvid_mmx2_put; c->idct_put= ff_idct_xvid_mmx2_put;
c->idct_add= ff_idct_xvid_mmx2_add; c->idct_add= ff_idct_xvid_mmx2_add;
c->idct = ff_idct_xvid_mmx2; c->idct = ff_idct_xvid_mmx2;
...@@ -3200,7 +3200,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3200,7 +3200,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->hadamard8_diff[1]= hadamard8_diff_mmx; c->hadamard8_diff[1]= hadamard8_diff_mmx;
c->pix_norm1 = pix_norm1_mmx; c->pix_norm1 = pix_norm1_mmx;
c->sse[0] = (mm_flags & MM_SSE2) ? sse16_sse2 : sse16_mmx; c->sse[0] = (ff_mm_flags & MM_SSE2) ? sse16_sse2 : sse16_mmx;
c->sse[1] = sse8_mmx; c->sse[1] = sse8_mmx;
c->vsad[4]= vsad_intra16_mmx; c->vsad[4]= vsad_intra16_mmx;
...@@ -3227,7 +3227,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3227,7 +3227,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->h264_idct8_dc_add= c->h264_idct8_dc_add=
c->h264_idct8_add= ff_h264_idct8_add_mmx; c->h264_idct8_add= ff_h264_idct8_add_mmx;
if (mm_flags & MM_MMXEXT) { if (ff_mm_flags & MM_MMXEXT) {
c->prefetch = prefetch_mmx2; c->prefetch = prefetch_mmx2;
c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2; c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2;
...@@ -3369,7 +3369,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3369,7 +3369,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
#ifdef CONFIG_ENCODERS #ifdef CONFIG_ENCODERS
c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_mmx2; c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_mmx2;
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS
} else if (mm_flags & MM_3DNOW) { } else if (ff_mm_flags & MM_3DNOW) {
c->prefetch = prefetch_3dnow; c->prefetch = prefetch_3dnow;
c->put_pixels_tab[0][1] = put_pixels16_x2_3dnow; c->put_pixels_tab[0][1] = put_pixels16_x2_3dnow;
...@@ -3463,7 +3463,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3463,7 +3463,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
} }
#ifdef CONFIG_SNOW_ENCODER #ifdef CONFIG_SNOW_ENCODER
if(mm_flags & MM_SSE2){ if(ff_mm_flags & MM_SSE2){
c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2; c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2;
c->vertical_compose97i = ff_snow_vertical_compose97i_sse2; c->vertical_compose97i = ff_snow_vertical_compose97i_sse2;
c->inner_add_yblock = ff_snow_inner_add_yblock_sse2; c->inner_add_yblock = ff_snow_inner_add_yblock_sse2;
...@@ -3475,22 +3475,22 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -3475,22 +3475,22 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
} }
#endif #endif
if(mm_flags & MM_3DNOW){ if(ff_mm_flags & MM_3DNOW){
c->vorbis_inverse_coupling = vorbis_inverse_coupling_3dnow; c->vorbis_inverse_coupling = vorbis_inverse_coupling_3dnow;
c->vector_fmul = vector_fmul_3dnow; c->vector_fmul = vector_fmul_3dnow;
if(!(avctx->flags & CODEC_FLAG_BITEXACT)) if(!(avctx->flags & CODEC_FLAG_BITEXACT))
c->float_to_int16 = float_to_int16_3dnow; c->float_to_int16 = float_to_int16_3dnow;
} }
if(mm_flags & MM_3DNOWEXT) if(ff_mm_flags & MM_3DNOWEXT)
c->vector_fmul_reverse = vector_fmul_reverse_3dnow2; c->vector_fmul_reverse = vector_fmul_reverse_3dnow2;
if(mm_flags & MM_SSE){ if(ff_mm_flags & MM_SSE){
c->vorbis_inverse_coupling = vorbis_inverse_coupling_sse; c->vorbis_inverse_coupling = vorbis_inverse_coupling_sse;
c->vector_fmul = vector_fmul_sse; c->vector_fmul = vector_fmul_sse;
c->float_to_int16 = float_to_int16_sse; c->float_to_int16 = float_to_int16_sse;
c->vector_fmul_reverse = vector_fmul_reverse_sse; c->vector_fmul_reverse = vector_fmul_reverse_sse;
c->vector_fmul_add_add = vector_fmul_add_add_sse; c->vector_fmul_add_add = vector_fmul_add_add_sse;
} }
if(mm_flags & MM_3DNOW) if(ff_mm_flags & MM_3DNOW)
c->vector_fmul_add_add = vector_fmul_add_add_3dnow; // faster than sse c->vector_fmul_add_add = vector_fmul_add_add_3dnow; // faster than sse
} }
......
...@@ -376,7 +376,7 @@ PIX_SAD(mmx2) ...@@ -376,7 +376,7 @@ PIX_SAD(mmx2)
void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx) void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
{ {
if (mm_flags & MM_MMX) { if (ff_mm_flags & MM_MMX) {
c->pix_abs[0][0] = sad16_mmx; c->pix_abs[0][0] = sad16_mmx;
c->pix_abs[0][1] = sad16_x2_mmx; c->pix_abs[0][1] = sad16_x2_mmx;
c->pix_abs[0][2] = sad16_y2_mmx; c->pix_abs[0][2] = sad16_y2_mmx;
...@@ -389,7 +389,7 @@ void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -389,7 +389,7 @@ void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
c->sad[0]= sad16_mmx; c->sad[0]= sad16_mmx;
c->sad[1]= sad8_mmx; c->sad[1]= sad8_mmx;
} }
if (mm_flags & MM_MMXEXT) { if (ff_mm_flags & MM_MMXEXT) {
c->pix_abs[0][0] = sad16_mmx2; c->pix_abs[0][0] = sad16_mmx2;
c->pix_abs[1][0] = sad8_mmx2; c->pix_abs[1][0] = sad8_mmx2;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "../avcodec.h" #include "../avcodec.h"
#include "x86_cpu.h" #include "x86_cpu.h"
extern uint16_t inv_zigzag_direct16[64]; extern uint16_t ff_inv_zigzag_direct16[64];
static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL; static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL; static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
...@@ -693,7 +693,7 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ ...@@ -693,7 +693,7 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){
void MPV_common_init_mmx(MpegEncContext *s) void MPV_common_init_mmx(MpegEncContext *s)
{ {
if (mm_flags & MM_MMX) { if (ff_mm_flags & MM_MMX) {
const int dct_algo = s->avctx->dct_algo; const int dct_algo = s->avctx->dct_algo;
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx; s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx;
...@@ -706,16 +706,16 @@ void MPV_common_init_mmx(MpegEncContext *s) ...@@ -706,16 +706,16 @@ void MPV_common_init_mmx(MpegEncContext *s)
draw_edges = draw_edges_mmx; draw_edges = draw_edges_mmx;
if (mm_flags & MM_SSE2) { if (ff_mm_flags & MM_SSE2) {
s->denoise_dct= denoise_dct_sse2; s->denoise_dct= denoise_dct_sse2;
} else { } else {
s->denoise_dct= denoise_dct_mmx; s->denoise_dct= denoise_dct_mmx;
} }
if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){
if(mm_flags & MM_SSE2){ if(ff_mm_flags & MM_SSE2){
s->dct_quantize= dct_quantize_SSE2; s->dct_quantize= dct_quantize_SSE2;
} else if(mm_flags & MM_MMXEXT){ } else if(ff_mm_flags & MM_MMXEXT){
s->dct_quantize= dct_quantize_MMX2; s->dct_quantize= dct_quantize_MMX2;
} else { } else {
s->dct_quantize= dct_quantize_MMX; s->dct_quantize= dct_quantize_MMX;
......
...@@ -139,7 +139,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, ...@@ -139,7 +139,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
"movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1 "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
: "+a" (last_non_zero_p1) : "+a" (last_non_zero_p1)
: "r" (block+64), "r" (qmat), "r" (bias), : "r" (block+64), "r" (qmat), "r" (bias),
"r" (inv_zigzag_direct16+64), "r" (temp_block+64) "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64)
); );
// note the asm is split cuz gcc doesnt like that many operands ... // note the asm is split cuz gcc doesnt like that many operands ...
asm volatile( asm volatile(
...@@ -185,7 +185,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, ...@@ -185,7 +185,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
"movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1 "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
: "+a" (last_non_zero_p1) : "+a" (last_non_zero_p1)
: "r" (block+64), "r" (qmat+64), "r" (bias+64), : "r" (block+64), "r" (qmat+64), "r" (bias+64),
"r" (inv_zigzag_direct16+64), "r" (temp_block+64) "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64)
); );
// note the asm is split cuz gcc doesnt like that many operands ... // note the asm is split cuz gcc doesnt like that many operands ...
asm volatile( asm volatile(
......
...@@ -469,7 +469,7 @@ static void h_resample(uint8_t *dst, int dst_width, const uint8_t *src, ...@@ -469,7 +469,7 @@ static void h_resample(uint8_t *dst, int dst_width, const uint8_t *src,
n = dst_width; n = dst_width;
} }
#ifdef HAVE_MMX #ifdef HAVE_MMX
if ((mm_flags & MM_MMX) && NB_TAPS == 4) if ((ff_mm_flags & MM_MMX) && NB_TAPS == 4)
h_resample_fast4_mmx(dst, n, h_resample_fast4_mmx(dst, n,
src, src_width, src_start, src_incr, filters); src, src_width, src_start, src_incr, filters);
else else
...@@ -527,14 +527,14 @@ static void component_resample(ImgReSampleContext *s, ...@@ -527,14 +527,14 @@ static void component_resample(ImgReSampleContext *s,
phase_y = get_phase(src_y); phase_y = get_phase(src_y);
#ifdef HAVE_MMX #ifdef HAVE_MMX
/* desactivated MMX because loss of precision */ /* desactivated MMX because loss of precision */
if ((mm_flags & MM_MMX) && NB_TAPS == 4 && 0) if ((ff_mm_flags & MM_MMX) && NB_TAPS == 4 && 0)
v_resample4_mmx(output, owidth, v_resample4_mmx(output, owidth,
s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth, s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
&s->v_filters[phase_y][0]); &s->v_filters[phase_y][0]);
else else
#endif #endif
#ifdef HAVE_ALTIVEC #ifdef HAVE_ALTIVEC
if ((mm_flags & MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6) if ((ff_mm_flags & MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6)
v_resample16_altivec(output, owidth, v_resample16_altivec(output, owidth,
s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth, s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
&s->v_filters[phase_y][0]); &s->v_filters[phase_y][0]);
......
...@@ -42,7 +42,7 @@ void float_init_altivec(DSPContext* c, AVCodecContext *avctx); ...@@ -42,7 +42,7 @@ void float_init_altivec(DSPContext* c, AVCodecContext *avctx);
#endif #endif
int mm_flags = 0; int ff_mm_flags = 0;
int mm_support(void) int mm_support(void)
{ {
...@@ -277,7 +277,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) ...@@ -277,7 +277,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
dsputil_h264_init_ppc(c, avctx); dsputil_h264_init_ppc(c, avctx);
if (has_altivec()) { if (has_altivec()) {
mm_flags |= MM_ALTIVEC; ff_mm_flags |= MM_ALTIVEC;
dsputil_init_altivec(c, avctx); dsputil_init_altivec(c, avctx);
snow_init_altivec(c, avctx); snow_init_altivec(c, avctx);
......
...@@ -3001,9 +3001,9 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, con ...@@ -3001,9 +3001,9 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, con
* improve the score of the whole frame, so iterative motion est * improve the score of the whole frame, so iterative motion est
* doesn't always converge. */ * doesn't always converge. */
if(s->avctx->me_cmp == FF_CMP_W97) if(s->avctx->me_cmp == FF_CMP_W97)
distortion = w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); distortion = ff_w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
else if(s->avctx->me_cmp == FF_CMP_W53) else if(s->avctx->me_cmp == FF_CMP_W53)
distortion = w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); distortion = ff_w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
else{ else{
distortion = 0; distortion = 0;
for(i=0; i<4; i++){ for(i=0; i<4; i++){
......
...@@ -128,8 +128,8 @@ extern void ff_snow_horizontal_compose97i(DWTELEM *b, int width); ...@@ -128,8 +128,8 @@ extern void ff_snow_horizontal_compose97i(DWTELEM *b, int width);
extern void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); extern void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
#ifdef CONFIG_SNOW_ENCODER #ifdef CONFIG_SNOW_ENCODER
int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h); int ff_w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h); int ff_w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
#else #else
static int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {assert (0);} static int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {assert (0);}
static int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {assert (0);} static int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {assert (0);}
......
...@@ -1197,7 +1197,7 @@ void avcodec_init(void) ...@@ -1197,7 +1197,7 @@ void avcodec_init(void)
return; return;
inited = 1; inited = 1;
dsputil_static_init(); ff_dsputil_static_init();
init_crcs(); init_crcs();
} }
......
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