Skip to content

Commit

Permalink
+ Correction and a minor optimisation
Browse files Browse the repository at this point in the history
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@832 d19143bc-622f-0410-bfdd-b5b2a6649095
  • Loading branch information
lilo_booter committed Sep 27, 2005
1 parent e973d28 commit 95f2d83
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/modules/avformat/consumer_avformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,18 +915,29 @@ static void *consumer_thread( void *arg )
if ( video_st->codec->pix_fmt == PIX_FMT_RGBA32 )
{
uint8_t *alpha = mlt_frame_get_alpha_mask( frame );
register int n;

for ( i = 0; i < height; i ++ )
{
p = input->data[ 0 ] + i * input->linesize[ 0 ];
n = ( width + 7 ) / 8;
p = output->data[ 0 ] + i * output->linesize[ 0 ];

#ifndef __DARWIN__
p += 3;
#endif
j = width;
while( j -- )

switch( width % 8 )
{
*p = *alpha ++;
*p += 4;
case 0: do { *p = *alpha++; p += 4;
case 7: *p = *alpha++; p += 4;
case 6: *p = *alpha++; p += 4;
case 5: *p = *alpha++; p += 4;
case 4: *p = *alpha++; p += 4;
case 3: *p = *alpha++; p += 4;
case 2: *p = *alpha++; p += 4;
case 1: *p = *alpha++; p += 4;
}
while( --n );
}
}
}
Expand Down

0 comments on commit 95f2d83

Please sign in to comment.