diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2009-01-13 23:44:16 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2009-01-13 23:44:16 +0000 |
commit | b250f9c66d3ddd84652d158fb979a5f21e3f2c71 (patch) | |
tree | ef84366029d6f8af6ed82e90c5f188bb7dfc844d /libavcodec/x86 | |
parent | 959da985b03570cfe7d239c0ba6d550ecb04c460 (diff) | |
download | ffmpeg-b250f9c66d3ddd84652d158fb979a5f21e3f2c71.tar.gz |
Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.
Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/cpuid.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_mmx.c | 28 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_mmx.h | 2 | ||||
-rw-r--r-- | libavcodec/x86/dsputilenc_mmx.c | 10 | ||||
-rw-r--r-- | libavcodec/x86/fft_sse.c | 2 | ||||
-rw-r--r-- | libavcodec/x86/h264_i386.h | 8 | ||||
-rw-r--r-- | libavcodec/x86/h264dsp_mmx.c | 10 | ||||
-rw-r--r-- | libavcodec/x86/idct_sse2_xvid.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/mpegvideo_mmx.c | 16 | ||||
-rw-r--r-- | libavcodec/x86/mpegvideo_mmx_template.c | 8 | ||||
-rw-r--r-- | libavcodec/x86/snowdsp_mmx.c | 2 |
11 files changed, 49 insertions, 45 deletions
diff --git a/libavcodec/x86/cpuid.c b/libavcodec/x86/cpuid.c index 664bac35ab..033ac0dd5f 100644 --- a/libavcodec/x86/cpuid.c +++ b/libavcodec/x86/cpuid.c @@ -44,7 +44,7 @@ int mm_support(void) int max_std_level, max_ext_level, std_caps=0, ext_caps=0; x86_reg a, c; -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define PUSHF "pushfq\n\t" #define POPF "popfq\n\t" #else @@ -83,7 +83,7 @@ int mm_support(void) rval |= FF_MM_MMX; if (std_caps & (1<<25)) rval |= FF_MM_MMXEXT -#ifdef HAVE_SSE +#if HAVE_SSE | FF_MM_SSE; if (std_caps & (1<<26)) rval |= FF_MM_SSE2; diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 1d93351507..0423da16fe 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -880,7 +880,7 @@ static void add_png_paeth_prediction_##cpu(uint8_t *dst, uint8_t *src, uint8_t * "pabsw %%mm5, %%mm5 \n" PAETH(mmx2, ABS3_MMX2) -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 PAETH(ssse3, ABS3_SSSE3) #endif @@ -1765,7 +1765,7 @@ void ff_mmxext_idct(DCTELEM *block); /* XXX: those functions should be suppressed ASAP when all IDCTs are converted */ -#ifdef CONFIG_GPL +#if CONFIG_GPL static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block) { ff_mmx_idct (block); @@ -2147,7 +2147,7 @@ static void vector_fmul_add_add_sse(float *dst, const float *src0, const float * static void vector_fmul_window_3dnow2(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len){ -#ifdef HAVE_6REGS +#if HAVE_6REGS if(add_bias == 0){ x86_reg i = -len*4; x86_reg j = len*4-8; @@ -2182,7 +2182,7 @@ static void vector_fmul_window_3dnow2(float *dst, const float *src0, const float static void vector_fmul_window_sse(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len){ -#ifdef HAVE_6REGS +#if HAVE_6REGS if(add_bias == 0){ x86_reg i = -len*4; x86_reg j = len*4-16; @@ -2324,7 +2324,7 @@ static void float_to_int16_sse2(int16_t *dst, const float *src, long len){ ); } -#ifdef HAVE_YASM +#if HAVE_YASM void ff_float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len); void ff_float_to_int16_interleave6_3dnow(int16_t *dst, const float **src, int len); void ff_float_to_int16_interleave6_3dn2(int16_t *dst, const float **src, int len); @@ -2332,7 +2332,7 @@ void ff_x264_deblock_v_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, void ff_x264_deblock_h_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); void ff_x264_deblock_v8_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta); void ff_x264_deblock_h_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta); -#ifdef ARCH_X86_32 +#if ARCH_X86_32 static void ff_x264_deblock_v_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta) { ff_x264_deblock_v8_luma_intra_mmxext(pix+0, stride, alpha, beta); @@ -2555,7 +2555,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) c->idct_add= ff_simple_idct_add_mmx; c->idct = ff_simple_idct_mmx; c->idct_permutation_type= FF_SIMPLE_IDCT_PERM; -#ifdef CONFIG_GPL +#if CONFIG_GPL }else if(idct_algo==FF_IDCT_LIBMPEG2MMX){ if(mm_flags & FF_MM_MMXEXT){ c->idct_put= ff_libmpeg2mmx2_idct_put; @@ -2853,7 +2853,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) H264_QPEL_FUNCS(3, 2, sse2); H264_QPEL_FUNCS(3, 3, sse2); } -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 if(mm_flags & FF_MM_SSSE3){ H264_QPEL_FUNCS(1, 0, ssse3); H264_QPEL_FUNCS(1, 1, ssse3); @@ -2876,14 +2876,14 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) } #endif -#if defined(CONFIG_GPL) && defined(HAVE_YASM) +#if CONFIG_GPL && HAVE_YASM if( mm_flags&FF_MM_MMXEXT ){ -#ifdef ARCH_X86_32 +#if ARCH_X86_32 c->h264_v_loop_filter_luma_intra = ff_x264_deblock_v_luma_intra_mmxext; c->h264_h_loop_filter_luma_intra = ff_x264_deblock_h_luma_intra_mmxext; #endif if( mm_flags&FF_MM_SSE2 ){ -#if defined(ARCH_X86_64) || !defined(__ICC) || __ICC > 1100 +#if ARCH_X86_64 || !defined(__ICC) || __ICC > 1100 c->h264_v_loop_filter_luma = ff_x264_deblock_v_luma_sse2; c->h264_h_loop_filter_luma = ff_x264_deblock_h_luma_sse2; c->h264_v_loop_filter_luma_intra = ff_x264_deblock_v_luma_intra_sse2; @@ -2896,10 +2896,10 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) } #endif -#ifdef CONFIG_SNOW_DECODER +#if CONFIG_SNOW_DECODER if(mm_flags & FF_MM_SSE2 & 0){ c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2; -#ifdef HAVE_7REGS +#if HAVE_7REGS c->vertical_compose97i = ff_snow_vertical_compose97i_sse2; #endif c->inner_add_yblock = ff_snow_inner_add_yblock_sse2; @@ -2907,7 +2907,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) else{ if(mm_flags & FF_MM_MMXEXT){ c->horizontal_compose97i = ff_snow_horizontal_compose97i_mmx; -#ifdef HAVE_7REGS +#if HAVE_7REGS c->vertical_compose97i = ff_snow_vertical_compose97i_mmx; #endif } diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h index 87617e3016..3124519c51 100644 --- a/libavcodec/x86/dsputil_mmx.h +++ b/libavcodec/x86/dsputil_mmx.h @@ -104,7 +104,7 @@ extern const double ff_pd_2[2]; SBUTTERFLY(t, b, c, wd, q) /* t= a2 b2 c2 d2 e2 f2 g2 h2 */\ /* c= a3 b3 c3 d3 e3 f3 g3 h3 */ -#ifdef ARCH_X86_64 +#if ARCH_X86_64 // permutes 01234567 -> 05736421 #define TRANSPOSE8(a,b,c,d,e,f,g,h,t)\ SBUTTERFLY(a,b,%%xmm8,wd,dqa)\ diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index 76b367822b..e8a3e11ebe 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -1015,7 +1015,7 @@ static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t MMABS_SUM(%%xmm7, %%xmm9, %%xmm1)\ "paddusw %%xmm1, %%xmm0 \n\t" -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define MMABS_SUM_8x8_SSE2 MMABS_SUM_8x8_NOSPILL #else #define MMABS_SUM_8x8_SSE2\ @@ -1180,7 +1180,7 @@ HADAMARD8_DIFF_SSE2(sse2) #undef MMABS_SUM_8x8 #undef HSUM -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 #define MMABS(a,z) MMABS_SSSE3(a,z) #define MMABS_SUM_8x8 MMABS_SUM_8x8_NOSPILL HADAMARD8_DIFF_SSE2(ssse3) @@ -1245,7 +1245,7 @@ DCT_SAD_FUNC(mmx2) DCT_SAD_FUNC(sse2) #undef MMABS -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 #define MMABS(a,z) MMABS_SSSE3(a,z) DCT_SAD_FUNC(ssse3) #undef MMABS @@ -1325,7 +1325,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si #undef SCALE_OFFSET #undef PMULHRW -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 #undef PHADDD #define DEF(x) x ## _ssse3 #define SET_RND(x) @@ -1417,7 +1417,7 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) c->flac_compute_autocorr = ff_flac_compute_autocorr_sse2; } -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 if(mm_flags & FF_MM_SSSE3){ if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ c->try_8x8basis= try_8x8basis_ssse3; diff --git a/libavcodec/x86/fft_sse.c b/libavcodec/x86/fft_sse.c index deced3b929..3d9f1c5145 100644 --- a/libavcodec/x86/fft_sse.c +++ b/libavcodec/x86/fft_sse.c @@ -108,7 +108,7 @@ void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input ::"r"(-4*k), "r"(4*k), "r"(input+n4), "r"(tcos+n8), "r"(tsin+n8) ); -#ifdef ARCH_X86_64 +#if ARCH_X86_64 // if we have enough regs, don't let gcc make the luts latency-bound // but if not, latency is faster than spilling __asm__("movlps %%xmm0, %0 \n" diff --git a/libavcodec/x86/h264_i386.h b/libavcodec/x86/h264_i386.h index 909c27490d..2394a8e491 100644 --- a/libavcodec/x86/h264_i386.h +++ b/libavcodec/x86/h264_i386.h @@ -33,9 +33,7 @@ //FIXME use some macros to avoid duplicating get_cabac (cannot be done yet //as that would make optimization work hard) -#if defined(ARCH_X86) && defined(HAVE_7REGS) && \ - defined(HAVE_EBX_AVAILABLE) && \ - !defined(BROKEN_RELOCATIONS) +#if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE && !defined(BROKEN_RELOCATIONS) static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){ @@ -149,7 +147,7 @@ static int decode_significance_8x8_x86(CABACContext *c, ); return coeff_count; } -#endif /* defined(ARCH_X86) && defined(HAVE_7REGS) && */ - /* defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ +#endif /* ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE */ + /* !defined(BROKEN_RELOCATIONS) */ #endif /* AVCODEC_X86_H264_I386_H */ diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c index 8eeb65779b..9342d78ea0 100644 --- a/libavcodec/x86/h264dsp_mmx.c +++ b/libavcodec/x86/h264dsp_mmx.c @@ -472,7 +472,7 @@ static void ff_h264_idct_add8_mmx2(uint8_t **dest, const int *block_offset, DCTE } } -#if defined(CONFIG_GPL) && defined(HAVE_YASM) +#if CONFIG_GPL && HAVE_YASM static void ff_h264_idct_dc_add8_mmx2(uint8_t *dst, int16_t *block, int stride) { __asm__ volatile( @@ -1488,7 +1488,7 @@ static void OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, u }\ -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\ static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ int h=16;\ @@ -2065,7 +2065,7 @@ QPEL_H264_V_XMM(put_, PUT_OP, sse2) QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2) QPEL_H264_HV_XMM(put_, PUT_OP, sse2) QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, sse2) -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 QPEL_H264_H_XMM(put_, PUT_OP, ssse3) QPEL_H264_H_XMM(avg_, AVG_MMX2_OP, ssse3) QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3) @@ -2079,7 +2079,7 @@ H264_MC_4816(3dnow) H264_MC_4816(mmx2) H264_MC_816(H264_MC_V, sse2) H264_MC_816(H264_MC_HV, sse2) -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 H264_MC_816(H264_MC_H, ssse3) H264_MC_816(H264_MC_HV, ssse3) #endif @@ -2161,7 +2161,7 @@ static void avg_h264_chroma_mc4_3dnow(uint8_t *dst/*align 8*/, uint8_t *src/*ali #undef H264_CHROMA_MC4_TMPL #undef H264_CHROMA_MC8_MV0 -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 #define AVG_OP(X) #undef H264_CHROMA_MC8_TMPL #undef H264_CHROMA_MC4_TMPL diff --git a/libavcodec/x86/idct_sse2_xvid.c b/libavcodec/x86/idct_sse2_xvid.c index d8711a2ee2..789167f712 100644 --- a/libavcodec/x86/idct_sse2_xvid.c +++ b/libavcodec/x86/idct_sse2_xvid.c @@ -103,7 +103,7 @@ DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders[]) = { #define CLEAR_ODD(r) "pxor "r","r" \n\t" #define PUT_ODD(dst) "pshufhw $0x1B, %%xmm2, "dst" \n\t" -#ifdef ARCH_X86_64 +#if ARCH_X86_64 # define ROW0 "%%xmm8" # define REG0 ROW0 @@ -371,7 +371,7 @@ inline void ff_idct_xvid_sse2(short *block) JZ("%%esi", "1f") "5: \n\t" iMTX_MULT("7*16(%0)", MANGLE(iTab2), ROUND(walkenIdctRounders+5*16), PUT_ODD(ROW7)) -#ifndef ARCH_X86_64 +#if !ARCH_X86_64 iLLM_HEAD #endif iLLM_PASS("%0") diff --git a/libavcodec/x86/mpegvideo_mmx.c b/libavcodec/x86/mpegvideo_mmx.c index 406d3b8c07..2abd4d5c01 100644 --- a/libavcodec/x86/mpegvideo_mmx.c +++ b/libavcodec/x86/mpegvideo_mmx.c @@ -583,25 +583,30 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ ); } -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 #define HAVE_SSSE3_BAK #endif #undef HAVE_SSSE3 +#define HAVE_SSSE3 0 #undef HAVE_SSE2 #undef HAVE_MMX2 +#define HAVE_SSE2 0 +#define HAVE_MMX2 0 #define RENAME(a) a ## _MMX #define RENAMEl(a) a ## _mmx #include "mpegvideo_mmx_template.c" -#define HAVE_MMX2 +#undef HAVE_MMX2 +#define HAVE_MMX2 1 #undef RENAME #undef RENAMEl #define RENAME(a) a ## _MMX2 #define RENAMEl(a) a ## _mmx2 #include "mpegvideo_mmx_template.c" -#define HAVE_SSE2 +#undef HAVE_SSE2 +#define HAVE_SSE2 1 #undef RENAME #undef RENAMEl #define RENAME(a) a ## _SSE2 @@ -609,7 +614,8 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ #include "mpegvideo_mmx_template.c" #ifdef HAVE_SSSE3_BAK -#define HAVE_SSSE3 +#undef HAVE_SSSE3 +#define HAVE_SSSE3 1 #undef RENAME #undef RENAMEl #define RENAME(a) a ## _SSSE3 @@ -637,7 +643,7 @@ void MPV_common_init_mmx(MpegEncContext *s) } if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 if(mm_flags & FF_MM_SSSE3){ s->dct_quantize= dct_quantize_SSSE3; } else diff --git a/libavcodec/x86/mpegvideo_mmx_template.c b/libavcodec/x86/mpegvideo_mmx_template.c index a1aae5fdd4..dbc94d36dc 100644 --- a/libavcodec/x86/mpegvideo_mmx_template.c +++ b/libavcodec/x86/mpegvideo_mmx_template.c @@ -29,7 +29,7 @@ #undef SAVE_SIGN #undef RESTORE_SIGN -#if defined(HAVE_SSE2) +#if HAVE_SSE2 #define MMREG_WIDTH "16" #define MM "%%xmm" #define MOVQ "movdqa" @@ -48,7 +48,7 @@ #define MMREG_WIDTH "8" #define MM "%%mm" #define MOVQ "movq" -#if defined(HAVE_MMX2) +#if HAVE_MMX2 #define SPREADW(a) "pshufw $0, "a", "a" \n\t" #define PMAXW(a,b) "pmaxsw "a", "b" \n\t" #define PMAX(a,b) \ @@ -74,7 +74,7 @@ #endif #endif -#ifdef HAVE_SSSE3 +#if HAVE_SSSE3 #define SAVE_SIGN(a,b) \ "movdqa "b", "a" \n\t"\ "pabsw "b", "b" \n\t" @@ -219,7 +219,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, SPREADW(MM"1") "psubusw "MM"1, "MM"4 \n\t" "packuswb "MM"4, "MM"4 \n\t" -#ifdef HAVE_SSE2 +#if HAVE_SSE2 "packuswb "MM"4, "MM"4 \n\t" #endif "movd "MM"4, %0 \n\t" // *overflow diff --git a/libavcodec/x86/snowdsp_mmx.c b/libavcodec/x86/snowdsp_mmx.c index 93119787fd..8374a63661 100644 --- a/libavcodec/x86/snowdsp_mmx.c +++ b/libavcodec/x86/snowdsp_mmx.c @@ -386,7 +386,7 @@ void ff_snow_horizontal_compose97i_mmx(IDWTELEM *b, int width){ } } -#ifdef HAVE_7REGS +#if HAVE_7REGS #define snow_vertical_compose_sse2_load_add(op,r,t0,t1,t2,t3)\ ""op" ("r",%%"REG_d"), %%"t0" \n\t"\ ""op" 16("r",%%"REG_d"), %%"t1" \n\t"\ |