]> git.sesse.net Git - mlt/commitdiff
Sundry minor fixes and optimisations
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 14 Jan 2005 13:03:00 +0000 (13:03 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 14 Jan 2005 13:03:00 +0000 (13:03 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@607 d19143bc-622f-0410-bfdd-b5b2a6649095

16 files changed:
demo/demo
demo/mlt_watermark
src/framework/mlt_producer.c
src/framework/mlt_properties.c
src/framework/mlt_properties.h
src/framework/mlt_property.c
src/framework/mlt_property.h
src/framework/mlt_tractor.c
src/modules/core/filter_data_show.c
src/modules/core/filter_obscure.c
src/modules/core/transition_composite.c
src/modules/core/transition_region.c
src/modules/feeds/PAL/data_fx.properties
src/modules/feeds/PAL/obscure.properties
src/modules/fezzik.ini
src/modules/gtk2/producer_pango.c

index 752fa8f409c83335ca2c2a31c450707ed3940def..98777ca7946622a0a4bd0e3824a8d9da964085c2 100755 (executable)
--- a/demo/demo
+++ b/demo/demo
@@ -88,7 +88,7 @@ do
                        if [ "$MLT_CONSUMER" == "westley:" ]
                        then    export WESTLEY_CONSUMER="westley:$demo.westley"
                                        bash $demo -consumer $WESTLEY_CONSUMER
-                                       inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=true
+                                       inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=1 composite.geometry=85%,5%:10%x10%
                        elif [ "$MLT_CONSUMER" == "westley" ]
                        then    bash $demo -consumer $MLT_CONSUMER | less
                        else    bash $demo -consumer $MLT_CONSUMER
index 7c8902b8df61dfc7df9f523932b7636a1b031ccb..b832d5be4fdd113ba468507bc3b6ca3c9dc0e548 100644 (file)
@@ -2,5 +2,5 @@ inigo \
 clip2.dv out=1000 \
 -track \
 watermark1.png out=1000 \
--transition composite fill=1 in=0 out=1000 a_track=0 b_track=1 \
+-transition composite fill=1 in=0 out=1000 a_track=0 b_track=1 geometry=85%,5%:10%x10% \
 $*
index 3382d1190f8c97c15a0a46f6c134b6c070ee7851..d84a0eb0571aeee2609230ad58c994222c86cb88 100644 (file)
@@ -208,11 +208,6 @@ mlt_producer mlt_producer_cut( mlt_producer this, int in, int out )
        mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
        mlt_producer_attach( result, filter );
        mlt_filter_close( filter );
-       filter = mlt_factory_filter( "data_show", "%obscure.properties" );
-       mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
-       mlt_producer_attach( result, filter );
-       mlt_filter_close( filter );
-       mlt_events_unblock( MLT_PRODUCER_PROPERTIES( result ), MLT_PRODUCER_PROPERTIES( result ) );
 
        return result;
 }
index 53db4764b282e413fa631bad83e806dfa9672e96..b42d02a4c90cd44f22dec0dea7eaf0d8088d9a25 100644 (file)
@@ -101,7 +101,7 @@ mlt_properties mlt_properties_new( )
 /** Load properties from a file.
 */
 
-mlt_properties mlt_properties_load( char *filename )
+mlt_properties mlt_properties_load( const char *filename )
 {
        // Construct a standalone properties object
        mlt_properties this = mlt_properties_new( );
@@ -151,7 +151,7 @@ mlt_properties mlt_properties_load( char *filename )
        return this;
 }
 
-static inline int generate_hash( char *name )
+static inline int generate_hash( const char *name )
 {
        int hash = 0;
        int i = 1;
@@ -165,7 +165,7 @@ static inline int generate_hash( char *name )
        real producer.
 */
 
-static inline void mlt_properties_do_mirror( mlt_properties this, char *name )
+static inline void mlt_properties_do_mirror( mlt_properties this, const char *name )
 {
        property_list *list = this->local;
        if ( list->mirror != NULL ) 
@@ -246,7 +246,7 @@ int mlt_properties_inherit( mlt_properties this, mlt_properties that )
 /** Pass all properties from 'that' that match the prefix to 'this' (excluding the prefix).
 */
 
-int mlt_properties_pass( mlt_properties this, mlt_properties that, char *prefix )
+int mlt_properties_pass( mlt_properties this, mlt_properties that, const char *prefix )
 {
        int count = mlt_properties_count( that );
        int length = strlen( prefix );
@@ -267,7 +267,7 @@ int mlt_properties_pass( mlt_properties this, mlt_properties that, char *prefix
 /** Locate a property by name
 */
 
-static inline mlt_property mlt_properties_find( mlt_properties this, char *name )
+static inline mlt_property mlt_properties_find( mlt_properties this, const char *name )
 {
        property_list *list = this->local;
        mlt_property value = NULL;
@@ -294,7 +294,7 @@ static inline mlt_property mlt_properties_find( mlt_properties this, char *name
 /** Add a new property.
 */
 
-static mlt_property mlt_properties_add( mlt_properties this, char *name )
+static mlt_property mlt_properties_add( mlt_properties this, const char *name )
 {
        property_list *list = this->local;
        int key = generate_hash( name );
@@ -303,7 +303,7 @@ static mlt_property mlt_properties_add( mlt_properties this, char *name )
        if ( list->count == list->size )
        {
                list->size += 50;
-               list->name = realloc( list->name, list->size * sizeof( char * ) );
+               list->name = realloc( list->name, list->size * sizeof( const char * ) );
                list->value = realloc( list->value, list->size * sizeof( mlt_property ) );
        }
 
@@ -322,7 +322,7 @@ static mlt_property mlt_properties_add( mlt_properties this, char *name )
 /** Fetch a property by name - this includes add if not found.
 */
 
-static mlt_property mlt_properties_fetch( mlt_properties this, char *name )
+static mlt_property mlt_properties_fetch( mlt_properties this, const char *name )
 {
        // Try to find an existing property first
        mlt_property property = mlt_properties_find( this, name );
@@ -338,7 +338,7 @@ static mlt_property mlt_properties_fetch( mlt_properties this, char *name )
 /** Set the property.
 */
 
-int mlt_properties_set( mlt_properties this, char *name, char *value )
+int mlt_properties_set( mlt_properties this, const char *name, const char *value )
 {
        int error = 1;
 
@@ -348,7 +348,7 @@ int mlt_properties_set( mlt_properties this, char *name, char *value )
        // Set it if not NULL
        if ( property == NULL )
        {
-               fprintf( stderr, "Whoops\n" );
+               fprintf( stderr, "Whoops - %s not found (should never occur)\n", name );
        }
        else if ( value == NULL )
        {
@@ -360,7 +360,7 @@ int mlt_properties_set( mlt_properties this, char *name, char *value )
                error = mlt_property_set_string( property, value );
                mlt_properties_do_mirror( this, name );
        }
-       else if ( property != NULL && value[ 0 ] == '@' )
+       else if ( value[ 0 ] == '@' )
        {
                int total = 0;
                int current = 0;
@@ -417,7 +417,7 @@ int mlt_properties_set( mlt_properties this, char *name, char *value )
 /** Set or default the property.
 */
 
-int mlt_properties_set_or_default( mlt_properties this, char *name, char *value, char *def )
+int mlt_properties_set_or_default( mlt_properties this, const char *name, const char *value, const char *def )
 {
        return mlt_properties_set( this, name, value == NULL ? def : value );
 }
@@ -425,7 +425,7 @@ int mlt_properties_set_or_default( mlt_properties this, char *name, char *value,
 /** Get a string value by name.
 */
 
-char *mlt_properties_get( mlt_properties this, char *name )
+char *mlt_properties_get( mlt_properties this, const char *name )
 {
        mlt_property value = mlt_properties_find( this, name );
        return value == NULL ? NULL : mlt_property_get_string( value );
@@ -476,7 +476,7 @@ int mlt_properties_count( mlt_properties this )
 /** Set a value by parsing a name=value string
 */
 
-int mlt_properties_parse( mlt_properties this, char *namevalue )
+int mlt_properties_parse( mlt_properties this, const char *namevalue )
 {
        char *name = strdup( namevalue );
        char *value = NULL;
@@ -515,7 +515,7 @@ int mlt_properties_parse( mlt_properties this, char *namevalue )
 /** Get a value associated to the name.
 */
 
-int mlt_properties_get_int( mlt_properties this, char *name )
+int mlt_properties_get_int( mlt_properties this, const char *name )
 {
        mlt_property value = mlt_properties_find( this, name );
        return value == NULL ? 0 : mlt_property_get_int( value );
@@ -524,7 +524,7 @@ int mlt_properties_get_int( mlt_properties this, char *name )
 /** Set a value associated to the name.
 */
 
-int mlt_properties_set_int( mlt_properties this, char *name, int value )
+int mlt_properties_set_int( mlt_properties this, const char *name, int value )
 {
        int error = 1;
 
@@ -546,7 +546,7 @@ int mlt_properties_set_int( mlt_properties this, char *name, int value )
 /** Get a value associated to the name.
 */
 
-double mlt_properties_get_double( mlt_properties this, char *name )
+double mlt_properties_get_double( mlt_properties this, const char *name )
 {
        mlt_property value = mlt_properties_find( this, name );
        return value == NULL ? 0 : mlt_property_get_double( value );
@@ -555,7 +555,7 @@ double mlt_properties_get_double( mlt_properties this, char *name )
 /** Set a value associated to the name.
 */
 
-int mlt_properties_set_double( mlt_properties this, char *name, double value )
+int mlt_properties_set_double( mlt_properties this, const char *name, double value )
 {
        int error = 1;
 
@@ -577,7 +577,7 @@ int mlt_properties_set_double( mlt_properties this, char *name, double value )
 /** Get a value associated to the name.
 */
 
-mlt_position mlt_properties_get_position( mlt_properties this, char *name )
+mlt_position mlt_properties_get_position( mlt_properties this, const char *name )
 {
        mlt_property value = mlt_properties_find( this, name );
        return value == NULL ? 0 : mlt_property_get_position( value );
@@ -586,7 +586,7 @@ mlt_position mlt_properties_get_position( mlt_properties this, char *name )
 /** Set a value associated to the name.
 */
 
-int mlt_properties_set_position( mlt_properties this, char *name, mlt_position value )
+int mlt_properties_set_position( mlt_properties this, const char *name, mlt_position value )
 {
        int error = 1;
 
@@ -608,7 +608,7 @@ int mlt_properties_set_position( mlt_properties this, char *name, mlt_position v
 /** Get a value associated to the name.
 */
 
-void *mlt_properties_get_data( mlt_properties this, char *name, int *length )
+void *mlt_properties_get_data( mlt_properties this, const char *name, int *length )
 {
        mlt_property value = mlt_properties_find( this, name );
        return value == NULL ? NULL : mlt_property_get_data( value, length );
@@ -617,7 +617,7 @@ void *mlt_properties_get_data( mlt_properties this, char *name, int *length )
 /** Set a value associated to the name.
 */
 
-int mlt_properties_set_data( mlt_properties this, char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise )
+int mlt_properties_set_data( mlt_properties this, const char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise )
 {
        int error = 1;
 
@@ -636,7 +636,7 @@ int mlt_properties_set_data( mlt_properties this, char *name, void *value, int l
 /** Rename a property.
 */
 
-int mlt_properties_rename( mlt_properties this, char *source, char *dest )
+int mlt_properties_rename( mlt_properties this, const char *source, const char *dest )
 {
        mlt_property value = mlt_properties_find( this, dest );
 
@@ -673,7 +673,7 @@ void mlt_properties_dump( mlt_properties this, FILE *output )
                        fprintf( output, "%s=%s\n", list->name[ i ], mlt_properties_get( this, list->name[ i ] ) );
 }
 
-void mlt_properties_debug( mlt_properties this, char *title, FILE *output )
+void mlt_properties_debug( mlt_properties this, const char *title, FILE *output )
 {
        fprintf( output, "%s: ", title );
        if ( this != NULL )
index ff87dc0989f6008fd0274a5bf258e68b60a4daaa..c2cbebccf35bc67b956ca00fd2305f2282add931 100644 (file)
@@ -42,32 +42,32 @@ struct mlt_properties_s
 
 extern int mlt_properties_init( mlt_properties, void *child );
 extern mlt_properties mlt_properties_new( );
-extern mlt_properties mlt_properties_load( char *file );
+extern mlt_properties mlt_properties_load( const char *file );
 extern int mlt_properties_inc_ref( mlt_properties self );
 extern int mlt_properties_dec_ref( mlt_properties self );
 extern int mlt_properties_ref_count( mlt_properties self );
 extern void mlt_properties_mirror( mlt_properties self, mlt_properties that );
 extern int mlt_properties_inherit( mlt_properties self, mlt_properties that );
-extern int mlt_properties_pass( mlt_properties self, mlt_properties that, char *prefix );
-extern int mlt_properties_set( mlt_properties self, char *name, char *value );
-extern int mlt_properties_set_or_default( mlt_properties self, char *name, char *value, char *def );
-extern int mlt_properties_parse( mlt_properties self, char *namevalue );
-extern char *mlt_properties_get( mlt_properties self, char *name );
+extern int mlt_properties_pass( mlt_properties self, mlt_properties that, const char *prefix );
+extern int mlt_properties_set( mlt_properties self, const char *name, const char *value );
+extern int mlt_properties_set_or_default( mlt_properties self, const char *name, const char *value, const char *def );
+extern int mlt_properties_parse( mlt_properties self, const char *namevalue );
+extern char *mlt_properties_get( mlt_properties self, const char *name );
 extern char *mlt_properties_get_name( mlt_properties self, int index );
 extern char *mlt_properties_get_value( mlt_properties self, int index );
 extern void *mlt_properties_get_data_at( mlt_properties self, int index, int *size );
-extern int mlt_properties_get_int( mlt_properties self, char *name );
-extern int mlt_properties_set_int( mlt_properties self, char *name, int value );
-extern double mlt_properties_get_double( mlt_properties self, char *name );
-extern int mlt_properties_set_double( mlt_properties self, char *name, double value );
-extern mlt_position mlt_properties_get_position( mlt_properties self, char *name );
-extern int mlt_properties_set_position( mlt_properties self, char *name, mlt_position value );
-extern int mlt_properties_set_data( mlt_properties self, char *name, void *value, int length, mlt_destructor, mlt_serialiser );
-extern void *mlt_properties_get_data( mlt_properties self, char *name, int *length );
-extern int mlt_properties_rename( mlt_properties self, char *source, char *dest );
+extern int mlt_properties_get_int( mlt_properties self, const char *name );
+extern int mlt_properties_set_int( mlt_properties self, const char *name, int value );
+extern double mlt_properties_get_double( mlt_properties self, const char *name );
+extern int mlt_properties_set_double( mlt_properties self, const char *name, double value );
+extern mlt_position mlt_properties_get_position( mlt_properties self, const char *name );
+extern int mlt_properties_set_position( mlt_properties self, const char *name, mlt_position value );
+extern int mlt_properties_set_data( mlt_properties self, const char *name, void *value, int length, mlt_destructor, mlt_serialiser );
+extern void *mlt_properties_get_data( mlt_properties self, const char *name, int *length );
+extern int mlt_properties_rename( mlt_properties self, const char *source, const char *dest );
 extern int mlt_properties_count( mlt_properties self );
 extern void mlt_properties_dump( mlt_properties self, FILE *output );
-extern void mlt_properties_debug( mlt_properties self, char *title, FILE *output );
+extern void mlt_properties_debug( mlt_properties self, const char *title, FILE *output );
 extern void mlt_properties_close( mlt_properties self );
 
 #endif
index ddc000c18733950cfee93fbd359c92516783e7fb..63e32a43090bdbff9a2c88a65ee571210d1fd54a 100644 (file)
@@ -110,7 +110,7 @@ int mlt_property_set_position( mlt_property this, mlt_position value )
 /** Set a string on this property.
 */
 
-int mlt_property_set_string( mlt_property this, char *value )
+int mlt_property_set_string( mlt_property this, const char *value )
 {
        if ( value != this->prop_string )
        {
@@ -153,6 +153,16 @@ int mlt_property_set_data( mlt_property this, void *value, int length, mlt_destr
        return 0;
 }
 
+static inline int mlt_property_atoi( const char *value )
+{
+       if ( value == NULL )
+               return 0;
+       else if ( value[0] == '0' && value[1] == 'x' )
+               return strtol( value + 2, NULL, 16 );
+       else 
+               return strtol( value, NULL, 10 );
+}
+
 /** Get an int from this property.
 */
 
@@ -167,7 +177,7 @@ int mlt_property_get_int( mlt_property this )
        else if ( this->types & mlt_prop_int64 )
                return ( int )this->prop_int64;
        else if ( this->types & mlt_prop_string )
-               return atoi( this->prop_string );
+               return mlt_property_atoi( this->prop_string );
        return 0;
 }
 
@@ -207,6 +217,16 @@ mlt_position mlt_property_get_position( mlt_property this )
        return 0;
 }
 
+static inline int64_t mlt_property_atoll( const char *value )
+{
+       if ( value == NULL )
+               return 0;
+       else if ( value[0] == '0' && value[1] == 'x' )
+               return strtoll( value + 2, NULL, 16 );
+       else 
+               return strtoll( value, NULL, 10 );
+}
+
 /** Get an int64 from this property.
 */
 
@@ -221,7 +241,7 @@ int64_t mlt_property_get_int64( mlt_property this )
        else if ( this->types & mlt_prop_position )
                return ( int64_t )this->prop_position;
        else if ( this->types & mlt_prop_string )
-               return ( int64_t )atol( this->prop_string );
+               return mlt_property_atoll( this->prop_string );
        return 0;
 }
 
index 96287d401f88b5603cca85b87bc72a6bad6c8639..51a8f4119c3df5a289a78bb3028a69e15e85cb88 100644 (file)
@@ -71,7 +71,7 @@ extern int mlt_property_set_int( mlt_property self, int value );
 extern int mlt_property_set_double( mlt_property self, double value );
 extern int mlt_property_set_position( mlt_property self, mlt_position value );
 extern int mlt_property_set_uint64( mlt_property self, uint64_t value );
-extern int mlt_property_set_string( mlt_property self, char *value );
+extern int mlt_property_set_string( mlt_property self, const char *value );
 extern int mlt_property_set_data( mlt_property self, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser );
 extern int mlt_property_get_int( mlt_property self );
 extern double mlt_property_get_double( mlt_property self );
index 861edff8b8fb0ceee2918026a0cc4f580dfe3723..4a26d0bf46e6035c8b045c5a8fdf76e31fa61a58 100644 (file)
@@ -308,8 +308,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
                                mlt_properties_set_data( frame_properties, label, temp, 0, ( mlt_destructor )mlt_frame_close, NULL );
 
                                // We want the first data_queue, but after that, all queues are appended
-                               if ( !done && mlt_properties_get_data( temp_properties, "data_queue", NULL ) != NULL && 
-                                    mlt_deque_count( mlt_properties_get_data( temp_properties, "data_queue", NULL ) ) != 0 )
+                               if ( !done && mlt_properties_get_data( temp_properties, "data_queue", NULL ) != NULL )
                                {
                                        if ( data_queue == NULL )
                                        {
index 4387ae21b5cdec1673f0f39adb4fc7801b0c0c87..b080446b4ef9634a5357b0313a34bbb8f0680a9b 100644 (file)
@@ -139,7 +139,7 @@ static int process_feed( mlt_properties feed, mlt_filter filter, mlt_frame frame
                        {
                                if ( !strncmp( name + len, "length[", 7 ) )
                                {
-                                       mlt_properties_set_position( properties, key, length / period );
+                                       mlt_properties_set_position( properties, key, ( length - period ) / period );
                                }
                                else
                                {
index ae70e106f40a33fa9ac3a894a9cd72cfe903e429..d5521981472dad89b59382dccccebe38333ae99b 100644 (file)
@@ -151,38 +151,45 @@ static float position_calculate( mlt_filter this, mlt_frame frame )
 /** The averaging function...
 */
 
-void obscure_average( uint8_t *start, int width, int height, int stride )
+static inline void obscure_average( uint8_t *start, int width, int height, int stride )
 {
-       int y;
-       int x;
+       register int y;
+       register int x;
        register int Y = ( *start + *( start + 2 ) ) / 2;
        register int U = *( start + 1 );
        register int V = *( start + 3 );
        register uint8_t *p;
+       register int components = width >> 1;
 
-       for ( y = 0; y < height; y ++ )
+       y = height;
+       while( y -- )
        {
-               p = start + y * stride;
-               for ( x = 0; x < width / 2; x ++ )
+               p = start;
+               x = components;
+               while( x -- )
                {
-                       Y = ( Y + *p ++ ) / 2;
-                       U = ( U + *p ++ ) / 2;
-                       Y = ( Y + *p ++ ) / 2;
-                       V = ( V + *p ++ ) / 2;
+                       Y = ( Y + *p ++ ) >> 1;
+                       U = ( U + *p ++ ) >> 1;
+                       Y = ( Y + *p ++ ) >> 1;
+                       V = ( V + *p ++ ) >> 1;
                }
+               start += stride;
        }
 
-       for ( y = 0; y < height; y ++ )
+       start -= height * stride;
+       y = height;
+       while( y -- )
        {
-               p = start + y * stride;
-               
-               for ( x = 0; x < width / 2; x ++ )
+               p = start;
+               x = components;
+               while( x -- )
                {
                        *p ++ = Y;
                        *p ++ = U;
                        *p ++ = Y;
                        *p ++ = V;
                }
+               start += stride;
        }
 }
 
@@ -213,7 +220,7 @@ static void obscure_render( uint8_t *image, int width, int height, struct geomet
                        aw = w + mw > area_w ? mw - ( w + mw - area_w ) : mw;
                        ah = h + mh > area_h ? mh - ( h + mh - area_h ) : mh;
                        if ( aw > 1 && ah > 1 )
-                               obscure_average( p + h * width * 2 + w * 2, aw, ah, width * 2 );
+                               obscure_average( p + h * ( width << 1 ) + ( w << 1 ), aw, ah, width << 1 );
                }
        }
 }
index ed2436fa50ee5a062e537048f38d19ecfaa346d0..16bf590bd559be59b7e9c41f61c9c71841637a64 100644 (file)
@@ -384,8 +384,8 @@ void composite_line_yuv( uint8_t *dest, uint8_t *src, int width_src, uint8_t *al
        for ( j = 0; j < width_src; j ++ )
        {
                a = ( alpha == NULL ) ? 255 : *alpha ++;
-               mix = ( luma == NULL ) ? weight : linearstep( luma[ j ], luma[ j ] + softness, weight );
-               mix = ( mix * ( a + 1 ) ) >> 8;
+               mix = ( luma == NULL ) ? weight : smoothstep( luma[ j ], luma[ j ] + softness, weight + softness );
+               mix = ( mix * a ) >> 8;
                *dest = ( *src++ * mix + *dest * ( ( 1 << 16 ) - mix ) ) >> 16;
                dest++;
                *dest = ( *src++ * mix + *dest * ( ( 1 << 16 ) - mix ) ) >> 16;
@@ -527,7 +527,7 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint
 */
 
 static inline void
-scale_luma ( uint16_t *dest_buf, int dest_width, int dest_height, const uint16_t *src_buf, int src_width, int src_height )
+scale_luma ( uint16_t *dest_buf, int dest_width, int dest_height, const uint16_t *src_buf, int src_width, int src_height, int invert )
 {
        register int i, j;
        register int x_step = ( src_width << 16 ) / dest_width;
@@ -541,7 +541,7 @@ scale_luma ( uint16_t *dest_buf, int dest_width, int dest_height, const uint16_t
                
                for ( j = 0; j < dest_width; j++ )
                {
-                       *dest_buf++ = src[ x >> 16 ];
+                       *dest_buf++ = src[ x >> 16 ] ^ invert;
                        x += x_step;
                }
                y += y_step;
@@ -554,6 +554,7 @@ static uint16_t* get_luma( mlt_properties properties, int width, int height )
        int luma_width = mlt_properties_get_int( properties, "_luma.width" );
        int luma_height = mlt_properties_get_int( properties, "_luma.height" );
        uint16_t *luma_bitmap = mlt_properties_get_data( properties, "_luma.bitmap", NULL );
+       int invert = mlt_properties_get_int( properties, "luma_invert" );
        
        // If the filename property changed, reload the map
        char *resource = mlt_properties_get( properties, "luma" );
@@ -647,7 +648,7 @@ static uint16_t* get_luma( mlt_properties properties, int width, int height )
                }
                // Scale luma map
                luma_bitmap = mlt_pool_alloc( width * height * sizeof( uint16_t ) );
-               scale_luma( luma_bitmap, width, height, orig_bitmap, luma_width, luma_height );
+               scale_luma( luma_bitmap, width, height, orig_bitmap, luma_width, luma_height, invert * ( ( 1 << 16 ) - 1 ) );
 
                // Remember the scaled luma size to prevent unnecessary scaling
                mlt_properties_set_int( properties, "_luma.width", width );
@@ -1015,8 +1016,10 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
 
                                if ( mlt_properties_get_int( properties, "titles" ) )
                                {
-                                       result.nw = result.item.w = *width;
-                                       result.nh = result.item.h = *height;
+                                       result.item.w = *width * ( result.item.w / result.nw );
+                                       result.nw = result.item.w;
+                                       result.item.h = *height * ( result.item.h / result.nh );
+                                       result.nh = *height;
                                        result.sw = width_b;
                                        result.sh = height_b;
                                }
@@ -1066,7 +1069,7 @@ mlt_transition transition_composite_init( char *arg )
                this->process = composite_process;
                
                // Default starting motion and zoom
-               mlt_properties_set( properties, "start", arg != NULL ? arg : "85%,5%:10%x10%" );
+               mlt_properties_set( properties, "start", arg != NULL ? arg : "0,0:100%x100%" );
                
                // Default factory
                mlt_properties_set( properties, "factory", "fezzik" );
index bfe4a4e1ddab8c6166fa6447726ab43bb4857b8e..4934d3bebdea36425d73124910552e318401ea32 100644 (file)
@@ -119,7 +119,7 @@ static uint8_t *filter_get_alpha_mask( mlt_frame this )
                alpha = p;
                while ( size -- )
                {
-                       *p ++ = *image ++;
+                       *p ++ = ( int )( ( ( *image ++ - 16 ) * 299 ) / 255 );
                        image ++;
                }
                mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", alpha, region_width * region_height, mlt_pool_release, NULL );
@@ -176,7 +176,7 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                        mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
 
                        // We want to ensure that we don't get a wobble...
-                       mlt_properties_set_int( composite_properties, "distort", 1 );
+                       //mlt_properties_set_int( composite_properties, "distort", 1 );
                        mlt_properties_set_int( composite_properties, "progressive", 1 );
 
                        // Pass all the composite. properties on the transition down
index e60979a62b95941fe7096266e7e24c9ddb0e1a4d..1a297134bafa0200a7e95f84952c372127f967b9 100644 (file)
@@ -28,7 +28,6 @@ titles=region
 .filter[0]=watermark
 .filter[0].resource=colour:0x000000
 .filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40
-.filter[0].composite.titles=1
 .filter[1]=watermark
 .filter[1].resource=pango:
 .filter[1].producer.markup=Shotcut
@@ -50,12 +49,10 @@ top-titles=region
 .filter[0]=watermark
 .filter[0].resource=colour:0x000000
 .filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40
-.filter[0].composite.titles=1
 .filter[1]=watermark
 .filter[1].resource=pango:
 .filter[1].producer.markup=Shotcut
 .filter[1].composite.geometry=0%,0%:100%x100%:0;8=0%,0%:100%x100%:100
-.filter[1].composite.halign=centre
 .filter[1].composite.titles=1
 
 #
@@ -70,8 +67,6 @@ tickertape=region
 .composite.geometry=0%,93%:100%x7%
 .filter[0]=watermark
 .filter[0].resource=colour:0x000000
-.filter[0].composite.geometry=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
 .filter[1]=watermark
 .filter[1].resource=pango:
 .filter[1].producer.markup=Shotcut
@@ -79,164 +74,6 @@ tickertape=region
 .filter[1].producer.font=San 32
 .filter[1].composite.titles=1
 
-#
-# ETV Location
-#
-
-location=region
-.description=Titles
-.properties.markup=filter[1].producer.markup
-.type.markup=text
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=0,80:230x30
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:0;25=0%,0%:100%x100%:100
-.filter[0].composite.luma=%luma01.pgm
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=0%,0%:100%x100%:0;24=0%,0%:100%x100%:0;49=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=right
-.filter[1].composite.valign=center
-
-courtesy=region
-.description=Titles
-.properties.markup=filter[1].producer.markup
-.type.markup=text
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=0,115:230x30
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=12=0%,0%:100%x100%:0;37=0%,0%:100%x100%:100
-.filter[0].composite.luma=%luma01.pgm
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=ETV Exclusive
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=0%,0%:100%x100%:0;37=0%,0%:100%x100%:0;61=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=right
-.filter[1].composite.valign=right
-
-exclusive=region
-.description=Exclusive
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=0,115:230x30
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:10;12=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=ETV Exclusive
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=0%,0%:100%x100%:10;12=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=right
-.filter[1].composite.valign=right
-
-file_shot=region
-.description=Titles
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=590,160:80x25
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=File Shot
-.filter[1].producer.font=San 20
-.filter[1].composite.geometry=0%,0%:100%x100%:15;25=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=centre
-.filter[1].composite.valign=centre
-
-special=region
-.description=Titles
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=465,375:255x35
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=Special
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=centre
-.filter[1].composite.valign=centre
-
-ticker=region
-.description=Tickertape
-.properties.markup=filter[1].producer.markup
-.type.markup=text
-.properties.length[0]=filter[1].composite.out
-.composite.geometry=0,500:722x75
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=Ticker - provided for reference
-.filter[1].composite.geometry=0%,0%:100%x100%:100
-.filter[1].composite.titles=0
-.filter[1].producer.font=San 24
-.filter[1].composite.halign=centre
-.filter[1].composite.titles=1
-.filter[1].composite.valign=centre
-
-super=region
-.description=Transcription
-.properties.0=filter[1].producer.markup
-.properties.1=filter[2].producer.markup
-.properties.align=filter[1].composite.valign
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.properties.length[2]=filter[2].composite.out
-.period=2
-.composite.geometry=0,410:720x90
-.filter[0]=watermark
-.filter[0].resource=colour:0xbbbbbb00
-.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[0].composite.luma=%luma18.pgm
-.filter[0].composite.out=25
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=
-.filter[1].producer.font=San 32
-.filter[1].producer.fgcolour=0x6c0101ff
-.filter[1].composite.geometry=0%,0%:100%x100%:0;25=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=centre
-.filter[1].composite.valign=top
-.filter[2]=watermark
-.filter[2].resource=pango:
-.filter[2].producer.markup=
-.filter[2].producer.font=San 32
-.filter[2].producer.fgcolour=0x6c0101ff
-.filter[2].composite.geometry=0%,0%:100%x100%:0;25=0%,0%:100%x100%:100
-.filter[2].composite.titles=1
-.filter[2].composite.halign=centre
-.filter[2].composite.valign=bottom
-
+greyscale=greyscale
+.description=greyscale
 
index 97162b7aa1c10744d611b657c2f4eb8fc76ac3fa..3917d9a5369e0534424ca5db2d681d1eadc7d6d0 100644 (file)
@@ -1,4 +1,4 @@
-# This properties file describes the fx available to the data_send and 
+# This properties file describes the fx available to the data_feed and 
 # data_show filters
 #
 # Syntax is as follows:
 # included as properties using the normal region filter syntax.
 #
 
-obscure=region
-.description=Obscure
+obscure0=region
+.description=Primary Obscure
+.properties.geometry=composite.geometry
+.properties.resource=resource
+.properties.length[0]=composite.out
+.composite.geometry=
+.resource=rectangle
+.composite.refresh=1
+.filter[0]=obscure
+
+obscure1=region
+.description=Secondary Obscure
 .properties.geometry=composite.geometry
 .properties.resource=resource
 .properties.length[0]=composite.out
@@ -22,5 +32,4 @@ obscure=region
 .resource=rectangle
 .composite.refresh=1
 .filter[0]=obscure
-.filter[0].start=0,0:100%x100%:8x8
 
index c3d7fccdc0c75bfa50ac933a720f254496f01f1c..f7061e5d7745cc14f3d64cafd8a7224c55ce04ec 100644 (file)
@@ -11,3 +11,4 @@ rescaler=mcrescale,gtkrescale,rescale
 resizer=resize
 resampler=resample,soxresample,avresample
 data=data_feed:attr_check
+obscure=data_show:%obscure.properties
index 6863edb6473bb0eafbc15ae85b442bfb235b985b..7863979e47f5e45d9d567b490d74772ad2ff6007 100644 (file)
@@ -541,6 +541,7 @@ static GdkPixbuf *pango_get_pixbuf( const char *markup, const char *text, const
        FT_Bitmap bitmap;
        uint8_t *src = NULL;
        uint8_t* dest = NULL;
+       uint8_t *d, *s, a;
        int stride;
 
        pango_ft2_font_map_set_resolution( fontmap, 72, 72 );
@@ -575,18 +576,23 @@ static GdkPixbuf *pango_get_pixbuf( const char *markup, const char *text, const
        src = bitmap.buffer;
        x = ( gdk_pixbuf_get_width( pixbuf ) - w - 2 * pad ) * align / 2 + pad;
        dest = gdk_pixbuf_get_pixels( pixbuf ) + 4 * x + pad * stride;
-       for ( j = 0; j < h; j++ )
+       j = h;
+
+       while( j -- )
        {
-               uint8_t *d = dest;
-               for ( i = 0; i < w; i++ )
+               d = dest;
+               s = src;
+               i = w;
+               while( i -- )
                {
-                       float a = ( float ) bitmap.buffer[ j * bitmap.pitch + i ] / 255.0;
-                       *d++ = ( int ) ( a * fg.r + ( 1 - a ) * bg.r );
-                       *d++ = ( int ) ( a * fg.g + ( 1 - a ) * bg.g );
-                       *d++ = ( int ) ( a * fg.b + ( 1 - a ) * bg.b );
-                       *d++ = ( int ) ( a * fg.a + ( 1 - a ) * bg.a );
+                       a = *s ++;
+                       *d++ = ( a * fg.r + ( 255 - a ) * bg.r ) >> 8;
+                       *d++ = ( a * fg.g + ( 255 - a ) * bg.g ) >> 8;
+                       *d++ = ( a * fg.b + ( 255 - a ) * bg.b ) >> 8;
+                       *d++ = ( a * fg.a + ( 255 - a ) * bg.a ) >> 8;
                }
                dest += stride;
+               src += bitmap.pitch;
        }
        mlt_pool_release( bitmap.buffer );
        g_object_unref( layout );