VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_cpu.h File Reference

This file provides CPU features detection. More...

Include dependency graph for vlc_cpu.h:

Go to the source code of this file.

Macros

#define HAVE_FPU   0
 Are single precision floating point operations "fast"? If this preprocessor constant is zero, floating point should be avoided (especially relevant for audio codecs).
 
#define set_cpu_funcs(name, activate, priority)
 

Functions

unsigned vlc_CPU (void)
 Retrieves CPU capability flags.
 
unsigned vlc_CPU_raw (void)
 Computes CPU capability flags.
 
void vlc_CPU_functions_init (const char *name, void *restrict funcs)
 Initialises DSP functions.
 
static void vlc_CPU_functions_init_once (const char *name, void *restrict funcs)
 Initialises DSP functions once.
 

Detailed Description

This file provides CPU features detection.

Macro Definition Documentation

◆ HAVE_FPU

#define HAVE_FPU   0

Are single precision floating point operations "fast"? If this preprocessor constant is zero, floating point should be avoided (especially relevant for audio codecs).

◆ set_cpu_funcs

#define set_cpu_funcs (   name,
  activate,
  priority 
)
Value:
set_callback(VLC_CHECKED_TYPE(void (*)(void *), activate)) \
set_capability(name, priority)
const char name[16]
Definition httpd.c:1298
#define set_callback(activate)
Definition vlc_plugin.h:372
#define VLC_CHECKED_TYPE(type, value)
Definition vlc_plugin.h:310

Function Documentation

◆ vlc_CPU()

unsigned vlc_CPU ( void  )

Retrieves CPU capability flags.

References unlikely, and vlc_CPU_raw().

◆ vlc_CPU_functions_init()

void vlc_CPU_functions_init ( const char *  name,
void *restrict  funcs 
)

Initialises DSP functions.

This helper looks for accelerated Digital Signal Processing functions identified by the supplied type name. Those functions ares typically implemented using architecture-specific assembler code with Single Instruction Multiple Data (SIMD) opcodes for faster processing.

The exact purposes and semantics of the DSP functions is uniquely identified by a nul-terminated string.

Note
This function should not be used directly. It is recommended to use the convenience wrapper vlc_CPU_functions_init_once() instead.
Parameters
namenul-terminated type identifier (cannot be NULL)
[in,out]funcstype-specific data structure to be initialised

References init, likely, vlc_module_map(), and vlc_module_match().

Referenced by vlc_CPU_functions_init_once().

◆ vlc_CPU_functions_init_once()

static void vlc_CPU_functions_init_once ( const char *  name,
void *restrict  funcs 
)
inlinestatic

Initialises DSP functions once.

This is a convenience wrapper for vlc_CPU_functions_init(). It only initialises the functions the first time it is evaluated.

References name, vlc_CPU_functions_init(), vlc_once_begin, vlc_once_complete(), and VLC_STATIC_ONCE.

◆ vlc_CPU_raw()

unsigned vlc_CPU_raw ( void  )

Computes CPU capability flags.

Do not call this function directly. Call vlc_CPU() instead, which caches the correct value.

Computes CPU capability flags.

Referenced by vlc_CPU().