From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0547A444D0 for ; Tue, 13 Sep 2022 11:59:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A55C68BB55; Tue, 13 Sep 2022 14:59:08 +0300 (EEST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DFFE68BB4D for ; Tue, 13 Sep 2022 14:59:00 +0300 (EEST) Received: by mail-lj1-f178.google.com with SMTP id s10so13439560ljp.5 for ; Tue, 13 Sep 2022 04:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=VhuoHnlG56hgFIijtBT1E/y4DNB/VedprLR/6UulmQc=; b=Up1Qg3TT+PB1FymvXmKlGuXRjBrlEoUxIQSef+JXvbSeO729Jagud27wixpGbcqvF1 BYpZq8s/oom5NLsWPL/DusJMOg02bcNuaJWyX922TUJwtN9Yqg2WKsbk8C4rnXDO77mh 7By43vaXvz7p28hnDOF+Jv24AGxnEV5ihxS7K5vWpl7iRZqYLFE6PYHPriDtC+WN7bFG xUvAPy49+a1ZP8XEqSlXRoagsGnwFhay/NqXX2B14gAyfbrxgEL7z0q973rzgyOgedQF SQ1YUCDzL6wggdp/BGGrbZuQNbanw2PAwEdbaw664/6yUU5Oi92xWWJcgjRuozOd69qx 2jnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=VhuoHnlG56hgFIijtBT1E/y4DNB/VedprLR/6UulmQc=; b=ix7hHYgUSUZgjMkCd43B6Lcg39NjOmgkMnqBZ4J9MOk7NBPxkYTLbHI4xOPlG6Qpw1 pO2VtpfVK4PfNbEdRiszHL8ZjDY+OhHqA+CZ1nhTSyo+JJoLqJV87eCFPQoOgAxJTFiv qCBfU/MOJLqQcc7WYCutB1PiPJLvRlxSsxcm2dMNB8Sd0+diVj1qCoEyqlQV0/d7tMUD kdZeCTJgP6apPWH9KQoR4aGspy+lx6eq6mlF6mLxy7HApftwON1S5LLp9Ezh9PR2jgPW 66LpfCqe3uTIAwVQg8qHXe8LVp14gXncXEMcKPiMUEnN9lqOkw7oez/8T/1KGRWnf7ha 5Mcw== X-Gm-Message-State: ACgBeo2RluYckEClFF+jtONmrGqzDlvuOkSTtmD2WqqAzHaUh/9QdTQA TPnfG6b/Bbeveffn0Cj5CfdvNTsNUm+W7A== X-Google-Smtp-Source: AA6agR41WuHtVq7xB2gjt1YMCD2teKwVJQW9zeRA7bWpOr8+WdwJ7WM62rFmZd9MP4y+o4df7zvhpg== X-Received: by 2002:a2e:a784:0:b0:26b:edd3:c148 with SMTP id c4-20020a2ea784000000b0026bedd3c148mr4959906ljf.317.1663070339266; Tue, 13 Sep 2022 04:58:59 -0700 (PDT) Received: from hum-HP-ProBook-440-G7.semihalf.net ([83.142.187.84]) by smtp.gmail.com with ESMTPSA id f20-20020a05651232d400b0048a8586293asm580288lfg.48.2022.09.13.04.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 04:58:58 -0700 (PDT) From: Hubert Mazur To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:58:23 +0200 Message-Id: <20220913115824.60792-3-hum@semihalf.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220913115824.60792-1-hum@semihalf.com> References: <20220913115824.60792-1-hum@semihalf.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] lavc/aarch64: Add neon implementation for vsad8_intra 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: gjb@semihalf.com, upstream@semihalf.com, jswinney@amazon.com, Hubert Mazur , martin@martin.st, mw@semihalf.com, spop@amazon.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Provide optimized implementation for pix_median_abs16 function. Performance comparison tests are shown below. - vsad_5_c: 94.7 - vsad_5_neon: 20.7 Benchmarks and tests run with checkasm tool on AWS Graviton 3. Signed-off-by: Hubert Mazur --- libavcodec/aarch64/me_cmp_init_aarch64.c | 3 ++ libavcodec/aarch64/me_cmp_neon.S | 42 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/libavcodec/aarch64/me_cmp_init_aarch64.c b/libavcodec/aarch64/me_cmp_init_aarch64.c index fb51a833be..d3fa047a86 100644 --- a/libavcodec/aarch64/me_cmp_init_aarch64.c +++ b/libavcodec/aarch64/me_cmp_init_aarch64.c @@ -45,6 +45,8 @@ int vsad16_neon(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride, int h); int vsad_intra16_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, ptrdiff_t stride, int h) ; +int vsad_intra8_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, + ptrdiff_t stride, int h) ; int vsse16_neon(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride, int h); int vsse_intra16_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, @@ -75,6 +77,7 @@ av_cold void ff_me_cmp_init_aarch64(MECmpContext *c, AVCodecContext *avctx) c->vsad[0] = vsad16_neon; c->vsad[4] = vsad_intra16_neon; + c->vsad[5] = vsad_intra8_neon; c->vsse[0] = vsse16_neon; c->vsse[4] = vsse_intra16_neon; diff --git a/libavcodec/aarch64/me_cmp_neon.S b/libavcodec/aarch64/me_cmp_neon.S index a4a4344f42..73701bd353 100644 --- a/libavcodec/aarch64/me_cmp_neon.S +++ b/libavcodec/aarch64/me_cmp_neon.S @@ -1050,3 +1050,45 @@ function pix_median_abs16_neon, export=1 ret endfunc + +function vsad_intra8_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *dummy + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.8b}, [x1], x3 + sub w4, w4, #1 // we need to make h-1 iterations + cmp w4, #3 + movi v16.8h, #0 + b.lt 2f + +1: + // v = abs( pix1[0] - pix1[0 + stride] ) + // score = sum(v) + ld1 {v1.8b}, [x1], x3 + ld1 {v2.8b}, [x1], x3 + uabal v16.8h, v0.8b, v1.8b + ld1 {v3.8b}, [x1], x3 + sub w4, w4, #3 + uabal v16.8h, v1.8b, v2.8b + cmp w4, #3 + mov v0.8b, v3.8b + uabal v16.8h, v2.8b, v3.8b + b.ge 1b + cbz w4, 3f + +2: + ld1 {v1.8b}, [x1], x3 + subs w4, w4, #1 + uabal v16.8h, v0.8b, v1.8b + mov v0.8b, v1.8b + cbnz w4, 2b + +3: + uaddlv s17, v16.8h + fmov w0, s17 + + ret +endfunc -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".