Go to the documentation of this file.
26 #ifndef AVUTIL_INTERNAL_H
27 #define AVUTIL_INTERNAL_H
29 #if !defined(DEBUG) && !defined(NDEBUG)
51 #ifndef attribute_align_arg
52 #if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2)
53 # define attribute_align_arg __attribute__((force_align_arg_pointer))
55 # define attribute_align_arg
59 #if defined(_MSC_VER) && CONFIG_SHARED
60 # define av_export __declspec(dllimport)
66 # define INT_BIT (CHAR_BIT * sizeof(int))
73 #define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
74 uint8_t la_##v[sizeof(t s o) + (a)]; \
75 t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
77 #define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \
78 DECLARE_ALIGNED(a, t, la_##v) s o; \
81 #define LOCAL_ALIGNED(a, t, v, ...) E1(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))
83 #if HAVE_LOCAL_ALIGNED_8
84 # define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
86 # define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
89 #if HAVE_LOCAL_ALIGNED_16
90 # define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
92 # define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
95 #define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
98 if (p == NULL && (size) != 0) {\
99 av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
104 #define FF_ALLOCZ_OR_GOTO(ctx, p, size, label)\
106 p = av_mallocz(size);\
107 if (p == NULL && (size) != 0) {\
108 av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
121 # define NULL_IF_CONFIG_SMALL(x) NULL
123 # define NULL_IF_CONFIG_SMALL(x) x
143 #if HAVE_SYMVER_ASM_LABEL
144 # define FF_SYMVER(type, name, args, ver) \
145 type ff_##name args __asm__ (EXTERN_PREFIX #name "@" ver); \
147 #elif HAVE_SYMVER_GNU_ASM
148 # define FF_SYMVER(type, name, args, ver) \
149 __asm__ (".symver ff_" #name "," EXTERN_PREFIX #name "@" ver); \
150 type ff_##name args; \
160 # define ONLY_IF_THREADS_ENABLED(x) x
162 # define ONLY_IF_THREADS_ENABLED(x) NULL