From patchwork Sat Jul 11 11:22:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 20962 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 222DE44BCB0 for ; Sat, 11 Jul 2020 14:30:10 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 091156882DE; Sat, 11 Jul 2020 14:30:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B0D426880C5 for ; Sat, 11 Jul 2020 14:30:03 +0300 (EEST) Received: by mail-lj1-f195.google.com with SMTP id h19so9245084ljg.13 for ; Sat, 11 Jul 2020 04:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=2vLOyjVtcMXX/YL5sTfng3Zr49bRnHGv0U9QJ6Ig8ZM=; b=jMTDrIKutDi9IejXmbr3HphAW9r1hZxR3Kks0mqy+TxTJK/dQ5A7Q0trmk2W5GKYlD blTQ5t7V1Qv1olDMAN46Npa/aAfBB/EGZ5A25hVVh2hib8YVPP8ASS+8EKabnEjxbtJk e3H+nVd2Ebb64nZEoiXcaEKNXYTdp0qZIPyVnaogL1OG6l9p53KnnGIF07bkQjdOsZZn UAa2pzcnIhAjE9DzjtNxfE9SeiImzoZKEWrGd0uGA1KM7jaBCtySdlDjbN86Yn8t9QpH XY3C3tcFePtQ1NZTmxPZqwwKlk39RsdWvloThiVNSxHnPy4JQY9pn8kEMuGfqpaF28ir s5Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=2vLOyjVtcMXX/YL5sTfng3Zr49bRnHGv0U9QJ6Ig8ZM=; b=gpSXccFxeM5iYQ+Pz0llr8y6XK9djt8WTiMiGZHPNg7eTUe7B1RI9m+sEGPOBv3BXK k4dwL/f5pZ+0h/O072TQAHS0RnYe/1+voJEq6TPQVIZCsA3t7PV+cNnkIgNwYRTVQ2Dp b/mlhOb4MXMb3bXRpMtEOlqkcjRP76/upzG/br/1WRBmvKwJV5A9xlB7DuvDUeM6kz9/ LSJgyPHrnBnkd/Tk+eYxkSN63WxFdEZypb8/TsNgqPnkkFeD2/qpVEapCIAA1pwP+DoM W5dhGt8D4CkwFf+EQG7q62wfBvm2wbqTH1c7C0XJufEBPuk3D0QkL7RzSFZxQ/cDOX9e 9sFw== X-Gm-Message-State: AOAM530cxhbr39LnvVHw/ZTlbCYdnXOnaOgajqST0jjcYjCaT6EF4nkM kvB68KfnyY1x7pdKahVyXTVRBfJa/0I= X-Google-Smtp-Source: ABdhPJym/zjUG7KDT/ioTgvnvqbDdY7xF3E+nJNN7qblq58TMSmILci19K5zudqhxAxoG43pPDF7VQ== X-Received: by 2002:a17:906:7c07:: with SMTP id t7mr68175496ejo.487.1594466567303; Sat, 11 Jul 2020 04:22:47 -0700 (PDT) Received: from localhost.localdomain ([37.244.249.110]) by smtp.gmail.com with ESMTPSA id t6sm5494008ejc.40.2020.07.11.04.22.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2020 04:22:46 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 Jul 2020 13:22:38 +0200 Message-Id: <20200711112239.7433-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_tinterlace: use frame counter from lavfi X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Remove internal counter. Signed-off-by: Paul B Mahol --- libavfilter/tinterlace.h | 1 - libavfilter/vf_tinterlace.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h index 020887ff34..4059ebf81a 100644 --- a/libavfilter/tinterlace.h +++ b/libavfilter/tinterlace.h @@ -67,7 +67,6 @@ typedef struct TInterlaceContext { AVRational preout_time_base; int flags; ///< flags affecting interlacing algorithm int lowpass; ///< legacy interlace filter lowpass mode - int frame; ///< number of the output frame int vsub; ///< chroma vertical subsampling AVFrame *cur; AVFrame *next; diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index a77753775c..d145e35520 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -423,7 +423,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) out->height = outlink->h; out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1)); - field = (1 + tinterlace->frame) & 1 ? FIELD_UPPER : FIELD_LOWER; + field = (1 + outlink->frame_count_in) & 1 ? FIELD_UPPER : FIELD_LOWER; /* copy upper and lower fields */ copy_picture_field(tinterlace, out->data, out->linesize, (const uint8_t **)cur->data, cur->linesize, @@ -517,7 +517,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, outlink->time_base); ret = ff_filter_frame(outlink, out); - tinterlace->frame++; return ret; }