forked from sahaRatul/sela
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrice.h
More file actions
26 lines (21 loc) · 834 Bytes
/
rice.h
File metadata and controls
26 lines (21 loc) · 834 Bytes
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
#ifndef _RICE_H_
#define _RICE_H_
#define MAX_RICE_PARAM 20
typedef struct rice_encode_context
{
unsigned short buffer;
unsigned short filled;
unsigned int bits;
}rice_encode_context;
typedef struct rice_decode_context
{
unsigned short buffer;
unsigned short filled;
unsigned int bytes;
}rice_decode_context;
int signed_to_unsigned(const unsigned int data_size,const short *input,unsigned short *output);
int unsigned_to_signed(const unsigned int data_size,const unsigned short *input,short *output);
unsigned short get_opt_rice_param(const unsigned short *data,int data_size,unsigned int *req_bits);
unsigned int rice_encode_block(short param,const unsigned short *input,int size,unsigned short *encoded);
unsigned int rice_decode_block(short param,const unsigned short *encoded,int count,unsigned short *decoded);
#endif