diff mbox series

[FFmpeg-devel,v2,14/22] lavfi/vpp_qsv: double the framerate for deinterlacing

Message ID 20210517032426.3376661-15-haihao.xiang@intel.com
State Superseded
Headers show
Series clean-up QSV filters | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Xiang, Haihao May 17, 2021, 3:24 a.m. UTC
---
 libavfilter/vf_vpp_qsv.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Linjie Fu June 6, 2021, 2:56 p.m. UTC | #1
Hi Haihao,

On Mon, May 17, 2021 at 11:30 AM Haihao Xiang <haihao.xiang@intel.com> wrote:
>
> ---
>  libavfilter/vf_vpp_qsv.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
> index 29ba220665..ec35f85b04 100644
> --- a/libavfilter/vf_vpp_qsv.c
> +++ b/libavfilter/vf_vpp_qsv.c
> @@ -255,10 +255,14 @@ static int config_input(AVFilterLink *inlink)
>      int              ret;
>      int64_t          ow, oh;
>
> -    if (vpp->framerate.den == 0 || vpp->framerate.num == 0)
> +    /* Ignore user's setting for framerate when deinterlacing is used */
> +    if (vpp->deinterlace)
> +        vpp->framerate = av_mul_q(inlink->frame_rate,
> +                                  (AVRational){ 2, 1 });
> +    else if (vpp->framerate.den == 0 || vpp->framerate.num == 0)
>          vpp->framerate = inlink->frame_rate;

No objection, just considering would it be better to prompt a warning
for users instead of just ignoring the user 's setting?

- linjie
Xiang, Haihao June 6, 2021, 4:39 p.m. UTC | #2
On Sun, 2021-06-06 at 22:56 +0800, Linjie Fu wrote:
> Hi Haihao,
> 
> On Mon, May 17, 2021 at 11:30 AM Haihao Xiang <haihao.xiang@intel.com> wrote:
> > 
> > ---
> >  libavfilter/vf_vpp_qsv.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
> > index 29ba220665..ec35f85b04 100644
> > --- a/libavfilter/vf_vpp_qsv.c
> > +++ b/libavfilter/vf_vpp_qsv.c
> > @@ -255,10 +255,14 @@ static int config_input(AVFilterLink *inlink)
> >      int              ret;
> >      int64_t          ow, oh;
> > 
> > -    if (vpp->framerate.den == 0 || vpp->framerate.num == 0)
> > +    /* Ignore user's setting for framerate when deinterlacing is used */
> > +    if (vpp->deinterlace)
> > +        vpp->framerate = av_mul_q(inlink->frame_rate,
> > +                                  (AVRational){ 2, 1 });
> > +    else if (vpp->framerate.den == 0 || vpp->framerate.num == 0)
> >          vpp->framerate = inlink->frame_rate;
> 
> No objection, just considering would it be better to prompt a warning
> for users instead of just ignoring the user 's setting?

Thanks for the comment, I will update it.

> 
> - linjie
diff mbox series

Patch

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 29ba220665..ec35f85b04 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -255,10 +255,14 @@  static int config_input(AVFilterLink *inlink)
     int              ret;
     int64_t          ow, oh;
 
-    if (vpp->framerate.den == 0 || vpp->framerate.num == 0)
+    /* Ignore user's setting for framerate when deinterlacing is used */
+    if (vpp->deinterlace)
+        vpp->framerate = av_mul_q(inlink->frame_rate,
+                                  (AVRational){ 2, 1 });
+    else if (vpp->framerate.den == 0 || vpp->framerate.num == 0)
         vpp->framerate = inlink->frame_rate;
 
-    if (av_cmp_q(vpp->framerate, inlink->frame_rate))
+    if (!vpp->deinterlace && av_cmp_q(vpp->framerate, inlink->frame_rate))
         vpp->use_frc = 1;
 
     ret = eval_expr(ctx);