FFmpeg 5.1.6
Macros
Alignment Macros

Helper macros for declaring aligned variables. More...

Macros

#define DECLARE_ALIGNED(n, t, v)   t __attribute__ ((aligned (n))) v
 Declare a variable that is aligned in memory. More...
 
#define DECLARE_ASM_ALIGNED(n, t, v)   t av_used __attribute__ ((aligned (n))) v
 Declare an aligned variable appropriate for use in inline assembly code. More...
 
#define DECLARE_ASM_CONST(n, t, v)   static const t av_used __attribute__ ((aligned (n))) v
 Declare a static constant aligned variable appropriate for use in inline assembly code. More...
 

Detailed Description

Helper macros for declaring aligned variables.

Macro Definition Documentation

◆ DECLARE_ALIGNED

#define DECLARE_ALIGNED (   n,
  t,
 
)    t __attribute__ ((aligned (n))) v

Declare a variable that is aligned in memory.

DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42;
DECLARE_ALIGNED(32, uint8_t, aligned_array)[128];
// The default-alignment equivalent would be
uint16_t aligned_int = 42;
uint8_t aligned_array[128];
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:116
Parameters
nMinimum alignment in bytes
tType of the variable (or array element)
vName of the variable

Definition at line 116 of file mem.h.

◆ DECLARE_ASM_ALIGNED

#define DECLARE_ASM_ALIGNED (   n,
  t,
 
)    t av_used __attribute__ ((aligned (n))) v

Declare an aligned variable appropriate for use in inline assembly code.

DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
#define DECLARE_ASM_ALIGNED(n, t, v)
Declare an aligned variable appropriate for use in inline assembly code.
Definition: mem.h:117
Parameters
nMinimum alignment in bytes
tType of the variable (or array element)
vName of the variable

Definition at line 117 of file mem.h.

◆ DECLARE_ASM_CONST

#define DECLARE_ASM_CONST (   n,
  t,
 
)    static const t av_used __attribute__ ((aligned (n))) v

Declare a static constant aligned variable appropriate for use in inline assembly code.

DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
#define DECLARE_ASM_CONST(n, t, v)
Declare a static constant aligned variable appropriate for use in inline assembly code.
Definition: mem.h:118
Parameters
nMinimum alignment in bytes
tType of the variable (or array element)
vName of the variable

Definition at line 118 of file mem.h.