From patchwork Fri Dec 8 00:05:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 6592 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp8949431jah; Thu, 7 Dec 2017 16:13:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMZIB+Tker8qXev4sHnR1cNMqgYfe6xV9Y3W1kYUdOv/LmDeA5/qh0QfcGui9uD2vqGlzFDF X-Received: by 10.28.55.82 with SMTP id e79mr2390795wma.60.1512692014108; Thu, 07 Dec 2017 16:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512692014; cv=none; d=google.com; s=arc-20160816; b=TMeY4Txr74KkbGA1mobpqKRJh/3fOitAH31q50Y1q8DahWKFGX37g7OiC7FdlCrpRr K16CXNBDG58Z4MzebpdhCYHidMxoCSNW3IHgvG/5qvGs8UgUi36swoa4Junxj9phzSqS FstGo4hObpeQKsFtQRtRdF2vS9LU4ai7ZNOs+XQ5w8yZ6W5jc/6VzUS9ICEIXUMq56Ml dbj3hXt/21AwmUCfU1TbcPlPpfeHT8AG+wie0UYb0er7hjSFHoLaPSKvF76PNTK7NUHg 7egDwOObGdy6bQ4VPUQuifQeEEWmaR4ImHP3re06yxB0Hkj33Af5LcO/zQyniHbeGK0H ndkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=tFGVyL98DIfH3RPSgxrT1RdD6M6eP3+tUdnt0F3Amjw=; b=gy3NcrjSeUjNvhl0mOdvNyLvRf84QBecuBuo8/4Cf2Mp/k5mzYsYZlARNyguG1KjNE ylb7Hmii7avLcVxTW9YdxwkWwjGBQedvTL5RAZQ7W9hciA8s+pps99qTi8Mbde90MKIy 0tu6jNZBg8sMiqQT/aWM0uWnZEenburIImE772u6MGtFM+ZYQxlHokuuIfCnUdvKSFlF q9lXgrnGPfmDw15ikscZCBIaLHLoMkAqn9syrCmWmHgSpYna5G2uBb69pLPKQDVDujlM WewjT2L4O7J28+J6mn4pGcIEXv5ROPg0LZMK5rHIThzIW4eMGXdO1sF9QLxni/iIWQOg TwmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@tmm1-net.20150623.gappssmtp.com header.s=20150623 header.b=O9MQP2W9; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y93si3975285wrc.394.2017.12.07.16.13.32; Thu, 07 Dec 2017 16:13:34 -0800 (PST) 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=@tmm1-net.20150623.gappssmtp.com header.s=20150623 header.b=O9MQP2W9; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A994368A3CE; Fri, 8 Dec 2017 02:13:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B6AFC68A3BF for ; Fri, 8 Dec 2017 02:13:19 +0200 (EET) Received: by mail-pf0-f196.google.com with SMTP id p84so5938040pfd.3 for ; Thu, 07 Dec 2017 16:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tmm1-net.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=+SaOU6womifeoRDSMVPxcH7dbOMtlf5HNWWOniNwQJA=; b=O9MQP2W9d+WWAt+nEEonMVFbhPpCCwDT+qYLjEpt/x7U4QE7IZns6GcUAXT6UoH7p9 nw2tbTewD8KwuIOLdM9vQT6cK4UdPISyqqTihESJWqzbFdZ3v4lH3srxUV+tNPa22zdc PltIYLv7u9b3XZpzx6xR2kWmb0lURMQ4Aa0eR/WYGyR/CDgmrXD3GeaJbqKz16vN5PD/ 8o5ffxpUSAAXlC4FQeSIBU+rzk4DbAnB3/1stOOoN9M5KjsBf5Eo9AfgvhUS/EB0nb2t eIKN7aeBG3bh4OGJ3VRPSamo/LUvI6e1akgQ2uWnZr2tjCccPgfEVv7opuPC1O2KUJ17 Cq5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=+SaOU6womifeoRDSMVPxcH7dbOMtlf5HNWWOniNwQJA=; b=OhlDerWiwIPI6YbCTTPbzuXA5h2tlrk4brgtUNza97q9EtW0N7/4OFoye4leosRS3k ZUI49vTw1NMwC+AylUf6yfw9XNUeggRWG9yrgrezryQLrj6NFi+X8+ybCZU0i1xxF7ed FoZI+3hsgLRaEeFNB11byaNLMLC3g95e0G7VWRbPSd7Jzsq/NhABY75mKtHSxyY0hzsQ Vifp154dc3IkIE/4TTlKCXLncHiMi4jVv2oRCImOCj3qrRCgmHpOn+Fj4PV2rzJUNjaA 9tKXhnKAJ8uqolOaK5oG8tijZcVpbApKADlJN0NESXVGyPaLeTONG27vMWXFzC/Cq3OC giCA== X-Gm-Message-State: AJaThX621CBvmEbi3Nl/yS+umbPhHXnfN9ri6XmHai1Sxx8gVhEFXdox Nlketr0FstPF54E9ATjhhhXJU2N5 X-Received: by 10.101.101.151 with SMTP id u23mr26242578pgv.74.1512691524918; Thu, 07 Dec 2017 16:05:24 -0800 (PST) Received: from localhost.localdomain (c-69-181-54-242.hsd1.ca.comcast.net. [69.181.54.242]) by smtp.gmail.com with ESMTPSA id t62sm8980998pgt.23.2017.12.07.16.05.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 16:05:24 -0800 (PST) From: Aman Gupta To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Dec 2017 16:05:15 -0800 Message-Id: <20171208000515.46049-1-ffmpeg@tmm1.net> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH v2] libavcodec/mpegvideo_parser: improve detection of progressive mpeg2 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 Cc: Michael Niedermayer , Aman Gupta MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Aman Gupta Previously many progressive mpeg2video samples were detected as interlaced by ffmpeg/ffprobe. For example, https://tmm1.s3.amazonaws.com/720p.ts Before: Input #0, mpegts, from 'https://tmm1.s3.amazonaws.com/720p.ts': Duration: 00:00:08.62, start: 18974.073233, bitrate: 9734 kb/s Program 2 Stream #0:0[0x12eb]: Video: mpeg2video (Main), yuv420p(tv, bottom first), 1280x720 ... After: Input #0, mpegts, from 'https://tmm1.s3.amazonaws.com/720p.ts': Duration: 00:00:08.62, start: 18974.073233, bitrate: 9734 kb/s Program 2 Stream #0:0[0x12eb]: Video: mpeg2video (Main), yuv420p(tv, progressive), 1280x720 ... Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index de70cd5632..be240b6890 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -131,7 +131,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, } } - if (!pc->progressive_sequence) { + if (!pc->progressive_sequence && !progressive_frame) { if (top_field_first) s->field_order = AV_FIELD_TT; else