From patchwork Mon Mar 25 15:02:36 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: 47439 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c889:b0:1a3:b6bb:3029 with SMTP id hb9csp1248146pzb; Mon, 25 Mar 2024 08:05:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUgaXMYEqiAu8o/SIvLeTVSrQB/rdnoequf6lSUD/sIXwhtEDr4jOH1AYncz8htpdKWd5o1NeZNM/guIoF2h5lR5g8UnjxfUtiKCQ== X-Google-Smtp-Source: AGHT+IGeFj6CBXcxiuI8bsyFlM+3kJvo86Y6R4UGVYWD7GSsW2RD4mCIo5cUHsg9UBJqgEbxwkPw X-Received: by 2002:a17:906:2a85:b0:a47:28a6:3429 with SMTP id l5-20020a1709062a8500b00a4728a63429mr4856355eje.62.1711379114114; Mon, 25 Mar 2024 08:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711379114; cv=none; d=google.com; s=arc-20160816; b=Ot7YqBT+dgnmE+u6XtN8GQc/rp+MvTo/wLWwV76aXgn9Ua/mFXUFMg+Xv6sV7TwXVs 3qJsZEynygRKPkLqOsH6zs8nvkHisxuTrdaZ3/moIHQ3xG+wcNBdKYJkAynUtoMj3lr6 qwLDUyUJfuec6kL3bdxb067VB7hfYUrpMzlHGRkJ2cjGZxhgW3gZVvrrz1pCw8hdZX9l VuPa2Grp/hjnM/eo5rKEoJLY/delTD8ctda4aYnDrQ+Jyel1r9kRshUbeUFv3mHD2RxN 3DXe/7a5HYnOYObrPmjNGC2my2mwrwQRXTVSV8j1AToEhiEducDj6EhrSyQrdaFemmNT +/jA== 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=lT6BOQRKBHKnOnwoFU9H3oOZOpzFqUtMAjRQPGnrPVg=; fh=DRs4GoYGH1Ee5ERfKSLc+LBtFKtorfi5XrD3r13LPeM=; b=FQFY2luHbz5IMHyctueNdjjULaA83AhBftTPHa0fInilcfm5SMtwdK8r+ItLlYTIdc o9hWEOFDazQwOkJ4i0RAMUSGp+P/W1K4s8Zvz7vpod2joYkaZLPSWSYNiazdEld9U9Lg R5rr9s7m1UlO0FwRAaR3usPWCc4n2xhUpGYSbB6FEox2eFC9YGtH4u31eKE89unJCC6K P6bYlCI7PFW3b+FyWib+cjiEX+jwUYs08FPL40BD+XsdmYQy3VhrpCDUATBJ19O5LbSo 63N8ONKopvbGHMZK896KbJWBR20N/s8UqLLMbCIYMNS/O/XmLcjwBuA8jAdLxITbyPAv +peg==; 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=C2HgjbM3; 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 k16-20020a170906681000b00a46ab9264e0si2609810ejr.548.2024.03.25.08.05.13; Mon, 25 Mar 2024 08:05:14 -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=C2HgjbM3; 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 A14BA68D5F8; Mon, 25 Mar 2024 17:03:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4061468D578 for ; Mon, 25 Mar 2024 17:02:56 +0200 (EET) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5101cd91017so5337639e87.2 for ; Mon, 25 Mar 2024 08:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1711378975; x=1711983775; 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=1AqdwaoBhiheCZY22TI72HJd2+nz/PR7QFhAKnU6aa8=; b=C2HgjbM3rW9VoI738qmw81oln6GtjySA865U566tp8cz/wxMnAwUaDKMLX/b0ox2UN c/imQcuFse5kGZFkib2Ps+/pQis3oWzGXKGfH4351wPmEctnT8WaDyOobrujpwv+tN9q xvWKh9ILGg35wxnN6IMoKJbVWmsHvpaN3CEGp9B3uVQDunuqIgeJ8fHJe6ouCFAwKDgY 2QIuFfB9Z3ijx3nguJkKbGRFkM4FfVsMDe/1g4sQnJcDR1Fwff96cMruyebjBZmuQNZB VT7qFzAY4Owt3kO1rMclclhM73W5jw7/S1lkMEtygKAhX3vR0S9GIfIw3TdfiBf+jwsC hgww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711378975; x=1711983775; 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=1AqdwaoBhiheCZY22TI72HJd2+nz/PR7QFhAKnU6aa8=; b=HMRwtIqsAw/KE1Yf+cgrivfBi2TE6EmYjn4ccJZaMcGfc7lzqXb4Xl5cXrRKIu1npM 64FhDP7QefMlKDQD2kdZDp9wmh+6FdxGPQJBrqhAE8qvNdXGUOWP47OPzLtSKuMy0UpJ SoFFW1/CUQ8zXJJaSetPYVZWflaD5+j6InIxawcM03TRUkh+DFI2Neb9UpcrUYD3JHYk 2nI4hjiMVw8TXxQPKI+n/js4A3lzTubwhj/peWYo+iSSraMll8WMVhPoSy81I5ZBD7J3 z6u10ZWjnoxGPnCiDlfINrcv3IC2+Q1YsAvEX49ZTiYZUxrmVmvwe+IFRJQ3fizVyYRN kJfw== X-Gm-Message-State: AOJu0YyDc2NeFsfPIFG5je2yvVBI/OWBupxj8V0wDipib4LGKHJB2qVv 1sneCKwm509qjPj5ElFj/q/rb9NyjFBqJxurK/2QCCmx3zOlvLgdX5Lif8tydGxm0A14Bl+EcBZ e4yPL X-Received: by 2002:ac2:4645:0:b0:513:e21:2a64 with SMTP id s5-20020ac24645000000b005130e212a64mr4381289lfo.31.1711378975370; Mon, 25 Mar 2024 08:02:55 -0700 (PDT) Received: from localhost (host-114-191.parnet.fi. [77.234.114.191]) by smtp.gmail.com with ESMTPSA id i12-20020a0565123e0c00b00515acc50f71sm417084lfv.260.2024.03.25.08.02.55 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Mar 2024 08:02:55 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Mar 2024 17:02:36 +0200 Message-Id: <20240325150243.59058-15-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 14/21] aarch64: hevc: Implement a neon version of hevc_qpel_uni_w_h*_8 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: 5rMLdbmpp8cl AWS Graviton 3: put_hevc_qpel_uni_w_h4_8_c: 159.0 put_hevc_qpel_uni_w_h4_8_neon: 64.2 put_hevc_qpel_uni_w_h4_8_i8mm: 40.0 put_hevc_qpel_uni_w_h6_8_c: 344.7 put_hevc_qpel_uni_w_h6_8_neon: 114.5 put_hevc_qpel_uni_w_h6_8_i8mm: 82.0 put_hevc_qpel_uni_w_h8_8_c: 596.2 put_hevc_qpel_uni_w_h8_8_neon: 132.2 put_hevc_qpel_uni_w_h8_8_i8mm: 106.0 put_hevc_qpel_uni_w_h12_8_c: 1325.0 put_hevc_qpel_uni_w_h12_8_neon: 299.0 put_hevc_qpel_uni_w_h12_8_i8mm: 211.5 put_hevc_qpel_uni_w_h16_8_c: 2300.0 put_hevc_qpel_uni_w_h16_8_neon: 422.0 put_hevc_qpel_uni_w_h16_8_i8mm: 286.2 put_hevc_qpel_uni_w_h24_8_c: 5059.0 put_hevc_qpel_uni_w_h24_8_neon: 912.2 put_hevc_qpel_uni_w_h24_8_i8mm: 664.2 put_hevc_qpel_uni_w_h32_8_c: 9198.2 put_hevc_qpel_uni_w_h32_8_neon: 1638.2 put_hevc_qpel_uni_w_h32_8_i8mm: 1033.7 put_hevc_qpel_uni_w_h48_8_c: 20754.7 put_hevc_qpel_uni_w_h48_8_neon: 3633.7 put_hevc_qpel_uni_w_h48_8_i8mm: 2300.7 put_hevc_qpel_uni_w_h64_8_c: 36854.7 put_hevc_qpel_uni_w_h64_8_neon: 6435.7 put_hevc_qpel_uni_w_h64_8_i8mm: 4039.2 --- libavcodec/aarch64/hevcdsp_init_aarch64.c | 7 + libavcodec/aarch64/hevcdsp_qpel_neon.S | 405 +++++++++++++++++++++- 2 files changed, 410 insertions(+), 2 deletions(-) diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index 6110a360d8..ea0d26c019 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -277,6 +277,11 @@ NEON8_FNPROTO(qpel_uni_hv, (uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width), _i8mm); +NEON8_FNPROTO(qpel_uni_w_h, (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(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -429,6 +434,8 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv,); NEON8_FNASSIGN(c->put_hevc_epel_bi, 1, 1, epel_bi_hv,); + NEON8_FNASSIGN_SHARED_32(c->put_hevc_qpel_uni_w, 0, 1, qpel_uni_w_h,); + if (have_i8mm(cpu_flags)) { NEON8_FNASSIGN(c->put_hevc_epel, 0, 1, epel_h, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel, 1, 1, epel_hv, _i8mm); diff --git a/libavcodec/aarch64/hevcdsp_qpel_neon.S b/libavcodec/aarch64/hevcdsp_qpel_neon.S index 062b7d4d0f..fba063186c 100644 --- a/libavcodec/aarch64/hevcdsp_qpel_neon.S +++ b/libavcodec/aarch64/hevcdsp_qpel_neon.S @@ -2456,8 +2456,10 @@ function ff_hevc_put_hevc_qpel_uni_hv64_8_neon_i8mm, export=1 ldp x7, x30, [sp], #48 b .Lqpel_uni_hv16_loop endfunc +DISABLE_I8MM +#endif -.macro QPEL_UNI_W_H_HEADER +.macro QPEL_UNI_W_H_HEADER elems=4s ldr x12, [sp] sub x2, x2, #3 movrel x9, qpel_filters @@ -2465,11 +2467,410 @@ endfunc ld1r {v28.2d}, [x9] mov w10, #-6 sub w10, w10, w5 - dup v30.4s, w6 // wx + dup v30.\elems, w6 // wx dup v31.4s, w10 // shift dup v29.4s, w7 // ox .endm +function ff_hevc_put_hevc_qpel_uni_w_h4_8_neon, export=1 + QPEL_UNI_W_H_HEADER 4h + sxtl v0.8h, v28.8b +1: + ld1 {v1.8b, v2.8b}, [x2], x3 + subs w4, w4, #1 + uxtl v1.8h, v1.8b + uxtl v2.8h, v2.8b + ext v3.16b, v1.16b, v2.16b, #2 + ext v4.16b, v1.16b, v2.16b, #4 + ext v5.16b, v1.16b, v2.16b, #6 + ext v6.16b, v1.16b, v2.16b, #8 + ext v7.16b, v1.16b, v2.16b, #10 + ext v16.16b, v1.16b, v2.16b, #12 + ext v17.16b, v1.16b, v2.16b, #14 + mul v18.4h, v1.4h, v0.h[0] + mla v18.4h, v3.4h, v0.h[1] + mla v18.4h, v4.4h, v0.h[2] + mla v18.4h, v5.4h, v0.h[3] + mla v18.4h, v6.4h, v0.h[4] + mla v18.4h, v7.4h, v0.h[5] + mla v18.4h, v16.4h, v0.h[6] + mla v18.4h, v17.4h, v0.h[7] + smull v16.4s, v18.4h, v30.4h + sqrshl v16.4s, v16.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtun v16.8b, v16.8h + str s16, [x0] + add x0, x0, x1 + b.hi 1b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_w_h6_8_neon, export=1 + QPEL_UNI_W_H_HEADER 8h + sub x1, x1, #4 + sxtl v0.8h, v28.8b +1: + ld1 {v1.8b, v2.8b}, [x2], x3 + subs w4, w4, #1 + uxtl v1.8h, v1.8b + uxtl v2.8h, v2.8b + ext v3.16b, v1.16b, v2.16b, #2 + ext v4.16b, v1.16b, v2.16b, #4 + ext v5.16b, v1.16b, v2.16b, #6 + ext v6.16b, v1.16b, v2.16b, #8 + ext v7.16b, v1.16b, v2.16b, #10 + ext v16.16b, v1.16b, v2.16b, #12 + ext v17.16b, v1.16b, v2.16b, #14 + mul v18.8h, v1.8h, v0.h[0] + mla v18.8h, v3.8h, v0.h[1] + mla v18.8h, v4.8h, v0.h[2] + mla v18.8h, v5.8h, v0.h[3] + mla v18.8h, v6.8h, v0.h[4] + mla v18.8h, v7.8h, v0.h[5] + mla v18.8h, v16.8h, v0.h[6] + mla v18.8h, v17.8h, v0.h[7] + smull v16.4s, v18.4h, v30.4h + smull2 v17.4s, v18.8h, v30.8h + sqrshl v16.4s, v16.4s, v31.4s + sqrshl v17.4s, v17.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqadd v17.4s, v17.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtn2 v16.8h, v17.4s + sqxtun v16.8b, v16.8h + str s16, [x0], #4 + st1 {v16.h}[2], [x0], x1 + b.hi 1b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_w_h8_8_neon, export=1 + QPEL_UNI_W_H_HEADER 8h + sxtl v0.8h, v28.8b +1: + ld1 {v1.8b, v2.8b}, [x2], x3 + subs w4, w4, #1 + uxtl v1.8h, v1.8b + uxtl v2.8h, v2.8b + ext v3.16b, v1.16b, v2.16b, #2 + ext v4.16b, v1.16b, v2.16b, #4 + ext v5.16b, v1.16b, v2.16b, #6 + ext v6.16b, v1.16b, v2.16b, #8 + ext v7.16b, v1.16b, v2.16b, #10 + ext v16.16b, v1.16b, v2.16b, #12 + ext v17.16b, v1.16b, v2.16b, #14 + mul v18.8h, v1.8h, v0.h[0] + mla v18.8h, v3.8h, v0.h[1] + mla v18.8h, v4.8h, v0.h[2] + mla v18.8h, v5.8h, v0.h[3] + mla v18.8h, v6.8h, v0.h[4] + mla v18.8h, v7.8h, v0.h[5] + mla v18.8h, v16.8h, v0.h[6] + mla v18.8h, v17.8h, v0.h[7] + smull v16.4s, v18.4h, v30.4h + smull2 v17.4s, v18.8h, v30.8h + sqrshl v16.4s, v16.4s, v31.4s + sqrshl v17.4s, v17.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqadd v17.4s, v17.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtn2 v16.8h, v17.4s + sqxtun v16.8b, v16.8h + st1 {v16.8b}, [x0], x1 + b.hi 1b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_w_h12_8_neon, export=1 + QPEL_UNI_W_H_HEADER 8h + add x13, x0, #8 + sxtl v0.8h, v28.8b +1: + ld1 {v1.8b, v2.8b, v3.8b}, [x2], x3 + subs w4, w4, #1 + uxtl v1.8h, v1.8b + uxtl v2.8h, v2.8b + uxtl v3.8h, v3.8b + ext v4.16b, v1.16b, v2.16b, #2 + ext v5.16b, v1.16b, v2.16b, #4 + ext v6.16b, v1.16b, v2.16b, #6 + ext v7.16b, v1.16b, v2.16b, #8 + ext v16.16b, v1.16b, v2.16b, #10 + ext v17.16b, v1.16b, v2.16b, #12 + ext v18.16b, v1.16b, v2.16b, #14 + mul v19.8h, v1.8h, v0.h[0] + mla v19.8h, v4.8h, v0.h[1] + mla v19.8h, v5.8h, v0.h[2] + mla v19.8h, v6.8h, v0.h[3] + mla v19.8h, v7.8h, v0.h[4] + mla v19.8h, v16.8h, v0.h[5] + mla v19.8h, v17.8h, v0.h[6] + mla v19.8h, v18.8h, v0.h[7] + ext v4.16b, v2.16b, v3.16b, #2 + ext v5.16b, v2.16b, v3.16b, #4 + ext v6.16b, v2.16b, v3.16b, #6 + ext v7.16b, v2.16b, v3.16b, #8 + ext v16.16b, v2.16b, v3.16b, #10 + ext v17.16b, v2.16b, v3.16b, #12 + ext v18.16b, v2.16b, v3.16b, #14 + mul v20.4h, v2.4h, v0.h[0] + mla v20.4h, v4.4h, v0.h[1] + mla v20.4h, v5.4h, v0.h[2] + mla v20.4h, v6.4h, v0.h[3] + mla v20.4h, v7.4h, v0.h[4] + mla v20.4h, v16.4h, v0.h[5] + mla v20.4h, v17.4h, v0.h[6] + mla v20.4h, v18.4h, v0.h[7] + smull v16.4s, v19.4h, v30.4h + smull2 v17.4s, v19.8h, v30.8h + smull v18.4s, v20.4h, v30.4h + sqrshl v16.4s, v16.4s, v31.4s + sqrshl v17.4s, v17.4s, v31.4s + sqrshl v18.4s, v18.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqadd v17.4s, v17.4s, v29.4s + sqadd v18.4s, v18.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtn2 v16.8h, v17.4s + sqxtn v17.4h, v18.4s + sqxtun v16.8b, v16.8h + sqxtun v17.8b, v17.8h + st1 {v16.8b}, [x0], x1 + st1 {v17.s}[0], [x13], x1 + b.hi 1b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_w_h16_8_neon, export=1 + QPEL_UNI_W_H_HEADER 8h + sxtl v0.8h, v28.8b +1: + ld1 {v1.8b, v2.8b, v3.8b}, [x2], x3 + subs w4, w4, #1 + uxtl v1.8h, v1.8b + uxtl v2.8h, v2.8b + uxtl v3.8h, v3.8b + ext v4.16b, v1.16b, v2.16b, #2 + ext v5.16b, v1.16b, v2.16b, #4 + ext v6.16b, v1.16b, v2.16b, #6 + ext v7.16b, v1.16b, v2.16b, #8 + ext v16.16b, v1.16b, v2.16b, #10 + ext v17.16b, v1.16b, v2.16b, #12 + ext v18.16b, v1.16b, v2.16b, #14 + mul v19.8h, v1.8h, v0.h[0] + mla v19.8h, v4.8h, v0.h[1] + mla v19.8h, v5.8h, v0.h[2] + mla v19.8h, v6.8h, v0.h[3] + mla v19.8h, v7.8h, v0.h[4] + mla v19.8h, v16.8h, v0.h[5] + mla v19.8h, v17.8h, v0.h[6] + mla v19.8h, v18.8h, v0.h[7] + ext v4.16b, v2.16b, v3.16b, #2 + ext v5.16b, v2.16b, v3.16b, #4 + ext v6.16b, v2.16b, v3.16b, #6 + ext v7.16b, v2.16b, v3.16b, #8 + ext v16.16b, v2.16b, v3.16b, #10 + ext v17.16b, v2.16b, v3.16b, #12 + ext v18.16b, v2.16b, v3.16b, #14 + mul v20.8h, v2.8h, v0.h[0] + mla v20.8h, v4.8h, v0.h[1] + mla v20.8h, v5.8h, v0.h[2] + mla v20.8h, v6.8h, v0.h[3] + mla v20.8h, v7.8h, v0.h[4] + mla v20.8h, v16.8h, v0.h[5] + mla v20.8h, v17.8h, v0.h[6] + mla v20.8h, v18.8h, v0.h[7] + smull v16.4s, v19.4h, v30.4h + smull2 v17.4s, v19.8h, v30.8h + smull v18.4s, v20.4h, v30.4h + smull2 v19.4s, v20.8h, v30.8h + sqrshl v16.4s, v16.4s, v31.4s + sqrshl v17.4s, v17.4s, v31.4s + sqrshl v18.4s, v18.4s, v31.4s + sqrshl v19.4s, v19.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqadd v17.4s, v17.4s, v29.4s + sqadd v18.4s, v18.4s, v29.4s + sqadd v19.4s, v19.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtn2 v16.8h, v17.4s + sqxtn v17.4h, v18.4s + sqxtn2 v17.8h, v19.4s + sqxtun v16.8b, v16.8h + sqxtun v17.8b, v17.8h + st1 {v16.8b, v17.8b}, [x0], x1 + b.hi 1b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_w_h24_8_neon, export=1 + QPEL_UNI_W_H_HEADER 8h + sxtl v0.8h, v28.8b +1: + ld1 {v1.8b, v2.8b, v3.8b, v4.8b}, [x2], x3 + subs w4, w4, #1 + uxtl v1.8h, v1.8b + uxtl v2.8h, v2.8b + uxtl v3.8h, v3.8b + uxtl v4.8h, v4.8b + ext v5.16b, v1.16b, v2.16b, #2 + ext v6.16b, v1.16b, v2.16b, #4 + ext v7.16b, v1.16b, v2.16b, #6 + ext v16.16b, v1.16b, v2.16b, #8 + ext v17.16b, v1.16b, v2.16b, #10 + ext v18.16b, v1.16b, v2.16b, #12 + ext v19.16b, v1.16b, v2.16b, #14 + mul v20.8h, v1.8h, v0.h[0] + mla v20.8h, v5.8h, v0.h[1] + mla v20.8h, v6.8h, v0.h[2] + mla v20.8h, v7.8h, v0.h[3] + mla v20.8h, v16.8h, v0.h[4] + mla v20.8h, v17.8h, v0.h[5] + mla v20.8h, v18.8h, v0.h[6] + mla v20.8h, v19.8h, v0.h[7] + ext v5.16b, v2.16b, v3.16b, #2 + ext v6.16b, v2.16b, v3.16b, #4 + ext v7.16b, v2.16b, v3.16b, #6 + ext v16.16b, v2.16b, v3.16b, #8 + ext v17.16b, v2.16b, v3.16b, #10 + ext v18.16b, v2.16b, v3.16b, #12 + ext v19.16b, v2.16b, v3.16b, #14 + mul v21.8h, v2.8h, v0.h[0] + mla v21.8h, v5.8h, v0.h[1] + mla v21.8h, v6.8h, v0.h[2] + mla v21.8h, v7.8h, v0.h[3] + mla v21.8h, v16.8h, v0.h[4] + mla v21.8h, v17.8h, v0.h[5] + mla v21.8h, v18.8h, v0.h[6] + mla v21.8h, v19.8h, v0.h[7] + ext v5.16b, v3.16b, v4.16b, #2 + ext v6.16b, v3.16b, v4.16b, #4 + ext v7.16b, v3.16b, v4.16b, #6 + ext v16.16b, v3.16b, v4.16b, #8 + ext v17.16b, v3.16b, v4.16b, #10 + ext v18.16b, v3.16b, v4.16b, #12 + ext v19.16b, v3.16b, v4.16b, #14 + mul v22.8h, v3.8h, v0.h[0] + mla v22.8h, v5.8h, v0.h[1] + mla v22.8h, v6.8h, v0.h[2] + mla v22.8h, v7.8h, v0.h[3] + mla v22.8h, v16.8h, v0.h[4] + mla v22.8h, v17.8h, v0.h[5] + mla v22.8h, v18.8h, v0.h[6] + mla v22.8h, v19.8h, v0.h[7] + smull v16.4s, v20.4h, v30.4h + smull2 v17.4s, v20.8h, v30.8h + smull v18.4s, v21.4h, v30.4h + smull2 v19.4s, v21.8h, v30.8h + smull v20.4s, v22.4h, v30.4h + smull2 v21.4s, v22.8h, v30.8h + sqrshl v16.4s, v16.4s, v31.4s + sqrshl v17.4s, v17.4s, v31.4s + sqrshl v18.4s, v18.4s, v31.4s + sqrshl v19.4s, v19.4s, v31.4s + sqrshl v20.4s, v20.4s, v31.4s + sqrshl v21.4s, v21.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqadd v17.4s, v17.4s, v29.4s + sqadd v18.4s, v18.4s, v29.4s + sqadd v19.4s, v19.4s, v29.4s + sqadd v20.4s, v20.4s, v29.4s + sqadd v21.4s, v21.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtn2 v16.8h, v17.4s + sqxtn v17.4h, v18.4s + sqxtn2 v17.8h, v19.4s + sqxtn v18.4h, v20.4s + sqxtn2 v18.8h, v21.4s + sqxtun v16.8b, v16.8h + sqxtun v17.8b, v17.8h + sqxtun v18.8b, v18.8h + st1 {v16.8b, v17.8b, v18.8b}, [x0], x1 + b.hi 1b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_w_h32_8_neon, export=1 + QPEL_UNI_W_H_HEADER 8h + ldr w10, [sp, #16] // width + ld1 {v1.8b}, [x2], #8 + sub x3, x3, w10, uxtw // decrement src stride + mov w11, w10 // original width + sub x3, x3, #8 // decrement src stride + sub x1, x1, w10, uxtw // decrement dst stride + sxtl v0.8h, v28.8b + uxtl v1.8h, v1.8b +1: + ld1 {v2.8b, v3.8b}, [x2], #16 + subs w10, w10, #16 // width + uxtl v2.8h, v2.8b + uxtl v3.8h, v3.8b + ext v4.16b, v1.16b, v2.16b, #2 + ext v5.16b, v1.16b, v2.16b, #4 + ext v6.16b, v1.16b, v2.16b, #6 + ext v7.16b, v1.16b, v2.16b, #8 + ext v16.16b, v1.16b, v2.16b, #10 + ext v17.16b, v1.16b, v2.16b, #12 + ext v18.16b, v1.16b, v2.16b, #14 + mul v19.8h, v1.8h, v0.h[0] + mla v19.8h, v4.8h, v0.h[1] + mla v19.8h, v5.8h, v0.h[2] + mla v19.8h, v6.8h, v0.h[3] + mla v19.8h, v7.8h, v0.h[4] + mla v19.8h, v16.8h, v0.h[5] + mla v19.8h, v17.8h, v0.h[6] + mla v19.8h, v18.8h, v0.h[7] + ext v4.16b, v2.16b, v3.16b, #2 + ext v5.16b, v2.16b, v3.16b, #4 + ext v6.16b, v2.16b, v3.16b, #6 + ext v7.16b, v2.16b, v3.16b, #8 + ext v16.16b, v2.16b, v3.16b, #10 + ext v17.16b, v2.16b, v3.16b, #12 + ext v18.16b, v2.16b, v3.16b, #14 + mul v20.8h, v2.8h, v0.h[0] + mla v20.8h, v4.8h, v0.h[1] + mla v20.8h, v5.8h, v0.h[2] + mla v20.8h, v6.8h, v0.h[3] + mla v20.8h, v7.8h, v0.h[4] + mla v20.8h, v16.8h, v0.h[5] + mla v20.8h, v17.8h, v0.h[6] + mla v20.8h, v18.8h, v0.h[7] + smull v16.4s, v19.4h, v30.4h + smull2 v17.4s, v19.8h, v30.8h + smull v18.4s, v20.4h, v30.4h + smull2 v19.4s, v20.8h, v30.8h + sqrshl v16.4s, v16.4s, v31.4s + sqrshl v17.4s, v17.4s, v31.4s + sqrshl v18.4s, v18.4s, v31.4s + sqrshl v19.4s, v19.4s, v31.4s + sqadd v16.4s, v16.4s, v29.4s + sqadd v17.4s, v17.4s, v29.4s + sqadd v18.4s, v18.4s, v29.4s + sqadd v19.4s, v19.4s, v29.4s + sqxtn v16.4h, v16.4s + sqxtn2 v16.8h, v17.4s + sqxtn v17.4h, v18.4s + sqxtn2 v17.8h, v19.4s + sqxtun v16.8b, v16.8h + sqxtun v17.8b, v17.8h + st1 {v16.8b, v17.8b}, [x0], #16 + mov v1.16b, v3.16b + b.gt 1b + subs w4, w4, #1 // height + add x2, x2, x3 + b.le 9f + ld1 {v1.8b}, [x2], #8 + mov w10, w11 + add x0, x0, x1 + uxtl v1.8h, v1.8b + b 1b +9: + ret +endfunc + +#if HAVE_I8MM +ENABLE_I8MM function ff_hevc_put_hevc_qpel_uni_w_h4_8_neon_i8mm, export=1 QPEL_UNI_W_H_HEADER 1: