627 |
|
|
628 |
#endif |
#endif |
629 |
|
|
630 |
|
|
631 |
|
static int iDQtab[5] = { |
632 |
|
1, 0, -1 /* no change */, 2, 3 |
633 |
|
}; |
634 |
|
#define DQ_VALUE2INDEX(value) iDQtab[(value)+2] |
635 |
|
|
636 |
|
|
637 |
static __inline void |
static __inline void |
638 |
CodeBlockIntra(const FRAMEINFO * const frame, |
CodeBlockIntra(const FRAMEINFO * const frame, |
639 |
const MACROBLOCK * pMB, |
const MACROBLOCK * pMB, |
668 |
|
|
669 |
// write dquant |
// write dquant |
670 |
if (pMB->mode == MODE_INTRA_Q) |
if (pMB->mode == MODE_INTRA_Q) |
671 |
BitstreamPutBits(bs, pMB->dquant, 2); |
BitstreamPutBits(bs, DQ_VALUE2INDEX(pMB->dquant), 2); |
672 |
|
|
673 |
// write interlacing |
// write interlacing |
674 |
if (frame->vol_flags & XVID_INTERLACING) { |
if (frame->vol_flags & XVID_INTERLACING) { |
730 |
|
|
731 |
// write dquant |
// write dquant |
732 |
if (pMB->mode == MODE_INTER_Q) |
if (pMB->mode == MODE_INTER_Q) |
733 |
BitstreamPutBits(bs, pMB->dquant, 2); |
BitstreamPutBits(bs, DQ_VALUE2INDEX(pMB->dquant), 2); |
734 |
|
|
735 |
// interlacing |
// interlacing |
736 |
if (frame->vol_flags & XVID_INTERLACING) { |
if (frame->vol_flags & XVID_INTERLACING) { |