0001
0002
0003
0004
0005
0006 #ifndef __NAL_RBSP_H__
0007 #define __NAL_RBSP_H__
0008
0009 #include <linux/kernel.h>
0010 #include <linux/types.h>
0011
0012 struct rbsp;
0013
0014 struct nal_rbsp_ops {
0015 int (*rbsp_bit)(struct rbsp *rbsp, int *val);
0016 int (*rbsp_bits)(struct rbsp *rbsp, int n, unsigned int *val);
0017 int (*rbsp_uev)(struct rbsp *rbsp, unsigned int *val);
0018 int (*rbsp_sev)(struct rbsp *rbsp, int *val);
0019 };
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 struct rbsp {
0039 u8 *data;
0040 size_t size;
0041 unsigned int pos;
0042 unsigned int num_consecutive_zeros;
0043 struct nal_rbsp_ops *ops;
0044 int error;
0045 };
0046
0047 extern struct nal_rbsp_ops write;
0048 extern struct nal_rbsp_ops read;
0049
0050 void rbsp_init(struct rbsp *rbsp, void *addr, size_t size,
0051 struct nal_rbsp_ops *ops);
0052 void rbsp_unsupported(struct rbsp *rbsp);
0053
0054 void rbsp_bit(struct rbsp *rbsp, int *value);
0055 void rbsp_bits(struct rbsp *rbsp, int n, int *value);
0056 void rbsp_uev(struct rbsp *rbsp, unsigned int *value);
0057 void rbsp_sev(struct rbsp *rbsp, int *value);
0058
0059 void rbsp_trailing_bits(struct rbsp *rbsp);
0060
0061 #endif