From patchwork Wed Sep 11 18:06:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 51523 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:14c:b0:48e:c0f8:d0de with SMTP id h12csp492796vqi; Wed, 11 Sep 2024 11:34:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUPKuQEd0dGdQenhZZcyetpwthxOr/PtlCzpTsNOwi1ZqdfKgifBTSVTpml6Zjub2SwnJs0WqUMJf6Ap5ILPwMw@gmail.com X-Google-Smtp-Source: AGHT+IEkjiCVQWaRa5jH2+qIb1/PHzGMwvaY19sAdiMGA9TeJ3q6s9OsNJZjFDp+vR1M+XFIud07 X-Received: by 2002:a05:6512:1248:b0:535:665f:cfc0 with SMTP id 2adb3069b0e04-53678fc22f2mr178945e87.32.1726079655244; Wed, 11 Sep 2024 11:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726079655; cv=none; d=google.com; s=arc-20240605; b=NFexcJWL/dje7tjBh2gWXkyOI8bzknxLkNPo4REtWii7JKX8ungUxQDQYo19/puWbE 6MnaB7JYPlx6+pag+BjgvThct9IZ1ny3OSMWruWsTxy5uaKN11/ge1g0vrom+XCyzR2s jVioa+ijqBClQKO1SoyGzTBfI8LMgC5CQwtkI9tI7V2wpaxdV0HJlILDT3pQK6ftwF1R M2Mth+L+yRopjzPIlJlEfelmdxwtnPC7rJNoeS98vgGf6bjmqG1RPbkw59RrnbDvoBU+ uWj629sf9R+Xe2+kscTghBT9biVrCo1g51vtAtuPotSN5+++z+0dIBd5Y0oA8LZWFgy2 CzLg== 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:date :to:from:message-id:dkim-signature:delivered-to; bh=PsyGSAk9O64Bn/gZ7BK+GS/ouZV8tn6kf3NtdjlSOrM=; fh=HnHYuZ9XgUo86ZRXTLWWmQxhslYEI9B9taZ5X1DLFfc=; b=QHgF/OqPFCBfFRJrR4dD6r92D0sN6cFwcenK29hJiy09YCnFW0ApMimUFMq/kQBy71 YCinzYnkdsNU4qy5SWSXoVOewmy0Yl0iGlfhuS/+EyBARInIAOoarAMPq0nP4v05617d t0mYC6FeFvOG1lBOIitP/G3srtvhF8yqd8Ky/UItKhiE5asRdggZimZ6lrXRu9yXPoYA FSB5hA4DQ5acIek1M3frmOD3j6CSW8qtnup3nMyUJsfSQVdM+BlinSPLtO3eTdPevC1M PcZz622ubG50/nfY3Ip2G6+fdn/vuWXNf/wXQdHMQg21V/FzCzYI2anW83wK8l7kiSP7 ACTg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=czZusRJB; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-5365f8ecaf2si3402766e87.329.2024.09.11.11.34.14; Wed, 11 Sep 2024 11:34:15 -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=@foxmail.com header.s=s201512 header.b=czZusRJB; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 43EBE68E2FF; Wed, 11 Sep 2024 21:06:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from xmbghk7.mail.qq.com (xmbghk7.mail.qq.com [43.163.128.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9ECA368E22A for ; Wed, 11 Sep 2024 21:06:33 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1726077984; bh=jpgZAf+PykZUR8tL5wom6EwZ1QkWgWq/N1a+rLqXjjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=czZusRJBmn2dCORWEo365LXlEG4GHa2Lqf65Q5IT9EgISomMU4ZTX26tARex3zKqr YleI4kBZHKDRYnycTPbV/mOjQFfK7jqkwKjiMUZqF7dNeoM3/Rvd9FBMSnVqqAL6kP bT/S7SkmUDQuAQ5crTgbZWbdgykfj2zi4l/jNCBM= Received: from ZHILIZHAO-MB1.tencent.com ([113.118.115.139]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 19397694; Thu, 12 Sep 2024 02:06:19 +0800 X-QQ-mid: xmsmtpt1726077983tpxu2juq0 Message-ID: X-QQ-XMAILINFO: NvH2zBBgt3uTtbO9za2YWT/e2Nh9NfYNSbM1xAZ71NXkb+jEnsyzO3rBbcEe0z N3sjWUQO/Gi0ASwkcvvKUmoZCvG6afXvVeXKHCbUAeQ9yBG8d8NIKTpgvOAbBX62zlnXM+HZpl8w i3iNigFOf9Ps16z1r9qbOPWF13fTJW+Kf9dKA1qmyXTUOpHQ32V8X4W7JA0QAoSv1sXmL9FjysAm V0bSzJy3RlW4bu8H8hfZ4lQUuHeN06rUAPmiDa5ZRFGZ0F4ADArEzJ06vX0w/RelppX7sXu67c0K 7CCrTYOYJUV5oed3Oqn1N1ZfjSTiJLkmzXf3hCIvGMiJgxhgAmtokf8+AXI9k9zEe1Uugggo5/O8 VM8GMLCf/b+b7Vaq21R/DicilaRQKNGSRrUSm9Dmr/0tBCHhzWa17DVKY0a7MGnXSQtHA6vN87/m Wkh7GdSm037x+MlLIAZ7/3tWE20jqCyq670FvU2p1ihgY7B53aaacndYfon7p5zvnGJB6ZZHvZ1v dwQdhnWtvzcOr6Mo/leFl7SjlPymzsoHe55Vo3fOnwnKZYiJrRIFTg/IG6HqO86mB80MsngdNVN4 kuBgneyq6YqSQhCFfs57qeA/rz7GHhGq0i42wLH8vo5G6UjsyhtWjaPLqLt4PLhw10hJ+3s3IHoA JG76hh16ORM04Y0cSxdNyNI+AMwC2B4iknZLew3SE1ybSsVdFGi6+nFy1MqqPoSTqYZgJSqgcSjm simcWAZvSlX/eZYugLci/uGdHw5fbkPw6c+IVkIXY+30ipi02CqcgdSYqDQXUVb47M3aI6nfP5DH DrFl6t2hbsD7qExXwCPCAVsDE9sPPunEGikCmDQvnTpHjQ27113WiX2JlALUJUQr6yQOOEmb/dmy oo24LxTS5AnvC24OWJ37Hz/EyJZY7kE5WcR3BXbvRqmSv/NSAOPPrI2NNIKKoficDQjG+gVg+eHh MSXJhbTDwCthhw96eQFbBuxcYr3izsXq+owvy4XPS5XYzF/fkw9Q== X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 12 Sep 2024 02:06:12 +0800 X-OQ-MSGID: <20240911180618.28921-9-quinkblack@foxmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240911180618.28921-1-quinkblack@foxmail.com> References: <20240911180618.28921-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 08/14] aarch64/vvc: Add put_qpel_vx 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Y0ezGBcj6zuG From: Zhao Zhili put_luma_v_8_4x4_c: 1.0 ( 1.00x) put_luma_v_8_4x4_neon: 0.0 ( 0.00x) put_luma_v_8_8x8_c: 3.5 ( 1.00x) put_luma_v_8_8x8_neon: 0.5 ( 7.00x) put_luma_v_8_16x16_c: 13.8 ( 1.00x) put_luma_v_8_16x16_neon: 1.2 (11.00x) put_luma_v_8_32x32_c: 54.2 ( 1.00x) put_luma_v_8_32x32_neon: 5.0 (10.85x) put_luma_v_8_64x64_c: 217.5 ( 1.00x) put_luma_v_8_64x64_neon: 18.8 (11.60x) put_luma_v_8_128x128_c: 886.2 ( 1.00x) put_luma_v_8_128x128_neon: 74.0 (11.98x) --- libavcodec/aarch64/h26x/dsp.h | 8 +++ libavcodec/aarch64/h26x/qpel_neon.S | 100 ++++++++++++++++++++++++++++ libavcodec/aarch64/vvc/dsp_init.c | 7 ++ 3 files changed, 115 insertions(+) diff --git a/libavcodec/aarch64/h26x/dsp.h b/libavcodec/aarch64/h26x/dsp.h index 323a253257..881091f39a 100644 --- a/libavcodec/aarch64/h26x/dsp.h +++ b/libavcodec/aarch64/h26x/dsp.h @@ -274,4 +274,12 @@ NEON8_FNPROTO_PARTIAL_6(qpel_h, (int16_t * dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width), _i8mm); +void ff_vvc_put_qpel_v4_8_neon(int16_t *dst, const uint8_t *_src, + ptrdiff_t _srcstride, int height, + const int8_t *hf, const int8_t *vf, int width); + +void ff_vvc_put_qpel_v8_8_neon(int16_t *dst, const uint8_t *_src, + ptrdiff_t _srcstride, int height, + const int8_t *hf, const int8_t *vf, int width); + #endif diff --git a/libavcodec/aarch64/h26x/qpel_neon.S b/libavcodec/aarch64/h26x/qpel_neon.S index 417d43e365..a6a3b9549d 100644 --- a/libavcodec/aarch64/h26x/qpel_neon.S +++ b/libavcodec/aarch64/h26x/qpel_neon.S @@ -86,6 +86,11 @@ endconst sxtl v0.8h, v0.8b .endm +.macro vvc_load_qpel_filterh freg + ld1 {v0.8b}, [\freg] + sxtl v0.8h, v0.8b +.endm + .macro calc_qpelh dst, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 smull \dst\().4s, \src0\().4h, v0.h[0] smlal \dst\().4s, \src1\().4h, v0.h[1] @@ -95,11 +100,15 @@ endconst smlal \dst\().4s, \src5\().4h, v0.h[5] smlal \dst\().4s, \src6\().4h, v0.h[6] smlal \dst\().4s, \src7\().4h, v0.h[7] +.ifc \op, sqxtn + sqxtn \dst\().4h, \dst\().4s +.else .ifc \op, sshr sshr \dst\().4s, \dst\().4s, \shift .else \op \dst\().4h, \dst\().4s, \shift .endif +.endif .endm .macro calc_qpelh2 dst, dstt, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 @@ -111,11 +120,15 @@ endconst smlal2 \dstt\().4s, \src5\().8h, v0.h[5] smlal2 \dstt\().4s, \src6\().8h, v0.h[6] smlal2 \dstt\().4s, \src7\().8h, v0.h[7] +.ifc \op, sqxtn2 + sqxtn2 \dst\().8h, \dstt\().4s +.else .ifc \op, sshr sshr \dst\().4s, \dstt\().4s, \shift .else \op \dst\().8h, \dstt\().4s, \shift .endif +.endif .endm .macro calc_all @@ -1000,6 +1013,93 @@ function ff_hevc_put_hevc_qpel_v64_8_neon, export=1 ret endfunc +/* ff_hevc_put_hevc_qpel_vx require filter parameters be + * [-, +, -, +, +, -, +, -], + * vvc doesn't meet the requirement. + */ +function ff_vvc_put_qpel_v4_8_neon, export=1 + vvc_load_qpel_filterh x5 + sub x1, x1, x2, lsl #1 + mov x9, #(VVC_MAX_PB_SIZE * 2) + sub x1, x1, x2 + ldr s16, [x1] + ldr s17, [x1, x2] + add x1, x1, x2, lsl #1 + ldr s18, [x1] + ldr s19, [x1, x2] + uxtl v16.8h, v16.8b + uxtl v17.8h, v17.8b + add x1, x1, x2, lsl #1 + ldr s20, [x1] + ldr s21, [x1, x2] + uxtl v18.8h, v18.8b + uxtl v19.8h, v19.8b + add x1, x1, x2, lsl #1 + ldr s22, [x1] + add x1, x1, x2 + uxtl v20.8h, v20.8b + uxtl v21.8h, v21.8b + uxtl v22.8h, v22.8b +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().s}[0], [x1], x2 + uxtl \tmp\().8h, \tmp\().8b + calc_qpelh v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqxtn + subs w3, w3, #1 + st1 {v24.4h}, [x0], x9 +.endm +1: + calc_all +.purgem calc +2: + ret +endfunc + +function ff_vvc_put_qpel_v8_8_neon, export=1 + vvc_load_qpel_filterh x5 + sub x1, x1, x2, lsl #1 + sub x1, x1, x2 + mov x9, #(VVC_MAX_PB_SIZE * 2) +0: + mov x8, x1 + ldr d16, [x8] + ldr d17, [x8, x2] + mov x10, x0 + mov w11, w3 + add x8, x8, x2, lsl #1 + ldr d18, [x8] + ldr d19, [x8, x2] + uxtl v16.8h, v16.8b + uxtl v17.8h, v17.8b + add x8, x8, x2, lsl #1 + ldr d20, [x8] + ldr d21, [x8, x2] + uxtl v18.8h, v18.8b + uxtl v19.8h, v19.8b + add x8, x8, x2, lsl #1 + ldr d22, [x8] + add x8, x8, x2 + uxtl v20.8h, v20.8b + uxtl v21.8h, v21.8b + uxtl v22.8h, v22.8b +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x8], x2 + uxtl \tmp\().8h, \tmp\().8b + calc_qpelh v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqxtn + calc_qpelh2 v24, v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqxtn2 + subs w11, w11, #1 + st1 {v24.8h}, [x10], x9 +.endm +1: + calc_all +.purgem calc +2: + subs w6, w6, #8 + add x0, x0, #16 + add x1, x1, #8 + b.ne 0b + ret +endfunc + function ff_hevc_put_hevc_qpel_bi_v4_8_neon, export=1 load_qpel_filterb x7, x6 sub x2, x2, x3, lsl #1 diff --git a/libavcodec/aarch64/vvc/dsp_init.c b/libavcodec/aarch64/vvc/dsp_init.c index bcc7df8f6c..ba3a49aa1a 100644 --- a/libavcodec/aarch64/vvc/dsp_init.c +++ b/libavcodec/aarch64/vvc/dsp_init.c @@ -60,6 +60,13 @@ void ff_vvc_dsp_init_aarch64(VVCDSPContext *const c, const int bd) c->inter.put[0][5][0][1] = c->inter.put[0][6][0][1] = ff_vvc_put_qpel_h32_8_neon; + c->inter.put[0][1][1][0] = ff_vvc_put_qpel_v4_8_neon; + c->inter.put[0][2][1][0] = + c->inter.put[0][3][1][0] = + c->inter.put[0][4][1][0] = + c->inter.put[0][5][1][0] = + c->inter.put[0][6][1][0] = ff_vvc_put_qpel_v8_8_neon; + c->inter.put_uni[0][1][0][0] = ff_vvc_put_pel_uni_pixels4_8_neon; c->inter.put_uni[0][2][0][0] = ff_vvc_put_pel_uni_pixels8_8_neon; c->inter.put_uni[0][3][0][0] = ff_vvc_put_pel_uni_pixels16_8_neon;