daala: decoder: use plane_CopyPixels

This commit is contained in:
Tristan Matthews 2023-01-30 10:52:22 -05:00 committed by Steve Lhomme
parent 295ddcabaf
commit dfde8b0e09
1 changed files with 8 additions and 13 deletions

View File

@ -561,21 +561,16 @@ static void CloseDecoder( vlc_object_t *p_this )
static void daala_CopyPicture( picture_t *p_pic,
daala_image *ycbcr )
{
const int i_planes = p_pic->i_planes < 3 ? p_pic->i_planes : 3;
const int i_planes = __MIN(p_pic->i_planes, 3);
for( int i_plane = 0; i_plane < i_planes; i_plane++ )
{
const int i_total_lines = __MIN(p_pic->p[i_plane].i_lines,
ycbcr->height >> ycbcr->planes[i_plane].ydec);
uint8_t *p_dst = p_pic->p[i_plane].p_pixels;
uint8_t *p_src = ycbcr->planes[i_plane].data;
const int i_dst_stride = p_pic->p[i_plane].i_pitch;
const int i_src_stride = ycbcr->planes[i_plane].ystride;
for( int i_line = 0; i_line < i_total_lines; i_line++ )
{
memcpy( p_dst, p_src, i_src_stride );
p_src += i_src_stride;
p_dst += i_dst_stride;
}
plane_t src;
src.i_lines = __MIN(p_pic->p[i_plane].i_lines, ycbcr->height >> ycbcr->planes[i_plane].ydec);
src.p_pixels = ycbcr->planes[i_plane].data;
src.i_pitch = ycbcr->planes[i_plane].ystride;
src.i_visible_pitch = src.i_pitch;
src.i_visible_lines = src.i_lines;
plane_CopyPixels( &p_pic->p[i_plane], &src );
}
}