543 |
|
|
544 |
} |
} |
545 |
|
|
546 |
BitstreamPutBits(&bs, 0xFFFF, 16); |
/* Fix from CVS_HEAD (2003-03-17) |
547 |
BitstreamPutBits(&bs, 0xFFFF, 16); |
* |
548 |
|
* Relic from OpenDivX - now disabled |
549 |
|
* |
550 |
|
* BitstreamPutBits(&bs, 0xFFFF, 16); |
551 |
|
* BitstreamPutBits(&bs, 0xFFFF, 16); |
552 |
|
*/ |
553 |
BitstreamPad(&bs); |
BitstreamPad(&bs); |
554 |
pFrame->length = BitstreamLength(&bs); |
pFrame->length = BitstreamLength(&bs); |
555 |
|
|
641 |
return; |
return; |
642 |
} |
} |
643 |
|
|
644 |
pEnc->current->fcode = |
pEnc->current->fcode = (hint->rawhints != 0) ? |
645 |
(hint->rawhints) ? hint->mvhint.fcode : BitstreamGetBits(&bs, |
(uint32_t)hint->mvhint.fcode : BitstreamGetBits(&bs, FCODEBITS); |
|
FCODEBITS); |
|
646 |
|
|
647 |
length = pEnc->current->fcode + 5; |
length = pEnc->current->fcode + 5; |
648 |
high = 1 << (length - 1); |
high = 1 << (length - 1); |
657 |
VECTOR tmp; |
VECTOR tmp; |
658 |
int vec; |
int vec; |
659 |
|
|
660 |
pMB->mode = |
pMB->mode = (hint->rawhints != 0) ? |
661 |
(hint->rawhints) ? bhint->mode : BitstreamGetBits(&bs, |
(uint32_t)bhint->mode : BitstreamGetBits(&bs, MODEBITS); |
|
MODEBITS); |
|
662 |
|
|
663 |
pMB->mode = (pMB->mode == MODE_INTER_Q) ? MODE_INTER : pMB->mode; |
pMB->mode = (pMB->mode == MODE_INTER_Q) ? MODE_INTER : pMB->mode; |
664 |
pMB->mode = (pMB->mode == MODE_INTRA_Q) ? MODE_INTRA : pMB->mode; |
pMB->mode = (pMB->mode == MODE_INTRA_Q) ? MODE_INTRA : pMB->mode; |
665 |
|
|
666 |
if (pMB->mode == MODE_INTER) { |
if (pMB->mode == MODE_INTER) { |
667 |
tmp.x = |
tmp.x = (hint->rawhints) ? |
668 |
(hint->rawhints) ? bhint->mvs[0].x : BitstreamGetBits(&bs, |
bhint->mvs[0].x : (int)BitstreamGetBits(&bs, length); |
669 |
length); |
tmp.y = (hint->rawhints) ? |
670 |
tmp.y = |
bhint->mvs[0].y : (int)BitstreamGetBits(&bs, length); |
|
(hint->rawhints) ? bhint->mvs[0].y : BitstreamGetBits(&bs, |
|
|
length); |
|
671 |
tmp.x -= (tmp.x >= high) ? high * 2 : 0; |
tmp.x -= (tmp.x >= high) ? high * 2 : 0; |
672 |
tmp.y -= (tmp.y >= high) ? high * 2 : 0; |
tmp.y -= (tmp.y >= high) ? high * 2 : 0; |
673 |
|
|
681 |
} |
} |
682 |
} else if (pMB->mode == MODE_INTER4V) { |
} else if (pMB->mode == MODE_INTER4V) { |
683 |
for (vec = 0; vec < 4; ++vec) { |
for (vec = 0; vec < 4; ++vec) { |
684 |
tmp.x = |
tmp.x = (hint->rawhints) ? |
685 |
(hint->rawhints) ? bhint->mvs[vec]. |
bhint->mvs[vec].x : (int)BitstreamGetBits(&bs, length); |
686 |
x : BitstreamGetBits(&bs, length); |
tmp.y = (hint->rawhints) ? |
687 |
tmp.y = |
bhint->mvs[vec].y : (int)BitstreamGetBits(&bs, length); |
|
(hint->rawhints) ? bhint->mvs[vec]. |
|
|
y : BitstreamGetBits(&bs, length); |
|
688 |
tmp.x -= (tmp.x >= high) ? high * 2 : 0; |
tmp.x -= (tmp.x >= high) ? high * 2 : 0; |
689 |
tmp.y -= (tmp.y >= high) ? high * 2 : 0; |
tmp.y -= (tmp.y >= high) ? high * 2 : 0; |
690 |
|
|