22#ifndef AVCODEC_MATHOPS_H
23#define AVCODEC_MATHOPS_H
31#define MAX_NEG_CROP 1024
56# define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
60# define MULL(a,b,s) (MUL64(a, b) >> (s))
71 return ((uint64_t)(
a) * (uint64_t)(
b))>>32;
76# define MAC64(d, a, b) ((d) += MUL64(a, b))
80# define MLS64(d, a, b) ((d) -= MUL64(a, b))
85# define MAC16(rt, ra, rb) rt += (ra) * (rb)
90# define MUL16(ra, rb) ((ra) * (rb))
94# define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb))
109 m = (
c >= max2) ? max2 :
c;
111 return (m >= min2) ? m : min2;
115#define mid_pred median3_c
119#define median4 median4
132#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
138 union {
unsigned u;
int s; } v = { (unsigned)
val <<
shift };
155 return (
val << ((8 *
sizeof(
int)) -
bits)) >> ((8 *
sizeof(int)) -
bits);
160#define COPY3_IF_LT(x, y, a, b, c, d)\
169#define MASK_ABS(mask, level) do { \
170 mask = level >> 31; \
171 level = (level ^ mask) - mask; \
176# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
180# define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
185# define PACK_2U8(a,b) (((a) << 8) | (b))
188# define PACK_4U8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
191# define PACK_2U16(a,b) (((a) << 16) | (b))
195# define PACK_2U8(a,b) (((b) << 8) | (a))
198# define PACK_4U8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
201# define PACK_2U16(a,b) (((b) << 16) | (a))
206# define PACK_2S8(a,b) PACK_2U8((a)&255, (b)&255)
209# define PACK_4S8(a,b,c,d) PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255)
212# define PACK_2S16(a,b) PACK_2U16((a)&0xffff, (b)&0xffff)
216# define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))
220#define ff_sqrt ff_sqrt
233 unsigned int c =
a >> (
s + 2);
238 return b - (
a <
b *
b);
static double val(void *priv, double ch)
common internal and external API header
static const uint8_t bits[8]
static int shift(int a, int b)
#define u(width, name, range_min, range_max)
const uint8_t ff_zigzag_direct[64]
static av_const unsigned zero_extend(unsigned val, unsigned bits)
static int8_t ff_u8_to_s8(uint8_t a)
static av_const int sign_extend(int val, unsigned bits)
static av_always_inline unsigned UMULH(unsigned a, unsigned b)
static av_const int median3_c(int a, int b, int c)
const uint32_t ff_inverse[257]
const uint8_t ff_sqrt_tab[256]
const uint8_t ff_zigzag_scan[16+1]
static av_const int64_t sign_extend64(int64_t val, unsigned bits)
EXTERN const uint32_t ff_square_tab[512]
const uint8_t ff_log2_run[41]
static av_const float ff_sqrf(float a)