CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/ext/at3_standalone/compat.h
Views: 1401
#pragma once12#include <stdlib.h>34// Compat hacks to make an FFMPEG-like environment, so we can keep the core code mostly unchanged.56#if defined(__clang__)7#define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(n))) v8#define DECLARE_ASM_CONST(n, t, v) static const t av_used __attribute__((aligned(n))) v9#define av_restrict __restrict10#elif defined(__GNUC__)11#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v12#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v13#define av_restrict __restrict__14#elif defined(_MSC_VER)15#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v16#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v17#define av_restrict __restrict18#else19#define DECLARE_ALIGNED(n,t,v) t v20#define DECLARE_ASM_CONST(n,t,v) static const t v21#define av_restrict22#endif2324#define AV_HAVE_FAST_UNALIGNED 025#define AV_INPUT_BUFFER_PADDING_SIZE 322627// TODO: This should work but doesn't??28// #define BITSTREAM_READER_LE2930#define LOCAL_ALIGNED(bits, type, name, subscript) type name subscript31#define av_alias32#define av_unused33#define av_assert0(cond)34#define av_assert1(cond)35#define av_assert2(cond)36#define av_printf_format(a,b)37#define avpriv_report_missing_feature(...)3839#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.40#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.4142#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))4344#define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A') ///< Invalid data found when processing input45#define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E') ///< Not yet implemented in FFmpeg, patches welcome4647#define AV_LOG_ERROR 1648#define AV_LOG_WARNING 2449#define AV_LOG_INFO 3250#define AV_LOG_VERBOSE 4051#define AV_LOG_DEBUG 4852#define AV_LOG_TRACE 565354void av_log(int level, const char *fmt, ...) av_printf_format(3, 4);5556/**57* Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they58* are not representable as absolute values of their type. This is the same59* as with *abs()60* @see FFNABS()61*/62#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))6364#define FFMAX(a,b) ((a) > (b) ? (a) : (b))65#define FFMIN(a,b) ((a) > (b) ? (b) : (a))6667#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)68#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))6970#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))7172#ifdef _MSC_VER73#pragma warning(disable:4305)74#pragma warning(disable:4244)75#pragma warning(disable:4101) // unused variable76#endif7778#define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))79#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))80#define av_be2ne32(x) AV_BSWAP32C((x))818283