]> git.sesse.net Git - mlt/commitdiff
Improve efficiency of memory copy in avformat consumer.
authorDan Dennedy <dan@dennedy.org>
Sun, 30 Jan 2011 19:59:29 +0000 (11:59 -0800)
committerDan Dennedy <dan@dennedy.org>
Sun, 30 Jan 2011 19:59:29 +0000 (11:59 -0800)
Patch from Paul Flinders <paul@flinders.org>.

src/modules/avformat/consumer_avformat.c

index f5fede438c589485369012dbed5c33e4b93c0e03..3482149aa562d05143dec59f54c62f1f595eb84d 100644 (file)
@@ -1374,7 +1374,6 @@ static void *consumer_thread( void *arg )
                                        if ( mlt_properties_get_int( frame_properties, "rendered" ) )
                                        {
                                                int i = 0;
-                                               int j = 0;
                                                uint8_t *p;
                                                uint8_t *q;
 
@@ -1386,12 +1385,8 @@ static void *consumer_thread( void *arg )
                                                for ( i = 0; i < height; i ++ )
                                                {
                                                        p = input->data[ 0 ] + i * input->linesize[ 0 ];
-                                                       j = width;
-                                                       while( j -- )
-                                                       {
-                                                               *p ++ = *q ++;
-                                                               *p ++ = *q ++;
-                                                       }
+                                                       memcpy( p, q, width * 2 );
+                                                       q += width * 2;
                                                }
 
                                                // Do the colour space conversion