From patchwork Fri Apr 3 21:37:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 18620 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a0c:ab15:0:0:0:0:0 with SMTP id h21csp1406494qvb; Fri, 3 Apr 2020 14:38:09 -0700 (PDT) X-Google-Smtp-Source: APiQypJRAJClpWdW3tcEQWTdUi5tQa3P+C4OACeuXYSICg+5Kgp2rYsR7YJSA0r53IzawSsi2zkp X-Received: by 2002:a05:6402:335:: with SMTP id q21mr415841edw.47.1585949889768; Fri, 03 Apr 2020 14:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585949889; cv=none; d=google.com; s=arc-20160816; b=SQLpr18utvUnj4RYSdUQJmeecrvY3WFMG2FPkoth2NrXR/Mxezy1KMdyfGw6mC+dBp r4hUQ09akrRe/YMnlm6qLgmCbX9Cm21sM+KSdHujSGiO8/lZu7MKvDp1WctT/Clv2DkW oOgibhhJLO1Rq2f5tKphPP+esqvi0jjxGLA19EBDXwSo3tTrO5wEekcQnIPL2xhNkbuW HBI3fraJNnIvDjEbsbQEU9kqW2sor6FKsTa5+q+MCihfcdsB7ME99gZ1EaZux21nZEhX KnmokaYXtxLRKzasUYhIgZh61VEIB/Xoq9eyXCQ2JtjnE0P/DKXuw3t7/yrYfpvL/XW6 XPBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:delivered-to; bh=FMijbGR4V5I5+3h3GsIavVX4XGlbQhq50BbtupId35A=; b=ZDnXpo3doGjXtHT5Q4OTHwnOR5/az+L7XU7ppY2r7MbS6Q6emOyHWy0wTAmtIITR3L DXjZmeRI1sumQ4php2R85jYP+7QCJpouU61wLGG4dJH7BEnvaGM9rIOtRJflPItg80ia 2IDIYK5VH0ojly+ClvV9TyipLmhcTIk2QeX/6r7+UNnAJ/pWNP1jhq9U7b7nCGxl1xZl aFY+LOCnsquQW4J+itoI22yKLSSa3UBa7RMb83nnQdTvvDPyPowkC8UDxwq8PavyT/CJ ALaF/T5ElaxVnag/ygY94PTqXrgtpv4HkM/LsnQ6kXlgrQ1c4kAQ4Lbsz5WNOTYQyNrU cehQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=n5wmJR2d; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id um1si6644295ejb.4.2020.04.03.14.38.09; Fri, 03 Apr 2020 14:38:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=n5wmJR2d; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7E58668AF38; Sat, 4 Apr 2020 00:38:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C497C68AE7B for ; Sat, 4 Apr 2020 00:37:59 +0300 (EEST) Received: by mail-io1-f41.google.com with SMTP id y14so9154960iol.12 for ; Fri, 03 Apr 2020 14:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=DyV9YBEWmMovaR8jJl1SxbYwna3o71NtkE0ZI86m9Ts=; b=n5wmJR2dc2rMKzf4dGLVeyrRgP04j6sOC/DBsKqUzfMf4B17N4HoKgoBZdi4hfpOQs sIexzvSQh/z5iqItoApfrxcJQpxoLvMAPyk5ACZfZpeWgK981Hu7gHaXEL8anxnM9bjP o/COID2fJljJPfhv3094nzxjazPkP6TVDlPTSvchTtsOsRyb26bdRGNz4VxPk0tHv+yc v3jBzUdzlcedn3TxfgmDn+xmz/u7qCJmJ3g2qTP0eDP2IJQYTrosHu/XFjEbfQKQgxPF ZNiiO9AIu7S7bBuSchQe6vbiUkkN7lZTndwKVtU/u5GmYIpRuskNKn9rL5kr+bsozZLJ rC5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=DyV9YBEWmMovaR8jJl1SxbYwna3o71NtkE0ZI86m9Ts=; b=e3q76FuEmmy4zFBujLCaeQnpN2AFrVfLENQU0dmLtVEv+IumWkjdzmt0NPXJpuienM hkRDm26O1VTEUOTo39BYlr4MndIkj5Bv621lZ/AegA7/XAnlknWZcBFhLqdHjUYEad1N W0KnYFt1LUkVTo3jZI/kxTuOlqKRlpi3F04VuqknZUj9UooVC9HCUhuJ2RKJlNvKnJQc 9KW2C7JDgHynxwJxqElmS9BO4ToggYRNShtRtUpexgJBPRdUwfm8au0Ut4WITn+krW7O BJuEFhegROiUg1SiB9BjVNBmUL9vynqiq+umss1ft5hx6ao0Ng1kMQmQYRWHPnE7zWjy 7VUg== X-Gm-Message-State: AGi0PuZyb3lwCviYst9v3b1iQIzMaaTDzrcqFMBSpguTJb7V3LjXLcE/ 7SKajJNhJVw00LAVwYgFSPz5cGjJCDRpJ3jRnHzSXQ== X-Received: by 2002:a05:6638:ed3:: with SMTP id q19mr10596286jas.49.1585949877957; Fri, 03 Apr 2020 14:37:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Carl Eugen Hoyos Date: Fri, 3 Apr 2020 23:37:46 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH v2]lavfi/telecine: Mark telecined frames as interlaced 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Sr19jcUGDtew Content-Length: 14614 Am Fr., 3. Apr. 2020 um 23:19 Uhr schrieb Carl Eugen Hoyos : > Attached patch marks actually telecined frames as interlaced, > other frames as progressive. New patch with changes to fate attached. Please comment, Carl Eugen From 97f3bba7b4f4f4bf4bbb69376daeb45e3386ba62 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Fri, 3 Apr 2020 23:04:15 +0200 Subject: [PATCH] lavfi/telecine: Mark telecined frames as interlaced. --- libavfilter/vf_telecine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c index 62599a7a3a..3e65f08e39 100644 --- a/libavfilter/vf_telecine.c +++ b/libavfilter/vf_telecine.c @@ -207,6 +207,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) s->stride[i], (s->planeheight[i] - !s->first_field + 1) / 2); } + s->frame[nout]->interlaced_frame = 1; nout++; len--; s->occupied = 0; @@ -220,6 +221,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) inpicref->data[i], inpicref->linesize[i], s->stride[i], s->planeheight[i]); + s->frame[nout]->interlaced_frame = inpicref->interlaced_frame; nout++; len -= 2; } @@ -236,6 +238,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) for (i = 0; i < nout; i++) { AVFrame *frame = av_frame_clone(s->frame[i]); + int interlaced = frame->interlaced_frame; if (!frame) { av_frame_free(&inpicref); @@ -243,6 +246,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) } av_frame_copy_props(frame, inpicref); + frame->interlaced_frame = interlaced; frame->pts = ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time) + av_rescale(outlink->frame_count_in, s->ts_unit.num, s->ts_unit.den); diff --git a/tests/ref/fate/filter-pixfmts-fieldmatch b/tests/ref/fate/filter-pixfmts-fieldmatch index c3165b872d..eb0fc3c224 100644 --- a/tests/ref/fate/filter-pixfmts-fieldmatch +++ b/tests/ref/fate/filter-pixfmts-fieldmatch @@ -1,5 +1,5 @@ -yuv410p a6c9b4065e8253d8120772f69be0bf04 -yuv411p b913e634ad37ce046240252bed8681fb -yuv420p a9286560141eb14595e427dbe5829b00 -yuv422p 11ad22ce00c5e8a30d0472f29fb15434 -yuv444p 6c5b0c1343d625d0656b6755906fd874 +yuv410p 572e4416ae6988dab3dbdbed3296b57c +yuv411p ce9ccbb1985b7840955e57c23d4bc003 +yuv420p f06c53990f577893fef6a4270aab691b +yuv422p 1c6ad2c3198ad577593214ebc9bc5705 +yuv444p 24813e175b1b09c01f5ec16149d83fce diff --git a/tests/ref/fate/filter-pixfmts-pullup b/tests/ref/fate/filter-pixfmts-pullup index c6ddb3489a..88c1dd565d 100644 --- a/tests/ref/fate/filter-pixfmts-pullup +++ b/tests/ref/fate/filter-pixfmts-pullup @@ -1,12 +1,12 @@ -gray 415c928947f83f9b45c24ad15a094bda -yuv410p 0f29d0b6394871e1e6cde484b4f351f4 -yuv411p ec059b1992e1acda472b9b2dd3e4506b -yuv420p dba6303cd02cc39cb0db7b546793d565 -yuv422p d7d3224dd900bb1b96608a28a704360d -yuv440p d4c5f20701cfceb4bbf7d75cfcc13514 -yuv444p 7e405274037e7f2ab845d7413a71e16d -yuvj411p dc602e7bd3449d16e17e695815616b1e -yuvj420p b98ec86eeef2d512aeb2fc4d32ffa656 -yuvj422p f09c3240bb662477b76ce4da34b4feed -yuvj440p 8d3ab69e2bbbbbd2f9be323c18922533 -yuvj444p 2dc27560eed5d685354796dcccce853c +gray 0af7cbb0cfb3efcb946e697c4b7bd5f9 +yuv410p c7a9e3aeb6b30eadcdf6ca5acb52c5b2 +yuv411p 2e19fb03dd57e4700ff560da3a84402e +yuv420p 7019c5de9774970eb3a7828cb92439e8 +yuv422p 8fc1c9fff0aa2566a50ff10a54e80ba7 +yuv440p 16775691a106117ecd244c45252f4ba7 +yuv444p b6ec514e4c30fea6b0dd696bf7d147d5 +yuvj411p 0b899555985616330109a2381d9828a4 +yuvj420p 1f51fe0c2c8d5ba12409bc4c821fed56 +yuvj422p 5e9a13247fe5201ea83d3a64241631e3 +yuvj440p 2e22b2e340f372792bec5ba0a8f46822 +yuvj444p becc016653bb26b472625d87dbfc10c4 diff --git a/tests/ref/fate/filter-yadif-mode0 b/tests/ref/fate/filter-yadif-mode0 index be807f9de5..15017492ff 100644 --- a/tests/ref/fate/filter-yadif-mode0 +++ b/tests/ref/fate/filter-yadif-mode0 @@ -33,3 +33,34 @@ 0, 36, 36, 1, 622080, 0x2e81bd32 0, 37, 37, 1, 622080, 0x852cf6cf 0, 38, 38, 1, 622080, 0xb055f0e5 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 diff --git a/tests/ref/fate/filter-yadif-mode1 b/tests/ref/fate/filter-yadif-mode1 index 53741b0ae7..4f90c8cd40 100644 --- a/tests/ref/fate/filter-yadif-mode1 +++ b/tests/ref/fate/filter-yadif-mode1 @@ -62,3 +62,34 @@ 0, 74, 74, 1, 622080, 0x852cf6cf 0, 75, 75, 1, 622080, 0x892a014e 0, 76, 76, 1, 622080, 0xb055f0e5 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 diff --git a/tests/ref/fate/filter-yadif10 b/tests/ref/fate/filter-yadif10 index 28e799fc1f..7475a24fc3 100644 --- a/tests/ref/fate/filter-yadif10 +++ b/tests/ref/fate/filter-yadif10 @@ -33,3 +33,34 @@ 0, 36, 36, 1, 1244160, 0xdd8b3b20 0, 37, 37, 1, 1244160, 0x229ac529 0, 38, 38, 1, 1244160, 0xf844e0a2 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 diff --git a/tests/ref/fate/filter-yadif16 b/tests/ref/fate/filter-yadif16 index 0c856ab37a..19f42311ff 100644 --- a/tests/ref/fate/filter-yadif16 +++ b/tests/ref/fate/filter-yadif16 @@ -33,3 +33,34 @@ 0, 36, 36, 1, 1244160, 0x9fc1bd32 0, 37, 37, 1, 1244160, 0x1389f6cf 0, 38, 38, 1, 1244160, 0x6fc5f0e5 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1 +yadif->cur->interlaced_frame: 1