[vlc-devel] [PATCH] [RFC] picture: integrate the 2 extra lines in the height padding

Janne Grunau janne-vlc at jannau.net
Thu Apr 5 18:49:42 CEST 2018


On 2018-04-05 10:40:57 +0200, Steve Lhomme wrote:
> Le 05/04/2018 à 10:05, Rémi Denis-Courmont a écrit :
> > Le 5 avril 2018 09:55:25 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
> > > lines
> > > correct but the height reported doesn't match. Leading to 
> > > potential
> > > misdetection of padding/alignment.
> > > 
> > > 
> > > Le 05/04/2018 à 08:51, Steve Lhomme a écrit :
> > > > ---
> > > >    src/misc/picture.c | 10 +++++-----
> > > >    1 file changed, 5 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/src/misc/picture.c b/src/misc/picture.c
> > > > index 7506e47725..7ce1170702 100644
> > > > --- a/src/misc/picture.c
> > > > +++ b/src/misc/picture.c
> > > > @@ -133,17 +133,17 @@ int picture_Setup( picture_t *p_picture, 
> > > > const
> > > video_format_t *restrict fmt )
> > > >        unsigned width, height;
> > > > +    /* Hack: append two scan lines for some SIMD assembler */

[...]

> > This works if SIMD simply assumes two extra lines after visible 
> > lines. But it does not work if SIMD assumes two extra lines after 
> > the aligned visible lines. This could be an algorithm operating on 
> > macro blocks and expecting some extra padding...
> > 
> > Basically, this patch assumes that either lines count must be 
> > over-aligned or there must be extra lines, but not both for any 
> > given algorithm. Not that I'd know if there is or ever will be such 
> > a case in underlying libraries.
> 
> Yes, and that's also a problem. We keep on misaligning every buffer 
> (we do
> the alignment and then add 2 lines, breaking the i_modulo_h) for some
> hypothetical case that may not exist anymore. For the ASM code I've 
> looked at/modified it was always possible to stop processing after the 
> visible lines. I'm not sure if there's anything that requires that 
> anymore.

I suspect it was for libavcodec's sake and it was fixed with the 
introduction of refcounted frames and/or overwork of the emulated edge 
handling.

ciao

Janne


More information about the vlc-devel mailing list