picture: align picture width to 64

It seems the latest FFmpeg requires 64 bits alignment for some I420 output.

Fixes #27285

(cherry picked from commit fa75a43b0b)

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
This commit is contained in:
Steve Lhomme 2022-10-06 15:56:12 +02:00 committed by Rémi Denis-Courmont
parent 535e17ff9f
commit ad26d63aa4
1 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
unsigned int i_ratio_h = 1;
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_w = LCM( i_modulo_w, 64 * p_dsc->p[i].w.den );
i_modulo_h = LCM( i_modulo_h, 16 * 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;
@ -198,7 +198,7 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
p->i_visible_pitch = (fmt->i_visible_width + (p_dsc->p[i].w.den - 1)) / p_dsc->p[i].w.den * p_dsc->p[i].w.num * p_dsc->pixel_size;
p->i_pixel_pitch = p_dsc->pixel_size;
assert( (p->i_pitch % 16) == 0 );
assert( (p->i_pitch % 64) == 0 );
}
p_picture->i_planes = p_dsc->plane_count;