/*This is meant to be a large, positive constant that can still be efficiently loadedasanimmediate(onplatformslikeARM,forexample).
Even relatively modest values like 100 would work fine.*/ #define VP8_LOTS_OF_BITS (0x40000000)
staticINLINEint vp8_decode_value(BOOL_DECODER *br, int bits) { int z = 0; int bit;
for (bit = bits - 1; bit >= 0; bit--) {
z |= (vp8dx_decode_bool(br, 0x80) << bit);
}
return z;
}
staticINLINEint vp8dx_bool_error(BOOL_DECODER *br) { /* Check if we have reached the end of the buffer. * *Variable'count'storesthenumberofbitsinthe'value'buffer,minus *8.Thetopbyteispartofthealgorithm,andtheremainderisbuffered *tobeshiftedintoit.Soifcount==8,thetop16bitsof'value'are *occupied,8forthealgorithmand8inthebuffer. * *Whenreadingabytefromtheuser'sbuffer,countisfilledwith8and *onebyteisfilledintothevaluebuffer.Whenwereachtheendofthe *data,countisadditionallyfilledwithVP8_LOTS_OF_BITS.Sowhen *count==VP8_LOTS_OF_BITS-1,theuser'sdatahasbeenexhausted.
*/ if ((br->count > VP8_BD_VALUE_SIZE) && (br->count < VP8_LOTS_OF_BITS)) { /* We have tried to decode bits after the end of *streamwasencountered.
*/ return1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.