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

Paul B Mahol onemda at gmail.com
Mon Apr 3 21:18:30 EEST 2017


On 4/3/17, Ricardo Constantino <wiiaboo at gmail.com> wrote:
> 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.
>>

Have you missed what I wrote above?

> 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.

Why div_q ?

>
>
>>
>> > 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);
>> > +        }
>> > +    }
>> > +
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list