Mercurial > libavcodec.hg
comparison common.h @ 144:cb5dabd00ba2 libavcodec
- Bug fix on inter MCBPC table for inter+q.
- H.263/H.263+ decoder now knows GOB start codes.
- H.263/H.263+ decoder now returns the size of the stream on the first call.
- Added show_bits() functions to see the buffer without loosing the bits.
- TODO: H.263v1 UMV parsing is buggy.
author | pulento |
---|---|
date | Sat, 03 Nov 2001 00:49:53 +0000 |
parents | bec00a2f18e2 |
children | ae0516eadae2 |
comparison
equal
deleted
inserted
replaced
143:35e3ced6cfd9 | 144:cb5dabd00ba2 |
---|---|
194 | 194 |
195 void init_get_bits(GetBitContext *s, | 195 void init_get_bits(GetBitContext *s, |
196 UINT8 *buffer, int buffer_size); | 196 UINT8 *buffer, int buffer_size); |
197 | 197 |
198 unsigned int get_bits_long(GetBitContext *s, int n); | 198 unsigned int get_bits_long(GetBitContext *s, int n); |
199 unsigned int show_bits_long(GetBitContext *s, int n); | |
199 | 200 |
200 static inline unsigned int get_bits(GetBitContext *s, int n){ | 201 static inline unsigned int get_bits(GetBitContext *s, int n){ |
201 if(s->bit_cnt>=n){ | 202 if(s->bit_cnt>=n){ |
202 /* most common case here */ | 203 /* most common case here */ |
203 unsigned int val = s->bit_buf >> (32 - n); | 204 unsigned int val = s->bit_buf >> (32 - n); |
221 st_bit_counts[st_current_index]++; | 222 st_bit_counts[st_current_index]++; |
222 #endif | 223 #endif |
223 return val; | 224 return val; |
224 } | 225 } |
225 return get_bits_long(s,1); | 226 return get_bits_long(s,1); |
227 } | |
228 | |
229 /* This function is identical to get_bits(), the only */ | |
230 /* diference is that it doesn't touch the buffer */ | |
231 /* it is usefull to see the buffer. */ | |
232 static inline unsigned int show_bits(GetBitContext *s, int n) | |
233 { | |
234 if(s->bit_cnt>=n) { | |
235 /* most common case here */ | |
236 unsigned int val = s->bit_buf >> (32 - n); | |
237 return val; | |
238 } | |
239 return show_bits_long(s,n); | |
226 } | 240 } |
227 | 241 |
228 static inline void skip_bits(GetBitContext *s, int n){ | 242 static inline void skip_bits(GetBitContext *s, int n){ |
229 if(s->bit_cnt>=n){ | 243 if(s->bit_cnt>=n){ |
230 /* most common case here */ | 244 /* most common case here */ |