-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsimple9.h
50 lines (35 loc) · 833 Bytes
/
simple9.h
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
44
45
46
47
48
49
50
//
// Created by art on 20.05.19.
//
#ifndef KP_SIMPLE9_H
#define KP_SIMPLE9_H
#include <iostream>
#include <vector>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#define SELECTOR_MASK 0x0000000F //15
#define SELECTOR_BITS 4
#define NSELECTORS 9
static const struct {
uint32_t nitems;
uint32_t nbits;
uint32_t nwaste;
} selectors[NSELECTORS] = {
{28, 1, 0},
{14, 2, 0},
{9, 3, 1},
{7, 4, 0},
{5, 5, 3},
{4, 7, 0},
{3, 9, 1},
{2, 14, 0},
{1, 28, 0},
};
void simple9_encode(std::vector<uint32_t> &array, std::vector<uint32_t > &encodeArray);
std::vector<uint32_t> simple9_decode(std::vector<uint32_t> &vec);
#endif //KP_SIMPLE9_H