[FFmpeg-devel] [PATCH v2 1/8] swscale: document SWS_FULL_CHR_H_* flags

Andrew Sayers ffmpeg-devel at pileofstuff.org
Thu Jul 4 21:14:25 EEST 2024


On Thu, Jul 04, 2024 at 07:59:10PM +0200, Niklas Haas wrote:
> On Thu, 04 Jul 2024 19:56:56 +0200 Niklas Haas <ffmpeg at haasn.xyz> wrote:
> > On Thu, 04 Jul 2024 16:24:24 +0100 Andrew Sayers <ffmpeg-devel at pileofstuff.org> wrote:
> > > On Thu, Jul 04, 2024 at 04:30:57PM +0200, Niklas Haas wrote:
> > > > From: Niklas Haas <git at haasn.dev>
> > > > 
> > > > Based on my best understanding of what they do, given the source code.
> > > > ---
> > > >  libswscale/swscale.h | 28 ++++++++++++++++++++++++++--
> > > >  1 file changed, 26 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/libswscale/swscale.h b/libswscale/swscale.h
> > > > index 9d4612aaf3..e22931cab4 100644
> > > > --- a/libswscale/swscale.h
> > > > +++ b/libswscale/swscale.h
> > > > @@ -82,11 +82,35 @@ const char *swscale_license(void);
> > > >  #define SWS_PRINT_INFO              0x1000
> > > >  
> > > >  //the following 3 flags are not completely implemented
> > > > -//internal chrominance subsampling info
> > > > +
> > > > +/**
> > > > + * Perform full chroma upsampling when converting to RGB as part of scaling.
> > > 
> > > Nitpick: "as part of scaling" seems redundant - can it be removed?
> > 
> > I wrote it this way because, afaict, this flag does not affect unscaled
> > special converters (yuv->rgba). But I can remove it if you still think
> > it's unnecessary.
> 
> How about: "Perform full chroma upsampling when upscaling to RGB"?

Ah, I hadn't understood that distinction at all.  I'd recommend...

1. keep the original if this applies to both up- and down-scaling
2. use the second if it's just for upscaling
3. either way, add a line like this at the end of the section:

    Note: this flag is ignored by unscaled special converters.

I realise this patch is just documenting current behaviour, and I'm not saying
that behaviour is correct or incorrect, but it seems important and certainly
wasn't intuitive to me.  So it's worth mentioning a bit louder :) 


More information about the ffmpeg-devel mailing list