--- encoder.c 2002/09/05 19:34:35 1.80 +++ encoder.c 2002/10/19 11:41:11 1.85 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - Encoder main module - * - * Copyright(C) 2002 Michael Militzer + * Copyright(C) 2002 Michael Militzer * * This program is an implementation of a part of one or more MPEG-4 * Video tools as specified in ISO/IEC 14496-2 standard. Those intending @@ -28,7 +28,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: encoder.c,v 1.80 2002/09/05 19:34:35 edgomez Exp $ + * $Id: encoder.c,v 1.85 2002/10/19 11:41:11 edgomez Exp $ * ****************************************************************************/ @@ -257,9 +257,7 @@ image_null(&pEnc->reference->image); image_null(&pEnc->vInterH); image_null(&pEnc->vInterV); - image_null(&pEnc->vInterVf); image_null(&pEnc->vInterHV); - image_null(&pEnc->vInterHVf); #ifdef _DEBUG_PSNR if (image_create @@ -284,17 +282,9 @@ pEnc->mbParam.edged_height) < 0) goto xvid_err_memory3; if (image_create - (&pEnc->vInterVf, pEnc->mbParam.edged_width, - pEnc->mbParam.edged_height) < 0) - goto xvid_err_memory3; - if (image_create (&pEnc->vInterHV, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height) < 0) goto xvid_err_memory3; - if (image_create - (&pEnc->vInterHVf, pEnc->mbParam.edged_width, - pEnc->mbParam.edged_height) < 0) - goto xvid_err_memory3; pParam->handle = (void *) pEnc; @@ -328,12 +318,8 @@ pEnc->mbParam.edged_height); image_destroy(&pEnc->vInterV, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height); - image_destroy(&pEnc->vInterVf, pEnc->mbParam.edged_width, - pEnc->mbParam.edged_height); image_destroy(&pEnc->vInterHV, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height); - image_destroy(&pEnc->vInterHVf, pEnc->mbParam.edged_width, - pEnc->mbParam.edged_height); xvid_err_memory2: xvid_free(pEnc->current->mbs); @@ -375,12 +361,8 @@ pEnc->mbParam.edged_height); image_destroy(&pEnc->vInterV, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height); - image_destroy(&pEnc->vInterVf, pEnc->mbParam.edged_width, - pEnc->mbParam.edged_height); image_destroy(&pEnc->vInterHV, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height); - image_destroy(&pEnc->vInterHVf, pEnc->mbParam.edged_width, - pEnc->mbParam.edged_height); #ifdef _DEBUG_PSNR image_destroy(&pEnc->sOriginal, pEnc->mbParam.edged_width, @@ -560,7 +542,7 @@ emms(); if (pFrame->quant == 0) { - RateControlUpdate(&pEnc->rate_control, pEnc->current->quant, + RateControlUpdate(&pEnc->rate_control, (int16_t)pEnc->current->quant, pFrame->length, pFrame->intra); } #ifdef _DEBUG_PSNR @@ -889,7 +871,7 @@ DECLARE_ALIGNED_MATRIX(qcoeff, 6, 64, int16_t, CACHE_LINE); int iLimit; - int x, y, k; + unsigned int x, y; int iSearchRange; int bIntra; @@ -898,8 +880,7 @@ start_timer(); image_setedges(pRef, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, - pEnc->mbParam.width, pEnc->mbParam.height, - pEnc->current->global_flags & XVID_INTERLACING); + pEnc->mbParam.width, pEnc->mbParam.height); stop_edges_timer(); pEnc->mbParam.m_rounding_type = 1 - pEnc->mbParam.m_rounding_type; @@ -1000,11 +981,11 @@ CodeIntraMB(pEnc, pMB); MBTransQuantIntra(&pEnc->mbParam, pEnc->current, pMB, x, y, dct_codes, qcoeff); - } - start_timer(); - MBPrediction(pEnc->current, x, y, pEnc->mbParam.mb_width, qcoeff); - stop_prediction_timer(); + start_timer(); + MBPrediction(pEnc->current, x, y, pEnc->mbParam.mb_width, qcoeff); + stop_prediction_timer(); + } if (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q) { pEnc->sStat.kblks++;