162 |
const FRAMEINFO * const frame, |
const FRAMEINFO * const frame, |
163 |
int mbnum); |
int mbnum); |
164 |
|
|
|
/***************************************************************************** |
|
|
* Bitstream |
|
|
****************************************************************************/ |
|
|
|
|
|
/* Input buffer should be readable as full chunks of 8bytes, including |
|
|
the end of the buffer. Padding might be appropriate. If only chunks |
|
|
of 4bytes are applicable, define XVID_SAFE_BS_TAIL. Note that this will |
|
|
slow decoding, so consider this as a last-resort solution */ |
|
|
/* #define XVID_SAFE_BS_TAIL */ |
|
|
|
|
165 |
/* initialise bitstream structure */ |
/* initialise bitstream structure */ |
166 |
|
|
167 |
static void __inline |
static void __inline |
263 |
uint32_t tmp; |
uint32_t tmp; |
264 |
|
|
265 |
bs->bufa = bs->bufb; |
bs->bufa = bs->bufb; |
|
#if defined(XVID_SAFE_BS_TAIL) |
|
|
if (bs->tail<(bs->start+((bs->length+3)>>2))) |
|
|
#endif |
|
|
{ |
|
266 |
tmp = *((uint32_t *) bs->tail + 2); |
tmp = *((uint32_t *) bs->tail + 2); |
267 |
#ifndef ARCH_IS_BIG_ENDIAN |
#ifndef ARCH_IS_BIG_ENDIAN |
268 |
BSWAP(tmp); |
BSWAP(tmp); |
269 |
#endif |
#endif |
270 |
bs->bufb = tmp; |
bs->bufb = tmp; |
271 |
bs->tail++; |
bs->tail++; |
|
} |
|
|
#if defined(XVID_SAFE_BS_TAIL) |
|
|
else { |
|
|
bs->bufb = 0; |
|
|
} |
|
|
#endif |
|
272 |
bs->pos -= 32; |
bs->pos -= 32; |
273 |
} |
} |
274 |
} |
} |