diff options
author | Aurelien Jacobs | 2009-01-13 23:44:16 +0000 |
---|---|---|
committer | Aurelien Jacobs | 2009-01-13 23:44:16 +0000 |
commit | b250f9c66d3ddd84652d158fb979a5f21e3f2c71 (patch) | |
tree | ef84366029d6f8af6ed82e90c5f188bb7dfc844d | |
parent | 959da985b03570cfe7d239c0ba6d550ecb04c460 (diff) |
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
154 files changed, 757 insertions, 749 deletions
diff --git a/cmdutils.c b/cmdutils.c index 32ffefaf3b..20291aaba4 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -30,19 +30,19 @@ #include "config.h" #include "libavformat/avformat.h" -#ifdef CONFIG_AVFILTER +#if CONFIG_AVFILTER #include "libavfilter/avfilter.h" #endif #include "libavdevice/avdevice.h" #include "libswscale/swscale.h" -#ifdef CONFIG_POSTPROC +#if CONFIG_POSTPROC #include "libpostproc/postprocess.h" #endif #include "libavutil/avstring.h" #include "libavcodec/opt.h" #include "cmdutils.h" #include "version.h" -#ifdef CONFIG_NETWORK +#if CONFIG_NETWORK #include "libavformat/network.h" #endif @@ -255,7 +255,7 @@ void print_error(const char *filename, int err) case AVERROR(ENOENT): fprintf(stderr, "%s: no such file or directory\n", filename); break; -#ifdef CONFIG_NETWORK +#if CONFIG_NETWORK case AVERROR(FF_NETERROR(EPROTONOSUPPORT)): fprintf(stderr, "%s: Unsupported network protocol\n", filename); break; @@ -279,13 +279,13 @@ static void print_all_lib_versions(FILE* outstream, int indent) PRINT_LIB_VERSION(outstream, avcodec, AVCODEC, indent); PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent); PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, indent); -#ifdef CONFIG_AVFILTER +#if CONFIG_AVFILTER PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent); #endif -#ifdef CONFIG_SWSCALE +#if CONFIG_SWSCALE PRINT_LIB_VERSION(outstream, swscale, SWSCALE, indent); #endif -#ifdef CONFIG_POSTPROC +#if CONFIG_POSTPROC PRINT_LIB_VERSION(outstream, postproc, POSTPROC, indent); #endif } @@ -311,7 +311,7 @@ void show_version(void) { void show_license(void) { -#ifdef CONFIG_NONFREE +#if CONFIG_NONFREE printf( "This version of %s has nonfree parts compiled in.\n" "Therefore it is not legally redistributable.\n", @@ -430,6 +430,7 @@ print_config(){ echo "#define ENABLE_${ucname} 1" >> $header echo "${pfx}${ucname}=yes" >> $makefile else + echo "#define ${pfx}${ucname} 0" >> $header echo "#define ENABLE_${ucname} 0" >> $header fi done diff --git a/doc/faq.texi b/doc/faq.texi index e070fd2938..0d923a48e0 100644 --- a/doc/faq.texi +++ b/doc/faq.texi @@ -426,7 +426,7 @@ you need the debug information, used the *_g versions. @section I do not like the LGPL, can I contribute code under the GPL instead? Yes, as long as the code is optional and can easily and cleanly be placed -under #ifdef CONFIG_GPL without breaking anything. So for example a new codec +under #if CONFIG_GPL without breaking anything. So for example a new codec or filter would be OK under GPL while a bug fix to LGPL code would not. @section I want to compile xyz.c alone but my compiler produced many errors. @@ -41,23 +41,23 @@ #include "libavutil/avstring.h" #include "libavformat/os_support.h" -#ifdef HAVE_SYS_RESOURCE_H +#if HAVE_SYS_RESOURCE_H #include <sys/types.h> #include <sys/resource.h> -#elif defined(HAVE_GETPROCESSTIMES) +#elif HAVE_GETPROCESSTIMES #include <windows.h> #endif -#ifdef HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H #include <sys/select.h> #endif -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS_H #include <fcntl.h> #include <sys/ioctl.h> #include <sys/time.h> #include <termios.h> -#elif defined(HAVE_CONIO_H) +#elif HAVE_CONIO_H #include <conio.h> #endif #undef time //needed because HAVE_AV_CONFIG_H is defined on top @@ -295,7 +295,7 @@ typedef struct AVInputFile { int nb_streams; /* nb streams we are aware of */ } AVInputFile; -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS_H /* init terminal so that we can grab keys */ static struct termios oldtty; @@ -303,7 +303,7 @@ static struct termios oldtty; static void term_exit(void) { -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS_H tcsetattr (0, TCSANOW, &oldtty); #endif } @@ -319,7 +319,7 @@ sigterm_handler(int sig) static void term_init(void) { -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS_H struct termios tty; tcgetattr (0, &tty); @@ -344,7 +344,7 @@ static void term_init(void) register a function to be called at normal program termination */ atexit(term_exit); -#ifdef CONFIG_BEOS_NETSERVER +#if CONFIG_BEOS_NETSERVER fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK); #endif } @@ -352,10 +352,10 @@ static void term_init(void) /* read a key without blocking */ static int read_key(void) { -#if defined(HAVE_TERMIOS_H) +#if HAVE_TERMIOS_H int n = 1; unsigned char ch; -#ifndef CONFIG_BEOS_NETSERVER +#if !CONFIG_BEOS_NETSERVER struct timeval tv; fd_set rfds; @@ -372,7 +372,7 @@ static int read_key(void) return n; } -#elif defined(HAVE_CONIO_H) +#elif HAVE_CONIO_H if(kbhit()) return(getch()); #endif @@ -427,7 +427,7 @@ static int av_exit(int ret) av_free(video_standard); -#ifdef CONFIG_POWERPC_PERF +#if CONFIG_POWERPC_PERF void powerpc_display_perf_report(void); powerpc_display_perf_report(); #endif /* CONFIG_POWERPC_PERF */ @@ -2553,7 +2553,7 @@ static void opt_top_field_first(const char *arg) static int opt_thread_count(const char *opt, const char *arg) { thread_count= parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); -#if !defined(HAVE_THREADS) +#if !HAVE_THREADS if (verbose >= 0) fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n"); #endif @@ -2626,7 +2626,7 @@ static void opt_video_tag(const char *arg) video_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24); } -#ifdef CONFIG_VHOOK +#if CONFIG_VHOOK static void add_frame_hooker(const char *arg) { int argc = 0; @@ -3416,12 +3416,12 @@ static void opt_pass(const char *pass_str) static int64_t getutime(void) { -#ifdef HAVE_GETRUSAGE +#if HAVE_GETRUSAGE struct rusage rusage; getrusage(RUSAGE_SELF, &rusage); return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec; -#elif defined(HAVE_GETPROCESSTIMES) +#elif HAVE_GETPROCESSTIMES HANDLE proc; FILETIME c, e, k, u; proc = GetCurrentProcess(); @@ -3828,7 +3828,7 @@ static const OptionDef options[] = { { "psnr", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_psnr}, "calculate PSNR of compressed frames" }, { "vstats", OPT_EXPERT | OPT_VIDEO, {(void*)&opt_vstats}, "dump video coding statistics to file" }, { "vstats_file", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_vstats_file}, "dump video coding statistics to file", "file" }, -#ifdef CONFIG_VHOOK +#if CONFIG_VHOOK { "vhook", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)add_frame_hooker}, "insert video processing module", "module" }, #endif { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" }, @@ -2019,7 +2019,7 @@ static int decode_thread(void *arg) else av_read_play(ic); } -#if defined(CONFIG_RTSP_DEMUXER) || defined(CONFIG_MMSH_PROTOCOL) +#if CONFIG_RTSP_DEMUXER || CONFIG_MMSH_PROTOCOL if (is->paused && (!strcmp(ic->iformat->name, "rtsp") || (ic->pb && !strcmp(url_fileno(ic->pb)->prot->name, "mmsh")))) { @@ -2467,7 +2467,7 @@ static int opt_vismv(const char *opt, const char *arg) static int opt_thread_count(const char *opt, const char *arg) { thread_count= parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); -#if !defined(HAVE_THREADS) +#if !HAVE_THREADS fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n"); #endif return 0; @@ -2579,7 +2579,7 @@ int main(int argc, char **argv) } if (!display_disable) { -#ifdef HAVE_SDL_VIDEO_SIZE +#if HAVE_SDL_VIDEO_SIZE const SDL_VideoInfo *vi = SDL_GetVideoInfo(); fs_screen_width = vi->current_w; fs_screen_height = vi->current_h; diff --git a/ffserver.c b/ffserver.c index 231697eec5..4736e2dac5 100644 --- a/ffserver.c +++ b/ffserver.c @@ -22,7 +22,7 @@ #define _XOPEN_SOURCE 600 #include "config.h" -#ifndef HAVE_CLOSESOCKET +#if !HAVE_CLOSESOCKET #define closesocket close #endif #include <string.h> @@ -41,7 +41,7 @@ #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> -#ifdef HAVE_POLL_H +#if HAVE_POLL_H #include <poll.h> #endif #include <errno.h> @@ -50,7 +50,7 @@ #include <time.h> #include <sys/wait.h> #include <signal.h> -#ifdef HAVE_DLFCN_H +#if HAVE_DLFCN_H #include <dlfcn.h> #endif @@ -3709,7 +3709,7 @@ static enum CodecID opt_video_codec(const char *arg) /* simplistic plugin support */ -#ifdef HAVE_DLOPEN +#if HAVE_DLOPEN static void load_module(const char *filename) { void *dll; @@ -4394,7 +4394,7 @@ static int parse_ffconfig(const char *filename) } } else if (!strcasecmp(cmd, "LoadModule")) { get_arg(arg, sizeof(arg), &p); -#ifdef HAVE_DLOPEN +#if HAVE_DLOPEN load_module(arg); #else fprintf(stderr, "%s:%d: Module support not compiled into this version: '%s'\n", 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"\ diff --git a/libavdevice/audio.c b/libavdevice/audio.c index d056711d03..4344ecb4f1 100644 --- a/libavdevice/audio.c +++ b/libavdevice/audio.c @@ -25,7 +25,7 @@ #include <stdint.h> #include <string.h> #include <errno.h> -#ifdef HAVE_SOUNDCARD_H +#if HAVE_SOUNDCARD_H #include <soundcard.h> #else #include <sys/soundcard.h> @@ -311,7 +311,7 @@ static int audio_read_close(AVFormatContext *s1) return 0; } -#ifdef CONFIG_OSS_DEMUXER +#if CONFIG_OSS_DEMUXER AVInputFormat oss_demuxer = { "oss", NULL_IF_CONFIG_SMALL("Open Sound System capture"), @@ -324,7 +324,7 @@ AVInputFormat oss_demuxer = { }; #endif -#ifdef CONFIG_OSS_MUXER +#if CONFIG_OSS_MUXER AVOutputFormat oss_muxer = { "oss", NULL_IF_CONFIG_SMALL("Open Sound System playback"), diff --git a/libavdevice/beosaudio.cpp b/libavdevice/beosaudio.cpp index def1fad608..84e7c77905 100644 --- a/libavdevice/beosaudio.cpp +++ b/libavdevice/beosaudio.cpp @@ -33,7 +33,7 @@ extern "C" { #include "libavformat/avformat.h" } -#ifdef HAVE_BSOUNDRECORDER +#if HAVE_BSOUNDRECORDER #include <SoundRecorder.h> using namespace BPrivate::Media::Experimental; #endif @@ -63,7 +63,7 @@ typedef struct { sem_id output_sem; int output_index; BSoundPlayer *player; -#ifdef HAVE_BSOUNDRECORDER +#if HAVE_BSOUNDRECORDER BSoundRecorder *recorder; #endif int has_quit; /* signal callbacks not to wait */ @@ -150,7 +150,7 @@ static void audioplay_callback(void *cookie, void *buffer, size_t bufferSize, co } } -#ifdef HAVE_BSOUNDRECORDER +#if HAVE_BSOUNDRECORDER /* called back by BSoundRecorder */ static void audiorecord_callback(void *cookie, bigtime_t timestamp, void *buffer, size_t bufferSize, const media_multi_audio_format &format) { @@ -192,7 +192,7 @@ static int audio_open(AudioData *s, int is_output, const char *audio_device) media_raw_audio_format format; media_multi_audio_format iformat; -#ifndef HAVE_BSOUNDRECORDER +#if !HAVE_BSOUNDRECORDER if (!is_output) return AVERROR(EIO); /* not for now */ #endif @@ -210,7 +210,7 @@ static int audio_open(AudioData *s, int is_output, const char *audio_device) s->frame_size = AUDIO_BLOCK_SIZE; /* bump up the priority (avoid realtime though) */ set_thread_priority(find_thread(NULL), B_DISPLAY_PRIORITY+1); -#ifdef HAVE_BSOUNDRECORDER +#if HAVE_BSOUNDRECORDER if (!is_output) { bool wait_for_input = false; if (audio_device && !strcmp(audio_device, "wait:")) @@ -273,7 +273,7 @@ static int audio_close(AudioData *s) } if (s->player) delete s->player; -#ifdef HAVE_BSOUNDRECORDER +#if HAVE_BSOUNDRECORDER if (s->recorder) delete s->recorder; #endif diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index ea9a6e25e1..86590d0891 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -26,13 +26,13 @@ #define _BSD_SOURCE 1 #include "libavformat/avformat.h" -#if defined (HAVE_DEV_BKTR_IOCTL_METEOR_H) && defined (HAVE_DEV_BKTR_IOCTL_BT848_H) +#if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H # include <dev/bktr/ioctl_meteor.h> # include <dev/bktr/ioctl_bt848.h> -#elif defined (HAVE_MACHINE_IOCTL_METEOR_H) && defined (HAVE_MACHINE_IOCTL_BT848_H) +#elif HAVE_MACHINE_IOCTL_METEOR_H && HAVE_MACHINE_IOCTL_BT848_H # include <machine/ioctl_meteor.h> # include <machine/ioctl_bt848.h> -#elif defined (HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H) && defined (HAVE_DEV_VIDEO_METEOR_IOCTL_BT848_H) +#elif HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H && HAVE_DEV_VIDEO_METEOR_IOCTL_BT848_H # include <dev/video/meteor/ioctl_meteor.h> # include <dev/video/bktr/ioctl_bt848.h> #elif HAVE_DEV_IC_BT8XX_H diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 1efed83f3b..e6e142a807 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -35,7 +35,7 @@ #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/time.h> -#ifdef HAVE_SYS_VIDEOIO_H +#if HAVE_SYS_VIDEOIO_H #include <sys/videoio.h> #else #include <asm/types.h> diff --git a/libavformat/aiff.c b/libavformat/aiff.c index 8bd69c200e..70569ed5a9 100644 --- a/libavformat/aiff.c +++ b/libavformat/aiff.c @@ -170,7 +170,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, return num_frames; } -#ifdef CONFIG_AIFF_MUXER +#if CONFIG_AIFF_MUXER typedef struct { int64_t form; int64_t frames; @@ -439,7 +439,7 @@ static int aiff_read_packet(AVFormatContext *s, return 0; } -#ifdef CONFIG_AIFF_DEMUXER +#if CONFIG_AIFF_DEMUXER AVInputFormat aiff_demuxer = { "aiff", NULL_IF_CONFIG_SMALL("Audio IFF"), @@ -453,7 +453,7 @@ AVInputFormat aiff_demuxer = { }; #endif -#ifdef CONFIG_AIFF_MUXER +#if CONFIG_AIFF_MUXER AVOutputFormat aiff_muxer = { "aiff", NULL_IF_CONFIG_SMALL("Audio IFF"), diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 43243f8062..387189a178 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -168,7 +168,7 @@ void av_register_all(void) REGISTER_MUXER (RTP, rtp); REGISTER_DEMUXER (RTSP, rtsp); REGISTER_DEMUXER (SDP, sdp); -#ifdef CONFIG_SDP_DEMUXER +#if CONFIG_SDP_DEMUXER av_register_rtp_dynamic_payload_handlers(); av_register_rdt_dynamic_payload_handlers(); #endif diff --git a/libavformat/amr.c b/libavformat/amr.c index 1f623512dc..cbc4ec50d4 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -30,7 +30,7 @@ Only mono files are supported. static const char AMR_header [] = "#!AMR\n"; static const char AMRWB_header [] = "#!AMR-WB\n"; -#ifdef CONFIG_AMR_MUXER +#if CONFIG_AMR_MUXER static int amr_write_header(AVFormatContext *s) { ByteIOContext *pb = s->pb; @@ -166,7 +166,7 @@ static int amr_read_packet(AVFormatContext *s, return 0; } -#ifdef CONFIG_AMR_DEMUXER +#if CONFIG_AMR_DEMUXER AVInputFormat amr_demuxer = { "amr", NULL_IF_CONFIG_SMALL("3GPP AMR file format"), @@ -178,7 +178,7 @@ AVInputFormat amr_demuxer = { }; #endif -#ifdef CONFIG_AMR_MUXER +#if CONFIG_AMR_MUXER AVOutputFormat amr_muxer = { "amr", NULL_IF_CONFIG_SMALL("3GPP AMR file format"), diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c index e1f3c1b6d9..94d208ffa6 100644 --- a/libavformat/asf-enc.c +++ b/libavformat/asf-enc.c @@ -812,14 +812,14 @@ static int asf_write_trailer(AVFormatContext *s) return 0; } -#ifdef CONFIG_ASF_MUXER +#if CONFIG_ASF_MUXER AVOutputFormat asf_muxer = { "asf", NULL_IF_CONFIG_SMALL("ASF format"), "video/x-ms-asf", "asf,wmv,wma", sizeof(ASFContext), -#ifdef CONFIG_LIBMP3LAME +#if CONFIG_LIBMP3LAME CODEC_ID_MP3, #else CODEC_ID_MP2, @@ -833,14 +833,14 @@ AVOutputFormat asf_muxer = { }; #endif -#ifdef CONFIG_ASF_STREAM_MUXER +#if CONFIG_ASF_STREAM_MUXER AVOutputFormat asf_stream_muxer = { "asf_stream", NULL_IF_CONFIG_SMALL("ASF format"), "video/x-ms-asf", "asf,wmv,wma", sizeof(ASFContext), -#ifdef CONFIG_LIBMP3LAME +#if CONFIG_LIBMP3LAME CODEC_ID_MP3, #else CODEC_ID_MP2, diff --git a/libavformat/au.c b/libavformat/au.c index 7d151cf1d6..caa7f4dff3 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -47,7 +47,7 @@ static const AVCodecTag codec_au_tags[] = { { 0, 0 }, }; -#ifdef CONFIG_AU_MUXER +#if CONFIG_AU_MUXER /* AUDIO_FILE header */ static int put_au_header(ByteIOContext *pb, AVCodecContext *enc) { @@ -177,7 +177,7 @@ static int au_read_packet(AVFormatContext *s, return 0; } -#ifdef CONFIG_AU_DEMUXER +#if CONFIG_AU_DEMUXER AVInputFormat au_demuxer = { "au", NULL_IF_CONFIG_SMALL("SUN AU format"), @@ -191,7 +191,7 @@ AVInputFormat au_demuxer = { }; #endif -#ifdef CONFIG_AU_MUXER +#if CONFIG_AU_MUXER AVOutputFormat au_muxer = { "au", NULL_IF_CONFIG_SMALL("SUN AU format"), diff --git a/libavformat/avienc.c b/libavformat/avienc.c index cea513f9c8..6267c77b20 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -27,7 +27,7 @@ * - fill all fields if non streamed (nb_frames for example) */ -#ifdef CONFIG_AVI_MUXER +#if CONFIG_AVI_MUXER typedef struct AVIIentry { unsigned int flags, pos, len; } AVIIentry; diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index d1dc09ba0f..aa6ad87dec 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -160,12 +160,12 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence) } else { int64_t res = AVERROR(EPIPE); -#if defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK) +#if CONFIG_MUXERS || CONFIG_NETWORK if (s->write_flag) { flush_buffer(s); s->must_flush = 1; } -#endif /* defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK) */ +#endif /* CONFIG_MUXERS || CONFIG_NETWORK */ if (!s->seek || (res = s->seek(s->opaque, offset, SEEK_SET)) < 0) return res; if (!s->write_flag) @@ -624,7 +624,7 @@ URLContext *url_fileno(ByteIOContext *s) return s->opaque; } -#ifdef CONFIG_MUXERS +#if CONFIG_MUXERS int url_fprintf(ByteIOContext *s, const char *fmt, ...) { va_list ap; @@ -688,8 +688,8 @@ int64_t av_url_read_fseek(ByteIOContext *s, int stream_index, } /* url_open_dyn_buf and url_close_dyn_buf are used in rtp.c to send a response - * back to the server even if CONFIG_MUXERS is not set. */ -#if defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK) + * back to the server even if CONFIG_MUXERS is false. */ +#if CONFIG_MUXERS || CONFIG_NETWORK /* buffer handling */ int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags) { diff --git a/libavformat/daud.c b/libavformat/daud.c index 2bca9478ea..cdd831ba4b 100644 --- a/libavformat/daud.c +++ b/libavformat/daud.c @@ -78,7 +78,7 @@ AVInputFormat daud_demuxer = { }; #endif -#ifdef CONFIG_DAUD_MUXER +#if CONFIG_DAUD_MUXER AVOutputFormat daud_muxer = { "daud", diff --git a/libavformat/dv.c b/libavformat/dv.c index a0e07e91ca..eb02e3bc4b 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -462,7 +462,7 @@ static int dv_read_close(AVFormatContext *s) return 0; } -#ifdef CONFIG_DV_DEMUXER +#if CONFIG_DV_DEMUXER AVInputFormat dv_demuxer = { "dv", NULL_IF_CONFIG_SMALL("DV video format"), diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index c8dc5a8301..428d4a0656 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -359,7 +359,7 @@ void dv_delete_mux(DVMuxContext *c) av_fifo_free(&c->audio_data[i]); } -#ifdef CONFIG_DV_MUXER +#if CONFIG_DV_MUXER static int dv_write_header(AVFormatContext *s) { if (!dv_init_mux(s)) { diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index fd859552d3..e5d98f11f8 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -22,7 +22,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "ffm.h" -#ifdef CONFIG_FFSERVER +#if CONFIG_FFSERVER #include <unistd.h> int64_t ffm_read_write_index(int fd) diff --git a/libavformat/file.c b/libavformat/file.c index 827541d1ae..88ac4db8d4 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -22,7 +22,7 @@ #include "libavutil/avstring.h" #include "avformat.h" #include <fcntl.h> -#ifdef HAVE_SETMODE +#if HAVE_SETMODE #include <io.h> #endif #include <unistd.h> @@ -107,7 +107,7 @@ static int pipe_open(URLContext *h, const char *filename, int flags) fd = 0; } } -#ifdef HAVE_SETMODE +#if HAVE_SETMODE setmode(fd, O_BINARY); #endif h->priv_data = (void *)(size_t)fd; diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 6e3a3e4f82..27f96217c4 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -382,7 +382,7 @@ AVOutputFormat flv_muxer = { "video/x-flv", "flv", sizeof(FLVContext), -#ifdef CONFIG_LIBMP3LAME +#if CONFIG_LIBMP3LAME CODEC_ID_MP3, #else // CONFIG_LIBMP3LAME CODEC_ID_ADPCM_SWF, diff --git a/libavformat/framehook.c b/libavformat/framehook.c index 90815fb1d6..8dba5bc85c 100644 --- a/libavformat/framehook.c +++ b/libavformat/framehook.c @@ -23,7 +23,7 @@ #include "avformat.h" #include "framehook.h" -#ifdef HAVE_DLFCN_H +#if HAVE_DLFCN_H #include <dlfcn.h> #endif diff --git a/libavformat/img2.c b/libavformat/img2.c index c0b5de2144..244b050802 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -305,7 +305,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) } } -#if defined(CONFIG_IMAGE2_MUXER) || defined(CONFIG_IMAGE2PIPE_MUXER) +#if CONFIG_IMAGE2_MUXER || CONFIG_IMAGE2PIPE_MUXER /******************************************************/ /* image output */ @@ -370,10 +370,10 @@ static int img_write_packet(AVFormatContext *s, AVPacket *pkt) return 0; } -#endif /* defined(CONFIG_IMAGE2_MUXER) || defined(CONFIG_IMAGE2PIPE_MUXER) */ +#endif /* CONFIG_IMAGE2_MUXER || CONFIG_IMAGE2PIPE_MUXER */ /* input */ -#ifdef CONFIG_IMAGE2_DEMUXER +#if CONFIG_IMAGE2_DEMUXER AVInputFormat image2_demuxer = { "image2", NULL_IF_CONFIG_SMALL("image2 sequence"), @@ -387,7 +387,7 @@ AVInputFormat image2_demuxer = { AVFMT_NOFILE, }; #endif -#ifdef CONFIG_IMAGE2PIPE_DEMUXER +#if CONFIG_IMAGE2PIPE_DEMUXER AVInputFormat image2pipe_demuxer = { "image2pipe", NULL_IF_CONFIG_SMALL("piped image2 sequence"), @@ -399,7 +399,7 @@ AVInputFormat image2pipe_demuxer = { #endif /* output */ -#ifdef CONFIG_IMAGE2_MUXER +#if CONFIG_IMAGE2_MUXER AVOutputFormat image2_muxer = { "image2", NULL_IF_CONFIG_SMALL("image2 sequence"), @@ -414,7 +414,7 @@ AVOutputFormat image2_muxer = { .flags= AVFMT_NOTIMESTAMPS | AVFMT_NOFILE }; #endif -#ifdef CONFIG_IMAGE2PIPE_MUXER +#if CONFIG_IMAGE2PIPE_MUXER AVOutputFormat image2pipe_muxer = { "image2pipe", NULL_IF_CONFIG_SMALL("piped image2 sequence"), diff --git a/libavformat/libnut.c b/libavformat/libnut.c index 3f4a69b2fb..a088551816 100644 --- a/libavformat/libnut.c +++ b/libavformat/libnut.c @@ -44,7 +44,7 @@ static const AVCodecTag nut_tags[] = { { 0, 0 }, }; -#ifdef CONFIG_LIBNUT_MUXER +#if CONFIG_LIBNUT_MUXER static int av_write(void * h, size_t len, const uint8_t * buf) { ByteIOContext * bc = h; put_buffer(bc, buf, len); diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 710214284b..e23d03b897 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -39,10 +39,10 @@ #include "libavutil/intreadwrite.h" #include "libavutil/avstring.h" #include "libavutil/lzo.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif -#ifdef CONFIG_BZLIB +#if CONFIG_BZLIB #include <bzlib.h> #endif @@ -879,7 +879,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size, goto failed; pkt_size -= olen; break; -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB case MATROSKA_TRACK_ENCODING_COMP_ZLIB: { z_stream zstream = {0}; if (inflateInit(&zstream) != Z_OK) @@ -900,7 +900,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size, break; } #endif -#ifdef CONFIG_BZLIB +#if CONFIG_BZLIB case MATROSKA_TRACK_ENCODING_COMP_BZLIB: { bz_stream bzstream = {0}; if (BZ2_bzDecompressInit(&bzstream, 0, 0) != BZ_OK) @@ -1147,10 +1147,10 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) } else if (encodings_list->nb_elem == 1) { if (encodings[0].type || (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP && -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_ZLIB && #endif -#ifdef CONFIG_BZLIB +#if CONFIG_BZLIB encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_BZLIB && #endif encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_LZO)) { diff --git a/libavformat/mmf.c b/libavformat/mmf.c index 5e6d4ebccb..7c2f4bf223 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -36,7 +36,7 @@ static int mmf_rate(int code) return mmf_rates[code]; } -#ifdef CONFIG_MMF_MUXER +#if CONFIG_MMF_MUXER static int mmf_rate_code(int rate) { int i; @@ -290,7 +290,7 @@ static int mmf_read_packet(AVFormatContext *s, return ret; } -#ifdef CONFIG_MMF_DEMUXER +#if CONFIG_MMF_DEMUXER AVInputFormat mmf_demuxer = { "mmf", NULL_IF_CONFIG_SMALL("mmf format"), @@ -302,7 +302,7 @@ AVInputFormat mmf_demuxer = { pcm_read_seek, }; #endif -#ifdef CONFIG_MMF_MUXER +#if CONFIG_MMF_MUXER AVOutputFormat mmf_muxer = { "mmf", NULL_IF_CONFIG_SMALL("mmf format"), diff --git a/libavformat/mov.c b/libavformat/mov.c index c842057b66..5638d34f80 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -31,7 +31,7 @@ #include "libavcodec/mpeg4audio.h" #include "libavcodec/mpegaudiodata.h" -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB #include <zlib.h> #endif @@ -1005,7 +1005,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) /* special codec parameters handling */ switch (st->codec->codec_id) { -#ifdef CONFIG_DV_DEMUXER +#if CONFIG_DV_DEMUXER case CODEC_ID_DVAUDIO: c->dv_fctx = av_alloc_format_context(); c->dv_demux = dv_init_demux(c->dv_fctx); @@ -1380,13 +1380,13 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) sc->pb = c->fc->pb; switch (st->codec->codec_id) { -#ifdef CONFIG_H261_DECODER +#if CONFIG_H261_DECODER case CODEC_ID_H261: #endif -#ifdef CONFIG_H263_DECODER +#if CONFIG_H263_DECODER case CODEC_ID_H263: #endif -#ifdef CONFIG_MPEG4_DECODER +#if CONFIG_MPEG4_DECODER case CODEC_ID_MPEG4: #endif st->codec->width= 0; /* let decoder init width/height */ @@ -1691,7 +1691,7 @@ static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOVAtom atom) static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { -#ifdef CONFIG_ZLIB +#if CONFIG_ZLIB ByteIOContext ctx; uint8_t *cmov_data; uint8_t *moov_data; /* uncompressed data */ @@ -1939,7 +1939,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) return -1; } av_get_packet(sc->pb, pkt, sample->size); -#ifdef CONFIG_DV_DEMUXER +#if CONFIG_DV_DEMUXER if (mov->dv_demux && sc->dv_audio_container) { dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size); av_free(pkt->data); diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 16e8fce1ae..7127cc4401 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1819,7 +1819,7 @@ static int mov_write_trailer(AVFormatContext *s) return res; } -#ifdef CONFIG_MOV_MUXER +#if CONFIG_MOV_MUXER AVOutputFormat mov_muxer = { "mov", NULL_IF_CONFIG_SMALL("MOV format"), @@ -1835,7 +1835,7 @@ AVOutputFormat mov_muxer = { .codec_tag = (const AVCodecTag* const []){codec_movvideo_tags, codec_movaudio_tags, 0}, }; #endif -#ifdef CONFIG_TGP_MUXER +#if CONFIG_TGP_MUXER AVOutputFormat tgp_muxer = { "3gp", NULL_IF_CONFIG_SMALL("3GP format"), @@ -1851,7 +1851,7 @@ AVOutputFormat tgp_muxer = { .codec_tag = (const AVCodecTag* const []){codec_3gp_tags, 0}, }; #endif -#ifdef CONFIG_MP4_MUXER +#if CONFIG_MP4_MUXER AVOutputFormat mp4_muxer = { "mp4", NULL_IF_CONFIG_SMALL("MP4 format"), @@ -1867,7 +1867,7 @@ AVOutputFormat mp4_muxer = { .codec_tag = (const AVCodecTag* const []){ff_mp4_obj_type, 0}, }; #endif -#ifdef CONFIG_PSP_MUXER +#if CONFIG_PSP_MUXER AVOutputFormat psp_muxer = { "psp", NULL_IF_CONFIG_SMALL("PSP MP4 format"), @@ -1883,7 +1883,7 @@ AVOutputFormat psp_muxer = { .codec_tag = (const AVCodecTag* const []){ff_mp4_obj_type, 0}, }; #endif -#ifdef CONFIG_TG2_MUXER +#if CONFIG_TG2_MUXER AVOutputFormat tg2_muxer = { "3g2", NULL_IF_CONFIG_SMALL("3GP2 format"), @@ -1899,7 +1899,7 @@ AVOutputFormat tg2_muxer = { .codec_tag = (const AVCodecTag* const []){codec_3gp_tags, 0}, }; #endif -#ifdef CONFIG_IPOD_MUXER +#if CONFIG_IPOD_MUXER AVOutputFormat ipod_muxer = { "ipod", NULL_IF_CONFIG_SMALL("iPod H.264 MP4 format"), diff --git a/libavformat/mp3.c b/libavformat/mp3.c index a4eb49c5e7..0b1a167002 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -527,7 +527,7 @@ static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt) return ret; } -#if defined(CONFIG_MP2_MUXER) || defined(CONFIG_MP3_MUXER) +#if CONFIG_MP2_MUXER || CONFIG_MP3_MUXER static void id3v1_create_tag(AVFormatContext *s, uint8_t *buf) { int v, i; @@ -645,9 +645,9 @@ static int mp3_write_trailer(struct AVFormatContext *s) } return 0; } -#endif /* defined(CONFIG_MP2_MUXER) || defined(CONFIG_MP3_MUXER) */ +#endif /* CONFIG_MP2_MUXER || CONFIG_MP3_MUXER */ -#ifdef CONFIG_MP3_DEMUXER +#if CONFIG_MP3_DEMUXER AVInputFormat mp3_demuxer = { "mp3", NULL_IF_CONFIG_SMALL("MPEG audio"), @@ -659,12 +659,12 @@ AVInputFormat mp3_demuxer = { .extensions = "mp2,mp3,m2a", /* XXX: use probe */ }; #endif -#ifdef CONFIG_MP2_MUXER +#if CONFIG_MP2_MUXER AVOutputFormat mp2_muxer = { "mp2", NULL_IF_CONFIG_SMALL("MPEG audio layer 2"), "audio/x-mpeg", -#ifdef CONFIG_LIBMP3LAME +#if CONFIG_LIBMP3LAME "mp2,m2a", #else "mp2,mp3,m2a", @@ -677,7 +677,7 @@ AVOutputFormat mp2_muxer = { mp3_write_trailer, }; #endif -#ifdef CONFIG_MP3_MUXER +#if CONFIG_MP3_MUXER AVOutputFormat mp3_muxer = { "mp3", NULL_IF_CONFIG_SMALL("MPEG audio layer 3"), diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 4b86f20dff..e4fe6ca940 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -1219,7 +1219,7 @@ static int mpeg_mux_end(AVFormatContext *ctx) return 0; } -#ifdef CONFIG_MPEG1SYSTEM_MUXER +#if CONFIG_MPEG1SYSTEM_MUXER AVOutputFormat mpeg1system_muxer = { "mpeg", NULL_IF_CONFIG_SMALL("MPEG-1 System format"), @@ -1233,7 +1233,7 @@ AVOutputFormat mpeg1system_muxer = { mpeg_mux_end, }; #endif -#ifdef CONFIG_MPEG1VCD_MUXER +#if CONFIG_MPEG1VCD_MUXER AVOutputFormat mpeg1vcd_muxer = { "vcd", NULL_IF_CONFIG_SMALL("MPEG-1 System format (VCD)"), @@ -1247,7 +1247,7 @@ AVOutputFormat mpeg1vcd_muxer = { mpeg_mux_end, }; #endif -#ifdef CONFIG_MPEG2VOB_MUXER +#if CONFIG_MPEG2VOB_MUXER AVOutputFormat mpeg2vob_muxer = { "vob", NULL_IF_CONFIG_SMALL("MPEG-2 PS format (VOB)"), @@ -1263,7 +1263,7 @@ AVOutputFormat mpeg2vob_muxer = { #endif /* Same as mpeg2vob_mux except that the pack size is 2324 */ -#ifdef CONFIG_MPEG2SVCD_MUXER +#if CONFIG_MPEG2SVCD_MUXER AVOutputFormat mpeg2svcd_muxer = { "svcd", NULL_IF_CONFIG_SMALL("MPEG-2 PS format (VOB)"), @@ -1279,7 +1279,7 @@ AVOutputFormat mpeg2svcd_muxer = { #endif /* Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */ -#ifdef CONFIG_MPEG2DVD_MUXER +#if CONFIG_MPEG2DVD_MUXER AVOutputFormat mpeg2dvd_muxer = { "dvd", NULL_IF_CONFIG_SMALL("MPEG-2 PS format (DVD VOB)"), diff --git a/libavformat/network.h b/libavformat/network.h index a5904d93af..ef08b557e9 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -21,7 +21,7 @@ #ifndef AVFORMAT_NETWORK_H #define AVFORMAT_NETWORK_H -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include <winsock2.h> #include <ws2tcpip.h> @@ -38,7 +38,7 @@ #define FF_NETERROR(err) err #endif -#ifdef HAVE_ARPA_INET_H +#if HAVE_ARPA_INET_H #include <arpa/inet.h> #endif @@ -46,7 +46,7 @@ int ff_socket_nonblock(int socket, int enable); static inline int ff_network_init(void) { -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H WSADATA wsaData; if (WSAStartup(MAKEWORD(1,1), &wsaData)) return 0; @@ -56,12 +56,12 @@ static inline int ff_network_init(void) static inline void ff_network_close(void) { -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H WSACleanup(); #endif } -#if !defined(HAVE_INET_ATON) +#if !HAVE_INET_ATON /* in os_support.c */ int inet_aton (const char * str, struct in_addr * add); #endif diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 5bcc44df2c..4d838a5e95 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -906,7 +906,7 @@ static int nut_read_close(AVFormatContext *s) return 0; } -#ifdef CONFIG_NUT_DEMUXER +#if CONFIG_NUT_DEMUXER AVInputFormat nut_demuxer = { "nut", NULL_IF_CONFIG_SMALL("NUT format"), diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index edcb2c7219..1e5f733194 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -809,9 +809,9 @@ AVOutputFormat nut_muxer = { "video/x-nut", "nut", sizeof(NUTContext), -#ifdef CONFIG_LIBVORBIS +#if CONFIG_LIBVORBIS CODEC_ID_VORBIS, -#elif defined(CONFIG_LIBMP3LAME) +#elif CONFIG_LIBMP3LAME CODEC_ID_MP3, #else CODEC_ID_MP2, diff --git a/libavformat/os_support.c b/libavformat/os_support.c index e6dbc307dd..6763e39cf9 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -30,18 +30,18 @@ #include <sys/time.h> #include "os_support.h" -#ifdef CONFIG_NETWORK -#ifndef HAVE_POLL_H -#ifdef HAVE_WINSOCK2_H +#if CONFIG_NETWORK +#if !HAVE_POLL_H +#if HAVE_WINSOCK2_H #include <winsock2.h> -#elif defined (HAVE_SYS_SELECT_H) +#elif HAVE_SYS_SELECT_H #include <sys/select.h> #endif #endif #include "network.h" -#if !defined(HAVE_INET_ATON) +#if !HAVE_INET_ATON #include <stdlib.h> #include <strings.h> @@ -58,7 +58,7 @@ int inet_aton (const char * str, struct in_addr * add) return 1; } -#endif /* !defined(HAVE_INET_ATON) */ +#endif /* !HAVE_INET_ATON */ /* resolve host with also IP address parsing */ int resolve_host(struct in_addr *sin_addr, const char *hostname) @@ -76,7 +76,7 @@ int resolve_host(struct in_addr *sin_addr, const char *hostname) int ff_socket_nonblock(int socket, int enable) { -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H return ioctlsocket(socket, FIONBIO, &enable); #else if (enable) @@ -87,8 +87,8 @@ int ff_socket_nonblock(int socket, int enable) } #endif /* CONFIG_NETWORK */ -#ifdef CONFIG_FFSERVER -#ifndef HAVE_POLL_H +#if CONFIG_FFSERVER +#if !HAVE_POLL_H int poll(struct pollfd *fds, nfds_t numfds, int timeout) { fd_set read_set; @@ -98,7 +98,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) int n; int rc; -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H if (numfds >= FD_SETSIZE) { errno = EINVAL; return -1; @@ -113,7 +113,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) for(i = 0; i < numfds; i++) { if (fds[i].fd < 0) continue; -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (fds[i].fd >= FD_SETSIZE) { errno = EINVAL; return -1; diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 0b6a292d6d..165dc23a06 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -34,7 +34,7 @@ static inline int is_dos_path(const char *path) { -#ifdef HAVE_DOS_PATHS +#if HAVE_DOS_PATHS if (path[0] && path[1] == ':') return 1; #endif @@ -58,18 +58,18 @@ static inline int is_dos_path(const char *path) # endif #endif -#ifdef CONFIG_NETWORK -#ifndef HAVE_SOCKLEN_T +#if CONFIG_NETWORK +#if !HAVE_SOCKLEN_T typedef int socklen_t; #endif /* most of the time closing a socket is just closing an fd */ -#ifndef HAVE_CLOSESOCKET +#if !HAVE_CLOSESOCKET #define closesocket close #endif -#ifdef CONFIG_FFSERVER -#ifndef HAVE_POLL_H +#if CONFIG_FFSERVER +#if !HAVE_POLL_H typedef unsigned long nfds_t; struct pollfd { diff --git a/libavformat/raw.c b/libavformat/raw.c index b93cdccd1c..f3214ac01c 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -28,7 +28,7 @@ #include "raw.h" /* simple formats */ -#ifdef CONFIG_FLAC_MUXER +#if CONFIG_FLAC_MUXER static int flac_write_header(struct AVFormatContext *s) { static const uint8_t header[8] = { @@ -61,7 +61,7 @@ static int flac_write_trailer(struct AVFormatContext *s) } #endif -#ifdef CONFIG_ROQ_MUXER +#if CONFIG_ROQ_MUXER static int roq_write_header(struct AVFormatContext *s) { static const uint8_t header[] = { @@ -75,14 +75,14 @@ static int roq_write_header(struct AVFormatContext *s) } #endif -#ifdef CONFIG_NULL_MUXER +#if CONFIG_NULL_MUXER static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt) { return 0; } #endif -#ifdef CONFIG_MUXERS +#if CONFIG_MUXERS static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt) { put_buffer(s->pb, pkt->data, pkt->size); @@ -91,7 +91,7 @@ static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt) } #endif -#ifdef CONFIG_DEMUXERS +#if CONFIG_DEMUXERS /* raw input */ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) { @@ -182,7 +182,7 @@ static int raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) } #endif -#ifdef CONFIG_RAWVIDEO_DEMUXER +#if CONFIG_RAWVIDEO_DEMUXER static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) { int packet_size, ret, width, height; @@ -208,7 +208,7 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) } #endif -#ifdef CONFIG_INGENIENT_DEMUXER +#if CONFIG_INGENIENT_DEMUXER // http://www.artificis.hu/files/texts/ingenient.txt static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt) { @@ -246,7 +246,7 @@ static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt) } #endif -#ifdef CONFIG_DEMUXERS +#if CONFIG_DEMUXERS int pcm_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { @@ -320,7 +320,7 @@ static int video_read_header(AVFormatContext *s, } #endif -#ifdef CONFIG_MPEGVIDEO_DEMUXER +#if CONFIG_MPEGVIDEO_DEMUXER #define SEQ_START_CODE 0x000001b3 #define GOP_START_CODE 0x000001b8 #define PICTURE_START_CODE 0x00000100 @@ -354,7 +354,7 @@ static int mpegvideo_probe(AVProbeData *p) } #endif -#ifdef CONFIG_M4V_DEMUXER +#if CONFIG_M4V_DEMUXER #define VISUAL_OBJECT_START_CODE 0x000001b5 #define VOP_START_CODE 0x000001b6 @@ -383,7 +383,7 @@ static int mpeg4video_probe(AVProbeData *probe_packet) } #endif -#ifdef CONFIG_H264_DEMUXER +#if CONFIG_H264_DEMUXER static int h264_probe(AVProbeData *p) { uint32_t code= -1; @@ -430,7 +430,7 @@ static int h264_probe(AVProbeData *p) } #endif -#ifdef CONFIG_H263_DEMUXER +#if CONFIG_H263_DEMUXER static int h263_probe(AVProbeData *p) { int code; @@ -445,7 +445,7 @@ static int h263_probe(AVProbeData *p) } #endif -#ifdef CONFIG_H261_DEMUXER +#if CONFIG_H261_DEMUXER static int h261_probe(AVProbeData *p) { int code; @@ -460,7 +460,7 @@ static int h261_probe(AVProbeData *p) } #endif -#ifdef CONFIG_DTS_DEMUXER +#if CONFIG_DTS_DEMUXER #define DCA_MARKER_14B_BE 0x1FFFE800 #define DCA_MARKER_14B_LE 0xFF1F00E8 #define DCA_MARKER_RAW_BE 0x7FFE8001 @@ -495,7 +495,7 @@ static int dts_probe(AVProbeData *p) } #endif -#ifdef CONFIG_DIRAC_DEMUXER +#if CONFIG_DIRAC_DEMUXER static int dirac_probe(AVProbeData *p) { if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D')) @@ -505,7 +505,7 @@ static int dirac_probe(AVProbeData *p) } #endif -#ifdef CONFIG_DNXHD_DEMUXER +#if CONFIG_DNXHD_DEMUXER static int dnxhd_probe(AVProbeData *p) { static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01}; @@ -516,7 +516,7 @@ static int dnxhd_probe(AVProbeData *p) } #endif -#if defined(CONFIG_AC3_DEMUXER) || defined(CONFIG_EAC3_DEMUXER) +#if CONFIG_AC3_DEMUXER || CONFIG_EAC3_DEMUXER static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id) { int max_frames, first_frames = 0, frames; @@ -555,21 +555,21 @@ static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id) } #endif -#ifdef CONFIG_AC3_DEMUXER +#if CONFIG_AC3_DEMUXER static int ac3_probe(AVProbeData *p) { return ac3_eac3_probe(p, CODEC_ID_AC3); } #endif -#ifdef CONFIG_EAC3_DEMUXER +#if CONFIG_EAC3_DEMUXER static int eac3_probe(AVProbeData *p) { return ac3_eac3_probe(p, CODEC_ID_EAC3); } #endif -#ifdef CONFIG_FLAC_DEMUXER +#if CONFIG_FLAC_DEMUXER static int flac_probe(AVProbeData *p) { if(memcmp(p->buf, "fLaC", 4)) return 0; @@ -577,7 +577,7 @@ static int flac_probe(AVProbeData *p) } #endif -#ifdef CONFIG_AAC_DEMUXER +#if CONFIG_AAC_DEMUXER static int adts_aac_probe(AVProbeData *p) { int max_frames = 0, first_frames = 0; @@ -612,7 +612,7 @@ static int adts_aac_probe(AVProbeData *p) /* Note: Do not forget to add new entries to the Makefile as well. */ -#ifdef CONFIG_AAC_DEMUXER +#if CONFIG_AAC_DEMUXER AVInputFormat aac_demuxer = { "aac", NULL_IF_CONFIG_SMALL("ADTS AAC"), @@ -626,7 +626,7 @@ AVInputFormat aac_demuxer = { }; #endif -#ifdef CONFIG_AC3_DEMUXER +#if CONFIG_AC3_DEMUXER AVInputFormat ac3_demuxer = { "ac3", NULL_IF_CONFIG_SMALL("raw AC-3"), @@ -640,7 +640,7 @@ AVInputFormat ac3_demuxer = { }; #endif -#ifdef CONFIG_AC3_MUXER +#if CONFIG_AC3_MUXER AVOutputFormat ac3_muxer = { "ac3", NULL_IF_CONFIG_SMALL("raw AC-3"), @@ -655,7 +655,7 @@ AVOutputFormat ac3_muxer = { }; #endif -#ifdef CONFIG_DIRAC_DEMUXER +#if CONFIG_DIRAC_DEMUXER AVInputFormat dirac_demuxer = { "dirac", NULL_IF_CONFIG_SMALL("raw Dirac"), @@ -668,7 +668,7 @@ AVInputFormat dirac_demuxer = { }; #endif -#ifdef CONFIG_DIRAC_MUXER +#if CONFIG_DIRAC_MUXER AVOutputFormat dirac_muxer = { "dirac", NULL_IF_CONFIG_SMALL("raw Dirac"), @@ -683,7 +683,7 @@ AVOutputFormat dirac_muxer = { }; #endif -#ifdef CONFIG_DNXHD_DEMUXER +#if CONFIG_DNXHD_DEMUXER AVInputFormat dnxhd_demuxer = { "dnxhd", NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"), @@ -696,7 +696,7 @@ AVInputFormat dnxhd_demuxer = { }; #endif -#ifdef CONFIG_DNXHD_MUXER +#if CONFIG_DNXHD_MUXER AVOutputFormat dnxhd_muxer = { "dnxhd", NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"), @@ -711,7 +711,7 @@ AVOutputFormat dnxhd_muxer = { }; #endif -#ifdef CONFIG_DTS_DEMUXER +#if CONFIG_DTS_DEMUXER AVInputFormat dts_demuxer = { "dts", NULL_IF_CONFIG_SMALL("raw DTS"), @@ -725,7 +725,7 @@ AVInputFormat dts_demuxer = { }; #endif -#ifdef CONFIG_DTS_MUXER +#if CONFIG_DTS_MUXER AVOutputFormat dts_muxer = { "dts", NULL_IF_CONFIG_SMALL("raw DTS"), @@ -740,7 +740,7 @@ AVOutputFormat dts_muxer = { }; #endif -#ifdef CONFIG_EAC3_DEMUXER +#if CONFIG_EAC3_DEMUXER AVInputFormat eac3_demuxer = { "eac3", NULL_IF_CONFIG_SMALL("raw E-AC-3"), @@ -754,7 +754,7 @@ AVInputFormat eac3_demuxer = { }; #endif -#ifdef CONFIG_EAC3_MUXER +#if CONFIG_EAC3_MUXER AVOutputFormat eac3_muxer = { "eac3", NULL_IF_CONFIG_SMALL("raw E-AC-3"), @@ -769,7 +769,7 @@ AVOutputFormat eac3_muxer = { }; #endif -#ifdef CONFIG_FLAC_DEMUXER +#if CONFIG_FLAC_DEMUXER AVInputFormat flac_demuxer = { "flac", NULL_IF_CONFIG_SMALL("raw FLAC"), @@ -783,7 +783,7 @@ AVInputFormat flac_demuxer = { }; #endif -#ifdef CONFIG_FLAC_MUXER +#if CONFIG_FLAC_MUXER AVOutputFormat flac_muxer = { "flac", NULL_IF_CONFIG_SMALL("raw FLAC"), @@ -799,7 +799,7 @@ AVOutputFormat flac_muxer = { }; #endif -#ifdef CONFIG_GSM_DEMUXER +#if CONFIG_GSM_DEMUXER AVInputFormat gsm_demuxer = { "gsm", NULL_IF_CONFIG_SMALL("GSM"), @@ -813,7 +813,7 @@ AVInputFormat gsm_demuxer = { }; #endif -#ifdef CONFIG_H261_DEMUXER +#if CONFIG_H261_DEMUXER AVInputFormat h261_demuxer = { "h261", NULL_IF_CONFIG_SMALL("raw H.261"), @@ -827,7 +827,7 @@ AVInputFormat h261_demuxer = { }; #endif -#ifdef CONFIG_H261_MUXER +#if CONFIG_H261_MUXER AVOutputFormat h261_muxer = { "h261", NULL_IF_CONFIG_SMALL("raw H.261"), @@ -842,7 +842,7 @@ AVOutputFormat h261_muxer = { }; #endif -#ifdef CONFIG_H263_DEMUXER +#if CONFIG_H263_DEMUXER AVInputFormat h263_demuxer = { "h263", NULL_IF_CONFIG_SMALL("raw H.263"), @@ -856,7 +856,7 @@ AVInputFormat h263_demuxer = { }; #endif -#ifdef CONFIG_H263_MUXER +#if CONFIG_H263_MUXER AVOutputFormat h263_muxer = { "h263", NULL_IF_CONFIG_SMALL("raw H.263"), @@ -871,7 +871,7 @@ AVOutputFormat h263_muxer = { }; #endif -#ifdef CONFIG_H264_DEMUXER +#if CONFIG_H264_DEMUXER AVInputFormat h264_demuxer = { "h264", NULL_IF_CONFIG_SMALL("raw H.264 video format"), @@ -885,7 +885,7 @@ AVInputFormat h264_demuxer = { }; #endif -#ifdef CONFIG_H264_MUXER +#if CONFIG_H264_MUXER AVOutputFormat h264_muxer = { "h264", NULL_IF_CONFIG_SMALL("raw H.264 video format"), @@ -900,7 +900,7 @@ AVOutputFormat h264_muxer = { }; #endif -#ifdef CONFIG_INGENIENT_DEMUXER +#if CONFIG_INGENIENT_DEMUXER AVInputFormat ingenient_demuxer = { "ingenient", NULL_IF_CONFIG_SMALL("Ingenient MJPEG"), @@ -914,7 +914,7 @@ AVInputFormat ingenient_demuxer = { }; #endif -#ifdef CONFIG_M4V_DEMUXER +#if CONFIG_M4V_DEMUXER AVInputFormat m4v_demuxer = { "m4v", NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"), @@ -928,7 +928,7 @@ AVInputFormat m4v_demuxer = { }; #endif -#ifdef CONFIG_M4V_MUXER +#if CONFIG_M4V_MUXER AVOutputFormat m4v_muxer = { "m4v", NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"), @@ -943,7 +943,7 @@ AVOutputFormat m4v_muxer = { }; #endif -#ifdef CONFIG_MJPEG_DEMUXER +#if CONFIG_MJPEG_DEMUXER AVInputFormat mjpeg_demuxer = { "mjpeg", NULL_IF_CONFIG_SMALL("MJPEG video"), @@ -957,7 +957,7 @@ AVInputFormat mjpeg_demuxer = { }; #endif -#ifdef CONFIG_MJPEG_MUXER +#if CONFIG_MJPEG_MUXER AVOutputFormat mjpeg_muxer = { "mjpeg", NULL_IF_CONFIG_SMALL("MJPEG video"), @@ -972,7 +972,7 @@ AVOutputFormat mjpeg_muxer = { }; #endif -#ifdef CONFIG_MLP_DEMUXER +#if CONFIG_MLP_DEMUXER AVInputFormat mlp_demuxer = { "mlp", NULL_IF_CONFIG_SMALL("raw MLP"), @@ -986,7 +986,7 @@ AVInputFormat mlp_demuxer = { }; #endif -#ifdef CONFIG_MPEG1VIDEO_MUXER +#if CONFIG_MPEG1VIDEO_MUXER AVOutputFormat mpeg1video_muxer = { "mpeg1video", NULL_IF_CONFIG_SMALL("MPEG video"), @@ -1001,7 +1001,7 @@ AVOutputFormat mpeg1video_muxer = { }; #endif -#ifdef CONFIG_MPEG2VIDEO_MUXER +#if CONFIG_MPEG2VIDEO_MUXER AVOutputFormat mpeg2video_muxer = { "mpeg2video", NULL_IF_CONFIG_SMALL("MPEG-2 video"), @@ -1016,7 +1016,7 @@ AVOutputFormat mpeg2video_muxer = { }; #endif -#ifdef CONFIG_MPEGVIDEO_DEMUXER +#if CONFIG_MPEGVIDEO_DEMUXER AVInputFormat mpegvideo_demuxer = { "mpegvideo", NULL_IF_CONFIG_SMALL("MPEG video"), @@ -1029,7 +1029,7 @@ AVInputFormat mpegvideo_demuxer = { }; #endif -#ifdef CONFIG_NULL_MUXER +#if CONFIG_NULL_MUXER AVOutputFormat null_muxer = { "null", NULL_IF_CONFIG_SMALL("null video format"), @@ -1048,7 +1048,7 @@ AVOutputFormat null_muxer = { }; #endif -#ifdef CONFIG_RAWVIDEO_DEMUXER +#if CONFIG_RAWVIDEO_DEMUXER AVInputFormat rawvideo_demuxer = { "rawvideo", NULL_IF_CONFIG_SMALL("raw video format"), @@ -1062,7 +1062,7 @@ AVInputFormat rawvideo_demuxer = { }; #endif -#ifdef CONFIG_RAWVIDEO_MUXER +#if CONFIG_RAWVIDEO_MUXER AVOutputFormat rawvideo_muxer = { "rawvideo", NULL_IF_CONFIG_SMALL("raw video format"), @@ -1077,7 +1077,7 @@ AVOutputFormat rawvideo_muxer = { }; #endif -#ifdef CONFIG_ROQ_MUXER +#if CONFIG_ROQ_MUXER AVOutputFormat roq_muxer = { "RoQ", @@ -1092,7 +1092,7 @@ AVOutputFormat roq_muxer = }; #endif -#ifdef CONFIG_SHORTEN_DEMUXER +#if CONFIG_SHORTEN_DEMUXER AVInputFormat shorten_demuxer = { "shn", NULL_IF_CONFIG_SMALL("raw Shorten"), @@ -1106,7 +1106,7 @@ AVInputFormat shorten_demuxer = { }; #endif -#ifdef CONFIG_VC1_DEMUXER +#if CONFIG_VC1_DEMUXER AVInputFormat vc1_demuxer = { "vc1", NULL_IF_CONFIG_SMALL("raw VC-1"), @@ -1151,13 +1151,13 @@ AVOutputFormat pcm_ ## name ## _muxer = {\ }; -#if !defined(CONFIG_MUXERS) && defined(CONFIG_DEMUXERS) +#if !CONFIG_MUXERS && CONFIG_DEMUXERS #define PCMDEF(name, long_name, ext, codec) \ PCMINPUTDEF(name, long_name, ext, codec) -#elif defined(CONFIG_MUXERS) && !defined(CONFIG_DEMUXERS) +#elif CONFIG_MUXERS && !CONFIG_DEMUXERS #define PCMDEF(name, long_name, ext, codec) \ PCMOUTPUTDEF(name, long_name, ext, codec) -#elif defined(CONFIG_MUXERS) && defined(CONFIG_DEMUXERS) +#elif CONFIG_MUXERS && CONFIG_DEMUXERS #define PCMDEF(name, long_name, ext, codec) \ PCMINPUTDEF(name, long_name, ext, codec)\ PCMOUTPUTDEF(name, long_name, ext, codec) diff --git a/libavformat/riff.c b/libavformat/riff.c index ed7d9a5f22..270aecc6b6 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -248,7 +248,7 @@ const AVCodecTag codec_wav_tags[] = { { 0, 0 }, }; -#ifdef CONFIG_MUXERS +#if CONFIG_MUXERS int64_t start_tag(ByteIOContext *pb, const char *tag) { put_tag(pb, tag); @@ -379,7 +379,7 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *ta } #endif //CONFIG_MUXERS -#ifdef CONFIG_DEMUXERS +#if CONFIG_DEMUXERS /* We could be given one of the three possible structures here: * WAVEFORMAT, PCMWAVEFORMAT or WAVEFORMATEX. Each structure * is an expansion of the previous one with the fields added diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index b78c759b02..1933ab06dc 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -32,7 +32,7 @@ #include "network.h" #include "os_support.h" #include <fcntl.h> -#ifdef HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H #include <sys/select.h> #endif diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 82e025f7d7..46a715909c 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -27,7 +27,7 @@ #include "avformat.h" #include <sys/time.h> -#ifdef HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H #include <sys/select.h> #endif #include <strings.h> @@ -1502,7 +1502,7 @@ static int rtsp_read_close(AVFormatContext *s) return 0; } -#ifdef CONFIG_RTSP_DEMUXER +#if CONFIG_RTSP_DEMUXER AVInputFormat rtsp_demuxer = { "rtsp", NULL_IF_CONFIG_SMALL("RTSP input format"), @@ -1595,7 +1595,7 @@ static int sdp_read_close(AVFormatContext *s) return 0; } -#ifdef CONFIG_SDP_DEMUXER +#if CONFIG_SDP_DEMUXER AVInputFormat sdp_demuxer = { "sdp", NULL_IF_CONFIG_SMALL("SDP"), @@ -1607,7 +1607,7 @@ AVInputFormat sdp_demuxer = { }; #endif -#ifdef CONFIG_REDIR_DEMUXER +#if CONFIG_REDIR_DEMUXER /* dummy redirector format (used directly in av_open_input_file now) */ static int redir_probe(AVProbeData *pd) { diff --git a/libavformat/sdp.c b/libavformat/sdp.c index d22f516c55..09541e3672 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -25,7 +25,7 @@ #include "avc.h" #include "rtp.h" -#ifdef CONFIG_RTP_MUXER +#if CONFIG_RTP_MUXER #define MAX_EXTRADATA_SIZE ((INT_MAX - 10) / 2) struct sdp_session_level { diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c index 52e3c7270f..1431daf589 100644 --- a/libavformat/swfenc.c +++ b/libavformat/swfenc.c @@ -503,7 +503,7 @@ static int swf_write_trailer(AVFormatContext *s) return 0; } -#ifdef CONFIG_SWF_MUXER +#if CONFIG_SWF_MUXER AVOutputFormat swf_muxer = { "swf", NULL_IF_CONFIG_SMALL("Flash format"), @@ -517,7 +517,7 @@ AVOutputFormat swf_muxer = { swf_write_trailer, }; #endif -#ifdef CONFIG_AVM2_MUXER +#if CONFIG_AVM2_MUXER AVOutputFormat avm2_muxer = { "avm2", NULL_IF_CONFIG_SMALL("Flash 9 (AVM2) format"), diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 05844517e5..d7eede61d2 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -22,7 +22,7 @@ #include <unistd.h> #include "network.h" #include "os_support.h" -#ifdef HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H #include <sys/select.h> #endif #include <sys/time.h> diff --git a/libavformat/udp.c b/libavformat/udp.c index 1101ffcf9a..f433e075af 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -29,7 +29,7 @@ #include <unistd.h> #include "network.h" #include "os_support.h" -#ifdef HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H #include <sys/select.h> #endif #include <sys/time.h> @@ -52,7 +52,7 @@ typedef struct { int is_multicast; int local_port; int reuse_socket; -#ifndef CONFIG_IPV6 +#if !CONFIG_IPV6 struct sockaddr_in dest_addr; #else struct sockaddr_storage dest_addr; @@ -72,7 +72,7 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL, struct sockaddr *addr } } #endif -#ifdef CONFIG_IPV6 +#if CONFIG_IPV6 if (addr->sa_family == AF_INET6) { if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &mcastTTL, sizeof(mcastTTL)) < 0) { av_log(NULL, AV_LOG_ERROR, "setsockopt(IPV6_MULTICAST_HOPS): %s\n", strerror(errno)); @@ -96,7 +96,7 @@ static int udp_join_multicast_group(int sockfd, struct sockaddr *addr) { } } #endif -#ifdef CONFIG_IPV6 +#if CONFIG_IPV6 if (addr->sa_family == AF_INET6) { struct ipv6_mreq mreq6; @@ -124,7 +124,7 @@ static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr) { } } #endif -#ifdef CONFIG_IPV6 +#if CONFIG_IPV6 if (addr->sa_family == AF_INET6) { struct ipv6_mreq mreq6; @@ -139,7 +139,7 @@ static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr) { return 0; } -#ifdef CONFIG_IPV6 +#if CONFIG_IPV6 static struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, int family, int flags) { struct addrinfo hints, *res = 0; int error; @@ -342,7 +342,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) int is_output; const char *p; char buf[256]; -#ifndef CONFIG_IPV6 +#if !CONFIG_IPV6 struct sockaddr_in my_addr; #else struct sockaddr_storage my_addr; diff --git a/libavformat/utils.c b/libavformat/utils.c index 707e47edb9..a675048744 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -160,7 +160,7 @@ AVOutputFormat *guess_format(const char *short_name, const char *filename, int score_max, score; /* specific test for image sequences */ -#ifdef CONFIG_IMAGE2_MUXER +#if CONFIG_IMAGE2_MUXER if (!short_name && filename && av_filename_number_test(filename) && av_guess_image2_codec(filename) != CODEC_ID_NONE) { @@ -214,7 +214,7 @@ enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, if(type == CODEC_TYPE_VIDEO){ enum CodecID codec_id= CODEC_ID_NONE; -#ifdef CONFIG_IMAGE2_MUXER +#if CONFIG_IMAGE2_MUXER if(!strcmp(fmt->name, "image2") || !strcmp(fmt->name, "image2pipe")){ codec_id= av_guess_image2_codec(filename); } diff --git a/libavformat/wav.c b/libavformat/wav.c index 01923d5aad..7aec532fe9 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -30,7 +30,7 @@ typedef struct { int last_duration; } WAVContext; -#ifdef CONFIG_WAV_MUXER +#if CONFIG_WAV_MUXER static int wav_write_header(AVFormatContext *s) { WAVContext *wav = s->priv_data; @@ -256,7 +256,7 @@ static int wav_read_seek(AVFormatContext *s, return pcm_read_seek(s, stream_index, timestamp, flags); } -#ifdef CONFIG_WAV_DEMUXER +#if CONFIG_WAV_DEMUXER AVInputFormat wav_demuxer = { "wav", NULL_IF_CONFIG_SMALL("WAV format"), @@ -270,7 +270,7 @@ AVInputFormat wav_demuxer = { .codec_tag= (const AVCodecTag* const []){codec_wav_tags, 0}, }; #endif -#ifdef CONFIG_WAV_MUXER +#if CONFIG_WAV_MUXER AVOutputFormat wav_muxer = { "wav", NULL_IF_CONFIG_SMALL("WAV format"), diff --git a/libavformat/westwood.c b/libavformat/westwood.c index 1c769466de..753daca571 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -371,7 +371,7 @@ static int wsvqa_read_packet(AVFormatContext *s, return ret; } -#ifdef CONFIG_WSAUD_DEMUXER +#if CONFIG_WSAUD_DEMUXER AVInputFormat wsaud_demuxer = { "wsaud", NULL_IF_CONFIG_SMALL("Westwood Studios audio format"), @@ -381,7 +381,7 @@ AVInputFormat wsaud_demuxer = { wsaud_read_packet, }; #endif -#ifdef CONFIG_WSVQA_DEMUXER +#if CONFIG_WSVQA_DEMUXER AVInputFormat wsvqa_demuxer = { "wsvqa", NULL_IF_CONFIG_SMALL("Westwood Studios VQA format"), diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index bc6c781bcf..6a5e8ee09d 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -29,7 +29,7 @@ struct frame_attributes { int top_field_first; }; -#ifdef CONFIG_YUV4MPEGPIPE_MUXER +#if CONFIG_YUV4MPEGPIPE_MUXER static int yuv4_generate_header(AVFormatContext *s, char* buf) { AVStream *st; @@ -382,7 +382,7 @@ static int yuv4_probe(AVProbeData *pd) return 0; } -#ifdef CONFIG_YUV4MPEGPIPE_DEMUXER +#if CONFIG_YUV4MPEGPIPE_DEMUXER AVInputFormat yuv4mpegpipe_demuxer = { "yuv4mpegpipe", NULL_IF_CONFIG_SMALL("YUV4MPEG pipe format"), diff --git a/libavutil/adler32.c b/libavutil/adler32.c index 148664e532..dad8dabed1 100644 --- a/libavutil/adler32.c +++ b/libavutil/adler32.c @@ -35,7 +35,7 @@ unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigne unsigned long s2 = adler >> 16; while (len>0) { -#ifdef CONFIG_SMALL +#if CONFIG_SMALL while(len>4 && s2 < (1U<<31)){ DO4(buf); len-=4; #else diff --git a/libavutil/aes.c b/libavutil/aes.c index 5030dac487..1631cb6543 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -39,7 +39,7 @@ static const uint8_t rcon[10] = { static uint8_t sbox[256]; static uint8_t inv_sbox[256]; -#ifdef CONFIG_SMALL +#if CONFIG_SMALL static uint32_t enc_multbl[1][256]; static uint32_t dec_multbl[1][256]; #else @@ -62,7 +62,7 @@ static void subshift(uint8_t s0[2][16], int s, uint8_t *box){ } static inline int mix_core(uint32_t multbl[4][256], int a, int b, int c, int d){ -#ifdef CONFIG_SMALL +#if CONFIG_SMALL #define ROT(x,s) ((x<<s)|(x>>(32-s))) return multbl[0][a] ^ ROT(multbl[0][b], 8) ^ ROT(multbl[0][c], 16) ^ ROT(multbl[0][d], 24); #else @@ -114,7 +114,7 @@ static void init_multbl2(uint8_t tbl[1024], int c[4], uint8_t *log8, uint8_t *al int x= sbox[i>>2]; if(x) tbl[i]= alog8[ log8[x] + log8[c[i&3]] ]; } -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL for(j=256; j<1024; j++) for(i=0; i<4; i++) tbl[4*j+i]= tbl[4*j + ((i-1)&3) - 1024]; diff --git a/libavutil/arm/bswap.h b/libavutil/arm/bswap.h index deb739407b..65c73c5ccb 100644 --- a/libavutil/arm/bswap.h +++ b/libavutil/arm/bswap.h @@ -23,7 +23,7 @@ #include "config.h" #include "libavutil/common.h" -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 #define bswap_16 bswap_16 static av_always_inline av_const uint16_t bswap_16(uint16_t x) { @@ -35,7 +35,7 @@ static av_always_inline av_const uint16_t bswap_16(uint16_t x) #define bswap_32 bswap_32 static av_always_inline av_const uint32_t bswap_32(uint32_t x) { -#ifdef HAVE_ARMV6 +#if HAVE_ARMV6 __asm__("rev %0, %0" : "+r"(x)); #else uint32_t t; diff --git a/libavutil/bswap.h b/libavutil/bswap.h index 100ed1c262..41e98d4649 100644 --- a/libavutil/bswap.h +++ b/libavutil/bswap.h @@ -30,13 +30,13 @@ #include "config.h" #include "common.h" -#if defined(ARCH_ARM) +#if ARCH_ARM # include "arm/bswap.h" -#elif defined(ARCH_BFIN) +#elif ARCH_BFIN # include "bfin/bswap.h" -#elif defined(ARCH_SH4) +#elif ARCH_SH4 # include "sh4/bswap.h" -#elif defined(ARCH_X86) +#elif ARCH_X86 # include "x86/bswap.h" #endif diff --git a/libavutil/common.h b/libavutil/common.h index d66120fa66..ddeecad7dc 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -154,7 +154,7 @@ static inline av_const int av_log2_16bit(unsigned int v) /* median of 3 */ static inline av_const int mid_pred(int a, int b, int c) { -#ifdef HAVE_CMOV +#if HAVE_CMOV int i=b; __asm__ volatile( "cmp %2, %1 \n\t" @@ -323,9 +323,9 @@ static inline av_pure int ff_get_fourcc(const char *s){ }\ } -#if defined(ARCH_X86) || defined(ARCH_PPC) || defined(ARCH_BFIN) +#if ARCH_X86 || ARCH_PPC || ARCH_BFIN #define AV_READ_TIME read_time -#if defined(ARCH_X86) +#if ARCH_X86 static inline uint64_t read_time(void) { uint32_t a, d; @@ -366,7 +366,7 @@ static inline uint64_t read_time(void) return (((uint64_t)tbu)<<32) | (uint64_t)tbl; } #endif -#elif defined(HAVE_GETHRTIME) +#elif HAVE_GETHRTIME #define AV_READ_TIME gethrtime #endif @@ -397,11 +397,11 @@ tend= AV_READ_TIME();\ #endif /** - * Returns NULL if CONFIG_SMALL is defined otherwise the argument + * Returns NULL if CONFIG_SMALL is true otherwise the argument * without modifications, used to disable the definition of strings * (for example AVCodec long_names). */ -#ifdef CONFIG_SMALL +#if CONFIG_SMALL # define NULL_IF_CONFIG_SMALL(x) NULL #else # define NULL_IF_CONFIG_SMALL(x) x diff --git a/libavutil/crc.c b/libavutil/crc.c index cc968024d3..8b8a90e6a5 100644 --- a/libavutil/crc.c +++ b/libavutil/crc.c @@ -22,7 +22,7 @@ #include "bswap.h" #include "crc.h" -#ifdef CONFIG_HARDCODED_TABLES +#if CONFIG_HARDCODED_TABLES #include "crc_data.h" #else static struct { @@ -75,7 +75,7 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ } } ctx[256]=1; -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL if(ctx_size >= sizeof(AVCRC)*1024) for (i = 0; i < 256; i++) for(j=0; j<3; j++) @@ -91,7 +91,7 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ * @return a pointer to the CRC table or NULL on failure */ const AVCRC *av_crc_get_table(AVCRCId crc_id){ -#ifndef CONFIG_HARDCODED_TABLES +#if !CONFIG_HARDCODED_TABLES if (!av_crc_table[crc_id][FF_ARRAY_ELEMS(av_crc_table[crc_id])-1]) if (av_crc_init(av_crc_table[crc_id], av_crc_table_params[crc_id].le, @@ -113,7 +113,7 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id){ uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length){ const uint8_t *end= buffer+length; -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL if(!ctx[256]) while(buffer<end-3){ crc ^= le2me_32(*(const uint32_t*)buffer); buffer+=4; diff --git a/libavutil/des.c b/libavutil/des.c index 43a14f6e6e..51d73a3c1e 100644 --- a/libavutil/des.c +++ b/libavutil/des.c @@ -74,7 +74,7 @@ static const uint8_t PC2_shuffle[] = { }; #undef T -#ifdef CONFIG_SMALL +#if CONFIG_SMALL static const uint8_t S_boxes[8][32] = { { 0x0e, 0xf4, 0x7d, 0x41, 0xe2, 0x2f, 0xdb, 0x18, 0xa3, 0x6a, 0xc6, 0xbc, 0x95, 0x59, 0x30, 0x87, @@ -218,7 +218,7 @@ static uint32_t f_func(uint32_t r, uint64_t k) { // apply S-boxes, those compress the data again from 8 * 6 to 8 * 4 bits for (i = 7; i >= 0; i--) { uint8_t tmp = (r ^ k) & 0x3f; -#ifdef CONFIG_SMALL +#if CONFIG_SMALL uint8_t v = S_boxes[i][tmp >> 1]; if (tmp & 1) v >>= 4; out = (out >> 4) | (v << 28); @@ -229,7 +229,7 @@ static uint32_t f_func(uint32_t r, uint64_t k) { r = (r >> 4) | (r << 28); k >>= 6; } -#ifdef CONFIG_SMALL +#if CONFIG_SMALL out = shuffle(out, P_shuffle, sizeof(P_shuffle)); #endif return out; diff --git a/libavutil/internal.h b/libavutil/internal.h index 957566026d..52fa7e8c97 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -102,7 +102,7 @@ #endif // Use rip-relative addressing if compiling PIC code on x86-64. -#if defined(ARCH_X86_64) && defined(PIC) +#if ARCH_X86_64 && defined(PIC) # define LOCAL_MANGLE(a) #a "(%%rip)" #else # define LOCAL_MANGLE(a) #a @@ -125,7 +125,7 @@ extern const uint32_t ff_inverse[256]; -#if defined(ARCH_X86) +#if ARCH_X86 # define FASTDIV(a,b) \ ({\ int ret,dmy;\ @@ -136,7 +136,7 @@ extern const uint32_t ff_inverse[256]; );\ ret;\ }) -#elif defined(HAVE_ARMV6) +#elif HAVE_ARMV6 static inline av_const int FASTDIV(int a, int b) { int r, t; @@ -147,7 +147,7 @@ static inline av_const int FASTDIV(int a, int b) : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse)); return r; } -#elif defined(ARCH_ARM) +#elif ARCH_ARM static inline av_const int FASTDIV(int a, int b) { int r, t; @@ -155,7 +155,7 @@ static inline av_const int FASTDIV(int a, int b) : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); return r; } -#elif defined(CONFIG_FASTDIV) +#elif CONFIG_FASTDIV # define FASTDIV(a,b) ((uint32_t)((((uint64_t)a)*ff_inverse[b])>>32)) #else # define FASTDIV(a,b) ((a)/(b)) @@ -171,7 +171,7 @@ static inline av_const unsigned int ff_sqrt(unsigned int a) if(a<255) return (ff_sqrt_tab[a+1]-1)>>4; else if(a<(1<<12)) b= ff_sqrt_tab[a>>4 ]>>2; -#ifndef CONFIG_SMALL +#if !CONFIG_SMALL else if(a<(1<<14)) b= ff_sqrt_tab[a>>6 ]>>1; else if(a<(1<<16)) b= ff_sqrt_tab[a>>8 ] ; #endif @@ -185,7 +185,7 @@ static inline av_const unsigned int ff_sqrt(unsigned int a) return b - (a<b*b); } -#if defined(ARCH_X86) +#if ARCH_X86 #define MASK_ABS(mask, level)\ __asm__ volatile(\ "cltd \n\t"\ @@ -199,7 +199,7 @@ static inline av_const unsigned int ff_sqrt(unsigned int a) level= (level^mask)-mask; #endif -#ifdef HAVE_CMOV +#if HAVE_CMOV #define COPY3_IF_LT(x,y,a,b,c,d)\ __asm__ volatile (\ "cmpl %0, %3 \n\t"\ @@ -259,42 +259,42 @@ if((y)<(x)){\ }\ } -#ifndef HAVE_LLRINT +#if !HAVE_LLRINT static av_always_inline av_const long long llrint(double x) { return rint(x); } #endif /* HAVE_LLRINT */ -#ifndef HAVE_LRINT +#if !HAVE_LRINT static av_always_inline av_const long int lrint(double x) { return rint(x); } #endif /* HAVE_LRINT */ -#ifndef HAVE_LRINTF +#if !HAVE_LRINTF static av_always_inline av_const long int lrintf(float x) { return (int)(rint(x)); } #endif /* HAVE_LRINTF */ -#ifndef HAVE_ROUND +#if !HAVE_ROUND static av_always_inline av_const double round(double x) { return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); } #endif /* HAVE_ROUND */ -#ifndef HAVE_ROUNDF +#if !HAVE_ROUNDF static av_always_inline av_const float roundf(float x) { return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); } #endif /* HAVE_ROUNDF */ -#ifndef HAVE_TRUNCF +#if !HAVE_TRUNCF static av_always_inline av_const float truncf(float x) { return (x > 0) ? floor(x) : ceil(x); diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index 535fdd2dfe..7c5909ea51 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -66,7 +66,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); #define AV_RL8(x) AV_RB8(x) #define AV_WL8(p, d) AV_WB8(p, d) -#ifdef HAVE_FAST_UNALIGNED +#if HAVE_FAST_UNALIGNED # ifdef WORDS_BIGENDIAN # define AV_RB16(x) AV_RN16(x) # define AV_WB16(p, d) AV_WN16(p, d) diff --git a/libavutil/md5.c b/libavutil/md5.c index 87b4026dc1..289fa56d72 100644 --- a/libavutil/md5.c +++ b/libavutil/md5.c @@ -98,7 +98,7 @@ static void body(uint32_t ABCD[4], uint32_t X[16]){ X[i]= bswap_32(X[i]); #endif -#ifdef CONFIG_SMALL +#if CONFIG_SMALL for( i = 0; i < 64; i++ ){ CORE(i,a,b,c,d) t=d; d=c; c=b; b=a; a=t; diff --git a/libavutil/mem.c b/libavutil/mem.c index 328bef787c..95299a1c0b 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -32,7 +32,7 @@ #undef realloc #include <stdlib.h> -#ifdef HAVE_MALLOC_H +#if HAVE_MALLOC_H #include <malloc.h> #endif @@ -43,7 +43,7 @@ void *av_malloc(unsigned int size) { void *ptr = NULL; -#ifdef CONFIG_MEMALIGN_HACK +#if CONFIG_MEMALIGN_HACK long diff; #endif @@ -51,16 +51,16 @@ void *av_malloc(unsigned int size) if(size > (INT_MAX-16) ) return NULL; -#ifdef CONFIG_MEMALIGN_HACK +#if CONFIG_MEMALIGN_HACK ptr = malloc(size+16); if(!ptr) return ptr; diff= ((-(long)ptr - 1)&15) + 1; ptr = (char*)ptr + diff; ((char*)ptr)[-1]= diff; -#elif defined (HAVE_POSIX_MEMALIGN) +#elif HAVE_POSIX_MEMALIGN posix_memalign(&ptr,16,size); -#elif defined (HAVE_MEMALIGN) +#elif HAVE_MEMALIGN ptr = memalign(16,size); /* Why 64? Indeed, we should align it: @@ -96,7 +96,7 @@ void *av_malloc(unsigned int size) void *av_realloc(void *ptr, unsigned int size) { -#ifdef CONFIG_MEMALIGN_HACK +#if CONFIG_MEMALIGN_HACK int diff; #endif @@ -104,7 +104,7 @@ void *av_realloc(void *ptr, unsigned int size) if(size > (INT_MAX-16) ) return NULL; -#ifdef CONFIG_MEMALIGN_HACK +#if CONFIG_MEMALIGN_HACK //FIXME this isn't aligned correctly, though it probably isn't needed if(!ptr) return av_malloc(size); diff= ((char*)ptr)[-1]; @@ -118,7 +118,7 @@ void av_free(void *ptr) { /* XXX: this test should not be needed on most libcs */ if (ptr) -#ifdef CONFIG_MEMALIGN_HACK +#if CONFIG_MEMALIGN_HACK free((char*)ptr - ((char*)ptr)[-1]); #else free(ptr); diff --git a/libavutil/mem.h b/libavutil/mem.h index 3ea9858236..ec6e3b7456 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -37,7 +37,7 @@ #elif defined(_MSC_VER) #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v -#elif defined(HAVE_INLINE_ASM) +#elif HAVE_INLINE_ASM #error The asm code needs alignment, but we do not know how to do it for this compiler. #else #define DECLARE_ALIGNED(n,t,v) t v diff --git a/libavutil/sha1.c b/libavutil/sha1.c index 61ad38de28..72c2726e3b 100644 --- a/libavutil/sha1.c +++ b/libavutil/sha1.c @@ -54,7 +54,7 @@ static void transform(uint32_t state[5], const uint8_t buffer[64]){ c = state[2]; d = state[3]; e = state[4]; -#ifdef CONFIG_SMALL +#if CONFIG_SMALL for(i=0; i<80; i++){ int t; if(i<16) t= be2me_32(((uint32_t*)buffer)[i]); @@ -110,7 +110,7 @@ void av_sha1_update(AVSHA1* ctx, const uint8_t* data, unsigned int len){ j = ctx->count & 63; ctx->count += len; -#ifdef CONFIG_SMALL +#if CONFIG_SMALL for( i = 0; i < len; i++ ){ ctx->buffer[ j++ ] = data[i]; if( 64 == j ){ diff --git a/libavutil/x86/bswap.h b/libavutil/x86/bswap.h index c52b5290e1..0ff8a93385 100644 --- a/libavutil/x86/bswap.h +++ b/libavutil/x86/bswap.h @@ -38,7 +38,7 @@ static av_always_inline av_const uint16_t bswap_16(uint16_t x) #define bswap_32 bswap_32 static av_always_inline av_const uint32_t bswap_32(uint32_t x) { -#ifdef HAVE_BSWAP +#if HAVE_BSWAP __asm__("bswap %0" : "+r" (x)); #else __asm__("rorw $8, %w0 \n\t" @@ -49,7 +49,7 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x) return x; } -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define bswap_64 bswap_64 static inline uint64_t av_const bswap_64(uint64_t x) { diff --git a/libavutil/x86_cpu.h b/libavutil/x86_cpu.h index 4b5f10527e..d29b7d8ad9 100644 --- a/libavutil/x86_cpu.h +++ b/libavutil/x86_cpu.h @@ -24,7 +24,7 @@ #include <stdint.h> #include "config.h" -#ifdef ARCH_X86_64 +#if ARCH_X86_64 # define REG_a "rax" # define REG_b "rbx" # define REG_c "rcx" @@ -64,15 +64,10 @@ typedef int32_t x86_reg; # define REGSP esp #endif -#if defined(ARCH_X86_64) || (defined(ARCH_X86_32) && defined(HAVE_EBX_AVAILABLE) && defined(HAVE_EBP_AVAILABLE)) -# define HAVE_7REGS 1 -#endif - -#if defined(ARCH_X86_64) || (defined(ARCH_X86_32) && (defined(HAVE_EBX_AVAILABLE) || defined(HAVE_EBP_AVAILABLE))) -# define HAVE_6REGS 1 -#endif +#define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE)) +#define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE)) -#if defined(ARCH_X86_64) && defined(PIC) +#if ARCH_X86_64 && defined(PIC) # define BROKEN_RELOCATIONS 1 #endif diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index b2f5badaa4..a41f28bc66 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -92,7 +92,7 @@ unsigned postproc_version(void) return LIBPOSTPROC_VERSION_INT; } -#ifdef HAVE_ALTIVEC_H +#if HAVE_ALTIVEC_H #include <altivec.h> #endif @@ -102,7 +102,7 @@ unsigned postproc_version(void) #define TEMP_STRIDE 8 //#define NUM_BLOCKS_AT_ONCE 16 //not used yet -#if defined(ARCH_X86) +#if ARCH_X86 DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL; DECLARE_ASM_CONST(8, uint64_t, w04)= 0x0004000400040004LL; DECLARE_ASM_CONST(8, uint64_t, w20)= 0x0020002000200020LL; @@ -150,7 +150,7 @@ static const char *replaceTable[]= }; -#if defined(ARCH_X86) +#if ARCH_X86 static inline void prefetchnta(void *p) { __asm__ volatile( "prefetchnta (%0)\n\t" @@ -554,45 +554,47 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, //Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one //Plain C versions -#if !(defined (HAVE_MMX) || defined (HAVE_ALTIVEC)) || defined (RUNTIME_CPUDETECT) +#if !(HAVE_MMX || HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT) #define COMPILE_C #endif -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC #define COMPILE_ALTIVEC #endif //HAVE_ALTIVEC -#if defined(ARCH_X86) +#if ARCH_X86 -#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT) +#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_MMX #endif -#if defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT) +#if HAVE_MMX2 || defined (RUNTIME_CPUDETECT) #define COMPILE_MMX2 #endif -#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT) +#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_3DNOW #endif -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ #undef HAVE_MMX +#define HAVE_MMX 0 #undef HAVE_MMX2 +#define HAVE_MMX2 0 #undef HAVE_3DNOW +#define HAVE_3DNOW 0 #undef HAVE_ALTIVEC +#define HAVE_ALTIVEC 0 #ifdef COMPILE_C -#undef HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW #define RENAME(a) a ## _C #include "postprocess_template.c" #endif #ifdef COMPILE_ALTIVEC #undef RENAME -#define HAVE_ALTIVEC +#undef HAVE_ALTIVEC +#define HAVE_ALTIVEC 1 #define RENAME(a) a ## _altivec #include "postprocess_altivec_template.c" #include "postprocess_template.c" @@ -601,9 +603,8 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, //MMX versions #ifdef COMPILE_MMX #undef RENAME -#define HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_MMX +#define HAVE_MMX 1 #define RENAME(a) a ## _MMX #include "postprocess_template.c" #endif @@ -611,9 +612,10 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, //MMX2 versions #ifdef COMPILE_MMX2 #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_MMX +#undef HAVE_MMX2 +#define HAVE_MMX 1 +#define HAVE_MMX2 1 #define RENAME(a) a ## _MMX2 #include "postprocess_template.c" #endif @@ -621,9 +623,12 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, //3DNOW versions #ifdef COMPILE_3DNOW #undef RENAME -#define HAVE_MMX +#undef HAVE_MMX #undef HAVE_MMX2 -#define HAVE_3DNOW +#undef HAVE_3DNOW +#define HAVE_MMX 1 +#define HAVE_MMX2 0 +#define HAVE_3DNOW 1 #define RENAME(a) a ## _3DNow #include "postprocess_template.c" #endif @@ -641,7 +646,7 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[] // difference would not be measurable here but it is much better because // someone might exchange the CPU whithout restarting MPlayer ;) #ifdef RUNTIME_CPUDETECT -#if defined(ARCH_X86) +#if ARCH_X86 // ordered per speed fastest first if(c->cpuCaps & PP_CPU_CAPS_MMX2) postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); @@ -652,7 +657,7 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[] else postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); #else -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC if(c->cpuCaps & PP_CPU_CAPS_ALTIVEC) postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); else @@ -660,13 +665,13 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[] postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); #endif #else //RUNTIME_CPUDETECT -#ifdef HAVE_MMX2 +#if HAVE_MMX2 postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); -#elif defined (HAVE_3DNOW) +#elif HAVE_3DNOW postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); -#elif defined (HAVE_MMX) +#elif HAVE_MMX postProcess_MMX(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); -#elif defined (HAVE_ALTIVEC) +#elif HAVE_ALTIVEC postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); #else postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index 05dc837207..908c5c764b 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -31,32 +31,32 @@ #undef PMINUB #undef PMAXUB -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define REAL_PAVGB(a,b) "pavgb " #a ", " #b " \n\t" -#elif defined (HAVE_3DNOW) +#elif HAVE_3DNOW #define REAL_PAVGB(a,b) "pavgusb " #a ", " #b " \n\t" #endif #define PAVGB(a,b) REAL_PAVGB(a,b) -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define PMINUB(a,b,t) "pminub " #a ", " #b " \n\t" -#elif defined (HAVE_MMX) +#elif HAVE_MMX #define PMINUB(b,a,t) \ "movq " #a ", " #t " \n\t"\ "psubusb " #b ", " #t " \n\t"\ "psubb " #t ", " #a " \n\t" #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define PMAXUB(a,b) "pmaxub " #a ", " #b " \n\t" -#elif defined (HAVE_MMX) +#elif HAVE_MMX #define PMAXUB(a,b) \ "psubusb " #a ", " #b " \n\t"\ "paddb " #a ", " #b " \n\t" #endif //FIXME? |255-0| = 1 (should not be a problem ...) -#ifdef HAVE_MMX +#if HAVE_MMX /** * Check if the middle 8x8 Block in the given 8x16 block is flat */ @@ -136,7 +136,7 @@ static inline int RENAME(vertClassify)(uint8_t src[], int stride, PPContext *c){ "psubusb %%mm3, %%mm4 \n\t" " \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pxor %%mm7, %%mm7 \n\t" "psadbw %%mm7, %%mm0 \n\t" #else @@ -176,10 +176,10 @@ static inline int RENAME(vertClassify)(uint8_t src[], int stride, PPContext *c){ * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 block in the middle) * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16 */ -#ifndef HAVE_ALTIVEC +#if !HAVE_ALTIVEC static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= stride*3; __asm__ volatile( //"movv %0 %1 %2\n\t" "movq %2, %%mm0 \n\t" // QP,..., QP @@ -306,7 +306,7 @@ static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb) : "%"REG_a, "%"REG_c ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW const int l1= stride; const int l2= stride + l1; const int l3= stride + l2; @@ -345,7 +345,7 @@ static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) src++; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } #endif //HAVE_ALTIVEC @@ -364,7 +364,7 @@ static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) */ static inline void RENAME(vertRK1Filter)(uint8_t *src, int stride, int QP) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= stride*3; // FIXME rounding __asm__ volatile( @@ -426,7 +426,7 @@ static inline void RENAME(vertRK1Filter)(uint8_t *src, int stride, int QP) : "r" (src), "r" ((x86_reg)stride) : "%"REG_a, "%"REG_c ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW const int l1= stride; const int l2= stride + l1; const int l3= stride + l2; @@ -449,7 +449,7 @@ static inline void RENAME(vertRK1Filter)(uint8_t *src, int stride, int QP) } } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } #endif //0 @@ -462,7 +462,7 @@ static inline void RENAME(vertRK1Filter)(uint8_t *src, int stride, int QP) */ static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= stride*3; __asm__ volatile( @@ -548,7 +548,7 @@ static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co) : "r" (src), "r" ((x86_reg)stride), "m" (co->pQPb) : "%"REG_a, "%"REG_c ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW const int l1= stride; const int l2= stride + l1; @@ -582,13 +582,13 @@ static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co) } src++; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } -#ifndef HAVE_ALTIVEC +#if !HAVE_ALTIVEC static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext *c) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW /* uint8_t tmp[16]; const int l1= stride; @@ -869,7 +869,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext } } */ -#elif defined (HAVE_MMX) +#elif HAVE_MMX src+= stride*4; __asm__ volatile( "pxor %%mm7, %%mm7 \n\t" @@ -978,7 +978,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext "movq (%%"REG_c"), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "movq %%mm7, %%mm6 \n\t" // 0 "psubw %%mm0, %%mm6 \n\t" "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| @@ -1010,7 +1010,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pminsw %%mm2, %%mm0 \n\t" "pminsw %%mm3, %%mm1 \n\t" #else @@ -1074,7 +1074,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext "pand %%mm2, %%mm4 \n\t" "pand %%mm3, %%mm5 \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pminsw %%mm0, %%mm4 \n\t" "pminsw %%mm1, %%mm5 \n\t" #else @@ -1101,7 +1101,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext : "r" ((x86_reg)stride), "m" (c->pQPb) : "%"REG_a, "%"REG_c ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW const int l1= stride; const int l2= stride + l1; const int l3= stride + l2; @@ -1139,14 +1139,14 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext } src++; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } #endif //HAVE_ALTIVEC -#ifndef HAVE_ALTIVEC +#if !HAVE_ALTIVEC static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW __asm__ volatile( "pxor %%mm6, %%mm6 \n\t" "pcmpeqb %%mm7, %%mm7 \n\t" @@ -1164,7 +1164,7 @@ static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) // %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 #undef FIND_MIN_MAX -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define REAL_FIND_MIN_MAX(addr)\ "movq " #addr ", %%mm0 \n\t"\ "pminub %%mm0, %%mm7 \n\t"\ @@ -1191,7 +1191,7 @@ FIND_MIN_MAX((%0, %1, 8)) "movq %%mm7, %%mm4 \n\t" "psrlq $8, %%mm7 \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pminub %%mm4, %%mm7 \n\t" // min of pixels "pshufw $0xF9, %%mm7, %%mm4 \n\t" "pminub %%mm4, %%mm7 \n\t" // min of pixels @@ -1216,7 +1216,7 @@ FIND_MIN_MAX((%0, %1, 8)) "movq %%mm6, %%mm4 \n\t" "psrlq $8, %%mm6 \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pmaxub %%mm4, %%mm6 \n\t" // max of pixels "pshufw $0xF9, %%mm6, %%mm4 \n\t" "pmaxub %%mm4, %%mm6 \n\t" @@ -1370,7 +1370,7 @@ DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1, : : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2) : "%"REG_a, "%"REG_d, "%"REG_c ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW int y; int min=255; int max=0; @@ -1487,7 +1487,7 @@ DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1, // src[0] = src[7]=src[stride*7]=src[stride*7 + 7]=255; } #endif -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } #endif //HAVE_ALTIVEC @@ -1499,7 +1499,7 @@ DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1, */ static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= 4*stride; __asm__ volatile( "lea (%0, %1), %%"REG_a" \n\t" @@ -1552,7 +1552,7 @@ static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int strid */ static inline void RENAME(deInterlaceInterpolateCubic)(uint8_t src[], int stride) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= stride*3; __asm__ volatile( "lea (%0, %1), %%"REG_a" \n\t" @@ -1594,7 +1594,7 @@ DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, : : "r" (src), "r" ((x86_reg)stride) : "%"REG_a, "%"REG_d, "%"REG_c ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW int x; src+= stride*3; for(x=0; x<8; x++){ @@ -1604,7 +1604,7 @@ DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, src[stride*9] = CLIP((-src[stride*6] + 9*src[stride*8] + 9*src[stride*10] - src[stride*12])>>4); src++; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } /** @@ -1616,7 +1616,7 @@ DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, */ static inline void RENAME(deInterlaceFF)(uint8_t src[], int stride, uint8_t *tmp) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= stride*4; __asm__ volatile( "lea (%0, %1), %%"REG_a" \n\t" @@ -1665,7 +1665,7 @@ DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) : : "r" (src), "r" ((x86_reg)stride), "r"(tmp) : "%"REG_a, "%"REG_d ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW int x; src+= stride*4; for(x=0; x<8; x++){ @@ -1683,7 +1683,7 @@ DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) src++; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } /** @@ -1695,7 +1695,7 @@ DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) */ static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= stride*4; __asm__ volatile( "lea (%0, %1), %%"REG_a" \n\t" @@ -1755,7 +1755,7 @@ DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) : : "r" (src), "r" ((x86_reg)stride), "r"(tmp), "r"(tmp2) : "%"REG_a, "%"REG_d ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW int x; src+= stride*4; for(x=0; x<8; x++){ @@ -1784,7 +1784,7 @@ DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) src++; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } /** @@ -1796,7 +1796,7 @@ DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4)) */ static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uint8_t *tmp) { -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW src+= 4*stride; __asm__ volatile( "lea (%0, %1), %%"REG_a" \n\t" @@ -1843,7 +1843,7 @@ static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uin : : "r" (src), "r" ((x86_reg)stride), "r" (tmp) : "%"REG_a, "%"REG_d ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW int a, b, c, x; src+= 4*stride; @@ -1886,7 +1886,7 @@ static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uin src += 4; tmp += 4; } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } /** @@ -1897,9 +1897,9 @@ static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uin */ static inline void RENAME(deInterlaceMedian)(uint8_t src[], int stride) { -#ifdef HAVE_MMX +#ifd HAVE_MMX src+= 4*stride; -#ifdef HAVE_MMX2 +#if HAVE_MMX2 __asm__ volatile( "lea (%0, %1), %%"REG_a" \n\t" "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t" @@ -2012,7 +2012,7 @@ MEDIAN((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8)) #endif //HAVE_MMX } -#ifdef HAVE_MMX +#if HAVE_MMX /** * transposes and shift the given 8x8 Block into dst1 and dst2 */ @@ -2180,7 +2180,7 @@ static inline void RENAME(transpose2)(uint8_t *dst, int dstStride, uint8_t *src) #endif //HAVE_MMX //static long test=0; -#ifndef HAVE_ALTIVEC +#if !HAVE_ALTIVEC static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride, uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise) { @@ -2191,7 +2191,7 @@ static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride, #define FAST_L2_DIFF //#define L1_DIFF //u should change the thresholds too if u try that one -#if defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#if HAVE_MMX2 || HAVE_3DNOW __asm__ volatile( "lea (%2, %2, 2), %%"REG_a" \n\t" // 3*stride "lea (%2, %2, 4), %%"REG_d" \n\t" // 5*stride @@ -2479,7 +2479,7 @@ L2_DIFF_CORE((%0, %%REGc) , (%1, %%REGc)) :: "r" (src), "r" (tempBlurred), "r"((x86_reg)stride), "m" (tempBlurredPast) : "%"REG_a, "%"REG_d, "%"REG_c, "memory" ); -#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#else //HAVE_MMX2 || HAVE_3DNOW { int y; int d=0; @@ -2562,11 +2562,11 @@ Switch between } } } -#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW) +#endif //HAVE_MMX2 || HAVE_3DNOW } #endif //HAVE_ALTIVEC -#ifdef HAVE_MMX +#if HAVE_MMX /** * accurate deblock filter */ @@ -2970,7 +2970,7 @@ static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int st "movq (%%"REG_c"), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "movq %%mm7, %%mm6 \n\t" // 0 "psubw %%mm0, %%mm6 \n\t" "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| @@ -3002,7 +3002,7 @@ static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int st "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pminsw %%mm2, %%mm0 \n\t" "pminsw %%mm3, %%mm1 \n\t" #else @@ -3066,7 +3066,7 @@ static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int st "pand %%mm2, %%mm4 \n\t" "pand %%mm3, %%mm5 \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "pminsw %%mm0, %%mm4 \n\t" "pminsw %%mm1, %%mm5 \n\t" #else @@ -3116,18 +3116,18 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ static inline void RENAME(blockCopy)(uint8_t dst[], int dstStride, const uint8_t src[], int srcStride, int levelFix, int64_t *packedOffsetAndScale) { -#ifndef HAVE_MMX +#if !HAVE_MMX int i; #endif if(levelFix){ -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset "movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale "lea (%2,%4), %%"REG_a" \n\t" "lea (%3,%5), %%"REG_d" \n\t" "pxor %%mm4, %%mm4 \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define REAL_SCALED_CPY(src1, src2, dst1, dst2) \ "movq " #src1 ", %%mm0 \n\t"\ "movq " #src1 ", %%mm5 \n\t"\ @@ -3203,7 +3203,7 @@ SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2)) &(src[srcStride*i]), BLOCK_SIZE); #endif //HAVE_MMX }else{ -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "lea (%0,%2), %%"REG_a" \n\t" "lea (%1,%3), %%"REG_d" \n\t" @@ -3243,7 +3243,7 @@ SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2)) */ static inline void RENAME(duplicate)(uint8_t src[], int stride) { -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "movq (%0), %%mm0 \n\t" "add %1, %0 \n\t" @@ -3280,7 +3280,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ int QPCorrecture= 256*256; int copyAhead; -#ifdef HAVE_MMX +#if HAVE_MMX int i; #endif @@ -3293,7 +3293,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ uint8_t * const tempDst= dstStride > 0 ? c.tempDst : c.tempDst - 23*dstStride; //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4; -#ifdef HAVE_MMX +#if HAVE_MMX for(i=0; i<57; i++){ int offset= ((i*c.ppMode.baseDcDiff)>>8) + 1; int threshold= offset*2 + 1; @@ -3351,7 +3351,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ scale= (double)(c.ppMode.maxAllowedY - c.ppMode.minAllowedY) / (double)(white-black); -#ifdef HAVE_MMX2 +#if HAVE_MMX2 c.packedYScale= (uint16_t)(scale*256.0 + 0.5); c.packedYOffset= (((black*c.packedYScale)>>8) - c.ppMode.minAllowedY) & 0xFFFF; #else @@ -3384,7 +3384,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing for(x=0; x<width; x+=BLOCK_SIZE){ -#ifdef HAVE_MMX2 +#if HAVE_MMX2 /* prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32); prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32); @@ -3411,7 +3411,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ : "%"REG_a, "%"REG_d ); -#elif defined(HAVE_3DNOW) +#elif HAVE_3DNOW //FIXME check if this is faster on an 3dnow chip or if it is faster without the prefetch or ... /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32); prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32); @@ -3457,7 +3457,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ //1% speedup if these are here instead of the inner loop const uint8_t *srcBlock= &(src[y*srcStride]); uint8_t *dstBlock= &(dst[y*dstStride]); -#ifdef HAVE_MMX +#if HAVE_MMX uint8_t *tempBlock1= c.tempBlocks; uint8_t *tempBlock2= c.tempBlocks + 8; #endif @@ -3493,7 +3493,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing for(x=0; x<width; x+=BLOCK_SIZE){ const int stride= dstStride; -#ifdef HAVE_MMX +#if HAVE_MMX uint8_t *tmpXchg; #endif if(isColor){ @@ -3507,7 +3507,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ yHistogram[ srcBlock[srcStride*12 + 4] ]++; } c.QP= QP; -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "movd %1, %%mm7 \n\t" "packuswb %%mm7, %%mm7 \n\t" // 0, 0, 0, QP, 0, 0, 0, QP @@ -3520,7 +3520,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 /* prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32); prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32); @@ -3547,7 +3547,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ : "%"REG_a, "%"REG_d ); -#elif defined(HAVE_3DNOW) +#elif HAVE_3DNOW //FIXME check if this is faster on an 3dnow chip or if it is faster without the prefetch or ... /* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32); prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32); @@ -3591,12 +3591,12 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ } } -#ifdef HAVE_MMX +#if HAVE_MMX RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride); #endif /* check if we have a previous block to deblock it with dstBlock */ if(x - 8 >= 0){ -#ifdef HAVE_MMX +#if HAVE_MMX if(mode & H_X1_FILTER) RENAME(vertX1Filter)(tempBlock1, 16, &c); else if(mode & H_DEBLOCK){ @@ -3617,7 +3617,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ if(mode & H_X1_FILTER) horizX1Filter(dstBlock-4, stride, QP); else if(mode & H_DEBLOCK){ -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC DECLARE_ALIGNED(16, unsigned char, tempBlock[272]); transpose_16x8_char_toPackedAlign_altivec(tempBlock, dstBlock - (4 + 1), stride); @@ -3659,7 +3659,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ dstBlock+=8; srcBlock+=8; -#ifdef HAVE_MMX +#if HAVE_MMX tmpXchg= tempBlock1; tempBlock1= tempBlock2; tempBlock2 = tmpXchg; @@ -3699,9 +3699,9 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ + dstBlock[x +14*dstStride] + dstBlock[x +15*dstStride]; }*/ } -#ifdef HAVE_3DNOW +#if HAVE_3DNOW __asm__ volatile("femms"); -#elif defined (HAVE_MMX) +#elif HAVE_MMX __asm__ volatile("emms"); #endif |