Go to the documentation of this file.
39 memset(
c, 0,
sizeof(*
c));
49 static const uint64_t
c1 = UINT64_C(0x87c37b91114253d5);
50 static const uint64_t
c2 = UINT64_C(0x4cf5ad432745937f);
52 #define ROT(a, b) (((a) << (b)) | ((a) >> (64 - (b))))
72 static inline uint64_t
update_h1(uint64_t k, uint64_t h1, uint64_t h2)
82 static inline uint64_t
update_h2(uint64_t k, uint64_t h1, uint64_t h2)
92 #if FF_API_CRYPTO_SIZE_T
99 uint64_t h1 =
c->h1, h2 =
c->h2;
101 if (
len <= 0)
return;
103 if (
c->state_pos > 0) {
104 while (
c->state_pos < 16) {
105 c->state[
c->state_pos++] = *
src++;
106 if (--
len <= 0)
return;
135 static inline uint64_t
fmix(uint64_t k)
138 k *= UINT64_C(0xff51afd7ed558ccd);
140 k *= UINT64_C(0xc4ceb9fe1a85ec53);
147 uint64_t h1 =
c->h1, h2 =
c->h2;
148 memset(
c->state +
c->state_pos, 0,
sizeof(
c->state) -
c->state_pos);
static av_cold int end(AVCodecContext *avctx)
static uint64_t get_k2(const uint8_t *src)
AVMurMur3 * av_murmur3_alloc(void)
Allocate an AVMurMur3 hash context.
void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len)
Update hash context with new data.
void av_murmur3_final(AVMurMur3 *c, uint8_t dst[16])
Finish hashing and output digest value.
static uint64_t update_h2(uint64_t k, uint64_t h1, uint64_t h2)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static uint64_t fmix(uint64_t k)
static uint64_t get_k1(const uint8_t *src)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void av_murmur3_init_seeded(AVMurMur3 *c, uint64_t seed)
Initialize or reinitialize an AVMurMur3 hash context with a seed.
void av_murmur3_init(AVMurMur3 *c)
Initialize or reinitialize an AVMurMur3 hash context.
static uint64_t update_h1(uint64_t k, uint64_t h1, uint64_t h2)