From patchwork Thu Mar 23 09:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 40780 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp4048865pzb; Thu, 23 Mar 2023 02:18:59 -0700 (PDT) X-Google-Smtp-Source: AK7set+nyzZDQlzOkGkvUr/DhCy1U9vX0n4UrmQNi3v+xszfbPHgpbnUxm2sl/lBeU1X/73DbNSy X-Received: by 2002:a17:906:194:b0:93b:dddf:4be4 with SMTP id 20-20020a170906019400b0093bdddf4be4mr3773344ejb.2.1679563139279; Thu, 23 Mar 2023 02:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563139; cv=none; d=google.com; s=arc-20160816; b=sCXM9G2O6w1APYUPsgeJyn82sneAHbBpeyKSIbPtNWGKRWXIvMQZC4RVz3odSnDSCs RwXY82qqCfdrPLilbL443xzpfI73k6klo0q11VXLsTJvt1oTfwXiop/xTyl5OZy6nMdW BiDeNDrFDjwBUeT4hy0Roz7vBXLyxpVT535VNjVPvgvqdkHa5IRxrRrPVQ9T1ysjWWJf 7wNwcv3A8ML1KpP0wF3EFzp4uxaxWxT0RPbCealp7gKxTHSYG7UB7SkeEyrgVlwTmV3V 43FAg/RZX3+jS4R7Khq+1m6VPnwOqrRTpjLz/j0CWk/F0qeKoLCFo5bg1AN9j1gRZifo 7Myw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from:feedback-id :dkim-signature:dkim-signature:delivered-to; bh=BKLoTu8Cl3LSj4MoUicQ0mckSqpmi2ekoAqmdR85WxI=; b=x+09sY1h1DhMfgmb81TFzrA1uxA2T8siXisb5BxQTUxKz4t6nfX8weQKChGKTjgRpU 2jQ8KoI78pOx+b8a9P8YxcUHwdGBkpzwACyQQvv77fVvbKLbbAzWk6MlRIq171oR/3Kf 3FvQLOQWlCiGl8qTwy6CPbW/mgUtb6hAsFuESHytY4KZ8l08jHdhZIu7IMdUafkLdRVz Bz7utJoqDxe/s5CcEzc4bRdkK9Hrgnyloe2I+Di10pq2Xrsjb5+50M/GthlPitt7LBZ+ C6uaM2DBhzgJA6DMfa12cTrgKGs7bYn7DQh6rQUtROzIH0R3/qYI0gsgzgiMFKZ61Ik9 vc1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm3 header.b=1QhfieFZ; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm2 header.b=I3QvGUYA; 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 f13-20020a17090631cd00b008ddf3c18301si15783704ejf.653.2023.03.23.02.18.58; Thu, 23 Mar 2023 02:18:59 -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=@itanimul.li header.s=fm3 header.b=1QhfieFZ; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm2 header.b=I3QvGUYA; 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 7353768C117; Thu, 23 Mar 2023 11:18:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 039F968C117 for ; Thu, 23 Mar 2023 11:18:47 +0200 (EET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 6AE7D320031A for ; Thu, 23 Mar 2023 05:18:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 23 Mar 2023 05:18:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1679563124; x=1679649524; bh=givVld1L3C utsP8Vd1t4XiR4VzgThKaYJe3dJ/uW+oc=; b=1QhfieFZKSOfiZZt3gwQSASUix UNIWzvQk9Sj1reHAg9/vL7iG/EDAnoLUu+8uPCSERY4yIbBAbIv4KFDNN4Xno7u/ 5snohgVtdp6kmJCnOIgFe6tb8Rl/74r3eKmWQad4vHj8/020oFpdVDnBirGX5EhT 2x8Q1hRxHXGF84OtPqujqVDRv3nbrnQ5X8LzKv+9qP46ng83uP7hpLkYOow489dN 6EvNW9UY+A3xtF+0fqG8SBquW8zz4KFFug6JF7nMqI2pnYbqmFATgbGR0TmTef5l 80qbyOpD3SI9lM9zCkG5MQtW0dKPQLoMcz0buIP+2CIraCUu86ATOo7MJBKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1679563124; x=1679649524; bh=givVld1L3CutsP8Vd1t4XiR4VzgT hKaYJe3dJ/uW+oc=; b=I3QvGUYARASYfF1um5KfO6jFyUnN3ki2a+KwtNu/PpZO x26m7TeGOoDptWEtbd+Wirp5qiW34st4MonZllLg7bdmWxyOMTjxLSsrdIZvH6pw e4rGeMyH84/p7wiMIV52P+CmycBGYUx4wAaiMuHjgMzphmiJ1v9wo6Dkn2HFIYoG qjjiJ7lRp+ised526CE434JpgT1xh9RclHXGuYihWl6U423xsiCh64aAj/PNsNo0 xymcpkVjV9BCjjDAIc0xkr8zuwNcWxn+D6u7a0zpSrlOT5Se8wGo5T+ML2pJOp8a wX3Qde+HeH1Yx0m1ZGGxofeDZa0y0pkq2vTH6cWq/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeggedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepfdflrdcuffgvkhhkvghrfdcuoehjuggvkhesihhtrghnihhmuhhl rdhliheqnecuggftrfgrthhtvghrnhepueetgfdtuedvjeejjedvteelffeuhedtfeetud fglefhjeeukeetvddvtdevieeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepjhguvghksehithgrnhhimhhulhdrlhhi X-ME-Proxy: Feedback-ID: i84994747:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 23 Mar 2023 05:18:44 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Mar 2023 10:18:29 +0100 Message-Id: <20230323091829.34057-1-jdek@itanimul.li> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/er: remove check for fields X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: 1TDrGvzwko2s This change on its own is almost certainly not correct; however, in testing many samples show notable improvement. --- The warning spams a bit when decoding using due to there being multiple ERContexts used but it doesn't seem that excessive and it will be removed soon (hopefully). libavcodec/error_resilience.c | 9 +++++++-- libavcodec/error_resilience.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 2aa6f1d864..bd7050062c 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -805,8 +805,7 @@ void ff_er_frame_start(ERContext *s) static int er_supported(ERContext *s) { if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || - !s->cur_pic.f || - s->cur_pic.field_picture + !s->cur_pic.f ) return 0; return 1; @@ -908,6 +907,12 @@ void ff_er_frame_end(ERContext *s) (s->avctx->skip_top + s->avctx->skip_bottom)) { return; } + + if (!s->warned_fields && (s->cur_pic.field_picture || s->cur_pic.f->interlaced_frame)) { + av_log(s->avctx, AV_LOG_WARNING, "Error concealment is not fully implemented for field pictures.\n"); + s->warned_fields = 1; + } + linesize = s->cur_pic.f->linesize; if ( s->avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO diff --git a/libavcodec/error_resilience.h b/libavcodec/error_resilience.h index 47cc8a4fc6..55efacaccc 100644 --- a/libavcodec/error_resilience.h +++ b/libavcodec/error_resilience.h @@ -87,6 +87,7 @@ typedef struct ERContext { int (*mv)[2][4][2], int mb_x, int mb_y, int mb_intra, int mb_skipped); void *opaque; + int warned_fields; } ERContext; void ff_er_frame_start(ERContext *s);