File: streamvbyte_zigzag.h

package info (click to toggle)
libstreamvbyte 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 576 kB
  • sloc: ansic: 5,697; makefile: 69
file content (43 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43

#ifndef INCLUDE_STREAMVBYTE_ZIGZAG_H_
#define INCLUDE_STREAMVBYTE_ZIGZAG_H_
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdint.h>// please use a C99-compatible compiler
#include <stddef.h>

#if defined(__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);


#if defined(__cplusplus)
};
#endif

#endif /* INCLUDE_STREAMVBYTE_ZIGZAG_H_ */