cpu.h File Reference
#include "version.h"

Go to the source code of this file.

Macros

#define AVUTIL_CPU_H
 
#define AV_CPU_FLAG_FORCE   0x80000000 /* force usage of selected flags (OR) */
 
#define AV_CPU_FLAG_MMX   0x0001
 
#define AV_CPU_FLAG_MMXEXT   0x0002
 
#define AV_CPU_FLAG_MMX2   0x0002
 
#define AV_CPU_FLAG_3DNOW   0x0004
 
#define AV_CPU_FLAG_SSE   0x0008
 
#define AV_CPU_FLAG_SSE2   0x0010
 
#define AV_CPU_FLAG_SSE2SLOW   0x40000000
 
#define AV_CPU_FLAG_3DNOWEXT   0x0020
 
#define AV_CPU_FLAG_SSE3   0x0040
 
#define AV_CPU_FLAG_SSE3SLOW   0x20000000
 
#define AV_CPU_FLAG_SSSE3   0x0080
 
#define AV_CPU_FLAG_ATOM   0x10000000
 
#define AV_CPU_FLAG_SSE4   0x0100
 
#define AV_CPU_FLAG_SSE42   0x0200
 
#define AV_CPU_FLAG_AVX   0x4000
 
#define AV_CPU_FLAG_XOP   0x0400
 
#define AV_CPU_FLAG_FMA4   0x0800
 
#define AV_CPU_FLAG_CMOV   0x1000
 
#define AV_CPU_FLAG_ALTIVEC   0x0001
 
#define AV_CPU_FLAG_ARMV5TE   (1 << 0)
 
#define AV_CPU_FLAG_ARMV6   (1 << 1)
 
#define AV_CPU_FLAG_ARMV6T2   (1 << 2)
 
#define AV_CPU_FLAG_VFP   (1 << 3)
 
#define AV_CPU_FLAG_VFPV3   (1 << 4)
 
#define AV_CPU_FLAG_NEON   (1 << 5)
 
#define AV_CPU_FLAG_FORCE   0x80000000 /* force usage of selected flags (OR) */
 
#define AV_CPU_FLAG_MMX   0x0001
 standard MMX More...
 
#define AV_CPU_FLAG_MMXEXT   0x0002
 SSE integer functions or AMD MMX ext. More...
 
#define AV_CPU_FLAG_MMX2   0x0002
 SSE integer functions or AMD MMX ext. More...
 
#define AV_CPU_FLAG_3DNOW   0x0004
 AMD 3DNOW. More...
 
#define AV_CPU_FLAG_SSE   0x0008
 SSE functions. More...
 
#define AV_CPU_FLAG_SSE2   0x0010
 PIV SSE2 functions. More...
 
#define AV_CPU_FLAG_SSE2SLOW   0x40000000
 SSE2 supported, but usually not faster. More...
 
#define AV_CPU_FLAG_3DNOWEXT   0x0020
 AMD 3DNowExt. More...
 
#define AV_CPU_FLAG_SSE3   0x0040
 Prescott SSE3 functions. More...
 
#define AV_CPU_FLAG_SSE3SLOW   0x20000000
 SSE3 supported, but usually not faster. More...
 
#define AV_CPU_FLAG_SSSE3   0x0080
 Conroe SSSE3 functions. More...
 
#define AV_CPU_FLAG_ATOM   0x10000000
 Atom processor, some SSSE3 instructions are slower. More...
 
#define AV_CPU_FLAG_SSE4   0x0100
 Penryn SSE4.1 functions. More...
 
#define AV_CPU_FLAG_SSE42   0x0200
 Nehalem SSE4.2 functions. More...
 
#define AV_CPU_FLAG_AVX   0x4000
 AVX functions: requires OS support even if YMM registers aren't used. More...
 
#define AV_CPU_FLAG_XOP   0x0400
 Bulldozer XOP functions. More...
 
#define AV_CPU_FLAG_FMA4   0x0800
 Bulldozer FMA4 functions. More...
 
#define AV_CPU_FLAG_CMOV   0x1000
 i686 cmov More...
 
#define AV_CPU_FLAG_ALTIVEC   0x0001
 standard More...
 
#define AV_CPU_FLAG_ARMV5TE   (1 << 0)
 
#define AV_CPU_FLAG_ARMV6   (1 << 1)
 
#define AV_CPU_FLAG_ARMV6T2   (1 << 2)
 
#define AV_CPU_FLAG_VFP   (1 << 3)
 
#define AV_CPU_FLAG_VFPV3   (1 << 4)
 
#define AV_CPU_FLAG_NEON   (1 << 5)
 

Functions

int av_get_cpu_flags (void)
 Return the flags which specify extensions supported by the CPU. More...
 
void av_set_cpu_flags_mask (int mask)
 Set a mask on flags returned by av_get_cpu_flags(). More...
 
int av_parse_cpu_flags (const char *s)
 Parse CPU flags from a string. More...
 
int ff_get_cpu_flags_arm (void)
 
int ff_get_cpu_flags_ppc (void)
 This function MAY rely on signal() or fork() in order to make sure AltiVec is present. More...
 
int ff_get_cpu_flags_x86 (void)
 

Macro Definition Documentation

#define AV_CPU_FLAG_3DNOW   0x0004

AMD 3DNOW.

Definition at line 34 of file cpu.h.

#define AV_CPU_FLAG_3DNOWEXT   0x0020
#define AV_CPU_FLAG_3DNOWEXT   0x0020

AMD 3DNowExt.

Definition at line 38 of file cpu.h.

#define AV_CPU_FLAG_ALTIVEC   0x0001

standard

Definition at line 50 of file cpu.h.

#define AV_CPU_FLAG_ARMV5TE   (1 << 0)
#define AV_CPU_FLAG_ARMV5TE   (1 << 0)

Definition at line 52 of file cpu.h.

#define AV_CPU_FLAG_ARMV6   (1 << 1)
#define AV_CPU_FLAG_ARMV6   (1 << 1)

Definition at line 53 of file cpu.h.

#define AV_CPU_FLAG_ARMV6T2   (1 << 2)
#define AV_CPU_FLAG_ARMV6T2   (1 << 2)

Definition at line 54 of file cpu.h.

#define AV_CPU_FLAG_ATOM   0x10000000

Atom processor, some SSSE3 instructions are slower.

Definition at line 42 of file cpu.h.

#define AV_CPU_FLAG_AVX   0x4000
#define AV_CPU_FLAG_AVX   0x4000

AVX functions: requires OS support even if YMM registers aren't used.

Definition at line 45 of file cpu.h.

#define AV_CPU_FLAG_CMOV   0x1000
#define AV_CPU_FLAG_CMOV   0x1000

i686 cmov

Definition at line 48 of file cpu.h.

#define AV_CPU_FLAG_FMA4   0x0800

Referenced by ff_get_cpu_flags_x86().

#define AV_CPU_FLAG_FMA4   0x0800

Bulldozer FMA4 functions.

Definition at line 47 of file cpu.h.

#define AV_CPU_FLAG_FORCE   0x80000000 /* force usage of selected flags (OR) */
#define AV_CPU_FLAG_FORCE   0x80000000 /* force usage of selected flags (OR) */

Definition at line 26 of file cpu.h.

#define AV_CPU_FLAG_MMX   0x0001

standard MMX

Definition at line 29 of file cpu.h.

#define AV_CPU_FLAG_MMX2   0x0002
#define AV_CPU_FLAG_MMX2   0x0002

SSE integer functions or AMD MMX ext.

Definition at line 32 of file cpu.h.

#define AV_CPU_FLAG_MMXEXT   0x0002

SSE integer functions or AMD MMX ext.

Definition at line 30 of file cpu.h.

#define AV_CPU_FLAG_NEON   (1 << 5)
#define AV_CPU_FLAG_NEON   (1 << 5)

Definition at line 57 of file cpu.h.

#define AV_CPU_FLAG_SSE   0x0008

SSE functions.

Definition at line 35 of file cpu.h.

#define AV_CPU_FLAG_SSE   0x0008
#define AV_CPU_FLAG_SSE2   0x0010

PIV SSE2 functions.

Definition at line 36 of file cpu.h.

#define AV_CPU_FLAG_SSE2SLOW   0x40000000

SSE2 supported, but usually not faster.

Definition at line 37 of file cpu.h.

#define AV_CPU_FLAG_SSE3   0x0040

Prescott SSE3 functions.

Definition at line 39 of file cpu.h.

#define AV_CPU_FLAG_SSE3   0x0040

Referenced by ff_get_cpu_flags_x86().

#define AV_CPU_FLAG_SSE3SLOW   0x20000000

SSE3 supported, but usually not faster.

Definition at line 40 of file cpu.h.

#define AV_CPU_FLAG_SSE3SLOW   0x20000000

Referenced by ff_get_cpu_flags_x86().

#define AV_CPU_FLAG_SSE4   0x0100

Penryn SSE4.1 functions.

Definition at line 43 of file cpu.h.

#define AV_CPU_FLAG_SSE42   0x0200
#define AV_CPU_FLAG_SSE42   0x0200

Nehalem SSE4.2 functions.

Definition at line 44 of file cpu.h.

#define AV_CPU_FLAG_SSSE3   0x0080

Conroe SSSE3 functions.

Definition at line 41 of file cpu.h.

#define AV_CPU_FLAG_VFP   (1 << 3)
#define AV_CPU_FLAG_VFP   (1 << 3)

Definition at line 55 of file cpu.h.

#define AV_CPU_FLAG_VFPV3   (1 << 4)

Definition at line 56 of file cpu.h.

#define AV_CPU_FLAG_VFPV3   (1 << 4)
#define AV_CPU_FLAG_XOP   0x0400

Referenced by ff_get_cpu_flags_x86().

#define AV_CPU_FLAG_XOP   0x0400

Bulldozer XOP functions.

Definition at line 46 of file cpu.h.

#define AVUTIL_CPU_H

Function Documentation

int av_get_cpu_flags ( void  )

Return the flags which specify extensions supported by the CPU.

Definition at line 25 of file cpu.c.

Referenced by ff_ac3dsp_init_arm(), ff_ac3dsp_init_x86(), ff_audio_convert_init_arm(), ff_audio_convert_init_x86(), ff_audio_mix_init_x86(), ff_cavsdsp_init_x86(), ff_dcadsp_init_arm(), ff_dnxhdenc_init_x86(), ff_dsputil_h264_init_ppc(), ff_dsputil_init_arm(), ff_dsputil_init_mmx(), ff_dsputil_init_pix_mmx(), ff_dsputil_init_ppc(), ff_dwt_init_x86(), ff_fft_fixed_init_arm(), ff_fft_init_arm(), ff_fft_init_x86(), ff_float_dsp_init_arm(), ff_float_dsp_init_ppc(), ff_float_dsp_init_vfp(), ff_float_dsp_init_x86(), ff_fmt_convert_init_arm(), ff_fmt_convert_init_x86(), ff_gradfun_init_x86(), ff_h263_decode_frame(), ff_h264_pred_init_arm(), ff_h264dsp_init_arm(), ff_h264dsp_init_ppc(), ff_h264dsp_init_x86(), ff_lpc_init_x86(), ff_mpadsp_init_arm(), ff_mpadsp_init_x86(), ff_MPV_common_init_altivec(), ff_MPV_common_init_arm(), ff_MPV_common_init_x86(), ff_MPV_encode_init_x86(), ff_pngdsp_init_x86(), ff_proresdsp_x86_init(), ff_psdsp_init_arm(), ff_rv34dsp_init_arm(), ff_rv34dsp_init_x86(), ff_rv40dsp_init_arm(), ff_rv40dsp_init_x86(), ff_sbrdsp_init_arm(), ff_sbrdsp_init_x86(), ff_sws_init_swScale_altivec(), ff_sws_init_swScale_mmx(), ff_swscale_get_unscaled_altivec(), ff_vc1dsp_init_altivec(), ff_vc1dsp_init_x86(), ff_videodsp_init_arm(), ff_videodsp_init_x86(), ff_volume_init_x86(), ff_vp3dsp_init_arm(), ff_vp3dsp_init_ppc(), ff_vp3dsp_init_x86(), ff_vp56dsp_init_arm(), ff_vp56dsp_init_x86(), ff_vp8dsp_init_altivec(), ff_vp8dsp_init_arm(), ff_vp8dsp_init_x86(), ff_yadif_init_x86(), ff_yuv2rgb_init_altivec(), ff_yuv2rgb_init_mmx(), hadamard_func(), main(), PRED4x4(), rgb2rgb_init_x86(), sws_init_context(), sws_setColorspaceDetails(), swScale(), and xvid_encode_init().

int av_parse_cpu_flags ( const char *  s)

Parse CPU flags from a string.

Returns
a combination of AV_CPU_* flags, negative on error.

Definition at line 48 of file cpu.c.

Referenced by main(), and opt_cpuflags().

void av_set_cpu_flags_mask ( int  mask)

Set a mask on flags returned by av_get_cpu_flags().

This function is mainly useful for testing.

Warning
this function is not thread safe.

Definition at line 42 of file cpu.c.

Referenced by main(), and opt_cpuflags().

int ff_get_cpu_flags_arm ( void  )

Definition at line 136 of file cpu.c.

Referenced by av_get_cpu_flags().

int ff_get_cpu_flags_ppc ( void  )

This function MAY rely on signal() or fork() in order to make sure AltiVec is present.

Definition at line 38 of file cpu.c.

Referenced by av_get_cpu_flags().

int ff_get_cpu_flags_x86 ( void  )

Definition at line 89 of file cpu.c.

Referenced by av_get_cpu_flags().