diff options
author | Yury Melnichek <melnichek@gmail.com> | 2011-01-30 05:06:30 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:11:16 +0300 |
commit | 6d51b053222a86b52ed3b3825a5f873bd385dafe (patch) | |
tree | 323be4856c4b84a6a8c32d992bd47c6cb60f259a /indexer/geometry_coding.cpp | |
parent | f3da0c3ca1cb915c8326f23f7f415dc8f689a050 (diff) |
Move EncodeDelta(), DecodeDelta() to header file and test them.
Diffstat (limited to 'indexer/geometry_coding.cpp')
-rw-r--r-- | indexer/geometry_coding.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/indexer/geometry_coding.cpp b/indexer/geometry_coding.cpp index 74a83b0a11..cf0d36487e 100644 --- a/indexer/geometry_coding.cpp +++ b/indexer/geometry_coding.cpp @@ -1,8 +1,6 @@ #include "geometry_coding.hpp" #include "../coding/byte_stream.hpp" -#include "../coding/varint.hpp" #include "../base/assert.hpp" -#include "../base/bits.hpp" #include "../base/stl_add.hpp" #include "../std/complex.hpp" #include "../std/vector.hpp" @@ -10,20 +8,6 @@ namespace { -inline uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction) -{ - return bits::BitwiseMerge( - bits::ZigZagEncode(static_cast<int32_t>(actual.x) - static_cast<int32_t>(prediction.x)), - bits::ZigZagEncode(static_cast<int32_t>(actual.y) - static_cast<int32_t>(prediction.y))); -} - -inline m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction) -{ - uint32_t x, y; - bits::BitwiseSplit(delta, x, y); - return m2::PointU(prediction.x + bits::ZigZagDecode(x), prediction.y + bits::ZigZagDecode(y)); -} - inline void EncodeVarUints(vector<uint64_t> const & varints, vector<char> & serialOutput) { PushBackByteSink<vector<char> > sink(serialOutput); |