From patchwork Sun Oct 20 20:05:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 52417 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:143:b0:48e:c0f8:d0de with SMTP id h3csp2246489vqi; Sun, 20 Oct 2024 13:34:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlWsQG5+wu1rjLQHpEFnOmub75Kuk76MpVnPsrJZ4ESM4zLhCv/BXjiFvqqXqbx/2qNLl3juTBYIJ8/IrFMF5+@gmail.com X-Google-Smtp-Source: AGHT+IHFPfN4ptymxnowGWvHboEMOp4VnApspY7ODdlUBdFvjKe4v1xC1i6tC1XaHEB83ex2rEGt X-Received: by 2002:a17:906:a28a:b0:a9a:8216:2f4d with SMTP id a640c23a62f3a-a9a8216326fmr234040866b.3.1729456446178; Sun, 20 Oct 2024 13:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729456446; cv=none; d=google.com; s=arc-20240605; b=TknDcj9ydhZIWODNTkq//yqzv65u97aWy9EuzGHb4v2FlLeV7WXDCHut4//jxEIG8Z 0/K7/p8eUr1keL/muH5+wwbymtUhS8Wzd7rm/IccYjZ59mMiI+LG1zC/f179IdRpvYQx fuMhYwsvmhZ+k0ThgMRj6G833SgDqGYNbH/upfUdB2SRrs9BjQT6Rj2/AkzZUNO2vyrY M5OTrIZ+FQUu+Et6EWDf5F5vpyqy6SYrEcFXOwU0ULpUWcxEubewIi+czH4d7pwvRUWT 1klaH7oMIsAF23AolPVsO1tsazQbau/qfPEbXkzURGhFrJ25AvAWbGieCb3cpoypTqtx XoRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=Li8gOJFE63knzY3g3YLWLq8SZehCuTENiy1qpyrCv+Q=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=F3p3HosfkdflHhM0TS5gQmBLsuc8yA27CfYDamquZJqTnQ/exqfsgim4hdA1UF+w4K VixqFLgiggVfgvmLpaygDB9Fuu+Rlld97t/rKRHWhueJxe5bl1LlHXsHvhyKCB3ZCMpU zTFuiEsddv7dGxpQ/qbQ+8H6tpqeGZttEqGdTyBQutMPoSydpHGsXk3N3LN5YBdYfI9c XLoL5t0NGU51TUfccqDDkNphMHwKBAXvwAActs4GJG/7rE8M1dtdLcISjpWOTK5UpB2F afsya1nPo6GIizLktTZNqLniy7qHEIJYwiOpfH9KuQRQ+JHpnNelOoJG8KENfkwpw0DY CNXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=ZOBJbiyX; 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 a640c23a62f3a-a9a9157597dsi156115166b.950.2024.10.20.13.34.05; Sun, 20 Oct 2024 13:34:06 -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=@haasn.xyz header.s=mail header.b=ZOBJbiyX; 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 F131268DD9B; Sun, 20 Oct 2024 23:09:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F0B968DC3F for ; Sun, 20 Oct 2024 23:09:00 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1729454936; bh=hoG+IjZmKVR74cLy8XcKi3Eaaqa15OC4lrgFLL6gzVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZOBJbiyX1a9MM0JnmZfRWlKrMYYSzHJiXnfkjy7Iw1rpA6bdIymPZ0eWRXO0b6ddH DUr6p8Ab928PEOIab/5uaOFr5IGJfnFGiMhAKrMz0YeAG84J0YJsbQzMKgWc8hmK7p XZdB5CmQz7TB0OVoUTZBCSElfQRTy083z3SWmmmI= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id B34614BE89; Sun, 20 Oct 2024 22:08:56 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 20 Oct 2024 22:05:19 +0200 Message-ID: <20241020200851.1414766-11-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241020200851.1414766-1-ffmpeg@haasn.xyz> References: <20241020200851.1414766-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 10/18] swscale/x86: use dedicated int for self-modifying MMX dstW 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: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZcfbEEc3YPl4 From: Niklas Haas I want to pull options out of SwsInternal, so we need to make this field a dedicated int that gets updated as appropriate in ff_swscale(). Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale.c | 1 + libswscale/swscale_internal.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index c368c68fea..e0a9e0279f 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -488,6 +488,7 @@ int ff_swscale(SwsInternal *c, const uint8_t *const src[], const int srcStride[] #if HAVE_MMX_INLINE ff_updateMMXDitherTables(c, dstY); + c->dstW_mmx = c->dstW; #endif if (should_dither) { c->chrDither8 = ff_dither_8x8_128[chrDstY & 7]; diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 5b92c3f72a..6b85ecadae 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -352,6 +352,7 @@ struct SwsInternal { SwsFunc convert_unscaled; int srcW; ///< Width of source luma/alpha planes. int srcH; ///< Height of source luma/alpha planes. + int dstW; ///< Width of destination luma/alpha planes. int dstH; ///< Height of destination luma/alpha planes. int chrSrcW; ///< Width of source chroma planes. int chrSrcH; ///< Height of source chroma planes. @@ -541,7 +542,7 @@ struct SwsInternal { DECLARE_ALIGNED(8, uint64_t, vOffset); int32_t lumMmxFilter[4 * MAX_FILTER_SIZE]; int32_t chrMmxFilter[4 * MAX_FILTER_SIZE]; - int dstW; ///< Width of destination luma/alpha planes. + int dstW_mmx; DECLARE_ALIGNED(8, uint64_t, esp); DECLARE_ALIGNED(8, uint64_t, vRounder); DECLARE_ALIGNED(8, uint64_t, u_temp);