summaryrefslogtreecommitdiff
path: root/media/ffvpx/libavutil/mem.h
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-10-01 10:27:24 -0500
committertrav90 <travawine@protonmail.ch>2018-10-01 10:27:24 -0500
commitebc8d7e3ca8723d815904e6fee6c088c659d6784 (patch)
tree9e3115f44e9a09b9c71d40d72c7d5c939b2278e2 /media/ffvpx/libavutil/mem.h
parent8e8fcee4a55de171303ebe526d3cf051522111bf (diff)
downloaduxp-ebc8d7e3ca8723d815904e6fee6c088c659d6784.tar.gz
[ffvpx] Update ffvp9/ffvp8 to release 4.0.2
Diffstat (limited to 'media/ffvpx/libavutil/mem.h')
-rw-r--r--media/ffvpx/libavutil/mem.h39
1 files changed, 20 insertions, 19 deletions
diff --git a/media/ffvpx/libavutil/mem.h b/media/ffvpx/libavutil/mem.h
index 527cd03191..7e0b12a8a7 100644
--- a/media/ffvpx/libavutil/mem.h
+++ b/media/ffvpx/libavutil/mem.h
@@ -74,6 +74,19 @@
*/
/**
+ * @def DECLARE_ASM_ALIGNED(n,t,v)
+ * Declare an aligned variable appropriate for use in inline assembly code.
+ *
+ * @code{.c}
+ * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
+ * @endcode
+ *
+ * @param n Minimum alignment in bytes
+ * @param t Type of the variable (or array element)
+ * @param v Name of the variable
+ */
+
+/**
* @def DECLARE_ASM_CONST(n,t,v)
* Declare a static constant aligned variable appropriate for use in inline
* assembly code.
@@ -89,25 +102,23 @@
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+ #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
-#elif defined(__TI_COMPILER_VERSION__)
- #define DECLARE_ALIGNED(n,t,v) \
- AV_PRAGMA(DATA_ALIGN(v,n)) \
- t __attribute__((aligned(n))) v
- #define DECLARE_ASM_CONST(n,t,v) \
- AV_PRAGMA(DATA_ALIGN(v,n)) \
- static const t __attribute__((aligned(n))) v
#elif defined(__DJGPP__)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
+ #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
#elif defined(__GNUC__) || defined(__clang__)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+ #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
+ #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
#else
#define DECLARE_ALIGNED(n,t,v) t v
+ #define DECLARE_ASM_ALIGNED(n,t,v) t v
#define DECLARE_ASM_CONST(n,t,v) static const t v
#endif
@@ -206,12 +217,7 @@ void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
* be allocated
* @see av_malloc()
*/
-av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
-{
- if (!size || nmemb >= INT_MAX / size)
- return NULL;
- return av_malloc(nmemb * size);
-}
+av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
/**
* Allocate a memory block for an array with av_mallocz().
@@ -226,12 +232,7 @@ av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t siz
* @see av_mallocz()
* @see av_malloc_array()
*/
-av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
-{
- if (!size || nmemb >= INT_MAX / size)
- return NULL;
- return av_mallocz(nmemb * size);
-}
+av_alloc_size(1, 2) void *av_mallocz_array(size_t nmemb, size_t size);
/**
* Non-inlined equivalent of av_mallocz_array().