[04/12] yadif: update frame rate

Message ID 1445977054-15625-5-git-send-email-stebbins@jetheaddev.com
State New
Headers show

Commit Message

John Stebbins Oct. 27, 2015, 8:17 p.m.
From: Michael Niedermayer <michaelni@gmx.at>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31619584556466e4beab98e9b04ed4c5ba0db178)
---
 libavfilter/vf_yadif.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Luca Barbato Oct. 27, 2015, 9:04 p.m. | #1
On 27/10/15 21:17, John Stebbins wrote:
> From: Michael Niedermayer <michaelni@gmx.at>
> 
> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> (cherry picked from commit 31619584556466e4beab98e9b04ed4c5ba0db178)
> ---
>  libavfilter/vf_yadif.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
> index 574eac4..62576f7 100644
> --- a/libavfilter/vf_yadif.c
> +++ b/libavfilter/vf_yadif.c
> @@ -462,6 +462,9 @@ static int config_props(AVFilterLink *link)
>      link->w             = link->src->inputs[0]->w;
>      link->h             = link->src->inputs[0]->h;
>  
> +    if(s->mode&1)
> +        link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, (AVRational){2,1});
> +
>      s->csp = av_pix_fmt_desc_get(link->format);
>      if (s->csp->comp[0].depth > 8) {
>          s->filter_line  = filter_line_c_16bit;
> 

The style will be fixed on commit, remind me to give names to the modes.
John Stebbins Oct. 27, 2015, 9:13 p.m. | #2
On Tue, 2015-10-27 at 22:04 +0100, Luca Barbato wrote:
> On 27/10/15 21:17, John Stebbins wrote:
> > From: Michael Niedermayer <michaelni@gmx.at>
> > 
> > Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> > (cherry picked from commit 31619584556466e4beab98e9b04ed4c5ba0db178)
> > ---
> >  libavfilter/vf_yadif.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
> > index 574eac4..62576f7 100644
> > --- a/libavfilter/vf_yadif.c
> > +++ b/libavfilter/vf_yadif.c
> > @@ -462,6 +462,9 @@ static int config_props(AVFilterLink *link)
> >      link->w             = link->src->inputs[0]->w;
> >      link->h             = link->src->inputs[0]->h;
> >  
> > +    if(s->mode&1)
> > +        link->frame_rate = av_mul_q(link->src->inputs[0]
> > ->frame_rate, (AVRational){2,1});
> > +
> >      s->csp = av_pix_fmt_desc_get(link->format);
> >      if (s->csp->comp[0].depth > 8) {
> >          s->filter_line  = filter_line_c_16bit;
> > 
> 
> The style will be fixed on commit, remind me to give names to the
> modes.
> 

I can fix these things if you would like.  Do you have preferences for
mode names (e.g. YADIF_SKIP_SPATIAL, YADIF_BOB)?  Just define them at
the top of the file?
Luca Barbato Oct. 27, 2015, 9:18 p.m. | #3
On 27/10/15 22:13, John Stebbins wrote:
> On Tue, 2015-10-27 at 22:04 +0100, Luca Barbato wrote:
>> On 27/10/15 21:17, John Stebbins wrote:
>>> From: Michael Niedermayer <michaelni@gmx.at>
>>>
>>> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
>>> (cherry picked from commit 31619584556466e4beab98e9b04ed4c5ba0db178)
>>> ---
>>>  libavfilter/vf_yadif.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
>>> index 574eac4..62576f7 100644
>>> --- a/libavfilter/vf_yadif.c
>>> +++ b/libavfilter/vf_yadif.c
>>> @@ -462,6 +462,9 @@ static int config_props(AVFilterLink *link)
>>>      link->w             = link->src->inputs[0]->w;
>>>      link->h             = link->src->inputs[0]->h;
>>>  
>>> +    if(s->mode&1)
>>> +        link->frame_rate = av_mul_q(link->src->inputs[0]
>>> ->frame_rate, (AVRational){2,1});
>>> +
>>>      s->csp = av_pix_fmt_desc_get(link->format);
>>>      if (s->csp->comp[0].depth > 8) {
>>>          s->filter_line  = filter_line_c_16bit;
>>>
>>
>> The style will be fixed on commit, remind me to give names to the
>> modes.
>>
> 
> I can fix these things if you would like.  Do you have preferences for
> mode names (e.g. YADIF_SKIP_SPATIAL, YADIF_BOB)?  Just define them at
> the top of the file?

In the option there is a description missing, but it is unrelated to
this patch. Basically mode 1 and 3 would change the frame rate.

lu
John Stebbins Oct. 27, 2015, 9:26 p.m. | #4
On Tue, 2015-10-27 at 22:18 +0100, Luca Barbato wrote:
> On 27/10/15 22:13, John Stebbins wrote:
> > On Tue, 2015-10-27 at 22:04 +0100, Luca Barbato wrote:
> > > On 27/10/15 21:17, John Stebbins wrote:
> > > > From: Michael Niedermayer <michaelni@gmx.at>
> > > > 
> > > > Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> > > > (cherry picked from commit
> > > > 31619584556466e4beab98e9b04ed4c5ba0db178)
> > > > ---
> > > >  libavfilter/vf_yadif.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > > 
> > > > diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
> > > > index 574eac4..62576f7 100644
> > > > --- a/libavfilter/vf_yadif.c
> > > > +++ b/libavfilter/vf_yadif.c
> > > > @@ -462,6 +462,9 @@ static int config_props(AVFilterLink *link)
> > > >      link->w             = link->src->inputs[0]->w;
> > > >      link->h             = link->src->inputs[0]->h;
> > > >  
> > > > +    if(s->mode&1)
> > > > +        link->frame_rate = av_mul_q(link->src->inputs[0]
> > > > ->frame_rate, (AVRational){2,1});
> > > > +
> > > >      s->csp = av_pix_fmt_desc_get(link->format);
> > > >      if (s->csp->comp[0].depth > 8) {
> > > >          s->filter_line  = filter_line_c_16bit;
> > > > 
> > > 
> > > The style will be fixed on commit, remind me to give names to the
> > > modes.
> > > 
> > 
> > I can fix these things if you would like.  Do you have preferences
> > for
> > mode names (e.g. YADIF_SKIP_SPATIAL, YADIF_BOB)?  Just define them
> > at
> > the top of the file?
> 
> In the option there is a description missing, but it is unrelated to
> this patch. Basically mode 1 and 3 would change the frame rate.
> 
> 

Yes, mode 1 and 3 are bob, which converts fields to frames.  I'm not
sure if you were answering my question or asking another question. Your
statement seems merely a statement of fact.
Hendrik Leppkes Oct. 27, 2015, 9:29 p.m. | #5
On Tue, Oct 27, 2015 at 10:26 PM, John Stebbins <stebbins@jetheaddev.com> wrote:
> On Tue, 2015-10-27 at 22:18 +0100, Luca Barbato wrote:
>> On 27/10/15 22:13, John Stebbins wrote:
>> > On Tue, 2015-10-27 at 22:04 +0100, Luca Barbato wrote:
>> > > On 27/10/15 21:17, John Stebbins wrote:
>> > > > From: Michael Niedermayer <michaelni@gmx.at>
>> > > >
>> > > > Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
>> > > > (cherry picked from commit
>> > > > 31619584556466e4beab98e9b04ed4c5ba0db178)
>> > > > ---
>> > > >  libavfilter/vf_yadif.c | 3 +++
>> > > >  1 file changed, 3 insertions(+)
>> > > >
>> > > > diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
>> > > > index 574eac4..62576f7 100644
>> > > > --- a/libavfilter/vf_yadif.c
>> > > > +++ b/libavfilter/vf_yadif.c
>> > > > @@ -462,6 +462,9 @@ static int config_props(AVFilterLink *link)
>> > > >      link->w             = link->src->inputs[0]->w;
>> > > >      link->h             = link->src->inputs[0]->h;
>> > > >
>> > > > +    if(s->mode&1)
>> > > > +        link->frame_rate = av_mul_q(link->src->inputs[0]
>> > > > ->frame_rate, (AVRational){2,1});
>> > > > +
>> > > >      s->csp = av_pix_fmt_desc_get(link->format);
>> > > >      if (s->csp->comp[0].depth > 8) {
>> > > >          s->filter_line  = filter_line_c_16bit;
>> > > >
>> > >
>> > > The style will be fixed on commit, remind me to give names to the
>> > > modes.
>> > >
>> >
>> > I can fix these things if you would like.  Do you have preferences
>> > for
>> > mode names (e.g. YADIF_SKIP_SPATIAL, YADIF_BOB)?  Just define them
>> > at
>> > the top of the file?
>>
>> In the option there is a description missing, but it is unrelated to
>> this patch. Basically mode 1 and 3 would change the frame rate.
>>
>>
>
> Yes, mode 1 and 3 are bob, which converts fields to frames.  I'm not
> sure if you were answering my question or asking another question. Your
> statement seems merely a statement of fact.

I think his point is that its entirely unrelated to this patch series,
and you should just leave it be for now, and if you really care, send
a cleanup patch later. ;)

- Hendrik
John Stebbins Oct. 27, 2015, 9:32 p.m. | #6
On Tue, 2015-10-27 at 22:29 +0100, Hendrik Leppkes wrote:
> On Tue, Oct 27, 2015 at 10:26 PM, John Stebbins <
> stebbins@jetheaddev.com> wrote:
> > On Tue, 2015-10-27 at 22:18 +0100, Luca Barbato wrote:
> > > On 27/10/15 22:13, John Stebbins wrote:
> > > > On Tue, 2015-10-27 at 22:04 +0100, Luca Barbato wrote:
> > > > > On 27/10/15 21:17, John Stebbins wrote:
> > > > > > From: Michael Niedermayer <michaelni@gmx.at>
> > > > > > 
> > > > > > Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> > > > > > (cherry picked from commit
> > > > > > 31619584556466e4beab98e9b04ed4c5ba0db178)
> > > > > > ---
> > > > > >  libavfilter/vf_yadif.c | 3 +++
> > > > > >  1 file changed, 3 insertions(+)
> > > > > > 
> > > > > > diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
> > > > > > index 574eac4..62576f7 100644
> > > > > > --- a/libavfilter/vf_yadif.c
> > > > > > +++ b/libavfilter/vf_yadif.c
> > > > > > @@ -462,6 +462,9 @@ static int config_props(AVFilterLink
> > > > > > *link)
> > > > > >      link->w             = link->src->inputs[0]->w;
> > > > > >      link->h             = link->src->inputs[0]->h;
> > > > > > 
> > > > > > +    if(s->mode&1)
> > > > > > +        link->frame_rate = av_mul_q(link->src->inputs[0]
> > > > > > ->frame_rate, (AVRational){2,1});
> > > > > > +
> > > > > >      s->csp = av_pix_fmt_desc_get(link->format);
> > > > > >      if (s->csp->comp[0].depth > 8) {
> > > > > >          s->filter_line  = filter_line_c_16bit;
> > > > > > 
> > > > > 
> > > > > The style will be fixed on commit, remind me to give names to
> > > > > the
> > > > > modes.
> > > > > 
> > > > 
> > > > I can fix these things if you would like.  Do you have
> > > > preferences
> > > > for
> > > > mode names (e.g. YADIF_SKIP_SPATIAL, YADIF_BOB)?  Just define
> > > > them
> > > > at
> > > > the top of the file?
> > > 
> > > In the option there is a description missing, but it is unrelated
> > > to
> > > this patch. Basically mode 1 and 3 would change the frame rate.
> > > 
> > > 
> > 
> > Yes, mode 1 and 3 are bob, which converts fields to frames.  I'm not
> > sure if you were answering my question or asking another question.
> > Your
> > statement seems merely a statement of fact.
> 
> I think his point is that its entirely unrelated to this patch series,
> and you should just leave it be for now, and if you really care, send
> a cleanup patch later. ;)
> 
> 


I can do that ;)

Patch

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 574eac4..62576f7 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -462,6 +462,9 @@  static int config_props(AVFilterLink *link)
     link->w             = link->src->inputs[0]->w;
     link->h             = link->src->inputs[0]->h;
 
+    if(s->mode&1)
+        link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, (AVRational){2,1});
+
     s->csp = av_pix_fmt_desc_get(link->format);
     if (s->csp->comp[0].depth > 8) {
         s->filter_line  = filter_line_c_16bit;