aboutsummaryrefslogtreecommitdiffstats
path: root/src/atrac/atrac1_bitalloc.cpp
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2018-07-28 00:43:57 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2018-07-28 00:43:57 +0300
commita883931b0d2e40dbfb0a4534694bc98742c09296 (patch)
treecfb9ee8e572fe177d1644948f79d7b0e0996357c /src/atrac/atrac1_bitalloc.cpp
parent4eade436667b31dd27f6bec7588c523d571eb664 (diff)
downloadatracdenc-a883931b0d2e40dbfb0a4534694bc98742c09296.tar.gz
Use lrint() + fesetround(FE_TONEAREST) instead of round() - a bit faster
Diffstat (limited to 'src/atrac/atrac1_bitalloc.cpp')
-rw-r--r--src/atrac/atrac1_bitalloc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/atrac/atrac1_bitalloc.cpp b/src/atrac/atrac1_bitalloc.cpp
index f73b1cf..1a7b155 100644
--- a/src/atrac/atrac1_bitalloc.cpp
+++ b/src/atrac/atrac1_bitalloc.cpp
@@ -260,7 +260,7 @@ void TAtrac1BitStreamWriter::WriteBitStream(const vector<uint32_t>& bitsPerEachB
const TFloat multiple = ((1 << (wordLength - 1)) - 1);
for (const TFloat val : scaledBlocks[i].Values) {
- const int tmp = round(val * multiple);
+ const int tmp = lrint(val * multiple);
const uint32_t testwl = bitsPerEachBlock[i] ? (bitsPerEachBlock[i] - 1) : 0;
const uint32_t a = !!testwl + testwl;
if (a != wordLength) {