aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2025-04-26 14:19:05 +0200
committerDaniil Cherednik <dan.cherednik@gmail.com>2025-04-26 14:19:05 +0200
commite7cd06823f1cf5ff1f0820de714dcd55f7e5a4e8 (patch)
tree03eb269ea750064217c7794c933abdfa5f251499 /src/util.h
parent0fe8e1a0d1a495e41a281f54af31d6713c0de01d (diff)
parenta0a18fc3536c006c157c3988c3f95f6b32df22f8 (diff)
downloadatracdenc-e7cd06823f1cf5ff1f0820de714dcd55f7e5a4e8.tar.gz
Merge branch 'new_psy'. It should reduce high frequency distortion for AT3 mode
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index cc3249b..ff4399e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -90,3 +90,15 @@ inline T CalcEnergy(const std::vector<T>& in) {
});
}
+inline int ToInt(float x) {
+#if defined(_MSC_VER) && !defined(_WIN64)
+ int n;
+ __asm {
+ fld x
+ fistp n
+ }
+ return n;
+#else
+ return lrint(x);
+#endif
+}