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 | |
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')
88 files changed, 362 insertions, 355 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c index 545f1254dd..6150c309c8 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -435,7 +435,7 @@ static av_cold int aac_decode_init(AVCodecContext * avccontext) { ac->sf_offset = 60; } -#ifndef CONFIG_HARDCODED_TABLES +#if !CONFIG_HARDCODED_TABLES for (i = 0; i < 428; i++) ff_aac_pow2sf_tab[i] = pow(2, (i - 200)/4.); #endif /* CONFIG_HARDCODED_TABLES */ diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index 3eab636cc4..76f9bbc624 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -899,7 +899,7 @@ const float * const ff_aac_codebook_vectors[] = { codebook_vector8, codebook_vector10, }; -#ifdef CONFIG_HARDCODED_TABLES +#if CONFIG_HARDCODED_TABLES /** * Table of pow(2, (i - 200)/4.) used for different purposes depending on the diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 07574d8da7..2a8491bc88 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -65,7 +65,7 @@ extern const uint16_t ff_aac_spectral_sizes[11]; extern const float *ff_aac_codebook_vectors[]; -#ifdef CONFIG_HARDCODED_TABLES +#if CONFIG_HARDCODED_TABLES extern const float ff_aac_pow2sf_tab[316]; #else extern float ff_aac_pow2sf_tab[316]; diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index c4fb3eeb6d..b13a376ea3 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -153,7 +153,7 @@ typedef struct ADPCMContext { /* XXX: implement encoding */ -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static int adpcm_encode_init(AVCodecContext *avctx) { if (avctx->channels > 2) @@ -1589,7 +1589,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS #define ADPCM_ENCODER(id,name,long_name_) \ AVCodec name ## _encoder = { \ #name, \ @@ -1607,7 +1607,7 @@ AVCodec name ## _encoder = { \ #define ADPCM_ENCODER(id,name,long_name_) #endif -#ifdef CONFIG_DECODERS +#if CONFIG_DECODERS #define ADPCM_DECODER(id,name,long_name_) \ AVCodec name ## _decoder = { \ #name, \ diff --git a/libavcodec/alpha/dsputil_alpha_asm.S b/libavcodec/alpha/dsputil_alpha_asm.S index dbdf279baf..57b21fca12 100644 --- a/libavcodec/alpha/dsputil_alpha_asm.S +++ b/libavcodec/alpha/dsputil_alpha_asm.S @@ -53,7 +53,7 @@ put_pixels_axp_asm: .frame sp, 0, ra .prologue 0 -#ifdef CONFIG_GPROF +#if CONFIG_GPROF lda AT, _mcount jsr AT, (AT), _mcount #endif @@ -150,7 +150,7 @@ put_pixels_clamped_mvi_asm: .frame sp, 0, ra .prologue 0 -#ifdef CONFIG_GPROF +#if CONFIG_GPROF lda AT, _mcount jsr AT, (AT), _mcount #endif @@ -205,7 +205,7 @@ add_pixels_clamped_mvi_asm: .frame sp, 0, ra .prologue 0 -#ifdef CONFIG_GPROF +#if CONFIG_GPROF lda AT, _mcount jsr AT, (AT), _mcount #endif diff --git a/libavcodec/alpha/motion_est_mvi_asm.S b/libavcodec/alpha/motion_est_mvi_asm.S index cdf40b1f36..db1e30d424 100644 --- a/libavcodec/alpha/motion_est_mvi_asm.S +++ b/libavcodec/alpha/motion_est_mvi_asm.S @@ -55,7 +55,7 @@ pix_abs16x16_mvi_asm: .frame sp, 0, ra, 0 .prologue 0 -#ifdef CONFIG_GPROF +#if CONFIG_GPROF lda AT, _mcount jsr AT, (AT), _mcount #endif diff --git a/libavcodec/arm/asm.S b/libavcodec/arm/asm.S index 0aa1639998..69d83488ad 100644 --- a/libavcodec/arm/asm.S +++ b/libavcodec/arm/asm.S @@ -38,7 +38,7 @@ .endm .macro movrel rd, val -#if defined(HAVE_ARMV6T2) && !defined(CONFIG_SHARED) +#if HAVE_ARMV6T2 && !CONFIG_SHARED movw \rd, #:lower16:\val movt \rd, #:upper16:\val #else diff --git a/libavcodec/arm/dsputil_arm.c b/libavcodec/arm/dsputil_arm.c index eaa6b9eb8d..a91ca13141 100644 --- a/libavcodec/arm/dsputil_arm.c +++ b/libavcodec/arm/dsputil_arm.c @@ -20,7 +20,7 @@ */ #include "libavcodec/dsputil.h" -#ifdef HAVE_IPP +#if HAVE_IPP #include <ipp.h> #endif @@ -93,7 +93,7 @@ static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block) ff_add_pixels_clamped(block, dest, line_size); } -#ifdef HAVE_IPP +#if HAVE_IPP static void simple_idct_ipp(DCTELEM *block) { ippiDCT8x8Inv_Video_16s_C1I(block); @@ -108,7 +108,7 @@ void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_s static void simple_idct_ipp_add(uint8_t *dest, int line_size, DCTELEM *block) { ippiDCT8x8Inv_Video_16s_C1I(block); -#ifdef HAVE_IWMMXT +#if HAVE_IWMMXT add_pixels_clamped_iwmmxt(block, dest, line_size); #else ff_add_pixels_clamped_ARM(block, dest, line_size); @@ -130,13 +130,13 @@ void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx) if (avctx->lowres == 0) { if(idct_algo == FF_IDCT_AUTO){ -#if defined(HAVE_IPP) +#if HAVE_IPP idct_algo = FF_IDCT_IPP; -#elif defined(HAVE_NEON) +#elif HAVE_NEON idct_algo = FF_IDCT_SIMPLENEON; -#elif defined(HAVE_ARMV6) +#elif HAVE_ARMV6 idct_algo = FF_IDCT_SIMPLEARMV6; -#elif defined(HAVE_ARMV5TE) +#elif HAVE_ARMV5TE idct_algo = FF_IDCT_SIMPLEARMV5TE; #else idct_algo = FF_IDCT_ARM; @@ -153,28 +153,28 @@ void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx) c->idct_add= simple_idct_ARM_add; c->idct = simple_idct_ARM; c->idct_permutation_type= FF_NO_IDCT_PERM; -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 } else if (idct_algo==FF_IDCT_SIMPLEARMV6){ c->idct_put= ff_simple_idct_put_armv6; c->idct_add= ff_simple_idct_add_armv6; c->idct = ff_simple_idct_armv6; c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM; #endif -#ifdef HAVE_ARMV5TE +#if HAVE_ARMV5TE } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){ c->idct_put= simple_idct_put_armv5te; c->idct_add= simple_idct_add_armv5te; c->idct = simple_idct_armv5te; c->idct_permutation_type = FF_NO_IDCT_PERM; #endif -#ifdef HAVE_IPP +#if HAVE_IPP } else if (idct_algo==FF_IDCT_IPP){ c->idct_put= simple_idct_ipp_put; c->idct_add= simple_idct_ipp_add; c->idct = simple_idct_ipp; c->idct_permutation_type= FF_NO_IDCT_PERM; #endif -#ifdef HAVE_NEON +#if HAVE_NEON } else if (idct_algo==FF_IDCT_SIMPLENEON){ c->idct_put= ff_simple_idct_put_neon; c->idct_add= ff_simple_idct_add_neon; @@ -201,17 +201,17 @@ void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx) c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm; -#ifdef HAVE_ARMV5TE +#if HAVE_ARMV5TE c->prefetch = ff_prefetch_arm; #endif -#ifdef HAVE_IWMMXT +#if HAVE_IWMMXT dsputil_init_iwmmxt(c, avctx); #endif -#ifdef HAVE_ARMVFP +#if HAVE_ARMVFP ff_float_init_arm_vfp(c, avctx); #endif -#ifdef HAVE_NEON +#if HAVE_NEON ff_dsputil_init_neon(c, avctx); #endif } diff --git a/libavcodec/arm/dsputil_arm_s.S b/libavcodec/arm/dsputil_arm_s.S index 639b7b8af8..9425d33286 100644 --- a/libavcodec/arm/dsputil_arm_s.S +++ b/libavcodec/arm/dsputil_arm_s.S @@ -24,12 +24,12 @@ preserve8 -#ifndef HAVE_PLD +#if !HAVE_PLD .macro pld reg .endm #endif -#ifdef HAVE_ARMV5TE +#if HAVE_ARMV5TE function ff_prefetch_arm, export=1 subs r2, r2, #1 pld [r0] diff --git a/libavcodec/arm/dsputil_vfp.S b/libavcodec/arm/dsputil_vfp.S index 04c8014e1e..50cfd984a2 100644 --- a/libavcodec/arm/dsputil_vfp.S +++ b/libavcodec/arm/dsputil_vfp.S @@ -133,7 +133,7 @@ function ff_vector_fmul_reverse_vfp, export=1 bx lr .endfunc -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 /** * ARM VFP optimized float to int16 conversion. * Assume that len is a positive number and is multiple of 8, destination diff --git a/libavcodec/arm/float_arm_vfp.c b/libavcodec/arm/float_arm_vfp.c index 5598aa9c02..41a7c19994 100644 --- a/libavcodec/arm/float_arm_vfp.c +++ b/libavcodec/arm/float_arm_vfp.c @@ -29,7 +29,7 @@ void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx) { c->vector_fmul = ff_vector_fmul_vfp; c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp; -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 c->float_to_int16 = ff_float_to_int16_vfp; #endif } diff --git a/libavcodec/arm/mathops.h b/libavcodec/arm/mathops.h index e36316c76b..7a9d632195 100644 --- a/libavcodec/arm/mathops.h +++ b/libavcodec/arm/mathops.h @@ -38,7 +38,7 @@ static inline av_const int MULL(int a, int b, unsigned shift) } #define MULH MULH -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 static inline av_const int MULH(int a, int b) { int r; @@ -73,7 +73,7 @@ static inline av_const int64_t MAC64(int64_t d, int a, int b) #define MAC64(d, a, b) ((d) = MAC64(d, a, b)) #define MLS64(d, a, b) MAC64(d, -(a), b) -#if defined(HAVE_ARMV5TE) +#if HAVE_ARMV5TE /* signed 16x16 -> 32 multiply add accumulate */ # define MAC16(rt, ra, rb) \ diff --git a/libavcodec/arm/mpegvideo_arm.c b/libavcodec/arm/mpegvideo_arm.c index 18faed2d36..4882dd4426 100644 --- a/libavcodec/arm/mpegvideo_arm.c +++ b/libavcodec/arm/mpegvideo_arm.c @@ -31,10 +31,10 @@ void MPV_common_init_arm(MpegEncContext *s) * allow optimized functions for armv5te unless * a better iwmmxt function exists */ -#ifdef HAVE_ARMV5TE +#if HAVE_ARMV5TE MPV_common_init_armv5te(s); #endif -#ifdef HAVE_IWMMXT +#if HAVE_IWMMXT MPV_common_init_iwmmxt(s); #endif } diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 8f16111960..7e8699bcc7 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -465,7 +465,7 @@ for(i=0; i<s->avctx->extradata_size; i++){ return (get_bits_count(&a->gb)+31)/32*4; } -#if defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER) +#if CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ ASV1Context * const a = avctx->priv_data; AVFrame *pict = data; @@ -519,7 +519,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, return size*4; } -#endif /* defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER) */ +#endif /* CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER */ static av_cold void common_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; @@ -569,7 +569,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ return 0; } -#if defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER) +#if CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER static av_cold int encode_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; int i; @@ -593,7 +593,7 @@ static av_cold int encode_init(AVCodecContext *avctx){ return 0; } -#endif /* defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER) */ +#endif /* CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER */ static av_cold int decode_end(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; @@ -631,7 +631,7 @@ AVCodec asv2_decoder = { .long_name= NULL_IF_CONFIG_SMALL("ASUS V2"), }; -#ifdef CONFIG_ASV1_ENCODER +#if CONFIG_ASV1_ENCODER AVCodec asv1_encoder = { "asv1", CODEC_TYPE_VIDEO, @@ -645,7 +645,7 @@ AVCodec asv1_encoder = { }; #endif -#ifdef CONFIG_ASV2_ENCODER +#if CONFIG_ASV2_ENCODER AVCodec asv2_encoder = { "asv2", CODEC_TYPE_VIDEO, diff --git a/libavcodec/bfin/mathops.h b/libavcodec/bfin/mathops.h index 1dd9338f8b..8af789dd4b 100644 --- a/libavcodec/bfin/mathops.h +++ b/libavcodec/bfin/mathops.h @@ -22,7 +22,7 @@ #ifndef AVCODEC_BFIN_MATHOPS_H #define AVCODEC_BFIN_MATHOPS_H -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP #define MULH(X,Y) ({ int xxo; \ __asm__ ( \ "a1 = %2.L * %1.L (FU);\n\t" \ diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h index 23bc34de90..0f8110612a 100644 --- a/libavcodec/bitstream.h +++ b/libavcodec/bitstream.h @@ -41,7 +41,7 @@ //#define ALT_BITSTREAM_WRITER //#define ALIGNED_BITSTREAM_WRITER #if !defined(LIBMPEG2_BITSTREAM_READER) && !defined(A32_BITSTREAM_READER) && !defined(ALT_BITSTREAM_READER) -# ifdef ARCH_ARM +# if ARCH_ARM # define A32_BITSTREAM_READER # else # define ALT_BITSTREAM_READER @@ -52,7 +52,7 @@ extern const uint8_t ff_reverse[256]; -#if defined(ARCH_X86) +#if ARCH_X86 // avoid +32 for shift optimization (gcc should do that ...) static inline int32_t NEG_SSR32( int32_t a, int8_t s){ __asm__ ("sarl %1, %0\n\t" @@ -196,7 +196,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value) #ifdef BITSTREAM_WRITER_LE bit_buf |= value << (32 - bit_left); if (n >= bit_left) { -#ifndef HAVE_FAST_UNALIGNED +#if !HAVE_FAST_UNALIGNED if (3 & (intptr_t) s->buf_ptr) { s->buf_ptr[0] = bit_buf ; s->buf_ptr[1] = bit_buf >> 8; @@ -217,7 +217,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value) } else { bit_buf<<=bit_left; bit_buf |= value >> (n - bit_left); -#ifndef HAVE_FAST_UNALIGNED +#if !HAVE_FAST_UNALIGNED if (3 & (intptr_t) s->buf_ptr) { s->buf_ptr[0] = bit_buf >> 24; s->buf_ptr[1] = bit_buf >> 16; @@ -243,7 +243,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value) static inline void put_bits(PutBitContext *s, int n, unsigned int value) { # ifdef ALIGNED_BITSTREAM_WRITER -# if defined(ARCH_X86) +# if ARCH_X86 __asm__ volatile( "movl %0, %%ecx \n\t" "xorl %%eax, %%eax \n\t" @@ -274,7 +274,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value) s->index= index; # endif # else //ALIGNED_BITSTREAM_WRITER -# if defined(ARCH_X86) +# if ARCH_X86 __asm__ volatile( "movl $7, %%ecx \n\t" "andl %0, %%ecx \n\t" @@ -550,7 +550,7 @@ static inline void skip_bits_long(GetBitContext *s, int n){ name##_bit_count-= 32;\ }\ -#if defined(ARCH_X86) +#if ARCH_X86 # define SKIP_CACHE(name, gb, num)\ __asm__(\ "shldl %2, %1, %0 \n\t"\ diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index e012727054..caed72277c 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -270,7 +270,7 @@ static void refill(CABACContext *c){ c->bytestream+= CABAC_BITS/8; } -#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 void refill2(CABACContext *c){ int i, x; @@ -372,7 +372,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st //FIXME gcc generates duplicate load/stores for c->low and c->range #define LOW "0" #define RANGE "4" -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define BYTESTART "16" #define BYTE "24" #define BYTEEND "32" @@ -381,7 +381,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st #define BYTE "16" #define BYTEEND "20" #endif -#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) int bit; #ifndef BRANCHLESS_CABAC_DECODER @@ -467,7 +467,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st #else /* BRANCHLESS_CABAC_DECODER */ -#if defined HAVE_FAST_CMOV +#if HAVE_FAST_CMOV #define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\ "mov "tmp" , %%ecx \n\t"\ "shl $17 , "tmp" \n\t"\ @@ -537,7 +537,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st ); bit&=1; #endif /* BRANCHLESS_CABAC_DECODER */ -#else /* defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ +#else /* ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE && !defined(BROKEN_RELOCATIONS) */ int s = *state; int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s]; int bit, lps_mask av_unused; @@ -576,7 +576,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st if(!(c->low & CABAC_MASK)) refill2(c); #endif /* BRANCHLESS_CABAC_DECODER */ -#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) */ return bit; } @@ -637,7 +637,7 @@ static int av_unused get_cabac_bypass(CABACContext *c){ static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){ -#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) +#if ARCH_X86 && !(defined(PIC) && defined(__GNUC__)) __asm__ volatile( "movl "RANGE "(%1), %%ebx \n\t" "movl "LOW "(%1), %%eax \n\t" diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index c80af01f0d..bb8ae2c7b5 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -30,6 +30,7 @@ /* Disable the encoder. */ #undef CONFIG_CLJR_ENCODER +#define CONFIG_CLJR_ENCODER 0 typedef struct CLJRContext{ AVCodecContext *avctx; @@ -84,7 +85,7 @@ static int decode_frame(AVCodecContext *avctx, return buf_size; } -#ifdef CONFIG_CLJR_ENCODER +#if CONFIG_CLJR_ENCODER static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ CLJRContext * const a = avctx->priv_data; AVFrame *pict = data; @@ -124,7 +125,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ return 0; } -#ifdef CONFIG_CLJR_ENCODER +#if CONFIG_CLJR_ENCODER static av_cold int encode_init(AVCodecContext *avctx){ common_init(avctx); @@ -146,7 +147,7 @@ AVCodec cljr_decoder = { .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), }; -#ifdef CONFIG_CLJR_ENCODER +#if CONFIG_CLJR_ENCODER AVCodec cljr_encoder = { "cljr", CODEC_TYPE_VIDEO, diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index ada6a712a3..55bf2ec128 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -23,7 +23,7 @@ #include "avcodec.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif #include "libavutil/lzo.h" @@ -163,7 +163,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, break; } case 1: { // zlib compression -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB unsigned long dlen = c->decomp_size; if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK) av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n"); diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 04f75b05f6..e7c12dd732 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -97,14 +97,14 @@ struct algo algos[] = { {"INT", 1, j_rev_dct, idct, MMX_PERM}, {"SIMPLE-C", 1, ff_simple_idct, idct, NO_PERM}, -#ifdef HAVE_MMX +#if HAVE_MMX {"MMX", 0, ff_fdct_mmx, fdct, NO_PERM, FF_MM_MMX}, -#ifdef HAVE_MMX2 +#if HAVE_MMX2 {"MMX2", 0, ff_fdct_mmx2, fdct, NO_PERM, FF_MM_MMXEXT}, {"SSE2", 0, ff_fdct_sse2, fdct, NO_PERM, FF_MM_SSE2}, #endif -#ifdef CONFIG_GPL +#if CONFIG_GPL {"LIBMPEG2-MMX", 1, ff_mmx_idct, idct, MMX_PERM, FF_MM_MMX}, {"LIBMPEG2-MMXEXT", 1, ff_mmxext_idct, idct, MMX_PERM, FF_MM_MMXEXT}, #endif @@ -114,25 +114,25 @@ struct algo algos[] = { {"XVID-SSE2", 1, ff_idct_xvid_sse2, idct, SSE2_PERM, FF_MM_SSE2}, #endif -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC {"altivecfdct", 0, fdct_altivec, fdct, NO_PERM, FF_MM_ALTIVEC}, #endif -#ifdef ARCH_BFIN +#if ARCH_BFIN {"BFINfdct", 0, ff_bfin_fdct, fdct, NO_PERM}, {"BFINidct", 1, ff_bfin_idct, idct, NO_PERM}, #endif -#ifdef ARCH_ARM +#if ARCH_ARM {"SIMPLE-ARM", 1, simple_idct_ARM, idct, NO_PERM }, {"INT-ARM", 1, j_rev_dct_ARM, idct, MMX_PERM }, -#ifdef HAVE_ARMV5TE +#if HAVE_ARMV5TE {"SIMPLE-ARMV5TE", 1, simple_idct_armv5te, idct, NO_PERM }, #endif -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 {"SIMPLE-ARMV6", 1, ff_simple_idct_armv6, idct, MMX_PERM }, #endif -#ifdef HAVE_NEON +#if HAVE_NEON {"SIMPLE-NEON", 1, ff_simple_idct_neon, idct, PARTTRANS_PERM }, #endif #endif /* ARCH_ARM */ @@ -186,7 +186,7 @@ static DCTELEM block_org[64] __attribute__ ((aligned (8))); static inline void mmx_emms(void) { -#ifdef HAVE_MMX +#if HAVE_MMX if (cpu_flags & FF_MM_MMX) __asm__ volatile ("emms\n\t"); #endif diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index a79a161d0c..f206b72d60 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -177,7 +177,7 @@ static int dnxhd_encode_init(AVCodecContext *avctx) dsputil_init(&ctx->m.dsp, avctx); ff_dct_common_init(&ctx->m); -#ifdef HAVE_MMX +#if HAVE_MMX ff_dnxhd_init_mmx(ctx); #endif if (!ctx->m.dct_quantize) diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 76f5dbbf4d..c50764f285 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -169,7 +169,7 @@ void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_s int j; j = src_scantable[i]; st->permutated[i] = permutation[j]; -#ifdef ARCH_PPC +#if ARCH_PPC st->inverse[j] = i; #endif } @@ -340,7 +340,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) } -#ifdef CONFIG_SNOW_ENCODER //dwt is in snow.c +#if CONFIG_SNOW_ENCODER //dwt is in snow.c static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int w, int h, int type){ int s, i, j; const int dec_count= w==8 ? 3 : 4; @@ -2711,7 +2711,7 @@ static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int } } -#ifdef CONFIG_CAVS_DECODER +#if CONFIG_CAVS_DECODER /* AVS specific */ void ff_cavsdsp_init(DSPContext* c, AVCodecContext *avctx); @@ -2729,7 +2729,7 @@ void ff_avg_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride) { } #endif /* CONFIG_CAVS_DECODER */ -#if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER) +#if CONFIG_VC1_DECODER || CONFIG_WMV3_DECODER /* VC-1 specific */ void ff_vc1dsp_init(DSPContext* c, AVCodecContext *avctx); @@ -2743,11 +2743,11 @@ void ff_intrax8dsp_init(DSPContext* c, AVCodecContext *avctx); /* H264 specific */ void ff_h264dspenc_init(DSPContext* c, AVCodecContext *avctx); -#if defined(CONFIG_RV30_DECODER) +#if CONFIG_RV30_DECODER void ff_rv30dsp_init(DSPContext* c, AVCodecContext *avctx); #endif /* CONFIG_RV30_DECODER */ -#if defined(CONFIG_RV40_DECODER) +#if CONFIG_RV40_DECODER static void put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride){ put_pixels16_xy2_c(dst, src, stride, 16); } @@ -3467,7 +3467,7 @@ void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){ case FF_CMP_NSSE: cmp[i]= c->nsse[i]; break; -#ifdef CONFIG_SNOW_ENCODER +#if CONFIG_SNOW_ENCODER case FF_CMP_W53: cmp[i]= c->w53[i]; break; @@ -3518,7 +3518,7 @@ static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ long i; -#ifndef HAVE_FAST_UNALIGNED +#if !HAVE_FAST_UNALIGNED if((long)src2 & (sizeof(long)-1)){ for(i=0; i+7<w; i+=8){ dst[i+0] = src1[i+0]-src2[i+0]; @@ -3686,7 +3686,7 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2 return s->dsp.sum_abs_dctelem(temp); } -#ifdef CONFIG_GPL +#if CONFIG_GPL #define DCT8_1D {\ const int s07 = SRC(0) + SRC(7);\ const int s16 = SRC(1) + SRC(6);\ @@ -3992,7 +3992,7 @@ static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2, WRAPPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c) WRAPPER8_16_SQ(hadamard8_intra8x8_c, hadamard8_intra16_c) WRAPPER8_16_SQ(dct_sad8x8_c, dct_sad16_c) -#ifdef CONFIG_GPL +#if CONFIG_GPL WRAPPER8_16_SQ(dct264_sad8x8_c, dct264_sad16_c) #endif WRAPPER8_16_SQ(dct_max8x8_c, dct_max16_c) @@ -4249,7 +4249,7 @@ int ff_check_alignment(void){ if((long)&aligned & 15){ if(!did_fail){ -#if defined(HAVE_MMX) || defined(HAVE_ALTIVEC) +#if HAVE_MMX || HAVE_ALTIVEC av_log(NULL, AV_LOG_ERROR, "Compiler did not align stack variables. Libavcodec has been miscompiled\n" "and may be very slow or crash. This is not a bug in libavcodec,\n" @@ -4269,7 +4269,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) ff_check_alignment(); -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS if(avctx->dct_algo==FF_DCT_FASTINT) { c->fdct = fdct_ifast; c->fdct248 = fdct_ifast248; @@ -4487,22 +4487,22 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->draw_edges = draw_edges_c; -#ifdef CONFIG_CAVS_DECODER +#if CONFIG_CAVS_DECODER ff_cavsdsp_init(c,avctx); #endif -#if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER) +#if CONFIG_VC1_DECODER || CONFIG_WMV3_DECODER ff_vc1dsp_init(c,avctx); #endif -#if defined(CONFIG_WMV2_DECODER) || defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER) +#if CONFIG_WMV2_DECODER || CONFIG_VC1_DECODER || CONFIG_WMV3_DECODER ff_intrax8dsp_init(c,avctx); #endif -#if defined(CONFIG_H264_ENCODER) +#if CONFIG_H264_ENCODER ff_h264dspenc_init(c,avctx); #endif -#if defined(CONFIG_RV30_DECODER) +#if CONFIG_RV30_DECODER ff_rv30dsp_init(c,avctx); #endif -#if defined(CONFIG_RV40_DECODER) +#if CONFIG_RV40_DECODER ff_rv40dsp_init(c,avctx); c->put_rv40_qpel_pixels_tab[0][15] = put_rv40_qpel16_mc33_c; c->avg_rv40_qpel_pixels_tab[0][15] = avg_rv40_qpel16_mc33_c; @@ -4527,7 +4527,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->hadamard8_diff[4]= hadamard8_intra16_c; SET_CMP_FUNC(dct_sad) SET_CMP_FUNC(dct_max) -#ifdef CONFIG_GPL +#if CONFIG_GPL SET_CMP_FUNC(dct264_sad) #endif c->sad[0]= pix_abs16_c; @@ -4544,7 +4544,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->vsse[4]= vsse_intra16_c; c->nsse[0]= nsse16_c; c->nsse[1]= nsse8_c; -#ifdef CONFIG_SNOW_ENCODER +#if CONFIG_SNOW_ENCODER c->w53[0]= w53_16_c; c->w53[1]= w53_8_c; c->w97[0]= w97_16_c; @@ -4558,7 +4558,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->diff_bytes= diff_bytes_c; c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; c->bswap_buf= bswap_buf; -#ifdef CONFIG_PNG_DECODER +#if CONFIG_PNG_DECODER c->add_png_paeth_prediction= ff_add_png_paeth_prediction; #endif @@ -4587,19 +4587,19 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->try_8x8basis= try_8x8basis_c; c->add_8x8basis= add_8x8basis_c; -#ifdef CONFIG_SNOW_DECODER +#if CONFIG_SNOW_DECODER c->vertical_compose97i = ff_snow_vertical_compose97i; c->horizontal_compose97i = ff_snow_horizontal_compose97i; c->inner_add_yblock = ff_snow_inner_add_yblock; #endif -#ifdef CONFIG_VORBIS_DECODER +#if CONFIG_VORBIS_DECODER c->vorbis_inverse_coupling = vorbis_inverse_coupling; #endif -#ifdef CONFIG_AC3_DECODER +#if CONFIG_AC3_DECODER c->ac3_downmix = ff_ac3_downmix_c; #endif -#ifdef CONFIG_FLAC_ENCODER +#if CONFIG_FLAC_ENCODER c->flac_compute_autocorr = ff_flac_compute_autocorr; #endif c->vector_fmul = vector_fmul_c; diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 2cdeef5b7c..62415b7a0a 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -174,7 +174,7 @@ typedef struct ScanTable{ const uint8_t *scantable; uint8_t permutated[64]; uint8_t raster_end[64]; -#ifdef ARCH_PPC +#if ARCH_PPC /** Used by dct_quantize_altivec to find last-non-zero */ DECLARE_ALIGNED(16, uint8_t, inverse[64]); #endif @@ -584,7 +584,7 @@ void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx); #define DECLARE_ALIGNED_16(t, v) DECLARE_ALIGNED(16, t, v) -#if defined(HAVE_MMX) +#if HAVE_MMX #undef emms_c @@ -608,23 +608,23 @@ static inline void emms(void) void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); -#elif defined(ARCH_ARM) +#elif ARCH_ARM extern int mm_flags; -#ifdef HAVE_NEON +#if HAVE_NEON # define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v) # define STRIDE_ALIGN 16 #endif -#elif defined(ARCH_PPC) +#elif ARCH_PPC extern int mm_flags; #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v) #define STRIDE_ALIGN 16 -#elif defined(HAVE_MMI) +#elif HAVE_MMI #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v) #define STRIDE_ALIGN 16 diff --git a/libavcodec/dv.c b/libavcodec/dv.c index e3f54b8c1f..55987a9d69 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -1123,7 +1123,7 @@ static int dv_encode_video_segment(AVCodecContext *avctx, DVwork_chunk *work_chu return 0; } -#ifdef CONFIG_DVVIDEO_DECODER +#if CONFIG_DVVIDEO_DECODER /* NOTE: exactly one frame must be given (120000 bytes for NTSC, 144000 bytes for PAL - or twice those for 50Mbps) */ static int dvvideo_decode_frame(AVCodecContext *avctx, @@ -1240,7 +1240,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, return 5; } -#ifdef CONFIG_DVVIDEO_ENCODER +#if CONFIG_DVVIDEO_ENCODER static void dv_format_frame(DVVideoContext* c, uint8_t* buf) { int chan, i, j, k; @@ -1328,7 +1328,7 @@ static int dvvideo_close(AVCodecContext *c) } -#ifdef CONFIG_DVVIDEO_ENCODER +#if CONFIG_DVVIDEO_ENCODER AVCodec dvvideo_encoder = { "dvvideo", CODEC_TYPE_VIDEO, @@ -1341,7 +1341,7 @@ AVCodec dvvideo_encoder = { }; #endif // CONFIG_DVVIDEO_ENCODER -#ifdef CONFIG_DVVIDEO_DECODER +#if CONFIG_DVVIDEO_DECODER AVCodec dvvideo_decoder = { "dvvideo", CODEC_TYPE_VIDEO, diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index bdd3a663d5..5f8037f1ee 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -563,7 +563,7 @@ static int is_intra_more_likely(MpegEncContext *s){ if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction -#ifdef CONFIG_XVMC +#if CONFIG_XVMC //prevent dsp.sad() check, that requires access to the image if(s->avctx->xvmc_acceleration && s->pict_type==FF_I_TYPE) return 1; #endif @@ -935,7 +935,7 @@ void ff_er_frame_end(MpegEncContext *s){ }else guess_mv(s); -#ifdef CONFIG_XVMC +#if CONFIG_XVMC /* the filters below are not XvMC compatible, skip them */ if(s->avctx->xvmc_acceleration) goto ec_clean; #endif @@ -1024,7 +1024,7 @@ void ff_er_frame_end(MpegEncContext *s){ v_block_filter(s, s->current_picture.data[2], s->mb_width , s->mb_height , s->uvlinesize, 0); } -#ifdef CONFIG_XVMC +#if CONFIG_XVMC ec_clean: #endif /* clean a few tables */ diff --git a/libavcodec/fft.c b/libavcodec/fft.c index 7c8cce84c6..099ecbe282 100644 --- a/libavcodec/fft.c +++ b/libavcodec/fft.c @@ -91,7 +91,7 @@ int ff_fft_init(FFTContext *s, int nbits, int inverse) s->imdct_half = ff_imdct_half_c; s->exptab1 = NULL; -#if defined HAVE_MMX && defined HAVE_YASM +#if HAVE_MMX && HAVE_YASM has_vectors = mm_support(); if (has_vectors & FF_MM_SSE) { /* SSE for P3/P4/K8 */ @@ -110,7 +110,7 @@ int ff_fft_init(FFTContext *s, int nbits, int inverse) s->imdct_half = ff_imdct_half_3dn; s->fft_calc = ff_fft_calc_3dn; } -#elif defined HAVE_ALTIVEC && !defined ALTIVEC_USE_REFERENCE_C_CODE +#elif HAVE_ALTIVEC && !defined ALTIVEC_USE_REFERENCE_C_CODE has_vectors = mm_support(); if (has_vectors & FF_MM_ALTIVEC) { s->fft_calc = ff_fft_calc_altivec; @@ -336,7 +336,7 @@ static void fft8(FFTComplex *z) TRANSFORM(z[1],z[3],z[5],z[7],sqrthalf,sqrthalf); } -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL static void fft16(FFTComplex *z) { FFTSample t1, t2, t3, t4, t5, t6; @@ -358,7 +358,7 @@ DECL_FFT(64,32,16) DECL_FFT(128,64,32) DECL_FFT(256,128,64) DECL_FFT(512,256,128) -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL #define pass pass_big #endif DECL_FFT(1024,512,256) diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 7211e16e9a..25007f51a5 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -350,7 +350,7 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int return ret; } -#ifdef CONFIG_FFV1_ENCODER +#if CONFIG_FFV1_ENCODER static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ PlaneContext * const p= &s->plane[plane_index]; RangeCoder * const c= &s->c; @@ -543,7 +543,7 @@ static av_cold int common_init(AVCodecContext *avctx){ return 0; } -#ifdef CONFIG_FFV1_ENCODER +#if CONFIG_FFV1_ENCODER static av_cold int encode_init(AVCodecContext *avctx) { FFV1Context *s = avctx->priv_data; @@ -632,7 +632,7 @@ static void clear_state(FFV1Context *f){ } } -#ifdef CONFIG_FFV1_ENCODER +#if CONFIG_FFV1_ENCODER static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ FFV1Context *f = avctx->priv_data; RangeCoder * const c= &f->c; @@ -1025,7 +1025,7 @@ AVCodec ffv1_decoder = { .long_name= NULL_IF_CONFIG_SMALL("FFmpeg codec #1"), }; -#ifdef CONFIG_FFV1_ENCODER +#if CONFIG_FFV1_ENCODER AVCodec ffv1_encoder = { "ffv1", CODEC_TYPE_VIDEO, diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index a13e379240..748906ea72 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -775,7 +775,7 @@ static void encode_residual_lpc(int32_t *res, const int32_t *smp, int n, for(i=0; i<order; i++) { res[i] = smp[i]; } -#ifdef CONFIG_SMALL +#if CONFIG_SMALL for(i=order; i<n; i+=2) { int j; int s = smp[i]; diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 90a20da2d9..1c5283668d 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -285,7 +285,7 @@ static av_cold int g726_reset(G726Context* c, int index) return 0; } -#ifdef CONFIG_ADPCM_G726_ENCODER +#if CONFIG_ADPCM_G726_ENCODER static int16_t g726_encode(G726Context* c, int16_t sig) { uint8_t i; @@ -342,7 +342,7 @@ static av_cold int g726_close(AVCodecContext *avctx) return 0; } -#ifdef CONFIG_ADPCM_G726_ENCODER +#if CONFIG_ADPCM_G726_ENCODER static int g726_encode_frame(AVCodecContext *avctx, uint8_t *dst, int buf_size, void *data) { @@ -381,7 +381,7 @@ static int g726_decode_frame(AVCodecContext *avctx, return buf_size; } -#ifdef CONFIG_ADPCM_G726_ENCODER +#if CONFIG_ADPCM_G726_ENCODER AVCodec adpcm_g726_encoder = { "g726", CODEC_TYPE_AUDIO, diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 781c0079ef..b3bbe5f9a4 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -54,7 +54,7 @@ #define H263_MBTYPE_B_VLC_BITS 6 #define CBPC_B_VLC_BITS 3 -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n); static void h263p_encode_umotion(MpegEncContext * s, int val); @@ -72,7 +72,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr); static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, int n, int coded, int intra, int rvlc); -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr); static void mpeg4_encode_visual_object_header(MpegEncContext * s); static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number); @@ -80,7 +80,7 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb); static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *dir_ptr, int encoding); -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static uint8_t uni_DCtab_lum_len[512]; static uint8_t uni_DCtab_chrom_len[512]; static uint16_t uni_DCtab_lum_bits[512]; @@ -155,7 +155,7 @@ static void show_pict_info(MpegEncContext *s){ ); } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static void aspect_to_info(MpegEncContext * s, AVRational aspect){ int i; @@ -736,7 +736,7 @@ void ff_h263_update_motion_val(MpegEncContext * s){ } } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code){ int l, bit_size, code; @@ -1549,7 +1549,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ } } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr) { int x, y, wrap, a, c, pred_dc, scale; @@ -1741,7 +1741,7 @@ int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir, return *mot_val; } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code) { int range, l, bit_size, sign, code, bits; @@ -2652,7 +2652,7 @@ void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS /** * encodes the dc value. @@ -3049,7 +3049,7 @@ static inline void memsetw(short *tab, int val, int n) tab[i] = val; } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS void ff_mpeg4_init_partitions(MpegEncContext *s) { @@ -3106,7 +3106,7 @@ int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){ } } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS void ff_mpeg4_encode_video_packet_header(MpegEncContext *s) { @@ -4563,7 +4563,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, } else if (s->mb_intra) { /* DC coef */ if(s->codec_id == CODEC_ID_RV10){ -#ifdef CONFIG_RV10_DECODER +#if CONFIG_RV10_DECODER if (s->rv10_version == 3 && s->pict_type == FF_I_TYPE) { int component, diff; component = (n <= 3 ? 0 : n - 4 + 1); diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index ae318b5576..dda05668aa 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -545,7 +545,7 @@ retry: } #endif -#if defined(HAVE_MMX) +#if HAVE_MMX if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build && avctx->idct_algo == FF_IDCT_AUTO && (mm_flags & FF_MM_MMX)){ avctx->idct_algo= FF_IDCT_XVIDMMX; avctx->coded_width= 0; // force reinit diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 09e8938fbd..ad124cbbd5 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -36,7 +36,7 @@ #include "vdpau_internal.h" #include "cabac.h" -#ifdef ARCH_X86 +#if ARCH_X86 #include "x86/h264_i386.h" #endif @@ -1380,8 +1380,8 @@ static const uint8_t *decode_nal(H264Context *h, const uint8_t *src, int *dst_le printf("%2X ", src[i]); #endif -#ifdef HAVE_FAST_UNALIGNED -# ifdef HAVE_FAST_64BIT +#if HAVE_FAST_UNALIGNED +# if HAVE_FAST_64BIT # define RS 7 for(i=0; i+1<length; i+=9){ if(!((~*(uint64_t*)(src+i) & (*(uint64_t*)(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL)) @@ -5224,7 +5224,7 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT uint8_t *last_coeff_ctx_base; uint8_t *abs_level_m1_ctx_base; -#ifndef ARCH_X86 +#if !ARCH_X86 #define CABAC_ON_STACK #endif #ifdef CABAC_ON_STACK @@ -5285,7 +5285,7 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT index[coeff_count++] = last;\ } const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD]; -#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) coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off); } else { coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index); @@ -5360,7 +5360,7 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT } -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL static void decode_cabac_residual_dc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) { decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 1); } @@ -5371,7 +5371,7 @@ static void decode_cabac_residual_nondc( H264Context *h, DCTELEM *block, int cat #endif static void decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) { -#ifdef CONFIG_SMALL +#if CONFIG_SMALL decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, cat == 0 || cat == 3); #else if( cat == 0 || cat == 3 ) decode_cabac_residual_dc(h, block, cat, n, scantable, qmul, max_coeff); @@ -6572,7 +6572,7 @@ static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8 filter_mb_mbaff_edgecv( h, &img_cr[0], uvlinesize, bS, rqp ); } -#ifdef CONFIG_SMALL +#if CONFIG_SMALL for( dir = 0; dir < 2; dir++ ) filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, dir ? 0 : first_vertical_edge_done, dir); #else @@ -8023,7 +8023,7 @@ AVCodec h264_decoder = { .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), }; -#ifdef CONFIG_H264_VDPAU_DECODER +#if CONFIG_H264_VDPAU_DECODER AVCodec h264_vdpau_decoder = { "h264_vdpau", CODEC_TYPE_VIDEO, @@ -8039,6 +8039,6 @@ AVCodec h264_vdpau_decoder = { }; #endif -#ifdef CONFIG_SVQ3_DECODER +#if CONFIG_SVQ3_DECODER #include "svq3.c" #endif diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index cfa04c4460..515312c311 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -44,11 +44,11 @@ int ff_h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size) for(i=0; i<buf_size; i++){ if(state==7){ -#ifdef HAVE_FAST_UNALIGNED +#if HAVE_FAST_UNALIGNED /* we check i<buf_size instead of i+3/7 because its simpler * and there should be FF_INPUT_BUFFER_PADDING_SIZE bytes at the end */ -# ifdef HAVE_FAST_64BIT +# if HAVE_FAST_64BIT while(i<buf_size && !((~*(uint64_t*)(buf+i) & (*(uint64_t*)(buf+i) - 0x0101010101010101ULL)) & 0x8080808080808080ULL)) i+=8; # else diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index bf13e4479c..c494f355bf 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -261,7 +261,7 @@ static int generate_bits_table(uint32_t *dst, uint8_t *len_table){ return 0; } -#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) +#if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER typedef struct { uint64_t val; int name; @@ -317,7 +317,7 @@ static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){ if(i==size) break; } } -#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */ +#endif /* CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER */ static void generate_joint_tables(HYuvContext *s){ uint16_t symbols[1<<VLC_BITS]; @@ -477,7 +477,7 @@ static int common_init(AVCodecContext *avctx){ return 0; } -#if defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) +#if CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER static av_cold int decode_init(AVCodecContext *avctx) { HYuvContext *s = avctx->priv_data; @@ -573,9 +573,9 @@ s->bgr32=1; return 0; } -#endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */ +#endif /* CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER */ -#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) +#if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){ int i; int index= 0; @@ -725,7 +725,7 @@ static av_cold int encode_init(AVCodecContext *avctx) return 0; } -#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */ +#endif /* CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER */ /* TODO instead of restarting the read when the code isn't in the first level * of the joint table, jump into the 2nd level of the individual table. */ @@ -761,7 +761,7 @@ static void decode_gray_bitstream(HYuvContext *s, int count){ } } -#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) +#if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER static int encode_422_bitstream(HYuvContext *s, int count){ int i; @@ -854,7 +854,7 @@ static int encode_gray_bitstream(HYuvContext *s, int count){ } return 0; } -#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */ +#endif /* CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER */ static av_always_inline void decode_bgr_1(HYuvContext *s, int count, int decorrelate, int alpha){ int i; @@ -931,7 +931,7 @@ static int encode_bgr_bitstream(HYuvContext *s, int count){ return 0; } -#if defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) +#if CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER static void draw_slice(HYuvContext *s, int y){ int h, cy; int offset[4]; @@ -1198,7 +1198,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const return (get_bits_count(&s->gb)+31)/32*4 + table_size; } -#endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */ +#endif /* CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER */ static int common_end(HYuvContext *s){ int i; @@ -1209,7 +1209,7 @@ static int common_end(HYuvContext *s){ return 0; } -#if defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) +#if CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER static av_cold int decode_end(AVCodecContext *avctx) { HYuvContext *s = avctx->priv_data; @@ -1224,9 +1224,9 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -#endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */ +#endif /* CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER */ -#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) +#if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ HYuvContext *s = avctx->priv_data; AVFrame *pict = data; @@ -1431,9 +1431,9 @@ static av_cold int encode_end(AVCodecContext *avctx) return 0; } -#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */ +#endif /* CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER */ -#ifdef CONFIG_HUFFYUV_DECODER +#if CONFIG_HUFFYUV_DECODER AVCodec huffyuv_decoder = { "huffyuv", CODEC_TYPE_VIDEO, @@ -1449,7 +1449,7 @@ AVCodec huffyuv_decoder = { }; #endif -#ifdef CONFIG_FFVHUFF_DECODER +#if CONFIG_FFVHUFF_DECODER AVCodec ffvhuff_decoder = { "ffvhuff", CODEC_TYPE_VIDEO, @@ -1465,7 +1465,7 @@ AVCodec ffvhuff_decoder = { }; #endif -#ifdef CONFIG_HUFFYUV_ENCODER +#if CONFIG_HUFFYUV_ENCODER AVCodec huffyuv_encoder = { "huffyuv", CODEC_TYPE_VIDEO, @@ -1479,7 +1479,7 @@ AVCodec huffyuv_encoder = { }; #endif -#ifdef CONFIG_FFVHUFF_ENCODER +#if CONFIG_FFVHUFF_ENCODER AVCodec ffvhuff_encoder = { "ffvhuff", CODEC_TYPE_VIDEO, diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 952ddcb566..94ea967d1d 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -34,7 +34,7 @@ #include "dsputil.h" #include "colorspace.h" -#ifdef HAVE_MMX +#if HAVE_MMX #include "x86/mmx.h" #include "x86/dsputil_mmx.h" #endif @@ -2089,7 +2089,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, return 0; } -#ifndef CONFIG_SWSCALE +#if !CONFIG_SWSCALE static uint8_t y_ccir_to_jpeg[256]; static uint8_t y_jpeg_to_ccir[256]; static uint8_t c_ccir_to_jpeg[256]; @@ -2662,7 +2662,7 @@ int img_get_alpha_info(const AVPicture *src, return ret; } -#ifdef HAVE_MMX +#if HAVE_MMX #define DEINT_INPLACE_LINE_LUM \ movd_m2r(lum_m4[0],mm0);\ movd_m2r(lum_m3[0],mm1);\ @@ -2716,7 +2716,7 @@ static void deinterlace_line(uint8_t *dst, const uint8_t *lum, int size) { -#ifndef HAVE_MMX +#if !HAVE_MMX uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int sum; @@ -2754,7 +2754,7 @@ static void deinterlace_line(uint8_t *dst, static void deinterlace_line_inplace(uint8_t *lum_m4, uint8_t *lum_m3, uint8_t *lum_m2, uint8_t *lum_m1, uint8_t *lum, int size) { -#ifndef HAVE_MMX +#if !HAVE_MMX uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int sum; diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c index 6ca810c6b4..6e897258d0 100644 --- a/libavcodec/imgresample.c +++ b/libavcodec/imgresample.c @@ -29,7 +29,7 @@ #include "imgconvert.h" #include "libswscale/swscale.h" -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC #include "ppc/imgresample_altivec.h" #endif @@ -153,7 +153,7 @@ static void v_resample(uint8_t *dst, int dst_width, const uint8_t *src, } } -#ifdef HAVE_MMX +#if HAVE_MMX #include "x86/mmx.h" @@ -340,7 +340,7 @@ static void h_resample(uint8_t *dst, int dst_width, const uint8_t *src, } else { n = dst_width; } -#ifdef HAVE_MMX +#if HAVE_MMX if ((mm_flags & FF_MM_MMX) && NB_TAPS == 4) h_resample_fast4_mmx(dst, n, src, src_width, src_start, src_incr, filters); @@ -397,7 +397,7 @@ static void component_resample(ImgReSampleContext *s, } /* apply vertical filter */ phase_y = get_phase(src_y); -#ifdef HAVE_MMX +#if HAVE_MMX /* desactivated MMX because loss of precision */ if ((mm_flags & FF_MM_MMX) && NB_TAPS == 4 && 0) v_resample4_mmx(output, owidth, @@ -405,7 +405,7 @@ static void component_resample(ImgReSampleContext *s, &s->v_filters[phase_y][0]); else #endif -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC if ((mm_flags & FF_MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6) v_resample16_altivec(output, owidth, s->line_buf + (ring_y - NB_TAPS + 1) * owidth, @@ -732,7 +732,7 @@ static void dump_filter(int16_t *filter) } } -#ifdef HAVE_MMX +#if HAVE_MMX int mm_flags; #endif @@ -804,7 +804,7 @@ int main(int argc, char **argv) } /* mmx test */ -#ifdef HAVE_MMX +#if HAVE_MMX av_log(NULL, AV_LOG_INFO, "MMX test\n"); fact = 0.72; xsize = (int)(XSIZE * fact); diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 5560b9a646..2f16b730ab 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -45,7 +45,7 @@ #include "bitstream.h" #include "lcl.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif @@ -65,7 +65,7 @@ typedef struct LclDecContext { unsigned int decomp_size; // Decompression buffer unsigned char* decomp_buf; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB z_stream zstream; #endif } LclDecContext; @@ -174,7 +174,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const unsigned char yq, y1q, uq, vq; int uqvq; unsigned int mthread_inlen, mthread_outlen; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB int zret; // Zlib return code #endif unsigned int len = buf_size; @@ -235,7 +235,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const } break; case CODEC_ID_ZLIB: -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB /* Using the original dll with normal compression (-1) and RGB format * gives a file with ZLIB fourcc, but frame is really uncompressed. * To be sure that's true check also frame size */ @@ -524,7 +524,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->pic.data[0] = NULL; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB // Needed if zlib unused or init aborted before inflateInit memset(&(c->zstream), 0, sizeof(z_stream)); #endif @@ -599,7 +599,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } break; case CODEC_ID_ZLIB: -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB switch (c->compression) { case COMP_ZLIB_HISPEED: av_log(avctx, AV_LOG_INFO, "High speed compression.\n"); @@ -648,7 +648,7 @@ static av_cold int decode_init(AVCodecContext *avctx) /* If needed init zlib */ if (avctx->codec_id == CODEC_ID_ZLIB) { -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB c->zstream.zalloc = Z_NULL; c->zstream.zfree = Z_NULL; c->zstream.opaque = Z_NULL; @@ -679,14 +679,14 @@ static av_cold int decode_end(AVCodecContext *avctx) if (c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB inflateEnd(&(c->zstream)); #endif return 0; } -#ifdef CONFIG_MSZH_DECODER +#if CONFIG_MSZH_DECODER AVCodec mszh_decoder = { "mszh", CODEC_TYPE_VIDEO, @@ -701,7 +701,7 @@ AVCodec mszh_decoder = { }; #endif -#ifdef CONFIG_ZLIB_DECODER +#if CONFIG_ZLIB_DECODER AVCodec zlib_decoder = { "zlib", CODEC_TYPE_VIDEO, diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c index d0269655e5..680a511be1 100644 --- a/libavcodec/lclenc.c +++ b/libavcodec/lclenc.c @@ -45,7 +45,7 @@ #include "bitstream.h" #include "lcl.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif @@ -70,7 +70,7 @@ typedef struct LclEncContext { unsigned int max_comp_size; // Compression buffer unsigned char* comp_buf; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB z_stream zstream; #endif } LclEncContext; @@ -87,7 +87,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, int i; int zret; // Zlib return code -#ifndef CONFIG_ZLIB +#if !CONFIG_ZLIB av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled in.\n"); return -1; #else @@ -144,7 +144,7 @@ static av_cold int encode_init(AVCodecContext *avctx) LclEncContext *c = avctx->priv_data; int zret; // Zlib return code -#ifndef CONFIG_ZLIB +#if !CONFIG_ZLIB av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n"); return 1; #else @@ -213,7 +213,7 @@ static av_cold int encode_end(AVCodecContext *avctx) av_freep(&avctx->extradata); av_freep(&c->comp_buf); -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB deflateEnd(&(c->zstream)); #endif diff --git a/libavcodec/libamr.c b/libavcodec/libamr.c index 79ca57ff37..80cb09019b 100644 --- a/libavcodec/libamr.c +++ b/libavcodec/libamr.c @@ -65,7 +65,7 @@ #include "avcodec.h" -#ifdef CONFIG_LIBAMR_NB_FIXED +#if CONFIG_LIBAMR_NB_FIXED #define MMS_IO @@ -137,7 +137,7 @@ static void amr_decode_fix_avctx(AVCodecContext * avctx) avctx->sample_fmt = SAMPLE_FMT_S16; } -#ifdef CONFIG_LIBAMR_NB_FIXED +#if CONFIG_LIBAMR_NB_FIXED /* fixed point version*/ /* frame size in serial bitstream file (frame type + serial stream + flags) */ #define SERIAL_FRAMESIZE (1+MAX_SERIAL_SIZE+5) @@ -353,7 +353,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, } -#elif defined(CONFIG_LIBAMR_NB) /* Float point version*/ +#elif CONFIG_LIBAMR_NB /* Float point version*/ typedef struct AMRContext { int frameCount; @@ -492,7 +492,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, #endif -#if defined(CONFIG_LIBAMR_NB) || defined(CONFIG_LIBAMR_NB_FIXED) +#if CONFIG_LIBAMR_NB || CONFIG_LIBAMR_NB_FIXED AVCodec libamr_nb_decoder = { @@ -524,7 +524,7 @@ AVCodec libamr_nb_encoder = #endif /* -----------AMR wideband ------------*/ -#ifdef CONFIG_LIBAMR_WB +#if CONFIG_LIBAMR_WB #ifdef _TYPEDEF_H //To avoid duplicate typedefs from typedef in amr-nb diff --git a/libavcodec/libdirac.h b/libavcodec/libdirac.h index 54db287824..b677a7e5e1 100644 --- a/libavcodec/libdirac.h +++ b/libavcodec/libdirac.h @@ -28,7 +28,7 @@ #include "config.h" -#ifdef CONFIG_LIBDIRAC +#if CONFIG_LIBDIRAC #include "avcodec.h" #include <libdirac_common/dirac_types.h> diff --git a/libavcodec/libfaad.c b/libavcodec/libfaad.c index c6da20dc3d..7cf39e2a5f 100644 --- a/libavcodec/libfaad.c +++ b/libavcodec/libfaad.c @@ -35,12 +35,13 @@ #endif /* - * when CONFIG_LIBFAADBIN is defined the libfaad will be opened at runtime + * when CONFIG_LIBFAADBIN is true libfaad will be opened at runtime */ //#undef CONFIG_LIBFAADBIN -//#define CONFIG_LIBFAADBIN +//#define CONFIG_LIBFAADBIN 0 +//#define CONFIG_LIBFAADBIN 1 -#ifdef CONFIG_LIBFAADBIN +#if CONFIG_LIBFAADBIN #include <dlfcn.h> static const char* const libfaadname = "libfaad.so"; #else @@ -224,7 +225,7 @@ static av_cold int faac_decode_init(AVCodecContext *avctx) FAACContext *s = avctx->priv_data; faacDecConfigurationPtr faac_cfg; -#ifdef CONFIG_LIBFAADBIN +#if CONFIG_LIBFAADBIN const char* err = 0; s->handle = dlopen(libfaadname, RTLD_LAZY); @@ -259,7 +260,7 @@ static av_cold int faac_decode_init(AVCodecContext *avctx) #undef dfaac -#ifdef CONFIG_LIBFAADBIN +#if CONFIG_LIBFAADBIN if (err) { dlclose(s->handle); av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot resolve %s in %s!\n", diff --git a/libavcodec/libschroedinger.h b/libavcodec/libschroedinger.h index 6902a5d059..79faefcb61 100644 --- a/libavcodec/libschroedinger.h +++ b/libavcodec/libschroedinger.h @@ -28,7 +28,7 @@ #include "config.h" -#ifdef CONFIG_LIBSCHROEDINGER +#if CONFIG_LIBSCHROEDINGER #include <schroedinger/schrobitstream.h> #include <schroedinger/schroframe.h> diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c index 314945961b..ac1553f2a8 100644 --- a/libavcodec/libxvidff.c +++ b/libavcodec/libxvidff.c @@ -166,9 +166,9 @@ av_cold int ff_xvid_encode_init(AVCodecContext *avctx) { xvid_gbl_init.version = XVID_VERSION; xvid_gbl_init.debug = 0; -#ifdef ARCH_PPC +#if ARCH_PPC /* Xvid's PPC support is borked, use libavcodec to detect */ -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC if( has_altivec() ) { xvid_gbl_init.cpu_flags = XVID_CPU_FORCE | XVID_CPU_ALTIVEC; } else diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 07265c81f5..9ef62cfb31 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -24,19 +24,19 @@ #include "libavutil/common.h" -#ifdef ARCH_X86_32 +#if ARCH_X86_32 #include "x86/mathops.h" -#elif defined(ARCH_ARM) +#elif ARCH_ARM #include "arm/mathops.h" -#elif defined(ARCH_PPC) +#elif ARCH_PPC #include "ppc/mathops.h" -#elif defined(ARCH_BFIN) +#elif ARCH_BFIN #include "bfin/mathops.h" diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c index 35ccbf6ba9..3a5b83bb3b 100644 --- a/libavcodec/mpc.c +++ b/libavcodec/mpc.c @@ -30,7 +30,7 @@ #include "bitstream.h" #include "dsputil.h" -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP #define USE_HIGHPRECISION #endif #include "mpegaudio.h" diff --git a/libavcodec/mpc.h b/libavcodec/mpc.h index 038c34f20a..d9aa22af41 100644 --- a/libavcodec/mpc.h +++ b/libavcodec/mpc.h @@ -33,7 +33,7 @@ #include "bitstream.h" #include "dsputil.h" -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP #define USE_HIGHPRECISION #endif #include "mpegaudio.h" diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 2db417280c..168e60b995 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -30,7 +30,7 @@ #include "bitstream.h" #include "dsputil.h" -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP #define USE_HIGHPRECISION #endif #include "mpegaudio.h" diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index c47e74dde2..9e21f09139 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -30,7 +30,7 @@ #include "bitstream.h" #include "dsputil.h" -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP #define USE_HIGHPRECISION #endif #include "mpegaudio.h" diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 0e41ffe9c5..8971e2bbb2 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -303,7 +303,7 @@ static int mpeg_decode_mb(MpegEncContext *s, }else memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */ s->mb_intra = 1; -#ifdef CONFIG_XVMC +#if CONFIG_XVMC //if 1, we memcpy blocks in xvmcvideo if(s->avctx->xvmc_acceleration > 1){ XVMC_pack_pblocks(s,-1);//inter are always full blocks @@ -516,7 +516,7 @@ static int mpeg_decode_mb(MpegEncContext *s, return -1; } -#ifdef CONFIG_XVMC +#if CONFIG_XVMC //if 1, we memcpy blocks in xvmcvideo if(s->avctx->xvmc_acceleration > 1){ XVMC_pack_pblocks(s,cbp); @@ -1644,7 +1644,7 @@ static int mpeg_field_start(MpegEncContext *s){ } } } -#ifdef CONFIG_XVMC +#if CONFIG_XVMC // MPV_frame_start will call this function too, // but we need to call it on every field if(s->avctx->xvmc_acceleration) @@ -1735,7 +1735,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, } for(;;) { -#ifdef CONFIG_XVMC +#if CONFIG_XVMC //If 1, we memcpy blocks in xvmcvideo. if(s->avctx->xvmc_acceleration > 1) XVMC_init_block(s);//set s->block @@ -1917,7 +1917,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr) return 0; -#ifdef CONFIG_XVMC +#if CONFIG_XVMC if(s->avctx->xvmc_acceleration) XVMC_field_end(s); #endif @@ -2473,7 +2473,7 @@ AVCodec mpegvideo_decoder = { .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), }; -#ifdef CONFIG_XVMC +#if CONFIG_XVMC static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){ Mpeg1Context *s; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index a1386a08d2..efab550e4f 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -36,7 +36,7 @@ /* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg audio decoder */ -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP # define USE_HIGHPRECISION #endif @@ -2322,7 +2322,7 @@ static void flush(AVCodecContext *avctx){ s->last_buf_size= 0; } -#ifdef CONFIG_MP3ADU_DECODER +#if CONFIG_MP3ADU_DECODER static int decode_frame_adu(AVCodecContext * avctx, void *data, int *data_size, const uint8_t * buf, int buf_size) @@ -2372,7 +2372,7 @@ static int decode_frame_adu(AVCodecContext * avctx, } #endif /* CONFIG_MP3ADU_DECODER */ -#ifdef CONFIG_MP3ON4_DECODER +#if CONFIG_MP3ON4_DECODER /** * Context for MP3On4 decoder @@ -2534,7 +2534,7 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, } #endif /* CONFIG_MP3ON4_DECODER */ -#ifdef CONFIG_MP1_DECODER +#if CONFIG_MP1_DECODER AVCodec mp1_decoder = { "mp1", @@ -2550,7 +2550,7 @@ AVCodec mp1_decoder = .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), }; #endif -#ifdef CONFIG_MP2_DECODER +#if CONFIG_MP2_DECODER AVCodec mp2_decoder = { "mp2", @@ -2566,7 +2566,7 @@ AVCodec mp2_decoder = .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), }; #endif -#ifdef CONFIG_MP3_DECODER +#if CONFIG_MP3_DECODER AVCodec mp3_decoder = { "mp3", @@ -2582,7 +2582,7 @@ AVCodec mp3_decoder = .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), }; #endif -#ifdef CONFIG_MP3ADU_DECODER +#if CONFIG_MP3ADU_DECODER AVCodec mp3adu_decoder = { "mp3adu", @@ -2598,7 +2598,7 @@ AVCodec mp3adu_decoder = .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), }; #endif -#ifdef CONFIG_MP3ON4_DECODER +#if CONFIG_MP3ON4_DECODER AVCodec mp3on4_decoder = { "mp3on4", diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 43a6e85a11..bc0b50f0df 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -121,19 +121,19 @@ int ff_dct_common_init(MpegEncContext *s) s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact; s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; -#if defined(HAVE_MMX) +#if HAVE_MMX MPV_common_init_mmx(s); -#elif defined(ARCH_ALPHA) +#elif ARCH_ALPHA MPV_common_init_axp(s); -#elif defined(CONFIG_MLIB) +#elif CONFIG_MLIB MPV_common_init_mlib(s); -#elif defined(HAVE_MMI) +#elif HAVE_MMI MPV_common_init_mmi(s); -#elif defined(ARCH_ARM) +#elif ARCH_ARM MPV_common_init_arm(s); -#elif defined(HAVE_ALTIVEC) +#elif HAVE_ALTIVEC MPV_common_init_altivec(s); -#elif defined(ARCH_BFIN) +#elif ARCH_BFIN MPV_common_init_bfin(s); #endif @@ -939,7 +939,7 @@ alloc: update_noise_reduction(s); } -#ifdef CONFIG_XVMC +#if CONFIG_XVMC if(s->avctx->xvmc_acceleration) return XVMC_field_start(s, avctx); #endif @@ -951,7 +951,7 @@ void MPV_frame_end(MpegEncContext *s) { int i; /* draw edge for correct motion prediction if outside */ -#ifdef CONFIG_XVMC +#if CONFIG_XVMC //just to make sure that all data is rendered. if(s->avctx->xvmc_acceleration){ XVMC_field_end(s); @@ -1736,7 +1736,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], { int mb_x, mb_y; const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; -#ifdef CONFIG_XVMC +#if CONFIG_XVMC if(s->avctx->xvmc_acceleration){ XVMC_decode_mb(s);//xvmc uses pblocks return; @@ -1974,7 +1974,7 @@ skip_idct: } void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL if(s->out_format == FMT_MPEG1) { if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1); else MPV_decode_mb_internal(s, block, 0, 1); diff --git a/libavcodec/mpegvideo_common.h b/libavcodec/mpegvideo_common.h index 6875e85313..acff26f185 100644 --- a/libavcodec/mpegvideo_common.h +++ b/libavcodec/mpegvideo_common.h @@ -371,7 +371,7 @@ void mpeg_motion(MpegEncContext *s, uint8_t **ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h) { -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL if(s->out_format == FMT_MPEG1) mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, field_based, bottom_field, field_select, ref_picture, pix_op, @@ -888,7 +888,7 @@ static inline void MPV_motion(MpegEncContext *s, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16]) { -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL if(s->out_format == FMT_MPEG1) MPV_motion_internal(s, dest_y, dest_cb, dest_cr, dir, ref_picture, pix_op, qpix_op, 1); diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 58d1a9773a..ddc8e6e997 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -62,7 +62,7 @@ static uint32_t v2_dc_chroma_table[512][2]; static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr); static void init_h263_dc_for_msmpeg4(void); static inline void msmpeg4_memsetw(short *tab, int val, int n); -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static void msmpeg4v2_encode_motion(MpegEncContext * s, int val); static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra); #endif //CONFIG_ENCODERS @@ -79,7 +79,7 @@ int frame_count = 0; #include "msmpeg4data.h" -#ifdef CONFIG_ENCODERS //strangely gcc includes this even if it is not references +#if CONFIG_ENCODERS //strangely gcc includes this even if it is not referenced static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]; #endif //CONFIG_ENCODERS @@ -109,7 +109,7 @@ static void common_init(MpegEncContext * s) s->y_dc_scale_table= wmv1_y_dc_scale_table; s->c_dc_scale_table= wmv1_c_dc_scale_table; break; -#if defined(CONFIG_WMV3_DECODER)||defined(CONFIG_VC1_DECODER) +#if CONFIG_WMV3_DECODER || CONFIG_VC1_DECODER case 6: s->y_dc_scale_table= wmv3_dc_scale_table; s->c_dc_scale_table= wmv3_dc_scale_table; @@ -134,7 +134,7 @@ static void common_init(MpegEncContext * s) } } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS /* build the table which associate a (x,y) motion vector to a vlc */ static void init_mv_table(MVTable *tab) @@ -411,7 +411,7 @@ int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block return pred; } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my) @@ -653,7 +653,7 @@ static inline int msmpeg4_pred_dc(MpegEncContext * s, int n, necessitate to modify mpegvideo.c. The problem comes from the fact they decided to store the quantized DC (which would lead to problems if Q could vary !) */ -#if (defined(ARCH_X86)) && !defined PIC +#if ARCH_X86 && !defined PIC __asm__ volatile( "movl %3, %%eax \n\t" "shrl $1, %%eax \n\t" @@ -673,7 +673,7 @@ static inline int msmpeg4_pred_dc(MpegEncContext * s, int n, : "%eax", "%edx" ); #else - /* #elif defined (ARCH_ALPHA) */ + /* #elif ARCH_ALPHA */ /* Divisions are extremely costly on Alpha; optimize the most common case. But they are costly everywhere... */ @@ -1362,7 +1362,7 @@ static inline void msmpeg4_memsetw(short *tab, int val, int n) tab[i] = val; } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) { int range, bit_size, sign, code, bits; diff --git a/libavcodec/options.c b/libavcodec/options.c index c875b31a15..e04219a1d7 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -267,7 +267,7 @@ static const AVOption options[]={ {"vsad", "sum of absolute vertical differences", 0, FF_OPT_TYPE_CONST, FF_CMP_VSAD, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"vsse","sum of squared vertical differences", 0, FF_OPT_TYPE_CONST, FF_CMP_VSSE, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"nsse", "noise preserving sum of squared differences", 0, FF_OPT_TYPE_CONST, FF_CMP_NSSE, INT_MIN, INT_MAX, V|E, "cmp_func"}, -#ifdef CONFIG_SNOW_ENCODER +#if CONFIG_SNOW_ENCODER {"w53", "5/3 wavelet, only used in snow", 0, FF_OPT_TYPE_CONST, FF_CMP_W53, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"w97", "9/7 wavelet, only used in snow", 0, FF_OPT_TYPE_CONST, FF_CMP_W97, INT_MIN, INT_MAX, V|E, "cmp_func"}, #endif diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 84aa098750..62dea0f54e 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -507,7 +507,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, return src - buf; } -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS #define PCM_ENCODER(id,sample_fmt_,name,long_name_) \ AVCodec name ## _encoder = { \ #name, \ @@ -525,7 +525,7 @@ AVCodec name ## _encoder = { \ #define PCM_ENCODER(id,sample_fmt_,name,long_name_) #endif -#ifdef CONFIG_DECODERS +#if CONFIG_DECODERS #define PCM_DECODER(id,sample_fmt_,name,long_name_) \ AVCodec name ## _decoder = { \ #name, \ diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index b62ea759df..3ff120903f 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -354,7 +354,7 @@ static int pam_probe(AVProbeData *pd) #endif -#ifdef CONFIG_PGM_ENCODER +#if CONFIG_PGM_ENCODER AVCodec pgm_encoder = { "pgm", CODEC_TYPE_VIDEO, @@ -369,7 +369,7 @@ AVCodec pgm_encoder = { }; #endif // CONFIG_PGM_ENCODER -#ifdef CONFIG_PGMYUV_ENCODER +#if CONFIG_PGMYUV_ENCODER AVCodec pgmyuv_encoder = { "pgmyuv", CODEC_TYPE_VIDEO, @@ -384,7 +384,7 @@ AVCodec pgmyuv_encoder = { }; #endif // CONFIG_PGMYUV_ENCODER -#ifdef CONFIG_PPM_ENCODER +#if CONFIG_PPM_ENCODER AVCodec ppm_encoder = { "ppm", CODEC_TYPE_VIDEO, @@ -399,7 +399,7 @@ AVCodec ppm_encoder = { }; #endif // CONFIG_PPM_ENCODER -#ifdef CONFIG_PBM_ENCODER +#if CONFIG_PBM_ENCODER AVCodec pbm_encoder = { "pbm", CODEC_TYPE_VIDEO, @@ -414,7 +414,7 @@ AVCodec pbm_encoder = { }; #endif // CONFIG_PBM_ENCODER -#ifdef CONFIG_PAM_ENCODER +#if CONFIG_PAM_ENCODER AVCodec pam_encoder = { "pam", CODEC_TYPE_VIDEO, diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index 124453ef9b..b07468b27d 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -24,7 +24,7 @@ #include "dsputil_ppc.h" -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC #include "dsputil_altivec.h" void fdct_altivec(int16_t *block); @@ -48,7 +48,7 @@ int mm_flags = 0; int mm_support(void) { int result = 0; -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC if (has_altivec()) { result |= FF_MM_ALTIVEC; } @@ -56,7 +56,7 @@ int mm_support(void) return result; } -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total]; /* list below must match enum in dsputil_ppc.h */ static unsigned char* perfname[] = { @@ -91,7 +91,7 @@ static unsigned char* perfname[] = { #include <stdio.h> #endif -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF void powerpc_display_perf_report(void) { int i, j; @@ -165,7 +165,7 @@ POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1); /* same as above, when dcbzl clear a whole 128B cache line i.e. the PPC970 aka G5 */ -#ifdef HAVE_DCBZL +#if HAVE_DCBZL void clear_blocks_dcbz128_ppc(DCTELEM *blocks) { POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1); @@ -195,7 +195,7 @@ void clear_blocks_dcbz128_ppc(DCTELEM *blocks) } #endif -#ifdef HAVE_DCBZL +#if HAVE_DCBZL /* check dcbz report how many bytes are set to 0 by dcbz */ /* update 24/06/2003 : replace dcbz by dcbzl to get the intended effect (Apple "fixed" dcbz) @@ -261,7 +261,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) break; } -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC if(ENABLE_H264_DECODER) dsputil_h264_init_ppc(c, avctx); if (has_altivec()) { @@ -275,7 +275,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) int_init_altivec(c, avctx); c->gmc1 = gmc1_altivec; -#ifdef CONFIG_ENCODERS +#if CONFIG_ENCODERS if (avctx->dct_algo == FF_DCT_AUTO || avctx->dct_algo == FF_DCT_ALTIVEC) { c->fdct = fdct_altivec; @@ -291,7 +291,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) } } -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF { int i, j; for (i = 0 ; i < powerpc_perf_total ; i++) { diff --git a/libavcodec/ppc/dsputil_ppc.h b/libavcodec/ppc/dsputil_ppc.h index 578c96120f..d9740ce592 100644 --- a/libavcodec/ppc/dsputil_ppc.h +++ b/libavcodec/ppc/dsputil_ppc.h @@ -21,7 +21,7 @@ #ifndef AVCODEC_PPC_DSPUTIL_PPC_H #define AVCODEC_PPC_DSPUTIL_PPC_H -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF void powerpc_display_perf_report(void); /* the 604* have 2, the G3* have 4, the G4s have 6, and the G5 are completely different (they MUST use @@ -68,7 +68,7 @@ enum powerpc_data_index { }; extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total]; -#ifndef HAVE_PPC64 +#if !HAVE_PPC64 #define POWERP_PMC_DATATYPE unsigned long #define POWERPC_GET_PMC1(a) __asm__ volatile("mfspr %0, 937" : "=r" (a)) #define POWERPC_GET_PMC2(a) __asm__ volatile("mfspr %0, 938" : "=r" (a)) diff --git a/libavcodec/ppc/gcc_fixes.h b/libavcodec/ppc/gcc_fixes.h index efa7a576cc..a97921f1f5 100644 --- a/libavcodec/ppc/gcc_fixes.h +++ b/libavcodec/ppc/gcc_fixes.h @@ -25,7 +25,7 @@ #include "config.h" -#ifdef HAVE_ALTIVEC_H +#if HAVE_ALTIVEC_H #include <altivec.h> #endif diff --git a/libavcodec/ppc/idct_altivec.c b/libavcodec/ppc/idct_altivec.c index 94b6598c28..d262282bf0 100644 --- a/libavcodec/ppc/idct_altivec.c +++ b/libavcodec/ppc/idct_altivec.c @@ -161,7 +161,7 @@ void idct_put_altivec(uint8_t* dest, int stride, vec_s16* block) POWERPC_PERF_DECLARE(altivec_idct_put_num, 1); vec_u8 tmp; -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1); #endif IDCT @@ -192,7 +192,7 @@ POWERPC_PERF_DECLARE(altivec_idct_add_num, 1); vec_u8 perm1; vec_u8 p0, p1, p; -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1); #endif diff --git a/libavcodec/ppc/mathops.h b/libavcodec/ppc/mathops.h index edfe2ea242..beba351787 100644 --- a/libavcodec/ppc/mathops.h +++ b/libavcodec/ppc/mathops.h @@ -23,7 +23,7 @@ #ifndef AVCODEC_PPC_MATHOPS_H #define AVCODEC_PPC_MATHOPS_H -#if defined(ARCH_PPC_405) +#if ARCH_PPC_405 /* signed 16x16 -> 32 multiply add accumulate */ #define MAC16(rt, ra, rb) \ __asm__ ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb)); diff --git a/libavcodec/ppc/util_altivec.h b/libavcodec/ppc/util_altivec.h index c54d0ea4c1..b52c159136 100644 --- a/libavcodec/ppc/util_altivec.h +++ b/libavcodec/ppc/util_altivec.h @@ -28,7 +28,7 @@ #include "config.h" -#ifdef HAVE_ALTIVEC_H +#if HAVE_ALTIVEC_H #include <altivec.h> #endif diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index e1b67d0c19..9727d599ac 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -39,7 +39,7 @@ #include "bitstream.h" #include "dsputil.h" -#ifdef CONFIG_MPEGAUDIO_HP +#if CONFIG_MPEGAUDIO_HP #define USE_HIGHPRECISION #endif diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index c88059aa41..31c3da79b4 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -184,7 +184,7 @@ int ff_rate_control_init(MpegEncContext *s) //FIXME maybe move to end if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) { -#ifdef CONFIG_LIBXVID +#if CONFIG_LIBXVID return ff_xvid_rate_control_init(s); #else av_log(s->avctx, AV_LOG_ERROR, "Xvid ratecontrol requires libavcodec compiled with Xvid support.\n"); @@ -260,7 +260,7 @@ void ff_rate_control_uninit(MpegEncContext *s) ff_eval_free(rcc->rc_eq_eval); av_freep(&rcc->entry); -#ifdef CONFIG_LIBXVID +#if CONFIG_LIBXVID if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) ff_xvid_rate_control_uninit(s); #endif @@ -678,7 +678,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) Picture * const pic= &s->current_picture; emms_c(); -#ifdef CONFIG_LIBXVID +#if CONFIG_LIBXVID if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) return ff_xvid_rate_estimate_qscale(s, dry_run); #endif diff --git a/libavcodec/rectangle.h b/libavcodec/rectangle.h index a1dfb5cf99..563c988030 100644 --- a/libavcodec/rectangle.h +++ b/libavcodec/rectangle.h @@ -64,7 +64,7 @@ static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, *(uint32_t*)(p + 3*stride)= v; }else if(w==8){ //gcc can't optimize 64bit math on x86_32 -#ifdef HAVE_FAST_64BIT +#if HAVE_FAST_64BIT const uint64_t v= val*0x0100000001ULL; *(uint64_t*)(p + 0*stride)= v; if(h==1) return; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index ad09c07a09..cba319c5b1 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -230,7 +230,7 @@ int rv_decode_dc(MpegEncContext *s, int n) } -#if defined(CONFIG_RV10_ENCODER) || defined(CONFIG_RV20_ENCODER) +#if CONFIG_RV10_ENCODER || CONFIG_RV20_ENCODER /* write RV 1.0 compatible frame header */ void rv10_encode_picture_header(MpegEncContext *s, int picture_number) { @@ -304,7 +304,7 @@ static int get_num(GetBitContext *gb) } #endif -#endif /* defined(CONFIG_RV10_ENCODER) || defined(CONFIG_RV20_ENCODER) */ +#endif /* CONFIG_RV10_ENCODER || CONFIG_RV20_ENCODER */ /* read RV 1.0 compatible frame header */ static int rv10_decode_picture_header(MpegEncContext *s) diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c index 2cf9e8de98..914b491ec9 100644 --- a/libavcodec/simple_idct.c +++ b/libavcodec/simple_idct.c @@ -59,13 +59,13 @@ static inline void idctRowCondDC (DCTELEM * row) { int a0, a1, a2, a3, b0, b1, b2, b3; -#ifdef HAVE_FAST_64BIT +#if HAVE_FAST_64BIT uint64_t temp; #else uint32_t temp; #endif -#ifdef HAVE_FAST_64BIT +#if HAVE_FAST_64BIT #ifdef WORDS_BIGENDIAN #define ROW0_MASK 0xffff000000000000LL #else @@ -127,7 +127,7 @@ static inline void idctRowCondDC (DCTELEM * row) b3 = MUL16(W7, row[1]); MAC16(b3, -W5, row[3]); -#ifdef HAVE_FAST_64BIT +#if HAVE_FAST_64BIT temp = ((uint64_t*)row)[1]; #else temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3]; diff --git a/libavcodec/snow.c b/libavcodec/snow.c index e3e5aa9b1c..0e60d49a01 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -4670,7 +4670,7 @@ AVCodec snow_decoder = { .long_name = NULL_IF_CONFIG_SMALL("Snow"), }; -#ifdef CONFIG_SNOW_ENCODER +#if CONFIG_SNOW_ENCODER AVCodec snow_encoder = { "snow", CODEC_TYPE_VIDEO, diff --git a/libavcodec/snow.h b/libavcodec/snow.h index b208e5fe6a..5d5ae1e68a 100644 --- a/libavcodec/snow.h +++ b/libavcodec/snow.h @@ -125,7 +125,7 @@ void ff_snow_vertical_compose97i(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTE void ff_snow_horizontal_compose97i(IDWTELEM *b, int width); void ff_snow_inner_add_yblock(const 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 +#if CONFIG_SNOW_ENCODER int 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); #else diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 6e0bdc839b..44b4582682 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -408,7 +408,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error) return x; } -#if defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) +#if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER // Heavily modified Levinson-Durbin algorithm which // copes better with quantization, and calculates the // actual whitened result as it goes. @@ -479,12 +479,12 @@ static void modified_levinson_durbin(int *window, int window_entries, av_free(state); } -#endif /* defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) */ +#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */ static const int samplerate_table[] = { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 }; -#if defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) +#if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER static inline int code_samplerate(int samplerate) { switch (samplerate) @@ -747,9 +747,9 @@ static int sonic_encode_frame(AVCodecContext *avctx, flush_put_bits(&pb); return (put_bits_count(&pb)+7)/8; } -#endif /* defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) */ +#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */ -#ifdef CONFIG_SONIC_DECODER +#if CONFIG_SONIC_DECODER static av_cold int sonic_decode_init(AVCodecContext *avctx) { SonicContext *s = avctx->priv_data; @@ -936,7 +936,7 @@ static int sonic_decode_frame(AVCodecContext *avctx, } #endif /* CONFIG_SONIC_DECODER */ -#ifdef CONFIG_SONIC_ENCODER +#if CONFIG_SONIC_ENCODER AVCodec sonic_encoder = { "sonic", CODEC_TYPE_AUDIO, @@ -950,7 +950,7 @@ AVCodec sonic_encoder = { }; #endif -#ifdef CONFIG_SONIC_LS_ENCODER +#if CONFIG_SONIC_LS_ENCODER AVCodec sonic_ls_encoder = { "sonicls", CODEC_TYPE_AUDIO, @@ -964,7 +964,7 @@ AVCodec sonic_ls_encoder = { }; #endif -#ifdef CONFIG_SONIC_DECODER +#if CONFIG_SONIC_DECODER AVCodec sonic_decoder = { "sonic", CODEC_TYPE_AUDIO, diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 49ad3d31bb..2a96f34b9e 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -119,7 +119,7 @@ static void svq1_write_header(SVQ1Context *s, int frame_type) #define QUALITY_THRESHOLD 100 #define THRESHOLD_MULTIPLIER 0.6 -#if defined(HAVE_ALTIVEC) +#if HAVE_ALTIVEC #undef vector #endif diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index f438ba8262..e3f014a3de 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -40,7 +40,7 @@ * http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov */ -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif @@ -849,7 +849,7 @@ static int svq3_decode_init(AVCodecContext *avctx) h->unknown_svq3_flag = get_bits1(&gb); avctx->has_b_frames = !s->low_delay; if (h->unknown_svq3_flag) { -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB unsigned watermark_width = svq3_get_ue_golomb(&gb); unsigned watermark_height = svq3_get_ue_golomb(&gb); int u1 = svq3_get_ue_golomb(&gb); diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 582076bede..9880391bc8 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -25,7 +25,7 @@ * @author Konstantin Shishkov */ #include "avcodec.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif #include "lzw.h" @@ -78,7 +78,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin int c, line, pixels, code; const uint8_t *ssrc = src; int width = s->width * s->bpp >> 3; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB uint8_t *zbuf; unsigned long outlen; if(s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE){ @@ -298,7 +298,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t * break; case TIFF_DEFLATE: case TIFF_ADOBE_DEFLATE: -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB break; #else av_log(s->avctx, AV_LOG_ERROR, "Deflate: ZLib not compiled in\n"); diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index c44045435b..6d95e89058 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -25,7 +25,7 @@ * @author Bartlomiej Wolowiec */ #include "avcodec.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif #include "bytestream.h" @@ -151,7 +151,7 @@ static int encode_strip(TiffEncoderContext * s, const int8_t * src, { switch (compr) { -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB case TIFF_DEFLATE: case TIFF_ADOBE_DEFLATE: { @@ -229,7 +229,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, s->compr = TIFF_RAW; } else if(avctx->compression_level == 2) { s->compr = TIFF_LZW; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB } else if ((avctx->compression_level >= 3)) { s->compr = TIFF_DEFLATE; #endif @@ -315,7 +315,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, } } -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) { uint8_t *zbuf; int zlen, zn; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 0d2d657bd7..72531a80f8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -40,7 +40,7 @@ #include <stdarg.h> #include <limits.h> #include <float.h> -#if !defined(HAVE_MKSTEMP) +#if !HAVE_MKSTEMP #include <fcntl.h> #endif @@ -251,7 +251,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ //we could change STRIDE_ALIGN to 16 for x86/sse but it would increase the //picture size unneccessarily in some cases. The solution here is not //pretty and better ideas are welcome! -#ifdef HAVE_MMX +#if HAVE_MMX if(s->codec_id == CODEC_ID_SVQ1) stride_align[i]= 16; else @@ -900,7 +900,7 @@ int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) { } } -#if !defined(HAVE_THREADS) +#if !HAVE_THREADS int avcodec_thread_init(AVCodecContext *s, int thread_count){ return -1; } @@ -927,7 +927,7 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v) * and opened file name in **filename. */ int av_tempfile(char *prefix, char **filename) { int fd=-1; -#if !defined(HAVE_MKSTEMP) +#if !HAVE_MKSTEMP *filename = tempnam(".", prefix); #else size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ @@ -938,7 +938,7 @@ int av_tempfile(char *prefix, char **filename) { av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n"); return -1; } -#if !defined(HAVE_MKSTEMP) +#if !HAVE_MKSTEMP fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444); #else snprintf(*filename, len, "/tmp/%sXXXXXX", prefix); diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index d9d4ce9f61..c3b35567ea 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -32,6 +32,7 @@ /* Disable the encoder. */ #undef CONFIG_VCR1_ENCODER +#define CONFIG_VCR1_ENCODER 0 typedef struct VCR1Context{ AVCodecContext *avctx; @@ -116,7 +117,7 @@ static int decode_frame(AVCodecContext *avctx, return buf_size; } -#ifdef CONFIG_VCR1_ENCODER +#if CONFIG_VCR1_ENCODER static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ VCR1Context * const a = avctx->priv_data; AVFrame *pict = data; @@ -156,7 +157,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ return 0; } -#ifdef CONFIG_VCR1_ENCODER +#if CONFIG_VCR1_ENCODER static av_cold int encode_init(AVCodecContext *avctx){ common_init(avctx); @@ -178,7 +179,7 @@ AVCodec vcr1_decoder = { .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), }; -#ifdef CONFIG_VCR1_ENCODER +#if CONFIG_VCR1_ENCODER AVCodec vcr1_encoder = { "vcr1", CODEC_TYPE_VIDEO, diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 27370253ce..73e285eda2 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2021,7 +2021,7 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb) return 0; } -#ifdef CONFIG_THEORA_DECODER +#if CONFIG_THEORA_DECODER static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) { Vp3DecodeContext *s = avctx->priv_data; 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"\ |