1479 |
stop_prediction_timer(); |
stop_prediction_timer(); |
1480 |
|
|
1481 |
start_timer(); |
start_timer(); |
|
if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE) |
|
|
{ pMB->cbp &= 0x3C; /* keep only bits 5-2 */ |
|
|
qcoeff[4*64+0]=0; /* zero, because for INTRA MBs DC value is saved */ |
|
|
qcoeff[5*64+0]=0; |
|
|
} |
|
1482 |
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->current->sStat); |
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->current->sStat); |
1483 |
stop_coding_timer(); |
stop_coding_timer(); |
1484 |
} |
} |
1646 |
MACROBLOCK *pMB = |
MACROBLOCK *pMB = |
1647 |
¤t->mbs[x + y * pParam->mb_width]; |
¤t->mbs[x + y * pParam->mb_width]; |
1648 |
|
|
1649 |
int bIntra = (pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q); |
if (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q) { |
|
|
|
|
if (bIntra) { |
|
1650 |
CodeIntraMB(pEnc, pMB); |
CodeIntraMB(pEnc, pMB); |
1651 |
MBTransQuantIntra(&pEnc->mbParam, current, pMB, x, y, |
MBTransQuantIntra(&pEnc->mbParam, current, pMB, x, y, |
1652 |
dct_codes, qcoeff); |
dct_codes, qcoeff); |
1657 |
|
|
1658 |
current->sStat.kblks++; |
current->sStat.kblks++; |
1659 |
|
|
|
if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE) { |
|
|
pMB->cbp &= 0x3C; /* keep only bits 5-2 */ |
|
|
qcoeff[4*64+0]=0; /* zero, because for INTRA MBs DC value is saved */ |
|
|
qcoeff[5*64+0]=0; |
|
|
} |
|
1660 |
MBCoding(current, pMB, qcoeff, bs, ¤t->sStat); |
MBCoding(current, pMB, qcoeff, bs, ¤t->sStat); |
1661 |
stop_coding_timer(); |
stop_coding_timer(); |
1662 |
continue; |
continue; |
1758 |
} |
} |
1759 |
/* ordinary case: normal coded INTER/INTER4V block */ |
/* ordinary case: normal coded INTER/INTER4V block */ |
1760 |
|
|
|
if ((current->vop_flags & XVID_VOP_GREYSCALE)) |
|
|
{ pMB->cbp &= 0x3C; /* keep only bits 5-2 */ |
|
|
qcoeff[4*64+0]=0; /* zero, because DC for INTRA MBs DC value is saved */ |
|
|
qcoeff[5*64+0]=0; |
|
|
} |
|
|
|
|
1761 |
if((pParam->vol_flags & XVID_VOL_QUARTERPEL)) { |
if((pParam->vol_flags & XVID_VOL_QUARTERPEL)) { |
1762 |
VECTOR predMV = get_qpmv2(current->mbs, pParam->mb_width, 0, x, y, 0); |
VECTOR predMV = get_qpmv2(current->mbs, pParam->mb_width, 0, x, y, 0); |
1763 |
pMB->pmvs[0].x = pMB->qmvs[0].x - predMV.x; |
pMB->pmvs[0].x = pMB->qmvs[0].x - predMV.x; |
1977 |
|
|
1978 |
if (mb->mode == MODE_DIRECT && (mb->cbp | mb->pmvs[3].x | mb->pmvs[3].y) == 0) |
if (mb->mode == MODE_DIRECT && (mb->cbp | mb->pmvs[3].x | mb->pmvs[3].y) == 0) |
1979 |
mb->mode = MODE_DIRECT_NONE_MV; /* skipped */ |
mb->mode = MODE_DIRECT_NONE_MV; /* skipped */ |
1980 |
|
else |
|
/* keep only bits 5-2 -- Chroma blocks will just be skipped by the |
|
|
* coding function for BFrames, that's why we don't zero teh DC |
|
|
* coeffs */ |
|
1981 |
if (frame->vop_flags & XVID_VOP_GREYSCALE) |
if (frame->vop_flags & XVID_VOP_GREYSCALE) |
1982 |
|
/* keep only bits 5-2 -- Chroma blocks will just be skipped by MBCodingBVOP */ |
1983 |
mb->cbp &= 0x3C; |
mb->cbp &= 0x3C; |
1984 |
|
|
1985 |
start_timer(); |
start_timer(); |
1991 |
|
|
1992 |
emms(); |
emms(); |
1993 |
|
|
|
/* TODO: dynamic fcode/bcode ??? */ |
|
|
|
|
1994 |
BitstreamPadAlways(bs); /* next_start_code() at the end of VideoObjectPlane() */ |
BitstreamPadAlways(bs); /* next_start_code() at the end of VideoObjectPlane() */ |
1995 |
frame->length = (BitstreamPos(bs) - bits) / 8; |
frame->length = (BitstreamPos(bs) - bits) / 8; |
1996 |
|
|