X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fmotion_est%2Ffilter_motion_est.c;h=f81a2b8324ecb51c1c8fd02aa7bcc49cae8aef5e;hb=351cc75c94ecbcf4e39de43375952447ca7c3fd5;hp=a6afa66b9bc5b50fb95339dea0b5e494c204bc17;hpb=113bbb78306dc480d20e01fce5084522ebc0a781;p=melted diff --git a/src/modules/motion_est/filter_motion_est.c b/src/modules/motion_est/filter_motion_est.c index a6afa66..f81a2b8 100644 --- a/src/modules/motion_est/filter_motion_est.c +++ b/src/modules/motion_est/filter_motion_est.c @@ -3,7 +3,7 @@ * /author Zachary Drew, Copyright 2005 * * Currently only uses Gamma data for comparisonon (bug or feature?) - * Vector optimization coming soon. + * SSE optimized where available. * * Vector orientation: The vector data that is generated for the current frame specifies * the motion from the previous frame to the current frame. To know how a macroblock @@ -34,7 +34,9 @@ #include #include +#ifndef __DARWIN__ #include "sad_sse.h" +#endif #define NDEBUG #include @@ -158,7 +160,7 @@ inline static int constrain( int *x, int *y, int *w, int *h, /** /brief Reference Sum of Absolute Differences comparison function * */ -inline static int sad_reference( uint8_t *block1, uint8_t *block2, const int xstride, const int ystride, const int w, const int h ) +static int sad_reference( uint8_t *block1, uint8_t *block2, const int xstride, const int ystride, const int w, const int h ) { int i, j, score = 0; for ( j = 0; j < h; j++ ){ @@ -288,6 +290,10 @@ static inline void diamond_search( // Keep track of best and former best candidates motion_vector best, former; + best.dx = 0; + best.dy = 0; + former.dx = 0; + former.dy = 0; // The direction of the refinement needs to be known motion_vector current; @@ -608,7 +614,9 @@ static void motion_search( uint8_t *from, //mb_w){ +#ifndef __DARWIN__ case 4: if(c->mb_h == 4) c->compare_optimized = sad_sse_422_luma_4x4; else c->compare_optimized = sad_sse_422_luma_4w; break; @@ -664,6 +673,7 @@ static void init_optimizations( struct motion_est_context_s *c ) break; case 64: c->compare_optimized = sad_sse_422_luma_64w; break; +#endif default: c->compare_optimized = sad_reference; break; } @@ -1064,7 +1074,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) /** Constructor for the filter. */ -mlt_filter filter_motion_est_init( char *arg ) +mlt_filter filter_motion_est_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { mlt_filter this = mlt_filter_new( ); if ( this != NULL )