Lines Matching refs:rbsp
115 struct rbsp { struct
121 static inline int rbsp_read_bit(struct rbsp *rbsp) in rbsp_read_bit() argument
123 int shift = 7 - (rbsp->pos % 8); in rbsp_read_bit()
124 int ofs = rbsp->pos++ / 8; in rbsp_read_bit()
126 if (ofs >= rbsp->size) in rbsp_read_bit()
129 return (rbsp->buf[ofs] >> shift) & 1; in rbsp_read_bit()
132 static inline int rbsp_write_bit(struct rbsp *rbsp, int bit) in rbsp_write_bit() argument
134 int shift = 7 - (rbsp->pos % 8); in rbsp_write_bit()
135 int ofs = rbsp->pos++ / 8; in rbsp_write_bit()
137 if (ofs >= rbsp->size) in rbsp_write_bit()
140 rbsp->buf[ofs] &= ~(1 << shift); in rbsp_write_bit()
141 rbsp->buf[ofs] |= bit << shift; in rbsp_write_bit()
146 static inline int rbsp_read_bits(struct rbsp *rbsp, int num, int *val) in rbsp_read_bits() argument
155 ret = rbsp_read_bit(rbsp); in rbsp_read_bits()
167 static int rbsp_write_bits(struct rbsp *rbsp, int num, int value) in rbsp_write_bits() argument
172 ret = rbsp_write_bit(rbsp, (value >> num) & 1); in rbsp_write_bits()
180 static int rbsp_read_uev(struct rbsp *rbsp, unsigned int *val) in rbsp_read_uev() argument
186 while ((ret = rbsp_read_bit(rbsp)) == 0) in rbsp_read_uev()
192 ret = rbsp_read_bits(rbsp, leading_zero_bits, &tmp); in rbsp_read_uev()
203 static int rbsp_write_uev(struct rbsp *rbsp, unsigned int value) in rbsp_write_uev() argument
211 ret = rbsp_write_bit(rbsp, 0); in rbsp_write_uev()
216 return rbsp_write_bits(rbsp, leading_zero_bits + 1, tmp); in rbsp_write_uev()
219 static int rbsp_read_sev(struct rbsp *rbsp, int *val) in rbsp_read_sev() argument
224 ret = rbsp_read_uev(rbsp, &tmp); in rbsp_read_sev()
259 struct rbsp sps; in coda_h264_sps_fixup()