1
2
3
4
5
6#ifndef __NAL_RBSP_H__
7#define __NAL_RBSP_H__
8
9#include <linux/kernel.h>
10#include <linux/types.h>
11
12struct rbsp;
13
14struct nal_rbsp_ops {
15 int (*rbsp_bit)(struct rbsp *rbsp, int *val);
16 int (*rbsp_bits)(struct rbsp *rbsp, int n, unsigned int *val);
17 int (*rbsp_uev)(struct rbsp *rbsp, unsigned int *val);
18 int (*rbsp_sev)(struct rbsp *rbsp, int *val);
19};
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38struct rbsp {
39 u8 *data;
40 size_t size;
41 unsigned int pos;
42 unsigned int num_consecutive_zeros;
43 struct nal_rbsp_ops *ops;
44 int error;
45};
46
47extern struct nal_rbsp_ops write;
48extern struct nal_rbsp_ops read;
49
50void rbsp_init(struct rbsp *rbsp, void *addr, size_t size,
51 struct nal_rbsp_ops *ops);
52void rbsp_unsupported(struct rbsp *rbsp);
53
54void rbsp_bit(struct rbsp *rbsp, int *value);
55void rbsp_bits(struct rbsp *rbsp, int n, int *value);
56void rbsp_uev(struct rbsp *rbsp, unsigned int *value);
57void rbsp_sev(struct rbsp *rbsp, int *value);
58
59void rbsp_trailing_bits(struct rbsp *rbsp);
60
61#endif
62