- output->nw = in->nw;
- output->nh = in->nh;
- output->x = in->x + ( out->x - in->x ) * position;
- output->y = in->y + ( out->y - in->y ) * position;
- output->w = in->w + ( out->w - in->w ) * position;
- output->h = in->h + ( out->h - in->h ) * position;
- output->mix = in->mix + ( out->mix - in->mix ) * position;
- output->distort = in->distort;
-
- // DRD> These break on negative values. I do not think they are needed
- // since yuv_composite takes care of YUYV group alignment
- //output->x = ( int )floor( output->x ) & 0xfffffffe;
- //output->w = ( int )floor( output->w ) & 0xfffffffe;
- //output->sw &= 0xfffffffe;
+ if ( in->frame != out->frame - 1 )
+ {
+ output->nw = in->nw;
+ output->nh = in->nh;
+ output->x = rint( in->x + ( out->x - in->x ) * position + 0.5 );
+ output->y = rint( in->y + ( out->y - in->y ) * position + 0.5 );
+ output->w = rint( in->w + ( out->w - in->w ) * position + 0.5 );
+ output->h = rint( in->h + ( out->h - in->h ) * position + 0.5 );
+ output->mix = in->mix + ( out->mix - in->mix ) * position;
+ output->distort = in->distort;
+ }
+ else
+ {
+ output->nw = out->nw;
+ output->nh = out->nh;
+ output->x = out->x;
+ output->y = out->y;
+ output->w = out->w;
+ output->h = out->h;
+ output->mix = out->mix;
+ output->distort = out->distort;
+ }
+
+ // Definitely incorrect...
+#if 0
+ if ( ( int )output->x & 1 && ( int )output->w & 1 )
+ {
+ output->x -= 1.0;
+ output->w += 1.0;
+ }
+ else if ( ( int )output->x & 1 )
+ {
+ output->x += 1.0;
+ }
+ else if ( ( int )output->w & 1 )
+ {
+ output->w += 1.0;
+ }
+#endif