Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/common/intops.h6
-rw-r--r--src/decode.c4
-rw-r--r--src/msac.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/include/common/intops.h b/include/common/intops.h
index a739709..61b891d 100644
--- a/include/common/intops.h
+++ b/include/common/intops.h
@@ -30,6 +30,8 @@
#include <stdint.h>
+#include "common/attributes.h"
+
static inline int imax(const int a, const int b) {
return a > b ? a : b;
}
@@ -51,11 +53,11 @@ static inline int apply_sign(const int v, const int s) {
}
static inline int ulog2(const unsigned v) {
- return 31 - __builtin_clz(v);
+ return 31 - clz(v);
}
static inline int u64log2(const uint64_t v) {
- return 63 - __builtin_clzll(v);
+ return 63 - clzll(v);
}
static inline unsigned rl16(const uint8_t *const ptr) {
diff --git a/src/decode.c b/src/decode.c
index 62629f9..3250bb8 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -296,7 +296,7 @@ static void derive_warpmv(const Dav1dTileContext *const t,
const int off = t->bx & (bs(&r[-b4_stride])[0] - 1);
add_sample(-off, 0, 1, -1, &r[-b4_stride]);
} else for (unsigned off = 0, xmask = masks[0]; np < 8 && xmask;) { // top
- const int tz = __builtin_ctz(xmask);
+ const int tz = ctz(xmask);
off += tz;
add_sample(off, 0, 1, -1, &r[off - b4_stride]);
xmask >>= tz + 1;
@@ -306,7 +306,7 @@ static void derive_warpmv(const Dav1dTileContext *const t,
const int off = t->by & (bs(&r[-1])[1] - 1);
add_sample(0, -off, -1, 1, &r[-1 - off * b4_stride]);
} else for (unsigned off = 0, ymask = masks[1]; np < 8 && ymask;) { // left
- const int tz = __builtin_ctz(ymask);
+ const int tz = ctz(ymask);
off += tz;
add_sample(0, off, -1, 1, &r[off * b4_stride - 1]);
ymask >>= tz + 1;
diff --git a/src/msac.c b/src/msac.c
index b3ae55d..dbf6ec7 100644
--- a/src/msac.c
+++ b/src/msac.c
@@ -32,7 +32,7 @@ typedef MsacContext od_ec_dec;
static inline int get_msb(unsigned int n) {
assert(n != 0);
- return 31 ^ __builtin_clz(n);
+ return 31 ^ clz(n);
}
#define EC_PROB_SHIFT 6