[vlc-commits] deinterlace: Fix blending of pictures with offset
Hugo Beauzée-Luyssen
git at videolan.org
Tue Mar 22 16:53:51 CET 2016
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Mar 18 12:17:15 2016 +0100| [ccb8f7239183480aba3219a3ef046b538aad697d] | committer: Hugo Beauzée-Luyssen
deinterlace: Fix blending of pictures with offset
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ccb8f7239183480aba3219a3ef046b538aad697d
---
modules/video_filter/deinterlace/algo_basic.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/modules/video_filter/deinterlace/algo_basic.c b/modules/video_filter/deinterlace/algo_basic.c
index 858ae93..8511d89 100644
--- a/modules/video_filter/deinterlace/algo_basic.c
+++ b/modules/video_filter/deinterlace/algo_basic.c
@@ -216,27 +216,32 @@ void RenderBlend( filter_t *p_filter,
picture_t *p_outpic, picture_t *p_pic )
{
int i_plane;
+ vlc_chroma_description_t* p_desc = p_filter->p_sys->chroma;
/* Copy image and skip lines */
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{
uint8_t *p_in, *p_out_end, *p_out;
+ size_t i_x_offset = p_pic->format.i_x_offset * p_desc->p[i_plane].w.num /
+ p_desc->p[i_plane].w.den * p_pic->p[i_plane].i_pixel_pitch;
+ size_t i_y_offset = p_pic->format.i_y_offset * p_desc->p[i_plane].h.num /
+ p_desc->p[i_plane].h.den * p_pic->p[i_plane].i_pitch;
- p_in = p_pic->p[i_plane].p_pixels;
+ p_in = p_pic->p[i_plane].p_pixels + i_y_offset;
- p_out = p_outpic->p[i_plane].p_pixels;
+ p_out = p_outpic->p[i_plane].p_pixels + i_y_offset;
p_out_end = p_out + p_outpic->p[i_plane].i_pitch
* p_outpic->p[i_plane].i_visible_lines;
/* First line: simple copy */
- memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch );
+ memcpy( p_out + i_x_offset, p_in + i_x_offset, p_pic->p[i_plane].i_visible_pitch );
p_out += p_outpic->p[i_plane].i_pitch;
/* Remaining lines: mean value */
for( ; p_out < p_out_end ; )
{
- Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch,
- p_pic->p[i_plane].i_pitch );
+ Merge( p_out + i_x_offset, p_in + i_x_offset, p_in + p_pic->p[i_plane].i_pitch + i_x_offset,
+ p_pic->p[i_plane].i_visible_pitch );
p_out += p_outpic->p[i_plane].i_pitch;
p_in += p_pic->p[i_plane].i_pitch;
More information about the vlc-commits
mailing list