aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2016-07-17 17:50:38 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2016-07-17 17:50:38 +0300
commit842bd06107983bf1775e9c1bbafc8cbe43ffb164 (patch)
tree4808bed3ae63572f092686f2e93ff44a2676abaa /src/util.h
parent1151d5831f19a9f24dd0c545a4968606712a62d2 (diff)
downloadatracdenc-842bd06107983bf1775e9c1bbafc8cbe43ffb164.tar.gz
Experimental implementation of gain control.atrac3_gaincontrol
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 9ba9d1d..9fa85bc 100644
--- a/src/util.h
+++ b/src/util.h
@@ -2,6 +2,7 @@
#include <cstdint>
#include <vector>
#include <algorithm>
+#include <cmath>
#include "config.h"
@@ -30,7 +31,7 @@ inline uint16_t GetFirstSetBit(uint32_t x) {
template<class T>
inline uint16_t Log2FloatToIdx(T x, uint16_t shift) {
T t = x * shift;
- return GetFirstSetBit(t);
+ return GetFirstSetBit(std::trunc(t));
}
template<class T>