37 |
* MinChen <chenm001@163.com> |
* MinChen <chenm001@163.com> |
38 |
* 14.04.2002 added FrameCodeB() |
* 14.04.2002 added FrameCodeB() |
39 |
* |
* |
40 |
* $Id: encoder.c,v 1.48 2002-06-24 09:53:17 suxen_drol Exp $ |
* $Id: encoder.c,v 1.49 2002-06-25 09:41:53 suxen_drol Exp $ |
41 |
* |
* |
42 |
****************************************************************************/ |
****************************************************************************/ |
43 |
|
|
742 |
pEnc->bframenum_head, pEnc->bframenum_tail, |
pEnc->bframenum_head, pEnc->bframenum_tail, |
743 |
pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size); |
pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size); |
744 |
|
|
|
|
|
745 |
BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0); |
BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0); |
746 |
BitstreamPad(&bs); |
BitstreamPad(&bs); |
747 |
BitstreamPutBits(&bs, 0x7f, 8); |
BitstreamPutBits(&bs, 0x7f, 8); |
812 |
pEnc->bframenum_head, pEnc->bframenum_tail, |
pEnc->bframenum_head, pEnc->bframenum_tail, |
813 |
pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size); |
pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size); |
814 |
|
|
|
|
|
815 |
pFrame->intra = 0; |
pFrame->intra = 0; |
816 |
|
|
817 |
BitstreamPutBits(&bs, 0x7f, 8); |
BitstreamPutBits(&bs, 0x7f, 8); |
914 |
* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ |
* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ |
915 |
|
|
916 |
|
|
917 |
if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop != -1 || |
if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop >= 0 || |
918 |
(pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 && |
(pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 && |
919 |
pEnc->iFrameNum >= pEnc->iMaxKeyInterval) |
pEnc->iFrameNum >= pEnc->iMaxKeyInterval) |
920 |
|| image_mad(&pEnc->reference->image, &pEnc->current->image, |
|| image_mad(&pEnc->reference->image, &pEnc->current->image, |
948 |
pFrame->intra = 0; |
pFrame->intra = 0; |
949 |
|
|
950 |
} else { |
} else { |
951 |
pEnc->bframenum_dx50bvop = -1; |
|
952 |
FrameCodeI(pEnc, &bs, &bits); |
FrameCodeI(pEnc, &bs, &bits); |
953 |
pFrame->intra = 1; |
pFrame->intra = 1; |
954 |
|
|
955 |
|
pEnc->bframenum_dx50bvop = -1; |
956 |
} |
} |
957 |
|
|
958 |
pEnc->flush_bframes = 1; |
pEnc->flush_bframes = 1; |
959 |
|
|
960 |
if ((pEnc->global & XVID_GLOBAL_PACKED)) { |
if ((pEnc->global & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0) { |
961 |
BitstreamPad(&bs); |
BitstreamPad(&bs); |
962 |
input_valid = 0; |
input_valid = 0; |
963 |
goto ipvop_loop; |
goto ipvop_loop; |