[XviD-devel] optimizations

skal skal at planet-d.net
Mon Apr 14 19:40:21 CEST 2003


	Gruel,

On Sun, 2003-04-13 at 12:47, Christoph Lampert wrote:

> P.S. @skal: Are you sure the parameters that are generated in 3 wp 
>      mode when only 2 wp would be needed (num_wp==2) is correct? 
>      It seems to me that scaling for duv[2] is wrong (ffmpeg shows 
>      errors), but when num_wp==2 is treated like 3, it's gone. 

	I haven't had a chance to re-read the ISO yet, but
	looking at the code, I can see a problem: the 3 points->2 points
	simplification shouldn't be done before the gradient
	have been computed and most of all *rounded*. But then,
	there's no point in simplifying 3->2warp pt, anyway, since
	the loop will be the same. So, i think the tests at the
	beginning of generate_GMCparameters() should read:


    // reduce the number of points, if possible
  if (nb_pts<2 || (pts->duv[1].x==0 && pts->duv[1].y==0 && pts->duv[2].x==0 && pts->duv[2].y==0)) {
    if (nb_pts<2 || (pts->duv[1].x==0 && pts->duv[1].y==0)) {
      if (nb_pts<1 || (pts->duv[0].x==0 && pts->duv[0].y==0)) {
	  nb_pts = 0;
	}
	  else nb_pts = 1;
    }
    else nb_pts = 2;
  }
  else nb_pts = 3;



	instead. Does it fix you problem?


	bye,
			Skal




More information about the XviD-devel mailing list