[vlc-devel] [PATCH 08/25] align planes to 32 instead of 16, for aligned AVX2 loads

Rémi Denis-Courmont remi at remlab.net
Tue Apr 14 19:05:50 CEST 2020


Le tiistaina 14. huhtikuuta 2020, 13.40.19 EEST Victorien Le Couviour--Tuffet a 
écrit :
> ---
>  src/misc/picture.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

This needs to use a symbolic constant. In fact, I vaguely recall that somebody 
else made the same point some time ago - but there was no value change to 
"justify" it.


> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index f44c9041a1..0ad4a9e29c 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -147,8 +147,8 @@ int picture_Setup( picture_t *p_picture, const
> video_format_t *restrict fmt )
> 
>      for( unsigned i = 0; i < p_dsc->plane_count; i++ )
>      {
> -        i_modulo_w = LCM( i_modulo_w, 16 * p_dsc->p[i].w.den );
> -        i_modulo_h = LCM( i_modulo_h, 16 * p_dsc->p[i].h.den );
> +        i_modulo_w = LCM( i_modulo_w, 32 * p_dsc->p[i].w.den );
> +        i_modulo_h = LCM( i_modulo_h, 32 * p_dsc->p[i].h.den );
>          if( i_ratio_h < p_dsc->p[i].h.den )
>              i_ratio_h = p_dsc->p[i].h.den;
>      }
> @@ -185,7 +185,7 @@ int picture_Setup( picture_t *p_picture, const
> video_format_t *restrict fmt ) * p_dsc->pixel_size;
>          p->i_pixel_pitch = p_dsc->pixel_size;
> 
> -        assert( (p->i_pitch % 16) == 0 );
> +        assert( (p->i_pitch % 32) == 0 );
>      }
>      p_picture->i_planes = p_dsc->plane_count;
> 
> @@ -206,7 +206,7 @@ static bool picture_InitPrivate(const video_format_t
> *restrict p_fmt, p_picture->date = VLC_TICK_INVALID;
> 
>      p_picture->format = *p_fmt;
> -    /* Make sure the real dimensions are a multiple of 16 */
> +    /* Make sure the real dimensions are a multiple of 32 */
>      if( picture_Setup( p_picture, p_fmt ) )
>          return false;


-- 
Rémi Denis-Courmont
Tapiola new town, Uusimaan Republic





More information about the vlc-devel mailing list