[04/11] yadif: update frame rate

Message ID 1446050900-7329-4-git-send-email-stebbins@jetheaddev.com
State New
Headers show

Commit Message

John Stebbins Oct. 28, 2015, 4:48 p.m.
From: Michael Niedermayer <michaelni@gmx.at>

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

Comments

Vittorio Giovara Oct. 28, 2015, 5:46 p.m. | #1
On Wed, Oct 28, 2015 at 5:48 PM, John Stebbins <stebbins@jetheaddev.com> wrote:
> From: Michael Niedermayer <michaelni@gmx.at>
>
> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> (cherry picked from ffmpeg commit 31619584556466e4beab98e9b04ed4c5ba0db178)
> ---
>  libavfilter/vf_yadif.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
> index 574eac4..f9d65e7 100644
> --- a/libavfilter/vf_yadif.c
> +++ b/libavfilter/vf_yadif.c
> @@ -462,6 +462,10 @@ static int config_props(AVFilterLink *link)
>      link->w             = link->src->inputs[0]->w;
>      link->h             = link->src->inputs[0]->h;
>
> +    if (s->mode & 1)

if (s->mode == 1 || s->mode == 3) please
Luca Barbato Oct. 28, 2015, 6:23 p.m. | #2
On 28/10/15 18:46, Vittorio Giovara wrote:
> On Wed, Oct 28, 2015 at 5:48 PM, John Stebbins <stebbins@jetheaddev.com> wrote:
>> From: Michael Niedermayer <michaelni@gmx.at>
>>
>> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
>> (cherry picked from ffmpeg commit 31619584556466e4beab98e9b04ed4c5ba0db178)
>> ---
>>  libavfilter/vf_yadif.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
>> index 574eac4..f9d65e7 100644
>> --- a/libavfilter/vf_yadif.c
>> +++ b/libavfilter/vf_yadif.c
>> @@ -462,6 +462,10 @@ static int config_props(AVFilterLink *link)
>>      link->w             = link->src->inputs[0]->w;
>>      link->h             = link->src->inputs[0]->h;
>>
>> +    if (s->mode & 1)
> 
> if (s->mode == 1 || s->mode == 3) please
> 

I'll update that to use something less magic and redo that myself =P
John is already doing a lot =)

lu

Patch

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 574eac4..f9d65e7 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -462,6 +462,10 @@  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;