int sumtop, sumbot, sumsqtop, sumsqbot, sumbottop;
int32_t sumtop, sumbot, sumsqtop, sumsqbot, sumbottop;
int field_dct_best_mmx( uint8_t *cur_lum_mb, uint8_t *pred_lum_mb){	/*	 * calculate prediction error (cur-pred) for top (blk0)	 * and bottom field (blk1)	 */	double r,d;	int rowoffs = 0;	int sumtop, sumbot, sumsqtop, sumsqbot, sumbottop;	int j;	int dct_type;	int topvar, botvar;	mmx_t sumtop_accs, sumbot_accs;	mmx_t sumsqtop_accs, sumsqbot_accs, sumxprod_accs;	int32_t sumtop_acc, sumbot_acc;	int32_t sumsqtop_acc, sumsqbot_acc, sumxprod_acc;	pxor_r2r(mm0,mm0);	movq_r2m( mm0, *(&sumtop_accs) );	movq_r2m( mm0, *(&sumbot_accs) );	movq_r2m( mm0, *(&sumsqtop_accs) );	movq_r2m( mm0, *(&sumsqbot_accs) );	movq_r2m( mm0, *(&sumxprod_accs) );		sumtop = sumsqtop = sumbot = sumsqbot = sumbottop = 0;	sumtop_acc = sumbot_acc = sumsqtop_acc = sumsqbot_acc = sumxprod_acc = 0; 	for (j=0; j<8; j++)	{#ifdef ORIGINAL_CODE		for (i=0; i<16; i++)		{			register int toppix = 				cur_lum_mb[rowoffs+i] - pred_lum_mb[rowoffs+i];			register int botpix = 				cur_lum_mb[rowoffs+width+i] - pred_lum_mb[rowoffs+width+i];			sumtop += toppix;			sumsqtop += toppix*toppix;			sumbot += botpix;			sumsqbot += botpix*botpix;			sumbottop += toppix*botpix;		}#endif		sum_sumsq_8bytes( &cur_lum_mb[rowoffs], &pred_lum_mb[rowoffs],						  &sumtop_accs, &sumbot_accs,						  &sumsqtop_accs, &sumsqbot_accs, &sumxprod_accs						  );		sum_sumsq_8bytes( &cur_lum_mb[rowoffs+8], &pred_lum_mb[rowoffs+8],						  &sumtop_accs, &sumbot_accs,						  &sumsqtop_accs, &sumsqbot_accs, &sumxprod_accs );		rowoffs += (opt->phy_width<<1);	}	mmx_sum_4_word_accs( &sumtop_accs, &sumtop );	mmx_sum_4_word_accs( &sumbot_accs, &sumbot );	emms();	sumsqtop = sumsqtop_accs.d[0] + sumsqtop_accs.d[1];	sumsqbot = sumsqbot_accs.d[0] + sumsqbot_accs.d[1];	sumbottop = sumxprod_accs.d[0] + sumxprod_accs.d[1];	/* Calculate Variances top and bottom.  If they're of similar	 sign estimate correlation if its good use frame DCT otherwise	 use field.	*/	r = 0.0;	topvar = sumsqtop-sumtop*sumtop/128;	botvar = sumsqbot-sumbot*sumbot/128;	if ( !((topvar <= 0) ^ (botvar <= 0)) )	{		d = ((double) topvar) * ((double)botvar);		r = (sumbottop-(sumtop*sumbot)/128);		if (r>0.5*sqrt(d))			return 0; /* frame DCT */		else			return 1; /* field DCT */	}	else		return 1; /* field DCT */	return dct_type;}