From patchwork Mon Mar 25 15:02:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 47436 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c889:b0:1a3:b6bb:3029 with SMTP id hb9csp1247635pzb; Mon, 25 Mar 2024 08:04:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU6m5ItQScDnQ7Kips2FQEn3WGLYVKtRVdGUWo7JQnxjAqRWf893q840UsC178UnURQAO+e4LnVAOLwx++zduGY2PlpbbrS8XmXUA== X-Google-Smtp-Source: AGHT+IG2e96cQ/SlXrdBcakYFByBriidQRaZb3lUhXb0kla+tR54Gp2uYU2xI9rIo8bhft2wWHwZ X-Received: by 2002:a17:907:9716:b0:a47:4f67:7085 with SMTP id jg22-20020a170907971600b00a474f677085mr3767213ejc.1.1711379071931; Mon, 25 Mar 2024 08:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711379071; cv=none; d=google.com; s=arc-20160816; b=K1mNGee0pmKYCFGA8h7gVd9dGeK/mOVgvPpmwZKrhr5gijje/L0YstHV5Rv+onWVmM es3s1vVJgWUQ402ViCKwGZLONy7IkDysjNsf1SNukuU85yCQu8/J42hKJHNkcmQqAQK3 IbH5WtMmAc5tFRnOgErJ983BOC27S6LjrbEcMboeQ1MSP9h6tSGuJdIUV3WZKWwRKKvV klcYzIqnZoXE/UI8gcWda448OyaBoPrOPoAnZLGKaZ2/VUxoKbE3+8ktEGsmtnrCwnb0 30zQ6mhmdw8h0mFH8gd2KRCAuoGF1luFscA7molkCgT+OuF3swmsGd8n8pBjZfTU7rpC bysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=MmQdpoyFW2ccfd8t6W1FLoS/hBgiZsmauJEBkEo+w7M=; fh=DRs4GoYGH1Ee5ERfKSLc+LBtFKtorfi5XrD3r13LPeM=; b=L96wR0NRM3RFcREaLglYJGoYfEuk0OGIwxNGd21aEI6TP7FyftSCb3brsZLtMk7JDB 4FsorE0Ip/4v6+IkBJfTrnKRxOnQbqIwj9RdV8s+C1SRnT6V5oR23qRmN/kIfTXT/OUV hOpZs0dbszRjRxDBGWXNyoMTHgogBHWAuO8hT/1byhsuCdac59ijL0QDIFQgTP3pnTek QvuNZe7wqF6Z2FkcR/BP+JQWj0N8oNx5QwQVqqKHS65+JOIf3178F2MYf3cvH1XDWpJz SpfeJTYdObpGAXxUSm+k2fhSOGvStJCqv+IBDh7MKtFT2uSHQ89TcPZnmICMRAUwiNwG 5W7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=OZDhbnkv; 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 p12-20020a170906a00c00b00a46fa6e7197si2687040ejy.614.2024.03.25.08.04.31; Mon, 25 Mar 2024 08:04:31 -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=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=OZDhbnkv; 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 8739F68D5DB; Mon, 25 Mar 2024 17:03:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CEFD768D53E for ; Mon, 25 Mar 2024 17:02:54 +0200 (EET) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-515a81928a1so2218670e87.3 for ; Mon, 25 Mar 2024 08:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1711378974; x=1711983774; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OQ57nMlKqPDOgMkCpmRRJYHPshFMVnxK4oI60w4opw4=; b=OZDhbnkvw+2jLisgWkZATvhFup4zEJ2o0vOu0r+eyQbLegPzhZhKxkuIb46JdJWfMr YXHLAmZLKFoGGtK49A5Smg8iDJJRftVnTT04jStytLSQOYSz1viHyWqAr0ev+a439fL7 gY7xatOc4r6sDKuV8uszYfyHZ1uISKMSH/JzvSEttkQNfX8H7+pWV5v0+BfowUwvlkBQ g4XV1mBOBN6UYci/Pr1SMkg1fUkuh1+1R3vHHcvJ/C9Cyb9O+JgelltUn7+JGDgAFplm rGiQKB4IGFeZ1coryXiTRrj7xDzBPNJdt/mdZkJO3Y9R6ajhBobp9nK/K1HQhACJDMp2 sfkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711378974; x=1711983774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OQ57nMlKqPDOgMkCpmRRJYHPshFMVnxK4oI60w4opw4=; b=E1xXjJ5NhmjqzhsqNKf1otenhg9XEj8Y31GwbIeUpmhRCc3R/GUAqNv7lyJVOLHcxe bVswnXKtKYO5ysWMzpw/EybAKF3GlzHCh1dPuCmAmHiYabJgZQ5OwzTPMUXuPzOwHYaV O+zww7xs4TAN4Te2SJD7UFYSzx+FWvBlQediwdpSZ7e6UnnxTz82BXo4BwYtAb35szL7 etePrdJcBJZhw6K3jADKPpcCzxjH6/c0c0/up0H3VJX86EZmvMLfBIa0ivj24DQZW4JU GfuCNMAjGYhLWQrdeGDb8OLyj016wPw68k/Vh3Zpr5PcfUh+86m8CAfP6SVgp4cPQbyq CEdA== X-Gm-Message-State: AOJu0YwYeLNC165977Agwx3MWqghOVJii4e0srmkpTginO2BYlrOYvLh +7HTwmcuKO4KUTlfFIiCXZGC5HSn5dgMrzZTyG0CWm3+sBQHTEiwOb0k441aqilzqV5wNLgp8i3 +S+C9 X-Received: by 2002:a19:e04b:0:b0:513:cf77:48c5 with SMTP id g11-20020a19e04b000000b00513cf7748c5mr5629991lfj.38.1711378973843; Mon, 25 Mar 2024 08:02:53 -0700 (PDT) Received: from localhost (host-114-191.parnet.fi. [77.234.114.191]) by smtp.gmail.com with ESMTPSA id a20-20020ac25214000000b005128cf5b323sm1102156lfl.251.2024.03.25.08.02.53 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Mar 2024 08:02:53 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Mar 2024 17:02:34 +0200 Message-Id: <20240325150243.59058-13-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240325150243.59058-1-martin@martin.st> References: <20240325150243.59058-1-martin@martin.st> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/21] aarch64: hevc: Produce epel_uni_w_hv functions for both neon and i8mm 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: Logan Lyu , "J . Dekker" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: p/6f8vYcWLyy AWS Graviton 3: put_hevc_epel_uni_w_hv4_8_c: 191.2 put_hevc_epel_uni_w_hv4_8_neon: 87.7 put_hevc_epel_uni_w_hv4_8_i8mm: 83.2 put_hevc_epel_uni_w_hv6_8_c: 349.5 put_hevc_epel_uni_w_hv6_8_neon: 153.0 put_hevc_epel_uni_w_hv6_8_i8mm: 148.5 put_hevc_epel_uni_w_hv8_8_c: 581.2 put_hevc_epel_uni_w_hv8_8_neon: 166.7 put_hevc_epel_uni_w_hv8_8_i8mm: 163.5 put_hevc_epel_uni_w_hv12_8_c: 1230.0 put_hevc_epel_uni_w_hv12_8_neon: 387.7 put_hevc_epel_uni_w_hv12_8_i8mm: 370.2 put_hevc_epel_uni_w_hv16_8_c: 2003.2 put_hevc_epel_uni_w_hv16_8_neon: 501.5 put_hevc_epel_uni_w_hv16_8_i8mm: 490.2 put_hevc_epel_uni_w_hv24_8_c: 4448.7 put_hevc_epel_uni_w_hv24_8_neon: 1092.2 put_hevc_epel_uni_w_hv24_8_i8mm: 1069.7 put_hevc_epel_uni_w_hv32_8_c: 7817.2 put_hevc_epel_uni_w_hv32_8_neon: 1916.2 put_hevc_epel_uni_w_hv32_8_i8mm: 1829.5 put_hevc_epel_uni_w_hv48_8_c: 16728.2 put_hevc_epel_uni_w_hv48_8_neon: 4263.7 put_hevc_epel_uni_w_hv48_8_i8mm: 4342.7 put_hevc_epel_uni_w_hv64_8_c: 29563.2 put_hevc_epel_uni_w_hv64_8_neon: 7474.2 put_hevc_epel_uni_w_hv64_8_i8mm: 7128.5 --- libavcodec/aarch64/hevcdsp_epel_neon.S | 55 ++++++++++++----------- libavcodec/aarch64/hevcdsp_init_aarch64.c | 6 +++ 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/libavcodec/aarch64/hevcdsp_epel_neon.S b/libavcodec/aarch64/hevcdsp_epel_neon.S index 876db9d449..d0c6205e1c 100644 --- a/libavcodec/aarch64/hevcdsp_epel_neon.S +++ b/libavcodec/aarch64/hevcdsp_epel_neon.S @@ -3573,10 +3573,8 @@ function hevc_put_hevc_epel_uni_w_hv24_8_end_neon ret endfunc -#if HAVE_I8MM -ENABLE_I8MM - -function ff_hevc_put_hevc_epel_uni_w_hv4_8_neon_i8mm, export=1 +.macro epel_uni_w_hv suffix +function ff_hevc_put_hevc_epel_uni_w_hv4_8_\suffix, export=1 epel_uni_w_hv_start sxtw x4, w4 @@ -3591,14 +3589,14 @@ function ff_hevc_put_hevc_epel_uni_w_hv4_8_neon_i8mm, export=1 mov x2, x3 add x3, x4, #3 mov x4, x5 - bl X(ff_hevc_put_hevc_epel_h4_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_h4_8_\suffix) ldp x4, x6, [sp, #16] ldp x0, x1, [sp, #32] ldr x30, [sp], #48 b hevc_put_hevc_epel_uni_w_hv4_8_end_neon endfunc -function ff_hevc_put_hevc_epel_uni_w_hv6_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv6_8_\suffix, export=1 epel_uni_w_hv_start sxtw x4, w4 @@ -3613,14 +3611,14 @@ function ff_hevc_put_hevc_epel_uni_w_hv6_8_neon_i8mm, export=1 mov x2, x3 add x3, x4, #3 mov x4, x5 - bl X(ff_hevc_put_hevc_epel_h6_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_h6_8_\suffix) ldp x4, x6, [sp, #16] ldp x0, x1, [sp, #32] ldr x30, [sp], #48 b hevc_put_hevc_epel_uni_w_hv6_8_end_neon endfunc -function ff_hevc_put_hevc_epel_uni_w_hv8_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv8_8_\suffix, export=1 epel_uni_w_hv_start sxtw x4, w4 @@ -3635,14 +3633,14 @@ function ff_hevc_put_hevc_epel_uni_w_hv8_8_neon_i8mm, export=1 mov x2, x3 add x3, x4, #3 mov x4, x5 - bl X(ff_hevc_put_hevc_epel_h8_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_h8_8_\suffix) ldp x4, x6, [sp, #16] ldp x0, x1, [sp, #32] ldr x30, [sp], #48 b hevc_put_hevc_epel_uni_w_hv8_8_end_neon endfunc -function ff_hevc_put_hevc_epel_uni_w_hv12_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv12_8_\suffix, export=1 epel_uni_w_hv_start sxtw x4, w4 @@ -3657,14 +3655,14 @@ function ff_hevc_put_hevc_epel_uni_w_hv12_8_neon_i8mm, export=1 mov x2, x3 add x3, x4, #3 mov x4, x5 - bl X(ff_hevc_put_hevc_epel_h12_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_h12_8_\suffix) ldp x4, x6, [sp, #16] ldp x0, x1, [sp, #32] ldr x30, [sp], #48 b hevc_put_hevc_epel_uni_w_hv12_8_end_neon endfunc -function ff_hevc_put_hevc_epel_uni_w_hv16_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv16_8_\suffix, export=1 epel_uni_w_hv_start sxtw x4, w4 @@ -3679,14 +3677,14 @@ function ff_hevc_put_hevc_epel_uni_w_hv16_8_neon_i8mm, export=1 mov x2, x3 add x3, x4, #3 mov x4, x5 - bl X(ff_hevc_put_hevc_epel_h16_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_h16_8_\suffix) ldp x4, x6, [sp, #16] ldp x0, x1, [sp, #32] ldr x30, [sp], #48 b hevc_put_hevc_epel_uni_w_hv16_8_end_neon endfunc -function ff_hevc_put_hevc_epel_uni_w_hv24_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv24_8_\suffix, export=1 epel_uni_w_hv_start sxtw x4, w4 @@ -3701,14 +3699,14 @@ function ff_hevc_put_hevc_epel_uni_w_hv24_8_neon_i8mm, export=1 mov x2, x3 add x3, x4, #3 mov x4, x5 - bl X(ff_hevc_put_hevc_epel_h24_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_h24_8_\suffix) ldp x4, x6, [sp, #16] ldp x0, x1, [sp, #32] ldr x30, [sp], #48 b hevc_put_hevc_epel_uni_w_hv24_8_end_neon endfunc -function ff_hevc_put_hevc_epel_uni_w_hv32_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv32_8_\suffix, export=1 ldp x15, x16, [sp] mov x17, #16 stp x15, x16, [sp, #-96]! @@ -3718,7 +3716,7 @@ function ff_hevc_put_hevc_epel_uni_w_hv32_8_neon_i8mm, export=1 stp x5, x6, [sp, #64] stp x17, x7, [sp, #80] - bl X(ff_hevc_put_hevc_epel_uni_w_hv16_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_uni_w_hv16_8_\suffix) ldp x0, x30, [sp, #16] ldp x1, x2, [sp, #32] ldp x3, x4, [sp, #48] @@ -3730,13 +3728,13 @@ function ff_hevc_put_hevc_epel_uni_w_hv32_8_neon_i8mm, export=1 mov x17, #16 stp x15, x16, [sp, #-32]! stp x17, x30, [sp, #16] - bl X(ff_hevc_put_hevc_epel_uni_w_hv16_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_uni_w_hv16_8_\suffix) ldp x17, x30, [sp, #16] ldp x15, x16, [sp], #32 ret endfunc -function ff_hevc_put_hevc_epel_uni_w_hv48_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv48_8_\suffix, export=1 ldp x15, x16, [sp] mov x17, #24 stp x15, x16, [sp, #-96]! @@ -3745,7 +3743,7 @@ function ff_hevc_put_hevc_epel_uni_w_hv48_8_neon_i8mm, export=1 stp x3, x4, [sp, #48] stp x5, x6, [sp, #64] stp x17, x7, [sp, #80] - bl X(ff_hevc_put_hevc_epel_uni_w_hv24_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_uni_w_hv24_8_\suffix) ldp x0, x30, [sp, #16] ldp x1, x2, [sp, #32] ldp x3, x4, [sp, #48] @@ -3757,13 +3755,13 @@ function ff_hevc_put_hevc_epel_uni_w_hv48_8_neon_i8mm, export=1 mov x17, #24 stp x15, x16, [sp, #-32]! stp x17, x30, [sp, #16] - bl X(ff_hevc_put_hevc_epel_uni_w_hv24_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_uni_w_hv24_8_\suffix) ldp x17, x30, [sp, #16] ldp x15, x16, [sp], #32 ret endfunc -function ff_hevc_put_hevc_epel_uni_w_hv64_8_neon_i8mm, export=1 +function ff_hevc_put_hevc_epel_uni_w_hv64_8_\suffix, export=1 ldp x15, x16, [sp] mov x17, #32 stp x15, x16, [sp, #-96]! @@ -3773,7 +3771,7 @@ function ff_hevc_put_hevc_epel_uni_w_hv64_8_neon_i8mm, export=1 stp x5, x6, [sp, #64] stp x17, x7, [sp, #80] - bl X(ff_hevc_put_hevc_epel_uni_w_hv32_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_uni_w_hv32_8_\suffix) ldp x0, x30, [sp, #16] ldp x1, x2, [sp, #32] ldp x3, x4, [sp, #48] @@ -3785,16 +3783,23 @@ function ff_hevc_put_hevc_epel_uni_w_hv64_8_neon_i8mm, export=1 mov x17, #32 stp x15, x16, [sp, #-32]! stp x17, x30, [sp, #16] - bl X(ff_hevc_put_hevc_epel_uni_w_hv32_8_neon_i8mm) + bl X(ff_hevc_put_hevc_epel_uni_w_hv32_8_\suffix) ldp x17, x30, [sp, #16] ldp x15, x16, [sp], #32 ret endfunc +.endm + +epel_uni_w_hv neon + +#if HAVE_I8MM +ENABLE_I8MM + +epel_uni_w_hv neon_i8mm DISABLE_I8MM #endif - function hevc_put_hevc_epel_bi_hv4_8_end_neon load_epel_filterh x7, x6 mov x10, #(MAX_PB_SIZE * 2) diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index 447ae80bfb..948103aa09 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -278,6 +278,11 @@ NEON8_FNPROTO(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width), _i8mm); +NEON8_FNPROTO(epel_uni_w_hv, (uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, + int height, int denom, int wx, int ox, + intptr_t mx, intptr_t my, int width),); + NEON8_FNPROTO(epel_uni_w_hv, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -417,6 +422,7 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) NEON8_FNASSIGN(c->put_hevc_epel, 1, 1, epel_hv,); NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 1, epel_uni_hv,); + NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv,); if (have_i8mm(cpu_flags)) { NEON8_FNASSIGN(c->put_hevc_epel, 0, 1, epel_h, _i8mm);