From patchwork Fri Jun 4 06:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 28080 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp815308iof; Thu, 3 Jun 2021 23:54:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqytqGTLygwPoBKuwp9rK0s3yS7/iFxNzVFPA4jx6F10YXckGsQdBmHJVxWxWMckzjwyoh X-Received: by 2002:a17:906:15c2:: with SMTP id l2mr2794217ejd.348.1622789644485; Thu, 03 Jun 2021 23:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622789644; cv=none; d=google.com; s=arc-20160816; b=eam4v534ebK8MQWiUgVyGu+XffCaGQqlIKqy1oZRzLIzrgQIeEThOCz1hUfU/HqZIj zdc8kbLEsnbTbC8pGhRydaRgsE7OvIluRhES3f/lKPypkcq2/St6g1RwNZsJ1mAlNkns yUXfqPSzBx+mAM6P6isdHbMYq7XWN4ZjxfHnCSo9gQHASCou+yEzi/hJoEZiwp34mb5H 1UA+LyseeGI8E6lJV0S46z7VGSbNmZqwNQeC5mK8nIFx8+B4yR7y25ZG0R86E+temCoU UkUnwmXbMnyCFn9LjXMP834Vls6DJzX/+09GpdJLbllQRevN0crFeH4E/8W+skbeTkIK o24Q== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=s6MvRNJ9v58QQ6bV4ik1lpTDAE0rsebEqqKK3PyWzhs=; b=pffwVbonLaiNScBCF1zPdOcjPxmQarSzzM3zk8L7KQe8sScqD3SvMdr5XyCVvZiTJL cuYf07WvOXvDa2cwIuWOR6nuW7YsIrXwk0fL23p+JQsVkh1Mn9EuMdfOjx0Bp4nK2ETc R70tqzuOZrh2iScggKYzUEtaf3RjXu9lpp6WaOT0yk0Yi37xzyPCIE25/Cb1pOMyyiV4 WfGHAqvgyj88mJhx/bXc0aJYXaH2X/bmyqevVt3gpE5i9iFSk5xO0MIh+ZgY4t44AXqH TOT+Sl0aEW0QMtdcMysTUnCxIslsXcscv9k+ugxHhNuZXf9prtTE4JkSOu3DkNCcz3ZM d7XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Wu1rHPNU; 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 x10si3915868eji.476.2021.06.03.23.54.04; Thu, 03 Jun 2021 23:54:04 -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=Wu1rHPNU; 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 A9E1268A252; Fri, 4 Jun 2021 09:54:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4576D6898EE for ; Fri, 4 Jun 2021 09:53:55 +0300 (EEST) Received: by mail-oi1-f182.google.com with SMTP id v22so8863301oic.2 for ; Thu, 03 Jun 2021 23:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/chF2yPuhmmUmW7It45/qNHpC7pPcmkUmvbJJmXhPJk=; b=Wu1rHPNU9czR02R1fUkZuaFtsrXq2pkOUFqIfO6ZajlfamUNgfeUzV4m55NxgfAP81 f3ANmhZ96RwzxhrDVxLAO8wo5MWa3Dg2DlVWzPGa+fV2P2EC+ZzIFAXj7KXaOZuLNP/u kMRnCBqzHlcueXxtc+R+z39HX7ky10d9+55QcmlPgfb1JuzfX/s7rKA0DD4kXg6sU26r r+j9audKeECqmT2kobg/BOY+s9S+lI1KOuuzPdw3y3A/cZveYqF5UNTL2q5OpruXDnsa ZxbSxoZalrEFrkHVA25YDQpODA+kUBqGxUwlDKmDALqDz9MrhYTy9mH5VmkP+odQ8MrF t3PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/chF2yPuhmmUmW7It45/qNHpC7pPcmkUmvbJJmXhPJk=; b=o+OxXTnujtzzCUHOU1STFJDPKC9d8aj+MwpkcJNkX15OYdAHZaPKhesVeIKq9n9XMz 1kLk2pzGNrmCgiJLR2u9GSNZMT1922x0PEZACgRXCdmmk+g/MsmiJp9qpq0Z6q/y+jcp TS59nAMihQXmd0rPn7nS4j/fvJVvXn78Vp0OmXEfjzHK76YjCR/d8lnXDhBIfzUV/Bfe +MmvEIi2U6lYkN08nr8gUTQyz75tGOZ67ZxUa4L5KK2MZz/fBD9Z+vkX9ix7A9IEWLkN 3HG8dow1G6Hh2d+XzQYDjL2lrbqnASRFlHdddBAVL1ATdTIo0QFbk2a9/2sNJ/936bPX Kb4A== X-Gm-Message-State: AOAM530nYUZQxBHDxCJg60JYBmBCLyDloUTSO5xHgb3BiVyj5fyaXbVd M/sVzAl+vOYHJsAHGP2Z0QQK6fYa4W4= X-Received: by 2002:a17:90b:1c0b:: with SMTP id oc11mr3354032pjb.156.1622789184609; Thu, 03 Jun 2021 23:46:24 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id f186sm955833pfb.36.2021.06.03.23.46.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Jun 2021 23:46:24 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 4 Jun 2021 14:43:43 +0800 Message-Id: <1622789023-9782-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1622646164-30564-1-git-send-email-lance.lmwang@gmail.com> References: <1622646164-30564-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2] swscale/swscale_unscaled: don't use the optimized bgr24toYV12 unscaled conversion when width%2 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: RQ+pamYZQHvv From: Limin Wang Signed-off-by: Limin Wang --- libswscale/swscale_unscaled.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index c4dd8a4..e8e2975 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1978,6 +1978,7 @@ void ff_get_unscaled_swscale(SwsContext *c) const enum AVPixelFormat dstFormat = c->dstFormat; const int flags = c->flags; const int dstH = c->dstH; + const int dstW = c->dstW; int needsDither; needsDither = isAnyRGB(dstFormat) && @@ -2033,7 +2034,7 @@ void ff_get_unscaled_swscale(SwsContext *c) /* bgr24toYV12 */ if (srcFormat == AV_PIX_FMT_BGR24 && (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && - !(flags & SWS_ACCURATE_RND)) + !(flags & SWS_ACCURATE_RND) && !(dstW&1)) c->swscale = bgr24ToYv12Wrapper; /* RGB/BGR -> RGB/BGR (no dither needed forms) */