summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libass/ass_cache.c22
-rw-r--r--libass/ass_utils.h22
2 files changed, 22 insertions, 22 deletions
diff --git a/libass/ass_cache.c b/libass/ass_cache.c
index 3ce4aff..6a699b5 100644
--- a/libass/ass_cache.c
+++ b/libass/ass_cache.c
@@ -30,6 +30,28 @@
#include "ass_outline.h"
#include "ass_cache.h"
+#define FNV1_32A_INIT 0x811c9dc5U
+#define FNV1_32A_PRIME 16777619U
+
+static inline uint32_t fnv_32a_buf(const void *buf, size_t len, uint32_t hval)
+{
+ if (!len)
+ return hval;
+
+ const uint8_t *bp = buf;
+ size_t n = (len + 3) / 4;
+
+ switch (len % 4) {
+ case 0: do { hval ^= *bp++; hval *= FNV1_32A_PRIME; //-fallthrough
+ case 3: hval ^= *bp++; hval *= FNV1_32A_PRIME; //-fallthrough
+ case 2: hval ^= *bp++; hval *= FNV1_32A_PRIME; //-fallthrough
+ case 1: hval ^= *bp++; hval *= FNV1_32A_PRIME;
+ } while (--n > 0);
+ }
+
+ return hval;
+}
+
// type-specific functions
// create hash/compare functions for bitmap, outline and composite cache
#define CREATE_HASH_FUNCTIONS
diff --git a/libass/ass_utils.h b/libass/ass_utils.h
index 4789179..5418ee6 100644
--- a/libass/ass_utils.h
+++ b/libass/ass_utils.h
@@ -182,28 +182,6 @@ static inline int double_to_d22(double x)
return lrint(x * 0x400000);
}
-#define FNV1_32A_INIT 0x811c9dc5U
-#define FNV1_32A_PRIME 16777619U
-
-static inline uint32_t fnv_32a_buf(const void *buf, size_t len, uint32_t hval)
-{
- if (!len)
- return hval;
-
- const uint8_t *bp = buf;
- size_t n = (len + 3) / 4;
-
- switch (len % 4) {
- case 0: do { hval ^= *bp++; hval *= FNV1_32A_PRIME; //-fallthrough
- case 3: hval ^= *bp++; hval *= FNV1_32A_PRIME; //-fallthrough
- case 2: hval ^= *bp++; hval *= FNV1_32A_PRIME; //-fallthrough
- case 1: hval ^= *bp++; hval *= FNV1_32A_PRIME;
- } while (--n > 0);
- }
-
- return hval;
-}
-
static inline int mystrtoi(char **p, int *res)
{
char *start = *p;