This source file includes following definitions.
- norm__
- mul__
- norm13
- norm16
- norm20
- norm21
- norm23
- mul15
- mul16
- mul17
- mul22
- mul23
- mul31
- mul32
- clip23
#ifndef AVCODEC_DCAMATH_H
#define AVCODEC_DCAMATH_H
#include "libavutil/common.h"
#include "libavutil/intmath.h"
static inline int32_t norm__(int64_t a, int bits)
{
if (bits > 0)
return (int32_t)((a + (INT64_C(1) << (bits - 1))) >> bits);
else
return (int32_t)a;
}
static inline int32_t mul__(int32_t a, int32_t b, int bits)
{
return norm__((int64_t)a * b, bits);
}
static inline int32_t norm13(int64_t a) { return norm__(a, 13); }
static inline int32_t norm16(int64_t a) { return norm__(a, 16); }
static inline int32_t norm20(int64_t a) { return norm__(a, 20); }
static inline int32_t norm21(int64_t a) { return norm__(a, 21); }
static inline int32_t norm23(int64_t a) { return norm__(a, 23); }
static inline int32_t mul15(int32_t a, int32_t b) { return mul__(a, b, 15); }
static inline int32_t mul16(int32_t a, int32_t b) { return mul__(a, b, 16); }
static inline int32_t mul17(int32_t a, int32_t b) { return mul__(a, b, 17); }
static inline int32_t mul22(int32_t a, int32_t b) { return mul__(a, b, 22); }
static inline int32_t mul23(int32_t a, int32_t b) { return mul__(a, b, 23); }
static inline int32_t mul31(int32_t a, int32_t b) { return mul__(a, b, 31); }
static inline int32_t mul32(int32_t a, int32_t b) { return mul__(a, b, 32); }
static inline int32_t clip23(int32_t a) { return av_clip_intp2(a, 23); }
#endif