[FFmpeg-devel] [PATCH] avfilter/vf_scale: add ov/hsub

Michael Niedermayer michaelni at gmx.at
Mon Nov 4 15:24:29 CET 2013


On Mon, Nov 04, 2013 at 02:36:14PM +0100, Stefano Sabatini wrote:
> On date Monday 2013-11-04 14:26:44 +0100, Michael Niedermayer encoded:
> > Suggested-by: divVerent
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  doc/filters.texi       |    7 ++++++-
> >  libavfilter/vf_scale.c |    7 +++++++
> >  2 files changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 7f07848..9fae339 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -6820,7 +6820,12 @@ input display aspect ratio. Calculated from @code{(iw / ih) * sar}.
> >  
> >  @item hsub
> >  @item vsub
> > -horizontal and vertical chroma subsample values. For example for the
> > +horizontal and vertical input chroma subsample values. For example for the
> > +pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
> > +
> > + at item ohsub
> > + at item ovsub
> > +horizontal and vertical output chroma subsample values. For example for the
> >  pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
> >  @end table
> >  
> > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
> > index 283c0b7..c9fb7c6 100644
> > --- a/libavfilter/vf_scale.c
> > +++ b/libavfilter/vf_scale.c
> > @@ -51,6 +51,8 @@ static const char *const var_names[] = {
> >      "dar",
> >      "hsub",
> >      "vsub",
> > +    "ohsub",
> > +    "ovsub",
> >      NULL
> >  };
> >  
> > @@ -64,6 +66,8 @@ enum var_name {
> >      VAR_DAR,
> >      VAR_HSUB,
> >      VAR_VSUB,
> > +    VAR_OHSUB,
> > +    VAR_OVSUB,
> >      VARS_NB
> >  };
> >  
> > @@ -227,6 +231,7 @@ static int config_props(AVFilterLink *outlink)
> >      enum AVPixelFormat outfmt = outlink->format;
> >      ScaleContext *scale = ctx->priv;
> >      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> > +    const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(outlink->format);
> >      int64_t w, h;
> >      double var_values[VARS_NB], res;
> >      char *expr;
> > @@ -242,6 +247,8 @@ static int config_props(AVFilterLink *outlink)
> >      var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
> >      var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
> >      var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;
> 
> > +    var_values[VAR_OHSUB]  = 1 << out_desc->log2_chroma_w;
> > +    var_values[VAR_OVSUB]  = 1 << out_desc->log2_chroma_h;
> 
> nit: vertial align
> 
> LGTM with micro bump.

fixed, applied, thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131104/0ef8bdcc/attachment.asc>


More information about the ffmpeg-devel mailing list