MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Log2Floor

Function Log2Floor

tensorflow/lite/kernels/internal/spectrogram.cc:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46inline int Log2Floor(uint32_t n) {
47 if (n == 0) return -1;
48 int log = 0;
49 uint32_t value = n;
50 for (int i = 4; i >= 0; --i) {
51 int shift = (1 << i);
52 uint32_t x = value >> shift;
53 if (x != 0) {
54 value = x;
55 log += shift;
56 }
57 }
58 return log;
59}
60
61inline int Log2Ceiling(uint32_t n) {
62 int floor = Log2Floor(n);

Callers 1

Log2CeilingFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected