Unify input/output defines to HAVE_* format.
Define values as 1 to simplify conditionals.
CONFIG := $(shell cat config.h)
# Optional muxer module sources
-ifneq ($(findstring AVS_INPUT, $(CONFIG)),)
+ifneq ($(findstring HAVE_AVS, $(CONFIG)),)
SRCCLI += input/avs.c
endif
SRCCLI += input/thread.c
endif
-ifneq ($(findstring LAVF_INPUT, $(CONFIG)),)
+ifneq ($(findstring HAVE_LAVF, $(CONFIG)),)
SRCCLI += input/lavf.c
endif
-ifneq ($(findstring FFMS_INPUT, $(CONFIG)),)
+ifneq ($(findstring HAVE_FFMS, $(CONFIG)),)
SRCCLI += input/ffms.c
endif
-ifneq ($(findstring MP4_OUTPUT, $(CONFIG)),)
+ifneq ($(findstring HAVE_GPAC, $(CONFIG)),)
SRCCLI += output/mp4.c
endif
s->i_left -= i_count;
if( s->i_left <= 32 )
{
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
M32( s->p ) = s->cur_bits >> (32 - s->i_left);
#else
M32( s->p ) = endian_fix( s->cur_bits << s->i_left );
void x264_cabac_encode_ue_bypass( x264_cabac_t *cb, int exp_bits, int val );
void x264_cabac_encode_flush( x264_t *h, x264_cabac_t *cb );
-#ifdef HAVE_MMX
+#if HAVE_MMX
#define x264_cabac_encode_decision x264_cabac_encode_decision_asm
#define x264_cabac_encode_bypass x264_cabac_encode_bypass_asm
#define x264_cabac_encode_terminal x264_cabac_encode_terminal_asm
#include <stdarg.h>
#include <ctype.h>
-#ifdef HAVE_MALLOC_H
+#if HAVE_MALLOC_H
#include <malloc.h>
#endif
}
OPT("log")
p->i_log_level = atoi(value);
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
OPT("visualize")
p->b_visualize = atobool(value);
#endif
void *x264_malloc( int i_size )
{
uint8_t *align_buf = NULL;
-#ifdef SYS_MACOSX
+#if SYS_MACOSX
/* Mac OS X always returns 16 bytes aligned memory */
align_buf = malloc( i_size );
-#elif defined( HAVE_MALLOC_H )
+#elif HAVE_MALLOC_H
align_buf = memalign( 16, i_size );
#else
uint8_t *buf = malloc( i_size + 15 + sizeof(void **) + sizeof(int) );
{
if( p )
{
-#if defined( HAVE_MALLOC_H ) || defined( SYS_MACOSX )
+#if HAVE_MALLOC_H || SYS_MACOSX
free( p );
#else
free( *( ( ( void **) p ) - 1 ) );
x264_deblock_function_t loopf;
x264_bitstream_function_t bsf;
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
struct visualize_t *visualize;
#endif
x264_lookahead_t *lookahead;
#include "macroblock.h"
#include "rectangle.h"
-#ifdef HAVE_MMX
+#if HAVE_MMX
#include "x86/util.h"
#endif
#include "common.h"
#include "cpu.h"
-#if defined(HAVE_PTHREAD) && defined(SYS_LINUX)
+#if HAVE_PTHREAD && SYS_LINUX
#include <sched.h>
#endif
-#ifdef SYS_BEOS
+#if SYS_BEOS
#include <kernel/OS.h>
#endif
-#if defined(SYS_MACOSX) || defined(SYS_FREEBSD)
+#if SYS_MACOSX || SYS_FREEBSD
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
-#ifdef SYS_OPENBSD
+#if SYS_OPENBSD
#include <sys/param.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
{"", 0},
};
-#if (defined(ARCH_PPC) && defined(SYS_LINUX)) || (defined(ARCH_ARM) && !defined(HAVE_NEON))
+#if (ARCH_PPC && SYS_LINUX) || (ARCH_ARM && !HAVE_NEON)
#include <signal.h>
#include <setjmp.h>
static sigjmp_buf jmpbuf;
}
#endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
int x264_cpu_cpuid_test( void );
uint32_t x264_cpu_cpuid( uint32_t op, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx );
int max_extended_cap;
int cache;
-#ifndef ARCH_X86_64
+#if !ARCH_X86_64
if( !x264_cpu_cpuid_test() )
return 0;
#endif
x264_log( NULL, X264_LOG_WARNING, "unable to determine cacheline size\n" );
}
-#ifdef BROKEN_STACK_ALIGNMENT
+#if BROKEN_STACK_ALIGNMENT
cpu |= X264_CPU_STACK_MOD4;
#endif
return cpu;
}
-#elif defined( ARCH_PPC )
+#elif ARCH_PPC
-#if defined(SYS_MACOSX) || defined(SYS_OPENBSD)
+#if SYS_MACOSX || SYS_OPENBSD
#include <sys/sysctl.h>
uint32_t x264_cpu_detect( void )
{
/* Thank you VLC */
uint32_t cpu = 0;
-#ifdef SYS_OPENBSD
+#if SYS_OPENBSD
int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
#else
int selectors[2] = { CTL_HW, HW_VECTORUNIT };
return cpu;
}
-#elif defined( SYS_LINUX )
+#elif SYS_LINUX
uint32_t x264_cpu_detect( void )
{
}
#endif
-#elif defined( ARCH_ARM )
+#elif ARCH_ARM
void x264_cpu_neon_test();
int x264_cpu_fast_neon_mrc_test();
uint32_t x264_cpu_detect( void )
{
int flags = 0;
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
flags |= X264_CPU_ARMV6;
// don't do this hack if compiled with -mfpu=neon
-#ifndef HAVE_NEON
+#if !HAVE_NEON
static void (* oldsig)( int );
oldsig = signal( SIGILL, sigill_handler );
if( sigsetjmp( jmpbuf, 1 ) )
int x264_cpu_num_processors( void )
{
-#if !defined(HAVE_PTHREAD)
+#if !HAVE_PTHREAD
return 1;
#elif defined(_WIN32)
return pthread_num_processors_np();
-#elif defined(SYS_LINUX)
+#elif SYS_LINUX
unsigned int bit;
int np;
cpu_set_t p_aff;
np += (((uint8_t *)&p_aff)[bit / 8] >> (bit % 8)) & 1;
return np;
-#elif defined(SYS_BEOS)
+#elif SYS_BEOS
system_info info;
get_system_info( &info );
return info.cpu_count;
-#elif defined(SYS_MACOSX) || defined(SYS_FREEBSD) || defined(SYS_OPENBSD)
+#elif SYS_MACOSX || SYS_FREEBSD || SYS_OPENBSD
int numberOfCPUs;
size_t length = sizeof( numberOfCPUs );
-#ifdef SYS_OPENBSD
+#if SYS_OPENBSD
int mib[2] = { CTL_HW, HW_NCPU };
if( sysctl(mib, 2, &numberOfCPUs, &length, NULL, 0) )
#else
int x264_cpu_num_processors( void );
void x264_cpu_emms( void );
void x264_cpu_sfence( void );
-#ifdef HAVE_MMX
+#if HAVE_MMX
#define x264_emms() x264_cpu_emms()
#else
#define x264_emms()
* problem, but I don't want to require such a new version.
* This applies only to x86_32, since other architectures that need alignment
* either have ABIs that ensure aligned stack, or don't support it at all. */
-#if defined(ARCH_X86) && defined(HAVE_MMX)
+#if ARCH_X86 && HAVE_MMX
int x264_stack_align( void (*func)(), ... );
#define x264_stack_align(func,...) x264_stack_align((void (*)())func, __VA_ARGS__)
#else
*****************************************************************************/
#include "common.h"
-#ifdef HAVE_MMX
+#if HAVE_MMX
# include "x86/dct.h"
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
# include "ppc/dct.h"
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
# include "arm/dct.h"
#endif
dctf->dct4x4dc = dct4x4dc;
dctf->idct4x4dc = idct4x4dc;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMX )
{
dctf->sub4x4_dct = x264_sub4x4_dct_mmx;
dctf->idct4x4dc = x264_idct4x4dc_mmx;
dctf->sub8x8_dct_dc = x264_sub8x8_dct_dc_mmxext;
-#ifndef ARCH_X86_64
+#if !ARCH_X86_64
dctf->sub8x8_dct = x264_sub8x8_dct_mmx;
dctf->sub16x16_dct = x264_sub16x16_dct_mmx;
dctf->add8x8_idct = x264_add8x8_idct_mmx;
#endif //HAVE_MMX
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
{
dctf->sub4x4_dct = x264_sub4x4_dct_altivec;
}
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
if( cpu&X264_CPU_NEON )
{
dctf->sub4x4_dct = x264_sub4x4_dct_neon;
pf->sub_8x8 = zigzag_sub_8x8_field;
pf->sub_4x4 = zigzag_sub_4x4_field;
pf->sub_4x4ac = zigzag_sub_4x4ac_field;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMXEXT )
{
pf->scan_4x4 = x264_zigzag_scan_4x4_field_mmxext;
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
pf->scan_4x4 = x264_zigzag_scan_4x4_field_altivec;
#endif
pf->sub_8x8 = zigzag_sub_8x8_frame;
pf->sub_4x4 = zigzag_sub_4x4_frame;
pf->sub_4x4ac = zigzag_sub_4x4ac_frame;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMX )
pf->scan_4x4 = x264_zigzag_scan_4x4_frame_mmx;
if( cpu&X264_CPU_MMXEXT )
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
pf->scan_4x4 = x264_zigzag_scan_4x4_frame_altivec;
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
if( cpu&X264_CPU_NEON )
pf->scan_4x4 = x264_zigzag_scan_4x4_frame_neon;
#endif
}
pf->interleave_8x8_cavlc = zigzag_interleave_8x8_cavlc;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMX )
pf->interleave_8x8_cavlc = x264_zigzag_interleave_8x8_cavlc_mmx;
if( cpu&X264_CPU_SHUFFLE_IS_FAST )
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
void x264_deblock_v_chroma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 );
void x264_deblock_h_chroma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 );
void x264_deblock_v_chroma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta );
void x264_deblock_strength_ssse3 ( uint8_t nnz[X264_SCAN8_SIZE], int8_t ref[2][X264_SCAN8_LUMA_SIZE],
int16_t mv[2][X264_SCAN8_LUMA_SIZE][2], uint8_t bs[2][4][4],
int mvy_limit, int bframe );
-#ifdef ARCH_X86
+#if ARCH_X86
void x264_deblock_h_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 );
void x264_deblock_v8_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 );
void x264_deblock_h_luma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta );
#endif
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
void x264_deblock_v_luma_altivec( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 );
void x264_deblock_h_luma_altivec( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 );
#endif // ARCH_PPC
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
void x264_deblock_v_luma_neon( uint8_t *, int, int, int, int8_t * );
void x264_deblock_h_luma_neon( uint8_t *, int, int, int, int8_t * );
void x264_deblock_v_chroma_neon( uint8_t *, int, int, int, int8_t * );
pf->deblock_chroma_intra[0] = deblock_h_chroma_intra_c;
pf->deblock_strength = deblock_strength_c;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMXEXT )
{
pf->deblock_chroma[1] = x264_deblock_v_chroma_mmxext;
pf->deblock_chroma[0] = x264_deblock_h_chroma_mmxext;
pf->deblock_chroma_intra[1] = x264_deblock_v_chroma_intra_mmxext;
pf->deblock_chroma_intra[0] = x264_deblock_h_chroma_intra_mmxext;
-#ifdef ARCH_X86
+#if ARCH_X86
pf->deblock_luma[1] = x264_deblock_v_luma_mmxext;
pf->deblock_luma[0] = x264_deblock_h_luma_mmxext;
pf->deblock_luma_intra[1] = x264_deblock_v_luma_intra_mmxext;
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
{
pf->deblock_luma[1] = x264_deblock_v_luma_altivec;
}
#endif // HAVE_ALTIVEC
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
if( cpu&X264_CPU_NEON )
{
pf->deblock_luma[1] = x264_deblock_v_luma_neon;
int dpy_depth = DefaultDepth( disp_display, screen );
XImage *ximage = XCreateImage( disp_display, visual, dpy_depth, ZPixmap, 0, &dummy, width, height, 8, 0 );
disp_chkerror( !ximage, "no ximage" );
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
ximage->byte_order = MSBFirst;
ximage->bitmap_bit_order = MSBFirst;
#else
static ALWAYS_INLINE uint32_t pack16to32( int a, int b )
{
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
return b + (a<<16);
#else
return a + (b<<16);
}
static ALWAYS_INLINE uint32_t pack8to16( int a, int b )
{
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
return b + (a<<8);
#else
return a + (b<<8);
}
static ALWAYS_INLINE uint32_t pack8to32( int a, int b, int c, int d )
{
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
return d + (c<<8) + (b<<16) + (a<<24);
#else
return a + (b<<8) + (c<<16) + (d<<24);
}
static ALWAYS_INLINE uint32_t pack16to32_mask( int a, int b )
{
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
return (b&0xFFFF) + (a<<16);
#else
return (a&0xFFFF) + (b<<16);
#include "common.h"
-#ifdef HAVE_MMX
+#if HAVE_MMX
#include "x86/mc.h"
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
#include "ppc/mc.h"
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
#include "arm/mc.h"
#endif
}
}
-#if defined(__GNUC__) && (defined(ARCH_X86) || defined(ARCH_X86_64))
+#if defined(__GNUC__) && (ARCH_X86 || ARCH_X86_64)
// gcc isn't smart enough to use the "idiv" instruction
static ALWAYS_INLINE int32_t div_64_32(int64_t x, int32_t y)
{
pf->mbtree_propagate_cost = mbtree_propagate_cost;
-#ifdef HAVE_MMX
+#if HAVE_MMX
x264_mc_init_mmx( cpu, pf );
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
x264_mc_altivec_init( pf );
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
x264_mc_init_arm( cpu, pf );
#endif
}
#include "config.h"
-#ifdef HAVE_STDINT_H
+#if HAVE_STDINT_H
#include <stdint.h>
#else
#include <inttypes.h>
#endif
-#ifndef HAVE_LOG2F
+#if !HAVE_LOG2F
#define log2f(x) (logf(x)/0.693147180559945f)
#define log2(x) (log(x)/0.693147180559945)
#endif
#include <fcntl.h> // _O_BINARY
#endif
-#if (defined(SYS_OPENBSD) && !defined(isfinite)) || defined(SYS_SunOS)
+#if (SYS_OPENBSD && !defined(isfinite)) || SYS_SunOS
#define isfinite finite
#endif
#ifdef _WIN32
// - armcc can't either, but is nice enough to actually tell you so
// - Apple gcc only maintains 4 byte alignment
// - llvm can align the stack, but only in svn and (unrelated) it exposes bugs in all released GNU binutils...
-#if defined(ARCH_ARM) && defined(SYS_MACOSX)
+#if ARCH_ARM && SYS_MACOSX
#define ALIGNED_ARRAY_8( type, name, sub1, ... )\
uint8_t name##_u [sizeof(type sub1 __VA_ARGS__) + 7]; \
type (*name) __VA_ARGS__ = (void*)((intptr_t)(name##_u+7) & ~7)
ALIGNED_8( type name sub1 __VA_ARGS__ )
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
#define ALIGNED_ARRAY_16( type, name, sub1, ... )\
uint8_t name##_u [sizeof(type sub1 __VA_ARGS__) + 15];\
type (*name) __VA_ARGS__ = (void*)((intptr_t)(name##_u+15) & ~15)
#endif
/* threads */
-#if defined(SYS_BEOS)
+#if SYS_BEOS
#include <kernel/OS.h>
#define x264_pthread_t thread_id
static inline int x264_pthread_create( x264_pthread_t *t, void *a, void *(*f)(void *), void *d )
#endif
#define HAVE_PTHREAD 1
-#elif defined(HAVE_PTHREAD)
+#elif HAVE_PTHREAD
#include <pthread.h>
-#define USE_REAL_PTHREAD
+#define USE_REAL_PTHREAD 1
#else
#define x264_pthread_t int
#define x264_pthread_join(t,s)
#endif //SYS_*
-#ifdef USE_REAL_PTHREAD
+#if USE_REAL_PTHREAD
#define x264_pthread_t pthread_t
#define x264_pthread_create pthread_create
#define x264_pthread_join pthread_join
#if !defined(_WIN64) && !defined(__LP64__)
#if defined(__INTEL_COMPILER)
-#define BROKEN_STACK_ALIGNMENT /* define it if stack is not mod16 */
+#define BROKEN_STACK_ALIGNMENT 1 /* define it if stack is not mod16 */
#endif
#endif
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
#define endian_fix(x) (x)
#define endian_fix64(x) (x)
#define endian_fix32(x) (x)
#define endian_fix16(x) (x)
#else
-#if defined(__GNUC__) && defined(HAVE_MMX)
+#if defined(__GNUC__) && HAVE_MMX
static ALWAYS_INLINE uint32_t endian_fix32( uint32_t x )
{
asm("bswap %0":"+r"(x));
return x;
}
-#elif defined(__GNUC__) && defined(HAVE_ARMV6)
+#elif defined(__GNUC__) && HAVE_ARMV6
static ALWAYS_INLINE uint32_t endian_fix32( uint32_t x )
{
asm("rev %0, %0":"+r"(x));
return (x<<24) + ((x<<8)&0xff0000) + ((x>>8)&0xff00) + (x>>24);
}
#endif
-#if defined(__GNUC__) && defined(ARCH_X86_64)
+#if defined(__GNUC__) && ARCH_X86_64
static ALWAYS_INLINE uint64_t endian_fix64( uint64_t x )
{
asm("bswap %0":"+r"(x));
}
#endif
-#if defined(__GNUC__) && defined(HAVE_MMX)
+#if defined(__GNUC__) && HAVE_MMX
/* Don't use __builtin_prefetch; even as recent as 4.3.4, GCC seems incapable of
* using complex address modes properly unless we use inline asm. */
static ALWAYS_INLINE void x264_prefetch( void *p )
/* We require that prefetch not fault on invalid reads, so we only enable it on
* known architectures. */
#elif defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 1) &&\
- (defined(ARCH_X86) || defined(ARCH_X86_64) || defined(ARCH_ARM) || defined(ARCH_PPC))
+ (ARCH_X86 || ARCH_X86_64 || ARCH_ARM || ARCH_PPC)
#define x264_prefetch(x) __builtin_prefetch(x)
#else
#define x264_prefetch(x)
#endif
-#ifdef USE_REAL_PTHREAD
-#ifdef SYS_MINGW
+#if USE_REAL_PTHREAD
+#if SYS_MINGW
#define x264_lower_thread_priority(p)\
{\
x264_pthread_t handle = pthread_self();\
#include "common.h"
-#ifdef HAVE_MMX
+#if HAVE_MMX
# include "x86/pixel.h"
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
# include "ppc/pixel.h"
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
# include "arm/pixel.h"
#endif
-#ifdef ARCH_UltraSparc
+#if ARCH_UltraSparc
# include "sparc/pixel.h"
#endif
SAD_X( 4x8 )
SAD_X( 4x4 )
-#ifdef ARCH_UltraSparc
+#if ARCH_UltraSparc
SAD_X( 16x16_vis )
SAD_X( 16x8_vis )
SAD_X( 8x16_vis )
SATD_X( 4x4, cpu )
SATD_X_DECL7()
-#ifdef HAVE_MMX
+#if HAVE_MMX
SATD_X_DECL7( _mmxext )
SATD_X_DECL6( _sse2 )
SATD_X_DECL7( _ssse3 )
SATD_X_DECL7( _sse4 )
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
SATD_X_DECL7( _neon )
#endif
pixf->intra_sad_x3_16x16 = x264_intra_sad_x3_16x16;
pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMX )
{
INIT7( ssd, _mmx );
INIT_ADS( _mmxext );
pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_mmxext;
pixf->var[PIXEL_8x8] = x264_pixel_var_8x8_mmxext;
-#ifdef ARCH_X86
+#if ARCH_X86
pixf->sa8d[PIXEL_16x16] = x264_pixel_sa8d_16x16_mmxext;
pixf->sa8d[PIXEL_8x8] = x264_pixel_sa8d_8x8_mmxext;
pixf->intra_sa8d_x3_8x8 = x264_intra_sa8d_x3_8x8_mmxext;
pixf->ssim_end4 = x264_pixel_ssim_end4_sse2;
pixf->sa8d[PIXEL_16x16] = x264_pixel_sa8d_16x16_sse2;
pixf->sa8d[PIXEL_8x8] = x264_pixel_sa8d_8x8_sse2;
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
pixf->intra_sa8d_x3_8x8 = x264_intra_sa8d_x3_8x8_sse2;
#endif
pixf->var2_8x8 = x264_pixel_var2_8x8_sse2;
if( cpu&X264_CPU_CACHELINE_64 )
{
INIT2( ssd, _sse2); /* faster for width 16 on p4 */
-#ifdef ARCH_X86
+#if ARCH_X86
INIT2( sad, _cache64_sse2 );
INIT2( sad_x3, _cache64_sse2 );
INIT2( sad_x4, _cache64_sse2 );
pixf->intra_satd_x3_8x8c = x264_intra_satd_x3_8x8c_ssse3;
pixf->intra_sad_x3_8x8c = x264_intra_sad_x3_8x8c_ssse3;
pixf->intra_satd_x3_4x4 = x264_intra_satd_x3_4x4_ssse3;
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
pixf->intra_sa8d_x3_8x8 = x264_intra_sa8d_x3_8x8_ssse3;
#endif
pixf->var2_8x8 = x264_pixel_var2_8x8_ssse3;
}
#endif //HAVE_MMX
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
if( cpu&X264_CPU_ARMV6 )
{
pixf->sad[PIXEL_4x8] = x264_pixel_sad_4x8_armv6;
}
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
{
x264_pixel_altivec_init( pixf );
}
#endif
-#ifdef ARCH_UltraSparc
+#if ARCH_UltraSparc
INIT4( sad, _vis );
INIT4( sad_x3, _vis );
INIT4( sad_x4, _vis );
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
*****************************************************************************/
-#ifdef HAVE_ALTIVEC_H
+#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
#include "common.h"
-#ifdef HAVE_MMX
+#if HAVE_MMX
# include "x86/predict.h"
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
# include "ppc/predict.h"
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
# include "arm/predict.h"
#endif
pf[I_PRED_16x16_DC_TOP ]= x264_predict_16x16_dc_top_c;
pf[I_PRED_16x16_DC_128 ]= x264_predict_16x16_dc_128_c;
-#ifdef HAVE_MMX
+#if HAVE_MMX
x264_predict_16x16_init_mmx( cpu, pf );
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
x264_predict_16x16_init_altivec( pf );
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
x264_predict_16x16_init_arm( cpu, pf );
#endif
}
pf[I_PRED_CHROMA_DC_TOP ]= x264_predict_8x8c_dc_top_c;
pf[I_PRED_CHROMA_DC_128 ]= x264_predict_8x8c_dc_128_c;
-#ifdef HAVE_MMX
+#if HAVE_MMX
x264_predict_8x8c_init_mmx( cpu, pf );
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC )
x264_predict_8x8c_init_altivec( pf );
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
x264_predict_8x8c_init_arm( cpu, pf );
#endif
}
pf[I_PRED_8x8_DC_128] = x264_predict_8x8_dc_128_c;
*predict_filter = x264_predict_8x8_filter_c;
-#ifdef HAVE_MMX
+#if HAVE_MMX
x264_predict_8x8_init_mmx( cpu, pf, predict_filter );
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
x264_predict_8x8_init_arm( cpu, pf, predict_filter );
#endif
}
pf[I_PRED_4x4_DC_TOP] = x264_predict_4x4_dc_top_c;
pf[I_PRED_4x4_DC_128] = x264_predict_4x4_dc_128_c;
-#ifdef HAVE_MMX
+#if HAVE_MMX
x264_predict_4x4_init_mmx( cpu, pf );
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
x264_predict_4x4_init_arm( cpu, pf );
#endif
}
#include "common.h"
-#ifdef HAVE_MMX
+#if HAVE_MMX
#include "x86/quant.h"
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
# include "ppc/quant.h"
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
# include "arm/quant.h"
#endif
pf->coeff_level_run[ DCT_LUMA_AC] = x264_coeff_level_run15;
pf->coeff_level_run[ DCT_LUMA_4x4] = x264_coeff_level_run16;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( cpu&X264_CPU_MMX )
{
-#ifdef ARCH_X86
+#if ARCH_X86
pf->quant_4x4 = x264_quant_4x4_mmx;
pf->quant_8x8 = x264_quant_8x8_mmx;
pf->dequant_4x4 = x264_dequant_4x4_mmx;
if( cpu&X264_CPU_MMXEXT )
{
pf->quant_2x2_dc = x264_quant_2x2_dc_mmxext;
-#ifdef ARCH_X86
+#if ARCH_X86
pf->quant_4x4_dc = x264_quant_4x4_dc_mmxext;
pf->decimate_score15 = x264_decimate_score15_mmxext;
pf->decimate_score16 = x264_decimate_score16_mmxext;
}
#endif // HAVE_MMX
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if( cpu&X264_CPU_ALTIVEC ) {
pf->quant_2x2_dc = x264_quant_2x2_dc_altivec;
pf->quant_4x4_dc = x264_quant_4x4_dc_altivec;
}
#endif
-#ifdef HAVE_ARMV6
+#if HAVE_ARMV6
if( cpu&X264_CPU_ARMV6 )
pf->coeff_last[DCT_CHROMA_DC] = x264_coeff_last4_arm;
#define x264_pixel_avg2_w12_sse2 x264_pixel_avg2_w16_sse2
PIXEL_AVG_WTAB(mmxext, mmxext, mmxext, mmxext, mmxext, mmxext)
-#ifdef ARCH_X86
+#if ARCH_X86
PIXEL_AVG_WTAB(cache32_mmxext, mmxext, cache32_mmxext, cache32_mmxext, cache32_mmxext, cache32_mmxext)
PIXEL_AVG_WTAB(cache64_mmxext, mmxext, cache64_mmxext, cache64_mmxext, cache64_mmxext, cache64_mmxext)
#endif
}
MC_LUMA(mmxext,mmxext,mmx)
-#ifdef ARCH_X86
+#if ARCH_X86
MC_LUMA(cache32_mmxext,cache32_mmxext,mmx)
MC_LUMA(cache64_mmxext,cache64_mmxext,mmx)
#endif
}
GET_REF(mmxext)
-#ifdef ARCH_X86
+#if ARCH_X86
GET_REF(cache32_mmxext)
GET_REF(cache64_mmxext)
#endif
HPEL(8, mmxext, mmxext, mmxext, mmxext)
HPEL(16, sse2_amd, mmxext, mmxext, sse2)
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
void x264_hpel_filter_sse2( uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *src, int stride, int width, int height, int16_t *buf );
void x264_hpel_filter_ssse3( uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *src, int stride, int width, int height, int16_t *buf );
#else
pf->prefetch_fenc = x264_prefetch_fenc_mmxext;
pf->prefetch_ref = x264_prefetch_ref_mmxext;
-#ifdef ARCH_X86 // all x86_64 cpus with cacheline split issues use sse2 instead
+#if ARCH_X86 // all x86_64 cpus with cacheline split issues use sse2 instead
if( cpu&X264_CPU_CACHELINE_32 )
{
pf->mc_luma = mc_luma_cache32_mmxext;
x264_predict_8x8c_dc_core_mmxext( src, s2, s3 );
}
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
static void x264_predict_8x8c_dc_left( uint8_t *src )
{
int y;
x264_intra_sa8d_x3_8x8_core_##cpu( fenc, sa8d_1d, res );\
}
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
INTRA_SA8D_X3(sse2)
INTRA_SA8D_X3(ssse3)
#else
pf[I_PRED_16x16_DC] = x264_predict_16x16_dc_mmxext;
pf[I_PRED_16x16_DC_TOP] = x264_predict_16x16_dc_top_mmxext;
pf[I_PRED_16x16_DC_LEFT] = x264_predict_16x16_dc_left_mmxext;
-#ifndef ARCH_X86_64
+#if !ARCH_X86_64
pf[I_PRED_16x16_P] = x264_predict_16x16_p_mmxext;
#endif
pf[I_PRED_16x16_H] = x264_predict_16x16_h_mmxext;
{
if( !(cpu&X264_CPU_MMX) )
return;
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
pf[I_PRED_CHROMA_DC_LEFT] = x264_predict_8x8c_dc_left;
#endif
pf[I_PRED_CHROMA_V] = x264_predict_8x8c_v_mmx;
return;
pf[I_PRED_CHROMA_DC_TOP] = x264_predict_8x8c_dc_top_mmxext;
pf[I_PRED_CHROMA_H] = x264_predict_8x8c_h_mmxext;
-#ifndef ARCH_X86_64
+#if !ARCH_X86_64
pf[I_PRED_CHROMA_P] = x264_predict_8x8c_p_mmxext;
#endif
pf[I_PRED_CHROMA_DC] = x264_predict_8x8c_dc_mmxext;
pf[I_PRED_8x8_DC_LEFT]= x264_predict_8x8_dc_left_mmxext;
pf[I_PRED_8x8_HD] = x264_predict_8x8_hd_mmxext;
*predict_8x8_filter = x264_predict_8x8_filter_mmxext;
-#ifdef ARCH_X86
+#if ARCH_X86
pf[I_PRED_8x8_DDL] = x264_predict_8x8_ddl_mmxext;
pf[I_PRED_8x8_DDR] = x264_predict_8x8_ddr_mmxext;
pf[I_PRED_8x8_VR] = x264_predict_8x8_vr_mmxext;
echo "available options:"
echo ""
echo " --help print this message"
-echo " --disable-avs-input disables avisynth input (win32 only)"
-echo " --disable-lavf-input disables libavformat input"
-echo " --disable-ffms-input disables ffmpegsource input"
-echo " --disable-mp4-output disables mp4 output (using gpac)"
+echo " --disable-avs disables avisynth support (windows only)"
+echo " --disable-lavf disables libavformat support"
+echo " --disable-ffms disables ffmpegsource support"
+echo " --disable-gpac disables gpac support"
echo " --disable-pthread disables multithreaded encoding"
echo " --disable-asm disables platform-specific assembly optimizations"
echo " --enable-debug adds -g, doesn't strip"
}
define() {
- echo "#define $1$([ -n "$2" ] && echo " $2")" >> config.h
+ echo "#define $1$([ -n "$2" ] && echo " $2" || echo " 1")" >> config.h
}
die() {
includedir='${prefix}/include'
DEVNULL='/dev/null'
-avs_input="auto"
-lavf_input="auto"
-ffms_input="auto"
-mp4_output="auto"
+avs="auto"
+lavf="auto"
+ffms="auto"
+gpac="auto"
pthread="auto"
asm="auto"
debug="no"
--disable-asm)
asm="no"
;;
- --disable-avs-input)
- avs_input="no"
+ --disable-avs)
+ avs="no"
;;
- --disable-lavf-input)
- lavf_input="no"
+ --disable-lavf)
+ lavf="no"
;;
- --disable-ffms-input)
- ffms_input="no"
+ --disable-ffms)
+ ffms="no"
;;
- --disable-mp4-output)
- mp4_output="no"
+ --disable-gpac)
+ gpac="no"
;;
--extra-asflags=*)
ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
vis="no"
fi
-if [ "$lavf_input" = "auto" ] ; then
- lavf_input="no"
+if [ "$lavf" = "auto" ] ; then
+ lavf="no"
if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>$DEVNULL; then
LAVF_LIBS="$LAVF_LIBS $(${cross_prefix}pkg-config --libs libavformat libavcodec libswscale)"
LAVF_CFLAGS="$LAVF_CFLAGS $(${cross_prefix}pkg-config --cflags libavformat libavcodec libswscale)"
cc_check libswscale/swscale.h "$LAVF_CFLAGS $LAVF_LIBS" ; then
# avcodec_decode_video2 is currently the most recently added function that we use; it was added in r18351
if cc_check libavformat/avformat.h "$LAVF_CFLAGS $LAVF_LIBS" "avcodec_decode_video2( NULL, NULL, NULL, NULL );" ; then
- lavf_input="yes"
- define LAVF_INPUT
+ lavf="yes"
+ define HAVE_LAVF
else
echo "Warning: libavformat is too old, update to ffmpeg r18351+"
fi
fi
fi
-if [ "$ffms_input" = "auto" ] ; then
+if [ "$ffms" = "auto" ] ; then
ffms_major="2"; ffms_minor="13"; ffms_micro="1"; ffms_bump="0"
- ffms_input="no"
+ ffms="no"
[ $ffms_micro -gt 0 -o $ffms_bump -gt 0 ] && vmicro=".$ffms_micro"
[ $ffms_bump -gt 0 ] && vbump=".$ffms_bump"
if ${cross_prefix}pkg-config --atleast-version="$ffms_major.$ffms_minor$vmicro$vbump" ffms2 2>$DEVNULL; then
[ -z "$FFMS2_LIBS" ] && FFMS2_LIBS="-lffms2"
if cc_check ffms.h "$FFMS2_CFLAGS $FFMS2_LIBS" "FFMS_DestroyVideoSource(0);" ; then
- ffms_input="yes"
+ ffms="yes"
elif cc_check ffms.h "$FFMS2_CFLAGS $FFMS2_LIBS -lstdc++ $LAVF_LIBS" "FFMS_DestroyVideoSource(0);" ; then
- ffms_input="yes"
+ ffms="yes"
FFMS2_LIBS="$FFMS2_LIBS -lstdc++ $LAVF_LIBS"
fi
- if [ $api_check = "yes" -a $ffms_input = "yes" ]; then
+ if [ $api_check = "yes" -a $ffms = "yes" ]; then
log_check "whether ffms2 version is at least $ffms_major.$ffms_minor$vmicro$vbump"
$CC $CFLAGS $FFMS2_CFLAGS -c -o conftest -x c - >$DEVNULL 2>&1 <<EOF
#include <ffms.h>
#error Requires ffms2 version 2.13.1
#endif
EOF
- [ $? = 0 ] && log_ok || { ffms_input="no"; log_fail; }
+ [ $? = 0 ] && log_ok || { ffms="no"; log_fail; }
fi
fi
-if [ "$ffms_input" = "yes" ]; then
+if [ "$ffms" = "yes" ]; then
LDFLAGSCLI="$FFMS2_LIBS $LDFLAGSCLI"
[ -n "$FFMS2_CFLAGS" ] && CFLAGS="$CFLAGS $FFMS2_CFLAGS"
- define FFMS_INPUT
-elif [ "$lavf_input" = "yes" ]; then
+ define HAVE_FFMS
+elif [ "$lavf" = "yes" ]; then
LDFLAGSCLI="$LAVF_LIBS $LDFLAGSCLI"
[ -n "$LAVF_CFLAGS" ] && CFLAGS="$CFLAGS $LAVF_CFLAGS"
fi
-MP4_LDFLAGS="-lgpac_static"
+GPAC_LIBS="-lgpac_static"
if [ $SYS = MINGW ]; then
- MP4_LDFLAGS="$MP4_LDFLAGS -lwinmm"
+ GPAC_LIBS="$GPAC_LIBS -lwinmm"
fi
-if [ "$mp4_output" = "auto" ] ; then
- mp4_output="no"
- if cc_check gpac/isomedia.h "$MP4_LDFLAGS" ; then
- if cc_check gpac/isomedia.h "$MP4_LDFLAGS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0);" ; then
- mp4_output="yes"
+if [ "$gpac" = "auto" ] ; then
+ gpac="no"
+ if cc_check gpac/isomedia.h "$GPAC_LIBS" ; then
+ if cc_check gpac/isomedia.h "$GPAC_LIBS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0);" ; then
+ gpac="yes"
else
echo "Warning: gpac is too old, update to 2007-06-21 UTC or later"
fi
fi
fi
-if [ "$mp4_output" = "yes" ] ; then
- define MP4_OUTPUT
- if cc_check gpac/isomedia.h "-Werror $MP4_LDFLAGS" "gf_malloc(1); gf_free(NULL);" ; then
+if [ "$gpac" = "yes" ] ; then
+ define HAVE_GPAC
+ if cc_check gpac/isomedia.h "-Werror $GPAC_LIBS" "gf_malloc(1); gf_free(NULL);" ; then
define HAVE_GF_MALLOC
fi
- LDFLAGSCLI="$LDFLAGSCLI $MP4_LDFLAGS"
+ LDFLAGSCLI="$LDFLAGSCLI $GPAC_LIBS"
fi
-if [ "$avs_input" = "auto" ] ; then
- avs_input=no
+if [ "$avs" = "auto" ] ; then
+ avs=no
if [ $SYS = MINGW ] && cc_check avisynth_c.h ; then
- avs_input="yes"
- define AVS_INPUT
+ avs="yes"
+ define HAVE_AVS
define HAVE_AVISYNTH_C_H
elif [ $SYS = MINGW ] && cc_check extras/avisynth_c.h ; then
- avs_input="yes"
- define AVS_INPUT
+ avs="yes"
+ define HAVE_AVS
fi
fi
Platform: $ARCH
System: $SYS
asm: $asm
-avs input: $avs_input
-lavf input: $lavf_input
-ffms input: $ffms_input
-mp4 output: $mp4_output
+avs: $avs
+lavf: $lavf
+ffms: $ffms
+gpac: $gpac
pthread: $pthread
debug: $debug
gprof: $gprof
#include "macroblock.h"
#include "me.h"
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
#include "common/visualize.h"
#endif
static int x264_validate_parameters( x264_t *h )
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
#ifdef __SSE__
if( !(x264_cpu_detect() & X264_CPU_SSE) )
{
h->param.i_threads = x264_clip3( h->param.i_threads, 1, X264_THREAD_MAX );
if( h->param.i_threads > 1 )
{
-#ifndef HAVE_PTHREAD
+#if !HAVE_PTHREAD
x264_log( h, X264_LOG_WARNING, "not compiled with pthread support!\n");
h->param.i_threads = 1;
#endif
h->param.rc.b_mb_tree = 0;
if( h->param.rc.b_stat_read )
h->param.rc.i_lookahead = 0;
-#ifdef HAVE_PTHREAD
+#if HAVE_PTHREAD
if( h->param.i_sync_lookahead < 0 )
h->param.i_sync_lookahead = h->param.i_bframe + 1;
h->param.i_sync_lookahead = X264_MIN( h->param.i_sync_lookahead, X264_LOOKAHEAD_MAX );
if( x264_clz( temp ) != 23 )
{
x264_log( h, X264_LOG_ERROR, "CLZ test failed: x264 has been miscompiled!\n" );
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
x264_log( h, X264_LOG_ERROR, "Are you attempting to run an SSE4a-targeted build on a CPU that\n" );
x264_log( h, X264_LOG_ERROR, "doesn't support it?\n" );
#endif
else
h->mb.b_reencode_mb = 0;
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
if( h->param.b_visualize )
x264_visualize_mb( h );
#endif
if( h->param.i_sync_lookahead )
x264_lower_thread_priority( 10 );
-#ifdef HAVE_MMX
+#if HAVE_MMX
/* Misalign mask has to be set separately for each thread. */
if( h->param.cpu&X264_CPU_SSE_MISALIGN )
x264_cpu_mask_misalign_sse();
#endif
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
if( h->param.b_visualize )
if( x264_visualize_init( h ) )
return (void *)-1;
h->sh.i_first_mb = h->sh.i_last_mb + 1;
}
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
if( h->param.b_visualize )
{
x264_visualize_show( h );
static int x264_threaded_slices_write( x264_t *h )
{
void *ret = NULL;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( h->param.cpu&X264_CPU_SSE_MISALIGN )
x264_cpu_mask_misalign_sse();
#endif
new_nonb->i_reference_count++;
}
-#ifdef HAVE_PTHREAD
+#if HAVE_PTHREAD
static void x264_lookahead_slicetype_decide( x264_t *h )
{
x264_stack_align( x264_slicetype_decide, h );
static void x264_lookahead_thread( x264_t *h )
{
int shift;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( h->param.cpu&X264_CPU_SSE_MISALIGN )
x264_cpu_mask_misalign_sse();
#endif
if( WORD_SIZE == 8 && sizeof(mvsad_t) == 8 )
{
uint64_t mvsad = M64( &mvsads[i] ) = M64( &mvsads[j] );
-#ifdef WORDS_BIGENDIAN
+#if WORDS_BIGENDIAN
mvsad >>= 32;
#endif
sad = mvsad;
#define __declspec(i)
#undef EXTERN_C
-#ifdef HAVE_AVISYNTH_C_H
+#if HAVE_AVISYNTH_C_H
#include <avisynth_c.h>
#else
#include "extras/avisynth_c.h"
#include "muxers.h"
#include <gpac/isomedia.h>
-#ifdef HAVE_GF_MALLOC
+#if HAVE_GF_MALLOC
#undef malloc
#undef free
#define malloc gf_malloc
#include "common/cpu.h"
// GCC doesn't align stack variables on ARM, so use .bss
-#ifdef ARCH_ARM
+#if ARCH_ARM
#undef ALIGNED_16
#define ALIGNED_16( var ) DECLARE_ALIGNED( static var, 16 )
#endif
static inline uint32_t read_time(void)
{
uint32_t a = 0;
-#if defined(__GNUC__) && (defined(ARCH_X86) || defined(ARCH_X86_64))
+#if defined(__GNUC__) && (ARCH_X86 || ARCH_X86_64)
asm volatile( "rdtsc" :"=a"(a) ::"edx" );
-#elif defined(ARCH_PPC)
+#elif ARCH_PPC
asm volatile( "mftb %0" : "=r" (a) );
-#elif defined(ARCH_ARM) // ARMv7 only
+#elif ARCH_ARM // ARMv7 only
asm volatile( "mrc p15, 0, %0, c9, c13, 0" : "=r"(a) );
#endif
return a;
}
}
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
int x264_stack_pagealign( int (*func)(), int align );
#else
#define x264_stack_pagealign( func, align ) func()
#define call_c1(func,...) func(__VA_ARGS__)
-#if defined(ARCH_X86) || defined(_WIN64)
+#if ARCH_X86 || defined(_WIN64)
/* detect when callee-saved regs aren't saved.
* needs an explicit asm check because it only sometimes crashes in normal use. */
intptr_t x264_checkasm_call( intptr_t (*func)(), int *ok, ... );
x264_cabac_encode_terminal_##cpu( &cb );\
}
DECL_CABAC(c)
-#ifdef HAVE_MMX
+#if HAVE_MMX
DECL_CABAC(asm)
#else
#define run_cabac_decision_asm run_cabac_decision_c
{
int ret = 0;
int cpu0 = 0, cpu1 = 0;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if( x264_cpu_detect() & X264_CPU_MMXEXT )
{
ret |= add_flags( &cpu0, &cpu1, X264_CPU_MMX | X264_CPU_MMXEXT, "MMX" );
ret |= add_flags( &cpu0, &cpu1, X264_CPU_CACHELINE_64, "MMX Cache64" );
cpu1 &= ~X264_CPU_CACHELINE_64;
-#ifdef ARCH_X86
+#if ARCH_X86
ret |= add_flags( &cpu0, &cpu1, X264_CPU_CACHELINE_32, "MMX Cache32" );
cpu1 &= ~X264_CPU_CACHELINE_32;
#endif
cpu1 &= ~X264_CPU_CACHELINE_64;
ret |= add_flags( &cpu0, &cpu1, X264_CPU_SSE4, "SSE4" );
}
-#elif defined(ARCH_PPC)
+#elif ARCH_PPC
if( x264_cpu_detect() & X264_CPU_ALTIVEC )
{
fprintf( stderr, "x264: ALTIVEC against C\n" );
ret = check_all_funcs( 0, X264_CPU_ALTIVEC );
}
-#elif defined(ARCH_ARM)
+#elif ARCH_ARM
if( x264_cpu_detect() & X264_CPU_ARMV6 )
ret |= add_flags( &cpu0, &cpu1, X264_CPU_ARMV6, "ARMv6" );
if( x264_cpu_detect() & X264_CPU_NEON )
if( argc > 1 && !strncmp( argv[1], "--bench", 7 ) )
{
-#if !defined(ARCH_X86) && !defined(ARCH_X86_64) && !defined(ARCH_PPC) && !defined(ARCH_ARM)
+#if !ARCH_X86 && !ARCH_X86_64 && !ARCH_PPC && !ARCH_ARM
fprintf( stderr, "no --bench for your cpu until you port rdtsc\n" );
return 1;
#endif
"auto",
"yuv",
"y4m",
-#ifdef AVS_INPUT
+#if HAVE_AVS
"avs",
#endif
-#ifdef LAVF_INPUT
+#if HAVE_LAVF
"lavf",
#endif
-#ifdef FFMS_INPUT
+#if HAVE_FFMS
"ffms",
#endif
0
"raw",
"mkv",
"flv",
-#ifdef MP4_OUTPUT
+#if HAVE_GPAC
"mp4",
#endif
0
cli_opt_t opt;
int ret;
-#ifdef PTW32_STATIC_LIB
+#if PTW32_STATIC_LIB
pthread_win32_process_attach_np();
pthread_win32_thread_attach_np();
#endif
ret = Encode( ¶m, &opt );
-#ifdef PTW32_STATIC_LIB
+#if PTW32_STATIC_LIB
pthread_win32_thread_detach_np();
pthread_win32_process_detach_np();
#endif
" --fullhelp List all options\n"
"\n",
X264_BUILD, X264_VERSION,
-#ifdef AVS_INPUT
+#if HAVE_AVS
"yes",
#else
"no",
#endif
-#ifdef LAVF_INPUT
+#if HAVE_LAVF
"yes",
#else
"no",
#endif
-#ifdef FFMS_INPUT
+#if HAVE_FFMS
"yes",
#else
"no",
#endif
-#ifdef MP4_OUTPUT
+#if HAVE_GPAC
"yes"
#else
"no"
if( !strcasecmp( ext, "mp4" ) )
{
-#ifdef MP4_OUTPUT
+#if HAVE_GPAC
output = mp4_output;
param->b_annexb = 0;
param->b_dts_compress = 0;
if( !strcasecmp( module, "avs" ) || !strcasecmp( ext, "d2v" ) || !strcasecmp( ext, "dga" ) )
{
-#ifdef AVS_INPUT
+#if HAVE_AVS
input = avs_input;
module = "avs";
#else
input = yuv_input;
else
{
-#ifdef FFMS_INPUT
+#if HAVE_FFMS
if( b_regular && (b_auto || !strcasecmp( demuxer, "ffms" )) &&
!ffms_input.open_file( filename, p_handle, info, opt ) )
{
input = ffms_input;
}
#endif
-#ifdef LAVF_INPUT
+#if HAVE_LAVF
if( (b_auto || !strcasecmp( demuxer, "lavf" )) &&
!lavf_input.open_file( filename, p_handle, info, opt ) )
{
input = lavf_input;
}
#endif
-#ifdef AVS_INPUT
+#if HAVE_AVS
if( b_regular && (b_auto || !strcasecmp( demuxer, "avs" )) &&
!avs_input.open_file( filename, p_handle, info, opt ) )
{
opt->b_progress = 0;
break;
case OPT_VISUALIZE:
-#ifdef HAVE_VISUALIZE
+#if HAVE_VISUALIZE
param->b_visualize = 1;
b_exit_on_ctrl_c = 1;
#else
param->vui.i_sar_height = info.sar_height;
}
-#ifdef HAVE_PTHREAD
+#if HAVE_PTHREAD
if( b_thread_input || param->i_threads > 1
|| (param->i_threads == X264_THREADS_AUTO && x264_cpu_num_processors() > 1) )
{
/* Callback for our DLL so we can initialize pthread */
BOOL WINAPI DllMain( HANDLE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
-#ifdef PTW32_STATIC_LIB
+#if PTW32_STATIC_LIB
switch( fdwReason )
{
case DLL_PROCESS_ATTACH: