Home | History | Annotate | Download | only in source

Lines Matching refs:bits

52  * 4 bits symbol value (bits [4,7]) along with four bits to represent length
53 * of the VLC code word (bits [0,3]) */
55 /* macro to obtain length of the coeff token information field, bits [0,4] */
57 /* macro to obtain length of the other information fields, bits [0,3] */
59 /* macro to obtain code word from the information fields, bits [4,7] */
60 #define INFO(vlc) (((vlc) >> 4) & 0xF) /* 4 MSB bits contain information */
62 * bits [5,10] */
65 * bits [11,15] */
70 /* VLC tables for coeff_token. Because of long codes (max. 16 bits) some of the
73 * [5 bits for tot.coeff.] [6 bits for tr.ones] [5 bits for VLC length]
77 /* VLC lengths up to 6 bits, 0 <= nC < 2 */
84 /* VLC lengths up to 10 bits, 0 <= nC < 2 */
93 /* VLC lengths up to 14 bits, 0 <= nC < 2 */
103 /* VLC lengths up to 16 bits, 0 <= nC < 2 */
110 /* VLC lengths up to 6 bits, 2 <= nC < 4 */
117 /* VLC lengths up to 9 bits, 2 <= nC < 4 */
124 /* VLC lengths up to 14 bits, 2 <= nC < 4 */
143 /* VLC lengths up to 6 bits, 4 <= nC < 8 */
154 /* VLC lengths up to 10 bits, 4 <= nC < 8 */
184 /* VLC lengths up to 3 bits, nC == -1 */
188 /* VLC lengths up to 8 bits, nC == -1 */
198 * [4 bits for info] [4 bits for VLC length] */
200 /* VLC lengths up to 5 bits */
207 /* VLC lengths up to 9 bits */
305 * [4 bits for info] [4bits for VLC length]
323 /* macro to initialize stream buffer cache, fills the buffer (32 bits) */
324 #define BUFFER_INIT(value, bits) \
326 bits = 32; \
330 /* macro to read numBits bits from the buffer, bits will be written to
331 * outVal. Refills the buffer if not enough bits left */
332 #define BUFFER_SHOW(value, bits, outVal, numBits) \
334 if (bits < (numBits)) \
336 if(h264bsdFlushBits(pStrmData,32-bits) == END_OF_STREAM) \
339 bits = 32; \
344 /* macro to flush numBits bits from the buffer */
345 #define BUFFER_FLUSH(value, bits, numBits) \
348 bits -= (numBits); \
351 /* macro to read and flush numBits bits from the buffer, bits will be written
352 * to outVal. Refills the buffer if not enough bits left */
353 #define BUFFER_GET(value, bits, outVal, numBits) \
355 if (bits < (numBits)) \
357 if(h264bsdFlushBits(pStrmData,32-bits) == END_OF_STREAM) \
360 bits = 32; \
364 bits -= (numBits); \
371 static u32 DecodeCoeffToken(u32 bits, u32 nc);
373 static u32 DecodeLevelPrefix(u32 bits);
375 static u32 DecodeTotalZeros(u32 bits, u32 totalCoeff, u32 isChromaDC);
377 static u32 DecodeRunBefore(u32 bits,u32 zerosLeft);
387 u32 bits next 16 stream bits
391 u32 information field (11 bits for value, 5 bits for length)
395 u32 DecodeCoeffToken(u32 bits, u32 nc)
410 if (bits >= 0x8000)
414 else if (bits >= 0x0C00)
415 value = coeffToken0_0[bits >> 10];
416 else if (bits >= 0x0100)
417 value = coeffToken0_1[bits >> 6];
418 else if (bits >= 0x0020)
419 value = coeffToken0_2[(bits>>2)-8];
421 value = coeffToken0_3[bits];
425 if (bits >= 0x8000)
427 value = bits & 0x4000 ? 0x0002 : 0x0822;
429 else if (bits >= 0x1000)
430 value = coeffToken2_0[bits >> 10];
431 else if (bits >= 0x0200)
432 value = coeffToken2_1[bits >> 7];
434 value = coeffToken2_2[bits>>2];
438 value = coeffToken4_0[bits >> 10];
440 value = coeffToken4_1[bits>>6];
444 value = coeffToken8[bits>>10];
448 value = coeffTokenMinus1_0[bits >> 13];
450 value = coeffTokenMinus1_1[bits>>8];
465 u32 bits next 16 stream bits
472 u32 DecodeLevelPrefix(u32 bits)
481 if (bits >= 0x8000)
483 else if (bits >= 0x4000)
485 else if (bits >= 0x2000)
487 else if (bits >= 0x1000)
489 else if (bits >= 0x0800)
491 else if (bits >= 0x0400)
493 else if (bits >= 0x0200)
495 else if (bits >= 0x0100)
497 else if (bits >= 0x0080)
499 else if (bits >= 0x0040)
501 else if (bits >= 0x0020)
503 else if (bits >= 0x0010)
505 else if (bits >= 0x0008)
507 else if (bits >= 0x0004)
509 else if (bits >= 0x0002)
511 else if (bits >= 0x0001)
528 u32 bits next 9 stream bits
534 u32 information field (4 bits value, 4 bits length)
538 u32 DecodeTotalZeros(u32 bits, u32 totalCoeff, u32 isChromaDC)
555 value = totalZeros_1_0[bits >> 4];
557 value = totalZeros_1_1[bits];
561 value = totalZeros_2[bits >> 3];
565 value = totalZeros_3[bits >> 3];
569 value = totalZeros_4[bits >> 4];
573 value = totalZeros_5[bits >> 4];
577 value = totalZeros_6[bits >> 3];
581 value = totalZeros_7[bits >> 3];
585 value = totalZeros_8[bits >> 3];
589 value = totalZeros_9[bits >> 3];
593 value = totalZeros_10[bits >> 4];
597 value = totalZeros_11[bits >> 5];
601 value = totalZeros_12[bits >> 5];
605 value = totalZeros_13[bits >> 6];
609 value = totalZeros_14[bits >> 7];
613 value = (bits >> 8) ? 0x11 : 0x01;
620 bits >>= 6;
621 if (bits > 3)
627 else if (bits > 1)
633 else if (bits)
652 u32 bits next 11 stream bits
656 u32 information field (4 bits value, 4 bits length)
660 u32 DecodeRunBefore(u32 bits, u32 zerosLeft)
672 value = runBefore_1[bits>>10];
676 value = runBefore_2[bits>>9];
680 value = runBefore_3[bits>>9];
684 value = runBefore_4[bits>>8];
688 value = runBefore_5[bits>>8];
692 value = runBefore_6[bits>>8];
696 if (bits >= 0x100)
697 value = ((7-(bits>>8))<<4)+0x3;
698 else if (bits >= 0x80)
700 else if (bits >= 0x40)
702 else if (bits >= 0x20)
704 else if (bits >= 0x10)
706 else if (bits >= 0x8)
708 else if (bits >= 0x4)
710 else if (bits >= 0x2)
712 else if (bits)
740 numCoeffs on bits [4,11] if successful
741 coeffMap on bits [16,31] if successful, this is bit map