[XviD-devel] GME speedup

Antonin Misek tonda.misek at post.cz
Fri Dec 12 08:39:50 CET 2003


Hi all,
I studied the function estimation_gmc.c/GlobalMotionEstRefine more and
prepared new version. The change is relatively small. Output is very similar
to original. But it uses about 30% less calls of estimation_gmc.c/globalSAD.
It is tested with MSVC and ARCH_IS_GENERIC without ProcesorPack (I cannot
install it, it breaks compilation of my other project).

Sorry Gruel for my last mail. I now understand that the specific part of
code is not bug but hack.

Nice XviDing

TonyMi

	int direction=4096,oldDirection;

#define TEST_ONE_CHANGE(var,dir)\
	if ((!direction)&&(dir*2>oldDirection)) break;\
	##var--;\
	if ((gmcSAD = globalSAD(&bestwp, pParam, pMBs, current, pRef, pCurr,
GMCblock))<gmcminSAD)\
	{ \
		gmcminSAD = gmcSAD;\
		direction |= dir;\
	} else {\
		##var+=2;\
		if ((gmcSAD = globalSAD(&bestwp, pParam, pMBs, current, pRef, pCurr,
GMCblock))<gmcminSAD)\
		{ \
			gmcminSAD = gmcSAD;\
			direction |= dir*2;\
		} else {\
			##var--;}\
	}

	do {
		oldDirection=direction;
		direction = 0;
		TEST_ONE_CHANGE(bestwp.duv[0].x,1);
		TEST_ONE_CHANGE(bestwp.duv[0].y,4);
		TEST_ONE_CHANGE(bestwp.duv[1].x,16);
		TEST_ONE_CHANGE(bestwp.duv[1].y,64);
		TEST_ONE_CHANGE(bestwp.duv[2].x,256);
		TEST_ONE_CHANGE(bestwp.duv[2].y,1024);
	} while (direction);




More information about the XviD-devel mailing list