diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2015-11-02 00:07:21 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2015-11-02 00:07:21 +0300 |
commit | 0b3154af9d688e1a5e3c88a4382ff1f6d165e9ac (patch) | |
tree | c5272c76eaaa8e9716f1f06b3806cb6054e2de2a | |
parent | 71dfcf35bf626df7c6a4a44fa5f3e0cab9b7d912 (diff) | |
download | atracdenc-0b3154af9d688e1a5e3c88a4382ff1f6d165e9ac.tar.gz |
fix: double -> int cast, should be round()
-rw-r--r-- | src/atrac/atrac1_bitalloc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/atrac/atrac1_bitalloc.cpp b/src/atrac/atrac1_bitalloc.cpp index d80ea9a..740e0c4 100644 --- a/src/atrac/atrac1_bitalloc.cpp +++ b/src/atrac/atrac1_bitalloc.cpp @@ -131,7 +131,7 @@ void TAtrac1BitStreamWriter::WriteBitStream(const vector<uint32_t>& bitsPerEachB const double multiple = ((1 << (wordLength - 1)) - 1); for (const double val : scaledBlocks[i].Values) { - const int tmp = val * multiple; + const int tmp = round(val * multiple); const int testwl = bitsPerEachBlock[i] ? (bitsPerEachBlock[i] - 1) : 0; const int a = !!testwl + testwl; if (a != wordLength) { |