[vlc-devel] [PATCH] picture: round the number of visible lines to the upper multiple

Rémi Denis-Courmont remi at remlab.net
Mon Apr 16 16:25:00 CEST 2018


Le maanantaina 16. huhtikuuta 2018, 16.35.31 EEST Steve Lhomme a écrit :
> The U/V lines of 4:2:0 chroma are divided by 2. But if the height is an odd
> number we end up missing the last line for these planes.
> 
> Fixes #20290
> ---
>  src/misc/picture.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index 7506e47725..35c245e728 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -159,7 +159,7 @@ int picture_Setup( picture_t *p_picture, const
> video_format_t *restrict fmt ) assert(w->den >= w->num);
> 
>          p->i_lines = height * h->num / h->den;
> -        p->i_visible_lines = fmt->i_visible_height * h->num / h->den;
> +        p->i_visible_lines = (fmt->i_visible_height + (h->den - 1)) *
> h->num / h->den;
> 
>          p->i_pitch = width * w->num / w->den * p_dsc->pixel_size;
>          p->i_visible_pitch = fmt->i_visible_width * w->num / w->den

Looks OK, though I wouldn't be surprised if it uncovered latent bugs.

-- 
Реми Денис-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list