39 |
* MinChen <chenm001@163.com> |
* MinChen <chenm001@163.com> |
40 |
* 14.04.2002 added FrameCodeB() |
* 14.04.2002 added FrameCodeB() |
41 |
* |
* |
42 |
* $Id: encoder.c,v 1.76.2.2 2002-09-26 01:54:54 h Exp $ |
* $Id: encoder.c,v 1.76.2.3 2002-09-27 17:25:17 h Exp $ |
43 |
* |
* |
44 |
****************************************************************************/ |
****************************************************************************/ |
45 |
|
|
659 |
{ |
{ |
660 |
uint16_t x, y; |
uint16_t x, y; |
661 |
Bitstream bs; |
Bitstream bs; |
662 |
uint32_t bits; |
uint32_t bits, mode; |
663 |
|
|
664 |
int input_valid = 1; |
int input_valid = 1; |
665 |
|
|
907 |
if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop >= 0 || |
if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop >= 0 || |
908 |
(pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 && |
(pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 && |
909 |
pEnc->iFrameNum >= pEnc->iMaxKeyInterval) |
pEnc->iFrameNum >= pEnc->iMaxKeyInterval) |
910 |
|| image_mad(&pEnc->reference->image, &pEnc->current->image, |
|| /*image_mad(&pEnc->reference->image, &pEnc->current->image, |
911 |
pEnc->mbParam.edged_width, pEnc->mbParam.width, |
pEnc->mbParam.edged_width, pEnc->mbParam.width, |
912 |
pEnc->mbParam.height) > 30) { |
pEnc->mbParam.height) > 30) {*/ |
913 |
|
2 == (mode = MEanalysis(&pEnc->reference->image, &pEnc->current->image, |
914 |
|
&pEnc->mbParam, pEnc->current->mbs, pEnc->current->fcode))) { |
915 |
|
|
916 |
/* |
/* |
917 |
* This will be coded as an Intra Frame |
* This will be coded as an Intra Frame |
918 |
*/ |
*/ |
960 |
* NB : sequences like "IIBB" decode fine with msfdam but, |
* NB : sequences like "IIBB" decode fine with msfdam but, |
961 |
* go screwy with divx 5.00 |
* go screwy with divx 5.00 |
962 |
*/ |
*/ |
963 |
} else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes) { |
} else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes || mode != 0) { |
964 |
/* |
/* |
965 |
* This will be coded as a Predicted Frame |
* This will be coded as a Predicted Frame |
966 |
*/ |
*/ |