RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rvl_codec.h
1// The following code is a C++ wrapper of the code presented by
2// Andrew D. Wilson in "Fast Lossless Depth Image Compression" at SIGCHI'17.
3// The original code is licensed under the MIT License.
4
5#ifndef RVL_CODEC_H_
6#define RVL_CODEC_H_
7
8#include <cstdint>
9#include "rtabmap/core/rtabmap_core_export.h"
10
11namespace rtabmap
12{
13
14class RTABMAP_CORE_EXPORT RvlCodec {
15public:
16 RvlCodec();
17 // Compress input data into output. The size of output can be equal to (1.5 * numPixels + 4) in the worst case.
18 int CompressRVL(const uint16_t * input, unsigned char * output, int numPixels);
19 // Decompress input data into output. The size of output must be equal to numPixels.
20 void DecompressRVL(const unsigned char * input, uint16_t * output, int numPixels);
21
22private:
23 RvlCodec(const RvlCodec &);
24 RvlCodec & operator=(const RvlCodec &);
25
26 void EncodeVLE(int value);
27 int DecodeVLE();
28
29 int *buffer_;
30 int *pBuffer_;
31 int word_;
32 int nibblesWritten_;
33};
34
35} // namespace rtabmap
36
37#endif // RVL_CODEC_H_