FFmpeg 7.1.1
Loading...
Searching...
No Matches
macros.h File Reference

Utility Preprocessor macros. More...

#include "libavutil/avconfig.h"

Go to the source code of this file.

Macros

#define AV_NE(be, le)
 
#define FFDIFFSIGN(x, y)
 Comparator.
 
#define FFMAX(a, b)
 
#define FFMAX3(a, b, c)
 
#define FFMIN(a, b)
 
#define FFMIN3(a, b, c)
 
#define FFSWAP(type, a, b)
 
#define FF_ARRAY_ELEMS(a)
 
#define MKTAG(a, b, c, d)
 
#define MKBETAG(a, b, c, d)
 
#define AV_STRINGIFY(s)
 
#define AV_TOSTRING(s)
 
#define AV_GLUE(a, b)
 
#define AV_JOIN(a, b)
 
#define AV_PRAGMA(s)
 
#define FFALIGN(x, a)
 

Detailed Description

Utility Preprocessor macros.

Definition in file macros.h.

Macro Definition Documentation

◆ AV_NE

#define AV_NE ( be,
le )

◆ FFDIFFSIGN

#define FFDIFFSIGN ( x,
y )
Value:
(((x)>(y)) - ((x)<(y)))

Comparator.

For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0 if x == y. This is useful for instance in a qsort comparator callback. Furthermore, compilers are able to optimize this to branchless code, and there is no risk of overflow with signed types. As with many macros, this evaluates its argument multiple times, it thus must not have a side-effect.

Definition at line 45 of file macros.h.

◆ FFMAX

#define FFMAX ( a,
b )
Value:
((a) > (b) ? (a) : (b))

Definition at line 47 of file macros.h.

Referenced by av_clipd_c(), and av_clipf_c().

◆ FFMAX3

#define FFMAX3 ( a,
b,
c )
Value:
FFMAX(FFMAX(a,b),c)
#define FFMAX(a, b)
Definition macros.h:47

Definition at line 48 of file macros.h.

◆ FFMIN

#define FFMIN ( a,
b )
Value:
((a) > (b) ? (b) : (a))
Examples
avio_read_callback.c, and transcode_aac.c.

Definition at line 49 of file macros.h.

Referenced by av_clipd_c(), av_clipf_c(), load_encode_and_write(), and read_packet().

◆ FFMIN3

#define FFMIN3 ( a,
b,
c )
Value:
FFMIN(FFMIN(a,b),c)
#define FFMIN(a, b)
Definition macros.h:49

Definition at line 50 of file macros.h.

◆ FFSWAP

#define FFSWAP ( type,
a,
b )
Value:
do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)

Definition at line 52 of file macros.h.

◆ FF_ARRAY_ELEMS

#define FF_ARRAY_ELEMS ( a)
Value:
(sizeof(a) / sizeof((a)[0]))
Examples
decode_audio.c, demux_decode.c, qsv_decode.c, and resample_audio.c.

Definition at line 53 of file macros.h.

Referenced by decode_packet(), get_format_from_sample_fmt(), get_format_from_sample_fmt(), and get_format_from_sample_fmt().

◆ MKTAG

#define MKTAG ( a,
b,
c,
d )
Value:
((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))

Definition at line 55 of file macros.h.

◆ MKBETAG

#define MKBETAG ( a,
b,
c,
d )
Value:
((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))

Definition at line 56 of file macros.h.

◆ AV_PRAGMA

#define AV_PRAGMA ( s)
Value:
_Pragma(#s)

Definition at line 76 of file macros.h.

◆ FFALIGN

#define FFALIGN ( x,
a )
Value:
(((x)+(a)-1)&~((a)-1))

Definition at line 78 of file macros.h.