--- encoder.c 2002/06/12 20:38:40 1.41 +++ encoder.c 2002/06/13 11:42:15 1.42 @@ -36,13 +36,14 @@ * MinChen * 14.04.2002 added FrameCodeB() * - * $Id: encoder.c,v 1.41 2002/06/12 20:38:40 edgomez Exp $ + * $Id: encoder.c,v 1.42 2002/06/13 11:42:15 edgomez Exp $ * ****************************************************************************/ #include #include #include +#include #include "encoder.h" #include "prediction/mbprediction.h" @@ -207,6 +208,10 @@ if (pEnc == NULL) return XVID_ERR_MEMORY; + /* Zero the Encoder Structure */ + + memset(pEnc, 0, sizeof(Encoder)); + /* Fill members of Encoder structure */ pEnc->mbParam.width = pParam->width; @@ -640,7 +645,7 @@ SWAP(pEnc->current, pEnc->reference); - EMMS(); + emms(); if (pFrame->quant == 0) pEnc->current->quant = RateControlGetQ(&pEnc->rate_control, 0); @@ -673,7 +678,7 @@ pEnc->mbParam.edged_width, pEnc->mbParam.height); #endif - EMMS(); + emms(); /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% * Luminance masking @@ -802,7 +807,7 @@ pResult->ublks = pEnc->sStat.ublks; } - EMMS(); + emms(); #ifdef _DEBUG psnr = @@ -876,7 +881,7 @@ pEnc->mbParam.edged_width, pEnc->mbParam.height); #endif - EMMS(); + emms(); BitstreamInit(&bs, pFrame->bitstream, 0); @@ -975,7 +980,7 @@ pResult->ublks = pEnc->sStat.ublks; } - EMMS(); + emms(); if (pFrame->quant == 0) { RateControlUpdate(&pEnc->rate_control, pEnc->current->quant,