26 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
27 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
28 |
* |
* |
29 |
* $Id: encoder.c,v 1.95.2.21 2003-05-12 12:27:32 suxen_drol Exp $ |
* $Id: encoder.c,v 1.95.2.23 2003-05-16 17:16:21 suxen_drol Exp $ |
30 |
* |
* |
31 |
****************************************************************************/ |
****************************************************************************/ |
32 |
|
|
679 |
data.fincr = frame->fincr; |
data.fincr = frame->fincr; |
680 |
data.fbase = pEnc->mbParam.fbase; |
data.fbase = pEnc->mbParam.fbase; |
681 |
|
|
682 |
|
for (i=0; i<3; i++) { |
683 |
|
data.min_quant[i] = pEnc->mbParam.min_quant[i]; |
684 |
|
data.max_quant[i] = pEnc->mbParam.max_quant[i]; |
685 |
|
} |
686 |
|
|
687 |
data.reference.csp = XVID_CSP_USER; |
data.reference.csp = XVID_CSP_USER; |
688 |
data.reference.plane[0] = pEnc->reference->image.y; |
data.reference.plane[0] = pEnc->reference->image.y; |
689 |
data.reference.plane[1] = pEnc->reference->image.u; |
data.reference.plane[1] = pEnc->reference->image.u; |
1084 |
type = MEanalysis(&pEnc->reference->image, pEnc->current, |
type = MEanalysis(&pEnc->reference->image, pEnc->current, |
1085 |
&pEnc->mbParam, pEnc->mbParam.iMaxKeyInterval, |
&pEnc->mbParam, pEnc->mbParam.iMaxKeyInterval, |
1086 |
pEnc->iFrameNum, pEnc->bframenum_tail, xFrame->bframe_threshold); |
pEnc->iFrameNum, pEnc->bframenum_tail, xFrame->bframe_threshold); |
|
|
|
|
if (type == B_VOP && !(pEnc->current->vop_flags & XVID_VOP_DYNAMIC_BFRAMES)) { |
|
|
type = P_VOP; /* disable dynamic bframes */ |
|
|
} |
|
1087 |
} |
} |
1088 |
} |
} |
1089 |
|
|
1090 |
/* bframes buffer overflow check */ |
/* bframes buffer overflow check */ |
1091 |
if (type != I_VOP) { |
if (type == B_VOP && pEnc->bframenum_tail >= pEnc->mbParam.max_bframes) { |
|
if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes) { |
|
1092 |
type = P_VOP; |
type = P_VOP; |
|
}else{ |
|
|
type = B_VOP; |
|
|
} |
|
1093 |
} |
} |
1094 |
|
|
1095 |
pEnc->iFrameNum++; |
pEnc->iFrameNum++; |