-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRun_Length_Encode_Slow.hxx
58 lines (54 loc) · 1.4 KB
/
Run_Length_Encode_Slow.hxx
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
51
52
53
54
55
56
57
58
#ifndef CVX_WAVELET_RUN_LENGTH_ENCODE_SLOW_HXX
#define CVX_WAVELET_RUN_LENGTH_ENCODE_SLOW_HXX
/*!
* Perform quantization and run length encoding.
* This implementation is slow, but correct.
* It is used for module tests of fast implementation.
*
* Arguments:
* scale - input samples are multiplied by scale before quantization.
* vals - input samples.
* num - length of vals array.
* compressed - compressed values are written to this block.
* bytepos - on output, contains number of bytes written to compressed.
* error - non zero if an error occured.
*
*/
void
Run_Length_Encode_Slow(
float scale,
float* vals,
int num,
unsigned long* compressed,
int& bytepos
);
/*!
* Decode array of floats that was encoded with Run_Length_Encode_Slow.
*
*/
int
Run_Length_Decode_Slow(
float scale,
float* vals,
int num_expected_vals,
unsigned long* compressed
);
/*!
* Compare two run length encoded blocks.
* Used in module tests, to compare results from fast and slow run length encoder.
*
* Arguments:
* compressed - 1st run length encoded block.
* bytepos - number of bytes in 1st run length encoded block.
* compressed2 - 2nd run length encoded block.
* bytepos2 - number of bytes in 2nd run length encoded block.
*
*/
bool
Run_Length_Encode_Compare(
unsigned long* compressed,
int bytepos,
unsigned long* compressed2,
int bytepos2
);
#endif