]> git.sesse.net Git - mlt/commitdiff
use interpolation settings
authorMarco Gittler <g.marco@freenet.de>
Mon, 19 Sep 2011 13:40:46 +0000 (15:40 +0200)
committerDan Dennedy <dan@dennedy.org>
Mon, 31 Oct 2011 04:52:36 +0000 (21:52 -0700)
src/modules/videostab/filter_videostab2.c
src/modules/videostab/transform_image.c

index bf99a4614c9d8027af880fefa47b6de19ae24b7c..1587c91556c688ec61e81bce4f9e62cee704fe9b 100644 (file)
@@ -156,6 +156,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                {
                        // Apply
                        TransformData* tf=mlt_properties_get_data( MLT_FILTER_PROPERTIES(filter), "_transformdata", NULL);
+                       char *interps = mlt_properties_get( MLT_FRAME_PROPERTIES( frame ), "rescale.interp" );
+
                        if (!tf){
                                tf=mlt_pool_alloc(sizeof(TransformData));
                                mlt_properties_set_data( MLT_FILTER_PROPERTIES(filter), "_transformdata", tf, 0, ( mlt_destructor )mlt_pool_release, NULL );
@@ -164,6 +166,19 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                        {
                                // Load analysis results from property
                                self->initialized = 2;
+
+                               int interp = 2;
+                               if ( strcmp( interps, "nearest" ) == 0 || strcmp( interps, "neighbor" ) == 0 )
+                                       interp = 0;
+                               else if ( strcmp( interps, "tiles" ) == 0 || strcmp( interps, "fast_bilinear" ) == 0 )
+                                       interp = 1;
+                               else if ( strcmp( interps, "bilinear" ) == 0 )
+                                       interp = 2;
+                               else if ( strcmp( interps, "bicubic" ) == 0 )
+                                       interp = 3;
+                               else if ( strcmp( interps, "bicublin" ) == 0 )
+                                       interp = 4;
+
                                transform_configure(tf,w,h,*format ,*image, deserialize_vectors(  vectors, length ),length);
                                
                        }
index f782c534900fbe27432e4e8b3d570fd871e4ba73..d186c5155f32aaa66bc89e7d958c3daac3de4846 100644 (file)
@@ -635,11 +635,11 @@ int transform_configure(TransformData *self,int width,int height, mlt_image_form
 
     td->zoom    = 0;
     td->optzoom = 1;
-    td->interpoltype = 2; // bi-linear
+    // set from  filter td->interpoltype = 2; // bi-linear
     td->sharpen = 0.8;
        
     td->interpoltype = TC_MIN(td->interpoltype,4);
-    if (0) {
+    if (1) {
         mlt_log_warning(NULL, "Image Transformation/Stabilization Settings:\n");
         mlt_log_warning(NULL, "    input     = %s\n", td->input);
         mlt_log_warning(NULL, "    smoothing = %d\n", td->smoothing);