From patchwork Thu Feb 4 11:32:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Josh Dekker X-Patchwork-Id: 25383 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A27F844A6C2 for ; Thu, 4 Feb 2021 13:33:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8E28168A062; Thu, 4 Feb 2021 13:33:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2BFD689CC9 for ; Thu, 4 Feb 2021 13:33:10 +0200 (EET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E20CA5C0193 for ; Thu, 4 Feb 2021 06:33:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 04 Feb 2021 06:33:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm1; bh= 42xOEXOcaaSbs9uW/pXBas2KRsZFUpa0qS1dlAp9O8U=; b=OAKfksUXSVWqX4lV hmZU1PSFyWg0Ee6mQvjhHBOcGHmxKqxaRe0pum/H0V+WnKhD+Y9AuWdlTkOuAk86 Qqpb88WjL5dNAQqLjtg3UlNZdpOzCpZXlWlhdnfULssaaK0mGhV8Pv9aYtPX8+ig 6LGWTbb2jXEthDvKHH2XdyaOhYf2gIiQpouovuevegHlJJbjT5v6B4wIJgeyVW1s 4jP52XWxPQBjgsXPrw15zrJOq3V+NTc27fz90w+0ZuCedakrz+xiL437NjYJGDi/ wj8R78q/U479sLTNaIFwOhDA/TMOGNcN74RpV255v2VPwPyq0k25QWOA1YIr40VL zCaBKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=42xOEXOcaaSbs9uW/pXBas2KRsZFUpa0qS1dlAp9O 8U=; b=sEnYcnUFX4uCeCtzXmK5SsZgc76n4cpgpiGuYMoBzaueA/eAQO2YEst9v WVwO2Q5Bb6bmNla+khtUJiJ//8RuP/CXcpZTwZABj/d/Ewabw4KkwIIiOfRy+s15 PZcTVMr+OjZQBgaEq36vF7ilyeV565UgXUpL10b9ueIfw4Gq/q7EH0QiIPoUt3Tf /aHiu7eN7Bkc2Vfht0QyoD5apd4VPa93vOprKs715yoJ/WNzlLzNh5oas/1isuJk YedftGHJXDrZWhCt6z0RmvTgssoTrnc1/iu2wvxT7L13WtjS9nEMZQPKdWoTCyXe SAg1B+nmlto680eVSUFgED5eA43GA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgeeggddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfgggtgfesthekre dtredtjeenucfhrhhomheplfhoshhhucffvghkkhgvrhcuoehjohhshhesihhtrghnihhm uhhlrdhliheqnecuggftrfgrthhtvghrnhepjeeikeduvdevleegleejtdetledvtdduje fgteegkeduleeludekudefveehffeinecuffhomhgrihhnpehnvghonhdrshgsnecukfhp peekjedruddvfedrudelvddrudehheenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehjohhshhesihhtrghnihhmuhhlrdhlih X-ME-Proxy: Received: from localhost.localdomain (i577bc09b.versanet.de [87.123.192.155]) by mail.messagingengine.com (Postfix) with ESMTPA id 87CEC1080059 for ; Thu, 4 Feb 2021 06:33:09 -0500 (EST) From: Josh Dekker To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Feb 2021 12:32:58 +0100 Message-Id: <20210204113259.20112-4-josh@itanimul.li> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20210204113259.20112-1-josh@itanimul.li> References: <20210204113259.20112-1-josh@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/4] avcodec/aarch64/hevcdsp: add idct_dc NEON X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Josh Dekker --- libavcodec/aarch64/hevcdsp_idct_neon.S | 54 +++++++++++++++++++++++ libavcodec/aarch64/hevcdsp_init_aarch64.c | 16 +++++++ 2 files changed, 70 insertions(+) diff --git a/libavcodec/aarch64/hevcdsp_idct_neon.S b/libavcodec/aarch64/hevcdsp_idct_neon.S index 329038a958..d3902a9e0f 100644 --- a/libavcodec/aarch64/hevcdsp_idct_neon.S +++ b/libavcodec/aarch64/hevcdsp_idct_neon.S @@ -5,6 +5,7 @@ * * Ported from arm/hevcdsp_idct_neon.S by * Copyright (c) 2020 Reimar Döffinger + * Copyright (c) 2020 Josh Dekker * * This file is part of FFmpeg. * @@ -568,3 +569,56 @@ tr_16x4 secondpass_10, 20 - 10, 512, 1 idct_16x16 8 idct_16x16 10 + +// void ff_hevc_idct_NxN_dc_DEPTH_neon(int16_t *coeffs) +.macro idct_dc size bitdepth +function ff_hevc_idct_\size\()x\size\()_dc_\bitdepth\()_neon, export=1 + ldrsh w1, [x0] + mov w2, #(1 << (13 - \bitdepth)) + add w1, w1, #1 + asr w1, w1, #1 + add w1, w1, w2 + asr w1, w1, #(14 - \bitdepth) + dup v0.8h, w1 + dup v1.8h, w1 +.if \size > 4 + dup v2.8h, w1 + dup v3.8h, w1 +.if \size > 16 /* dc 32x32 */ + mov x2, #4 +1: + subs x2, x2, #1 +.endif + add x12, x0, #64 + mov x13, #128 +.if \size > 8 /* dc 16x16 */ + st1 {v0.8h-v3.8h}, [ x0], x13 + st1 {v0.8h-v3.8h}, [x12], x13 + st1 {v0.8h-v3.8h}, [ x0], x13 + st1 {v0.8h-v3.8h}, [x12], x13 + st1 {v0.8h-v3.8h}, [ x0], x13 + st1 {v0.8h-v3.8h}, [x12], x13 +.endif /* dc 8x8 */ + st1 {v0.8h-v3.8h}, [ x0], x13 + st1 {v0.8h-v3.8h}, [x12], x13 +.if \size > 16 /* dc 32x32 */ + bne 1b +.endif +.else /* dc 4x4 */ + st1 {v0.8h-v1.8h}, [x0] +.endif + ret +endfunc +.endm + +idct_dc 4 8 +idct_dc 4 10 + +idct_dc 8 8 +idct_dc 8 10 + +idct_dc 16 8 +idct_dc 16 10 + +idct_dc 32 8 +idct_dc 32 10 diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c index 4c29daa6d5..fe111bd1ac 100644 --- a/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -45,6 +45,14 @@ void ff_hevc_idct_8x8_8_neon(int16_t *coeffs, int col_limit); void ff_hevc_idct_8x8_10_neon(int16_t *coeffs, int col_limit); void ff_hevc_idct_16x16_8_neon(int16_t *coeffs, int col_limit); void ff_hevc_idct_16x16_10_neon(int16_t *coeffs, int col_limit); +void ff_hevc_idct_4x4_dc_8_neon(int16_t *coeffs); +void ff_hevc_idct_8x8_dc_8_neon(int16_t *coeffs); +void ff_hevc_idct_16x16_dc_8_neon(int16_t *coeffs); +void ff_hevc_idct_32x32_dc_8_neon(int16_t *coeffs); +void ff_hevc_idct_4x4_dc_10_neon(int16_t *coeffs); +void ff_hevc_idct_8x8_dc_10_neon(int16_t *coeffs); +void ff_hevc_idct_16x16_dc_10_neon(int16_t *coeffs); +void ff_hevc_idct_32x32_dc_10_neon(int16_t *coeffs); av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) { @@ -57,6 +65,10 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->add_residual[3] = ff_hevc_add_residual_32x32_8_neon; c->idct[1] = ff_hevc_idct_8x8_8_neon; c->idct[2] = ff_hevc_idct_16x16_8_neon; + c->idct_dc[0] = ff_hevc_idct_4x4_dc_8_neon; + c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_neon; + c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon; + c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon; } if (bit_depth == 10) { c->add_residual[0] = ff_hevc_add_residual_4x4_10_neon; @@ -65,5 +77,9 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->add_residual[3] = ff_hevc_add_residual_32x32_10_neon; c->idct[1] = ff_hevc_idct_8x8_10_neon; c->idct[2] = ff_hevc_idct_16x16_10_neon; + c->idct_dc[0] = ff_hevc_idct_4x4_dc_10_neon; + c->idct_dc[1] = ff_hevc_idct_8x8_dc_10_neon; + c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_neon; + c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_neon; } }