From patchwork Mon Apr 15 17:35:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 48080 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp1995428pzb; Mon, 15 Apr 2024 10:36:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV4gQDMOrnorXTXhrCwkzJoXWgYxif4H6sTkQ4irPj2TNqcnzkhnkbIj5r0hJNRfiFiY8NPgv8tG7S/9fI15TnQ1hDU5rRjhFGDeA== X-Google-Smtp-Source: AGHT+IG2NMMEG8Mwg1lmd3RWAmQx7yV6Iq2enafpyJA4SIe+8KN1601nIkua68ycQ+rAWOvrYReX X-Received: by 2002:a05:6512:3083:b0:518:cfd1:cd4c with SMTP id z3-20020a056512308300b00518cfd1cd4cmr4508525lfd.10.1713202600010; Mon, 15 Apr 2024 10:36:40 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m19-20020a17090607d300b00a519d2e5bf2si4630826ejc.547.2024.04.15.10.36.39; Mon, 15 Apr 2024 10:36:39 -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=@outlook.com header.s=selector1 header.b=R4d2kThN; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 02EA168CFC8; Mon, 15 Apr 2024 20:36:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2018.outbound.protection.outlook.com [40.92.99.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B4CB568CF40 for ; Mon, 15 Apr 2024 20:36:24 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=av0lQPD0XAul1QxyMiZBGnLtv6SIk4uKI8HytJLLv5pj/RrObJz7LF0jgz5BT9EUZIlbdZaoCcV40JGH1xg3tm9/2WzZhx3S7TXECS7KjghNn1j2Li3Oke66PfZSAUI+2GyVmyDE+1FMfMKfCuXUzqUu4GlX7Xtyg64012eWl051NDrgc5gAzWW/QDMxxE5xhbF0tmvCkX17mkluPQVFIlSI5dD5MxMFlqbbt6gBbJoBl7CiXD6/2G4AKcQLcRYsHngCQ62tuHd60FURiyf1QpIvFumFQZB9sS8uPTjqkOdfzBscv4BKSgMpdJZ1b6x0Sm+266s8Wch9RoljiGhKhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ytSWoxXd4K+M4KaER0obonqyDkukqEgYGoE1Y33KnPc=; b=oghlO1vx35TYhChO2p0RceatBD9JFc63UUg36Abfj6llaLmm0eo0W7nvPmZEkbZrC4Qj1uBcYXMwv99w7xFg6tcW3qT5XKATDBJJv81OIOT/e9awtDum6hFM4IW7R979qs9ZMeSV273Xgyw0GiFXFu5G5zpO6UKh8HAaqGXf/6tE+XUyAVewH9Ra7FWScpam5r+gH3dOcDtMAc2fiHEEHZjTjTwFxmTFGRa8c2efmHDTCj2bn49OEHrMKaQ/VYCNeYvdjbkHev3qbY8DMYurx09xmDrXkAtcZS2b4Gb0EIRahuldO1lS54HtFhpwCcaFuOs9a11EzDXGWj/HI2RygA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ytSWoxXd4K+M4KaER0obonqyDkukqEgYGoE1Y33KnPc=; b=R4d2kThNC+qMIhHyVOy0oHw8hy0r4DoIzBDSUNVbJlqSpIFn8d9e5mESB0sSwgN8dDFleouVsvaf1ozX3dqYXw2blQeeELzdIA8oKbl6pU1VHdPmqkcNGhS7QAM1JSb+CemuXrJUvlsuoUIm9QxJ9id5uB1KGYSz00wN1mcdkdnSTXPqXnFVk1rzAgFWOjrN/NxByoAuhtxEvAaYnDdOO7I86Jze5FWA5hgtpIBV83+hhT6s/saQ5KrOoFZTRrLCrtc65f6dGnsUrXRfA+bEWBKT8VVHMLZtMFhnZoLeDbnH2vdombpwYPTnCtstn6/qoRcCpuI3yVIVEJMjyngoKA== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by TY3P286MB3030.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:319::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Mon, 15 Apr 2024 17:36:11 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::c2ed:24ae:fd4c:fee7]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::c2ed:24ae:fd4c:fee7%5]) with mapi id 15.20.7452.049; Mon, 15 Apr 2024 17:36:11 +0000 From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Apr 2024 01:35:50 +0800 Message-ID: X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20240415173550.657-1-toqsxw@outlook.com> References: <20240415173550.657-1-toqsxw@outlook.com> X-TMN: [/wUj1jHl7aiTT+lsDeGlq0Ata6pxreh+] X-ClientProxiedBy: PU1PR06CA0014.apcprd06.prod.outlook.com (2603:1096:803:2a::26) To OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) X-Microsoft-Original-Message-ID: <20240415173550.657-3-toqsxw@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2173:EE_|TY3P286MB3030:EE_ X-MS-Office365-Filtering-Correlation-Id: 260e4bc4-8947-41d7-06fc-08dc5d728ad3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q91stQbXiQsfaFrM49Y/LAouQuK+6jfM+wh3GthMd1AFUUaJT5YlvaugfuuLilooT9XrMo2g/SB4uQVBchh5VaHHQEZXpohRPJKDCLm5dKiaZ1TKG7qFt9LGKm3CM/D0rncxzCSps5vhl1A43dFV22sk+mvV2y41X4MsRUj4TJn4oZjvOi7AGla4XRRMBPGbkf4tZ0dmHJG1TY0XySmUBOFChONDdTqRrO0SUAJDxbHfqzeKVu6njsncO9oMz92lFQ7Mx+O4rO3wPHg/Ns7S9E5nEpFS8IqIKol6ymkKnTMWhiN/nbX8y8WOXth+OWcaTq5/rT3fzELIn/pQSJtQDekSiA6UsLb6cKoNN/24LhHqBT7PZyAJssYlxkp/jVhD9sf5ypu6XRzkFgWLoqBzgYdGKMG/bCSJy3hpy1+89/cDfyzfmu4J333OgJbvQWFOmFGCOJWW47QVlKNT1Pdxp4rE+ErHvroQOZM2z781MMyYRNpqiKSTsopsIpKISjs/OucnOqLwmtw7Jdu8s8H7tMJNEZO/45PFlvgQJ6RvYqQioImKtbfy4CPSgOgE5WPtuKEa7fPemEoZg0vC0r3XoMrJzdR7EwFx0jHegr+/dhZES0CMsLQxaBo1/Bht2x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A1Aw8JeQrWmPn1e6UjkfRRvUJc9zKFiWQYg01e614MMQ7sF+m3kxEKCpEBQOsgKAMk9sj0pXhvdpwZ2xDNtrxp1AOWpHL3SLJwcE/3X2tOWABitw6eXxZ9LLBB/dPQXpU7UlKJxiid7zJfApqSwb6+6ukRYeIK0Kq6z5Jre6PCuMUlcsb44PIWaN+t3DEFzTQ4+sGxYFhUTudP7JIeWK3BpCUBQcxuJCJaUhSg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 260e4bc4-8947-41d7-06fc-08dc5d728ad3 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 17:36:11.8564 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3P286MB3030 Subject: [FFmpeg-devel] [PATCH v2 3/3] avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options 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: Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: vCsjXObCWJB0 From: Wu Jianhua Signed-off-by: Wu Jianhua --- libavcodec/x86/vvc/vvcdsp_init.c | 46 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/libavcodec/x86/vvc/vvcdsp_init.c b/libavcodec/x86/vvc/vvcdsp_init.c index aef6699c35..985d750472 100644 --- a/libavcodec/x86/vvc/vvcdsp_init.c +++ b/libavcodec/x86/vvc/vvcdsp_init.c @@ -88,6 +88,7 @@ AVG_PROTOTYPES(10, avx2) AVG_PROTOTYPES(12, avx2) #if ARCH_X86_64 +#if HAVE_SSE4_EXTERNAL #define FW_PUT(name, depth, opt) \ void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \ int height, const int8_t *hf, const int8_t *vf, int width) \ @@ -125,7 +126,9 @@ void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *sr FW_PUT_SSE4( 8) FW_PUT_SSE4(10) FW_PUT_SSE4(12) +#endif +#if HAVE_AVX2_EXTERNAL #define FW_PUT_TAP_AVX2(n, bitd) \ FW_PUT(n ## tap_h32, bitd, avx2) \ FW_PUT(n ## tap_h64, bitd, avx2) \ @@ -161,6 +164,25 @@ FW_PUT_AVX2(12) FW_PUT_16BPC_AVX2(10) FW_PUT_16BPC_AVX2(12) +#define AVG_FUNCS(bpc, bd, opt) \ +void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \ + const int16_t *src0, const int16_t *src1, int width, int height) \ +{ \ + BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, (1 << bd) - 1); \ +} \ +void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \ + const int16_t *src0, const int16_t *src1, int width, int height, \ + int denom, int w0, int w1, int o0, int o1) \ +{ \ + BF(ff_vvc_w_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, \ + denom, w0, w1, o0, o1, (1 << bd) - 1); \ +} + +AVG_FUNCS(8, 8, avx2) +AVG_FUNCS(16, 10, avx2) +AVG_FUNCS(16, 12, avx2) +#endif + #define PEL_LINK(dst, C, W, idx1, idx2, name, D, opt) \ dst[C][W][idx1][idx2] = ff_vvc_put_## name ## _ ## D ## _##opt; \ dst ## _uni[C][W][idx1][idx2] = ff_h2656_put_uni_ ## name ## _ ## D ## _##opt; \ @@ -226,27 +248,9 @@ FW_PUT_16BPC_AVX2(12) MC_TAP_LINKS_16BPC_AVX2(LUMA, 8, bd); \ MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd); -#define AVG_FUNCS(bpc, bd, opt) \ -void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \ - const int16_t *src0, const int16_t *src1, int width, int height) \ -{ \ - BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, (1 << bd) - 1); \ -} \ -void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \ - const int16_t *src0, const int16_t *src1, int width, int height, \ - int denom, int w0, int w1, int o0, int o1) \ -{ \ - BF(ff_vvc_w_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, \ - denom, w0, w1, o0, o1, (1 << bd) - 1); \ -} - -AVG_FUNCS(8, 8, avx2) -AVG_FUNCS(16, 10, avx2) -AVG_FUNCS(16, 12, avx2) - -#define AVG_INIT(bd, opt) do { \ - c->inter.avg = bf(ff_vvc_avg, bd, opt); \ - c->inter.w_avg = bf(ff_vvc_w_avg, bd, opt); \ +#define AVG_INIT(bd, opt) do { \ + c->inter.avg = bf(ff_vvc_avg, bd, opt); \ + c->inter.w_avg = bf(ff_vvc_w_avg, bd, opt); \ } while (0) #endif