File: streamvbyte_zigzag.h

package info (click to toggle)
tilemaker 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 78,284 kB
  • sloc: cpp: 28,715; ansic: 4,052; makefile: 180; ruby: 77; sh: 6
file content (35 lines) | stat: -rw-r--r-- 878 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef INCLUDE_STREAMVBYTE_ZIGZAG_H_
#define INCLUDE_STREAMVBYTE_ZIGZAG_H_

#include <stddef.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Convert N signed integers to N unsigned integers, using zigzag encoding.
 */
void zigzag_encode(const int32_t* in, uint32_t* out, size_t N);

/**
 * Convert N signed integers to N unsigned integers, using zigzag delta encoding.
 */
void zigzag_delta_encode(const int32_t* in, uint32_t* out, size_t N, int32_t prev);

/**
 * Convert N unsigned integers to N signed integers, using zigzag encoding.
 */
void zigzag_decode(const uint32_t* in, int32_t* out, size_t N);

/**
 * Convert N unsigned integers to N signed integers, using zigzag delta encoding.
 */
void zigzag_delta_decode(const uint32_t* in, int32_t* out, size_t N, int32_t prev);

#ifdef __cplusplus
}
#endif

#endif /* INCLUDE_STREAMVBYTE_ZIGZAG_H_ */