293{
295 int len, maxBits, cachedBits, padBits;
296 unsigned int cache;
297 unsigned char cw, *tBase;
298
299 if (bitsLeft <= 0)
300 return 0;
301
304
305
306 cache = 0;
307 cachedBits = (8 - bitOffset) & 0x07;
308 if (cachedBits)
309 cache = (unsigned int)(*buf++) << (32 - cachedBits);
310 bitsLeft -= cachedBits;
311
312 i = padBits = 0;
313 while (i < (nVals - 3)) {
314
315 if (bitsLeft >= 16) {
316
317 cache |= (unsigned int)(*buf++) << (24 - cachedBits);
318 cache |= (unsigned int)(*buf++) << (16 - cachedBits);
319 cachedBits += 16;
320 bitsLeft -= 16;
321 } else {
322
323 if (cachedBits + bitsLeft <= 0) return i;
324 if (bitsLeft > 0) cache |= (unsigned int)(*buf++) << (24 - cachedBits);
325 if (bitsLeft > 8) cache |= (unsigned int)(*buf++) << (16 - cachedBits);
326 cachedBits += bitsLeft;
327 bitsLeft = 0;
328
329 cache &= (
signed int)(
int32_t)0x80000000 >> (cachedBits - 1);
330 padBits = 10;
331 cachedBits += padBits;
332 }
333
334
335 while (i < (nVals - 3) && cachedBits >= 10 ) {
336 cw = tBase[cache >> (32 - maxBits)];
338 cachedBits -= len;
339 cache <<= len;
340
345
346
347 if (cachedBits < padBits)
348 return i;
349
350 *vwxy++ = v;
351 *vwxy++ = w;
354 i += 4;
355 }
356 }
357
358
359 return i;
360}
const int32_t quadTabOffset[2]
const unsigned char quadTable[64+16]
const int32_t quadTabMaxBits[2]