[vlc-devel] [PATCH] core: only add extra height if there wasn't enough added for the modulo
Steve Lhomme
robux4 at videolabs.io
Tue Apr 28 10:09:37 CEST 2015
Anyone disagrees with merging this commit ? Judging by this thread,
the hack is not needed anymore:
https://mailman.videolan.org/pipermail/vlc-devel/2015-April/102377.html
And since then we pushed avcodec support to 55.0
On Mon, Apr 20, 2015 at 1:38 PM, Steve Lhomme <robux4 at videolabs.io> wrote:
> From: Steve Lhomme <robUx4 at videolabs.io>
>
> --
> this whole hack may even be useless
> ---
> src/misc/picture.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index 6aa5b05..1785d3d 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -181,13 +181,17 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
> i_modulo_h = LCM( i_modulo_h, 32 );
>
> const int i_width_aligned = ( fmt->i_width + i_modulo_w - 1 ) / i_modulo_w * i_modulo_w;
> - const int i_height_aligned = ( fmt->i_height + i_modulo_h - 1 ) / i_modulo_h * i_modulo_h;
> - const int i_height_extra = 2 * i_ratio_h; /* This one is a hack for some ASM functions */
> + int i_height_aligned = ( fmt->i_height + i_modulo_h - 1 ) / i_modulo_h * i_modulo_h;
> + if( i_height_aligned - fmt->i_height < 2 * i_ratio_h )
> + {
> + /* This one is a hack for some ASM functions */
> + i_height_aligned += 2 * i_ratio_h;
> + }
> for( unsigned i = 0; i < p_dsc->plane_count; i++ )
> {
> plane_t *p = &p_picture->p[i];
>
> - p->i_lines = (i_height_aligned + i_height_extra ) * p_dsc->p[i].h.num / p_dsc->p[i].h.den;
> + p->i_lines = i_height_aligned * p_dsc->p[i].h.num / p_dsc->p[i].h.den;
> p->i_visible_lines = fmt->i_visible_height * p_dsc->p[i].h.num / p_dsc->p[i].h.den;
> p->i_pitch = i_width_aligned * p_dsc->p[i].w.num / p_dsc->p[i].w.den * p_dsc->pixel_size;
> p->i_visible_pitch = fmt->i_visible_width * p_dsc->p[i].w.num / p_dsc->p[i].w.den * p_dsc->pixel_size;
> --
> 2.3.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list