summaryrefslogtreecommitdiffstats
path: root/third_party/aom/aom_dsp/aom_dsp_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/aom_dsp/aom_dsp_common.h')
-rw-r--r--third_party/aom/aom_dsp/aom_dsp_common.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/third_party/aom/aom_dsp/aom_dsp_common.h b/third_party/aom/aom_dsp/aom_dsp_common.h
index 82f9a95e9..5b104321b 100644
--- a/third_party/aom/aom_dsp/aom_dsp_common.h
+++ b/third_party/aom/aom_dsp/aom_dsp_common.h
@@ -31,8 +31,6 @@ extern "C" {
#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
-#define NELEMENTS(x) (sizeof((x)) / sizeof((x)[0]))
-
#define IMPLIES(a, b) (!(a) || (b)) // Logical 'a implies b' (or 'a -> b')
#define IS_POWER_OF_TWO(x) (((x) & ((x)-1)) == 0)
@@ -54,16 +52,9 @@ extern "C" {
#define UNLIKELY(v) (v)
#endif
-#define AOM_SWAP(type, a, b) \
- do { \
- type c = (b); \
- b = a; \
- a = c; \
- } while (0)
-
#if CONFIG_AOM_QM
typedef uint16_t qm_val_t;
-#define AOM_QM_BITS 6
+#define AOM_QM_BITS 5
#endif
#if CONFIG_HIGHBITDEPTH
// Note:
@@ -87,11 +78,14 @@ static INLINE int clamp(int value, int low, int high) {
return value < low ? low : (value > high ? high : value);
}
+static INLINE int64_t clamp64(int64_t value, int64_t low, int64_t high) {
+ return value < low ? low : (value > high ? high : value);
+}
+
static INLINE double fclamp(double value, double low, double high) {
return value < low ? low : (value > high ? high : value);
}
-#if CONFIG_HIGHBITDEPTH
static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
switch (bd) {
case 8:
@@ -100,7 +94,6 @@ static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
case 12: return (uint16_t)clamp(val, 0, 4095);
}
}
-#endif // CONFIG_HIGHBITDEPTH
#ifdef __cplusplus
} // extern "C"