[FFmpeg-devel] [PATCH] avfilter/vf_pad: add aspect option

Ricardo Constantino wiiaboo at gmail.com
Mon Apr 3 21:07:52 EEST 2017


On 2 April 2017 at 22:13, Paul B Mahol <onemda at gmail.com> wrote:

> On 4/2/17, Paul B Mahol <onemda at gmail.com> wrote:
> > Signed-off-by: Paul B Mahol <onemda at gmail.com>
> > ---
> >  doc/filters.texi     |  3 +++
> >  libavfilter/vf_pad.c | 14 ++++++++++++++
> >  2 files changed, 17 insertions(+)
> >
> > +    if (adjusted_aspect.num && adjusted_aspect.den) {
> > +        adjusted_aspect = av_mul_q(adjusted_aspect, av_make_q(s->w,
>                                                        ^ changed to
> sample aspect ratio locally.
>
Shouldn't this av_mul_q be a
av_div_q(adjusted_aspect, inlink->sample_aspect_ratio) instead?

That way it won't try to expand 40/33 SAR 704x480 to 1034x480 but
instead leave it as 704x480.


>
> > s->h));
> > +        if (s->h < av_rescale(s->w, adjusted_aspect.den,
> > adjusted_aspect.num)) {
> > +            s->h = var_values[VAR_OUT_H] = var_values[VAR_OH] =
> > av_rescale(s->w, adjusted_aspect.den, adjusted_aspect.num);
> > +        } else {
> > +            s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] =
> > av_rescale(s->h, adjusted_aspect.num, adjusted_aspect.den);
> > +        }
> > +    }
> > +


More information about the ffmpeg-devel mailing list