Commit dfa08f13 authored by Jean-Paul Saman's avatar Jean-Paul Saman

rawvideo: do not memcpy but use the block data pointer as picture data

Manual backport of commit-id: edcd9df100cf1e8daa502d257c6d9543a0e1c45d
parent 5983f314
......@@ -267,6 +267,22 @@ static void FillPicture( decoder_t *p_dec, block_t *p_block, picture_t *p_pic )
{
int i_plane;
decoder_sys_t *p_sys = p_dec->p_sys;
if( p_pic->i_type == MEMORY_PICTURE )
{
free( p_pic->p_data_orig );
p_pic->p_data_orig = p_block;
p_pic->p_data = p_block->p_buffer;
/* Fill the p_pixels field for each plane */
p_pic->p[0].p_pixels = p_pic->p_data;
for( int i = 1; i < p_pic->i_planes; i++ )
p_pic->p[i].p_pixels = p_pic->p[i-1].p_pixels +
p_pic->p[i-1].i_lines * p_pic->p[i-1].i_pitch;
}
else
{
uint8_t *p_src = p_block->p_buffer;
for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
......@@ -286,6 +302,8 @@ static void FillPicture( decoder_t *p_dec, block_t *p_block, picture_t *p_pic )
p_dst += i_pitch, p_src += i_visible_pitch )
vlc_memcpy( p_dst, p_src, i_visible_pitch );
}
block_Release( p_block );
}
}
/*****************************************************************************
......@@ -309,7 +327,6 @@ static picture_t *DecodeFrame( decoder_t *p_dec, block_t *p_block )
p_pic->date = date_Get( &p_sys->pts );
p_pic->b_progressive = true;
block_Release( p_block );
return p_pic;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment