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.15 2002-11-02 16:12:27 chl Exp $ |
* $Id: encoder.c,v 1.76.2.16 2002-11-07 10:28:15 suxen_drol Exp $ |
43 |
* |
* |
44 |
****************************************************************************/ |
****************************************************************************/ |
45 |
|
|
107 |
}; |
}; |
108 |
|
|
109 |
|
|
|
static void __inline |
|
|
image_null(IMAGE * image) |
|
|
{ |
|
|
image->y = image->u = image->v = NULL; |
|
|
} |
|
|
|
|
|
|
|
110 |
/***************************************************************************** |
/***************************************************************************** |
111 |
* Encoder creation |
* Encoder creation |
112 |
* |
* |
616 |
start_timer(); |
start_timer(); |
617 |
if (image_input |
if (image_input |
618 |
(&pEnc->queue[pEnc->queue_tail], pEnc->mbParam.width, pEnc->mbParam.height, |
(&pEnc->queue[pEnc->queue_tail], pEnc->mbParam.width, pEnc->mbParam.height, |
619 |
pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace)) |
pEnc->mbParam.edged_width, pFrame->image, pFrame->stride, pFrame->colorspace, pFrame->general & XVID_INTERLACING)) |
620 |
return; |
return; |
621 |
stop_conv_timer(); |
stop_conv_timer(); |
622 |
|
|
711 |
pFrame->length = BitstreamLength(&bs); |
pFrame->length = BitstreamLength(&bs); |
712 |
pFrame->intra = 0; |
pFrame->intra = 0; |
713 |
|
|
714 |
|
emms(); |
715 |
|
|
716 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
717 |
} |
} |
718 |
|
|
731 |
if (input_valid) |
if (input_valid) |
732 |
queue_image(pEnc, pFrame); |
queue_image(pEnc, pFrame); |
733 |
|
|
734 |
|
emms(); |
735 |
|
|
736 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
737 |
} |
} |
738 |
|
|
766 |
if (input_valid) |
if (input_valid) |
767 |
queue_image(pEnc, pFrame); |
queue_image(pEnc, pFrame); |
768 |
|
|
769 |
|
emms(); |
770 |
|
|
771 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
772 |
} |
} |
773 |
} |
} |
798 |
start_timer(); |
start_timer(); |
799 |
if (image_input |
if (image_input |
800 |
(&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height, |
(&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height, |
801 |
pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace)) |
pEnc->mbParam.edged_width, pFrame->image, pFrame->stride, pFrame->colorspace, pFrame->general & XVID_INTERLACING)) |
802 |
|
{ |
803 |
|
emms(); |
804 |
return XVID_ERR_FORMAT; |
return XVID_ERR_FORMAT; |
805 |
|
} |
806 |
stop_conv_timer(); |
stop_conv_timer(); |
807 |
|
|
808 |
// queue input frame, and dequue next image |
// queue input frame, and dequue next image |
841 |
} |
} |
842 |
|
|
843 |
pFrame->length = BitstreamLength(&bs); |
pFrame->length = BitstreamLength(&bs); |
844 |
|
emms(); |
845 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
846 |
} |
} |
847 |
|
|
1079 |
stop_global_timer(); |
stop_global_timer(); |
1080 |
write_timer(); |
write_timer(); |
1081 |
|
|
1082 |
|
emms(); |
1083 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
1084 |
} |
} |
1085 |
|
|
1134 |
start_timer(); |
start_timer(); |
1135 |
if (image_input |
if (image_input |
1136 |
(&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height, |
(&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height, |
1137 |
pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace) < 0) |
pEnc->mbParam.edged_width, pFrame->image, pFrame->stride, pFrame->colorspace, pFrame->general & XVID_INTERLACING) < 0) |
1138 |
return XVID_ERR_FORMAT; |
return XVID_ERR_FORMAT; |
1139 |
stop_conv_timer(); |
stop_conv_timer(); |
1140 |
|
|
1625 |
|
|
1626 |
if (pEnc->current->global_flags & XVID_GMC) { |
if (pEnc->current->global_flags & XVID_GMC) { |
1627 |
// printf("Global Motion = %d %d quarterpel=%d\n", pEnc->current->GMC_MV.x, pEnc->current->GMC_MV.y,pEnc->current->quarterpel); |
// printf("Global Motion = %d %d quarterpel=%d\n", pEnc->current->GMC_MV.x, pEnc->current->GMC_MV.y,pEnc->current->quarterpel); |
1628 |
|
DPRINTF(DPRINTF_HEADER, "Global Motion = %d %d quarterpel=%d\n", pEnc->current->GMC_MV.x, pEnc->current->GMC_MV.y,pEnc->current->quarterpel); |
1629 |
pEnc->current->coding_type = S_VOP; |
pEnc->current->coding_type = S_VOP; |
1630 |
} else |
} else |
1631 |
pEnc->current->coding_type = P_VOP; |
pEnc->current->coding_type = P_VOP; |