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 140CF49223 for ; Tue, 7 May 2024 07:36:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8DEBD68D720; Tue, 7 May 2024 10:36:43 +0300 (EEST) Received: from out203-205-221-240.mail.qq.com (out203-205-221-240.mail.qq.com [203.205.221.240]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D227568D65B for ; Tue, 7 May 2024 10:36:35 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1715067386; bh=GD/jV8Hd4d9tpw3WfhOBxjIybmIvnSxg/6Cjt/J1eXE=; h=From:To:Cc:Subject:Date; b=GQvpmCYcqXoRNdNeRcl9nW6irg1HK6AIrcb+N4HOy2ua5I1j2w56jrLqnX2cSdAqW 8f4v10lyeyGTxBdy3FlT2G4iI2pA80940B8wfs1EtLCsk7w96EiN1FbqI3082w0b66 547n/v1JhCRv4u2wOaZmxIqtekv2ncaxP4DeAvUE= Received: from localhost.localdomain ([42.56.223.122]) by newxmesmtplogicsvrsza29-0.qq.com (NewEsmtp) with SMTP id 9188D283; Tue, 07 May 2024 15:36:24 +0800 X-QQ-mid: xmsmtpt1715067384tbml8ve5r Message-ID: X-QQ-XMAILINFO: OMxr5LZhXS0MqOA1Db8nIG1EmmA3Tk9j2tauEtt8tZBq8EzkF5e7x6A2NzG5Lp O5gLM3jQ98Y9KKFHCmUkL0Czk0OpUwQf4RAhHfj199/wB8Sil36Dvs9egj0P77OqCt4hMDQEwIlA QTSnh44y8ErpwNqNag1e0fm6R76q3XiiOFxvLDWXP81A1WW0oZlqJfEP3BN7krDij14qW3Jc/C9W 4ExfqIJTsysDusG6RTYsvVb0nEvpVNbF1JTP0AQBRmLxzNK9/ZZPXxS2A4fVGC7IQ8jluWtLOqgf ajlitE9xgJ2H3sjEDrgGBHrmViUIDQ/Rte933u5kChOgc+sLchSDLPPHEH6CwTQ4zXdhZQDuK+2d PEeDMkkPWW6q0EDFn9dWcBHuTl/aOgfZV5NSqiN2XKmXQrIQFt76Hag7nmYgIlYcbXHXxuB87rsP qdlwWetfKT2VTnjKaIQQC82r5Hnq89HkH070LtdDaiX2XtCPNVNkSZjIUBqPV1RB6U1B36iolpTs 1B/lCM4rFTXxYKe3HE8piP+74bhecNzMdnBJoefOfTPwJe6IrYGiq5jC2MOvVh9FGgFUmWEsONi8 QjbxoEDWjVKDb0GGh3iNYtae0Doe2PZQMCdmWm7tajGxtzYZLU7uEeZv3GaKP1cfzCYKTdVo6frD dznyZn65flf8rNRis7u/uxvWodHr0zyPxIY+LHM4SrKGSWQK+9tPwKcUsuB1GQAc32kq/2tLMS+t 2uxwvrIhRRB6Z/6NldvsNKX82yruOQCTIZ3C6Qvw4mHLe/buXtfYTKEBwmvwapahCYEebpYpbRc2 gUfMbua4AoCaC7P/xnqrtPya1fH04KaopgIUSnlR1cCBWQ2PnH7/55NiTU/CV9IFrv11FYi7NHnw HVEhrCTvMBxINsiV4jBN+mIJ7qcckYvw== X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= From: uk7b@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 May 2024 15:36:05 +0800 X-OQ-MSGID: <20240507073613.2871668-1-uk7b@foxmail.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/9] lavc/vp9dsp: R-V ipred vert 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: sunyuechi 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: From: sunyuechi C908: vp9_vert_8x8_8bpp_c: 22.0 vp9_vert_8x8_8bpp_rvi: 15.7 vp9_vert_16x16_8bpp_c: 71.2 vp9_vert_16x16_8bpp_rvi: 39.0 vp9_vert_32x32_8bpp_c: 300.2 vp9_vert_32x32_8bpp_rvi: 135.2 --- libavcodec/riscv/Makefile | 1 + libavcodec/riscv/vp9_intra_rvi.S | 61 ++++++++++++++++++++++++++++++++ libavcodec/riscv/vp9dsp.h | 6 ++++ libavcodec/riscv/vp9dsp_init.c | 15 ++++++-- 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 libavcodec/riscv/vp9_intra_rvi.S diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile index 050c08ee61..65dd0d656a 100644 --- a/libavcodec/riscv/Makefile +++ b/libavcodec/riscv/Makefile @@ -63,6 +63,7 @@ RVV-OBJS-$(CONFIG_VC1DSP) += riscv/vc1dsp_rvv.o OBJS-$(CONFIG_VP8DSP) += riscv/vp8dsp_init.o RVV-OBJS-$(CONFIG_VP8DSP) += riscv/vp8dsp_rvv.o OBJS-$(CONFIG_VP9_DECODER) += riscv/vp9dsp_init.o +RV-OBJS-$(CONFIG_VP9_DECODER) += riscv/vp9_intra_rvi.o RVV-OBJS-$(CONFIG_VP9_DECODER) += riscv/vp9_intra_rvv.o OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_init.o RVV-OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_rvv.o diff --git a/libavcodec/riscv/vp9_intra_rvi.S b/libavcodec/riscv/vp9_intra_rvi.S new file mode 100644 index 0000000000..617f9f55a2 --- /dev/null +++ b/libavcodec/riscv/vp9_intra_rvi.S @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Institue of Software Chinese Academy of Sciences (ISCAS). + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/riscv/asm.S" + +#if __riscv_xlen >= 64 +func ff_v_32x32_rvi + ld t0, (a3) + ld t1, 8(a3) + ld t2, 16(a3) + ld t3, 24(a3) + .rept 32 + sd t0, (a0) + sd t1, 8(a0) + sd t2, 16(a0) + sd t3, 24(a0) + add a0, a0, a1 + .endr + + ret +endfunc + +func ff_v_16x16_rvi + ld t0, (a3) + ld t1, 8(a3) + .rept 16 + sd t0, (a0) + sd t1, 8(a0) + add a0, a0, a1 + .endr + + ret +endfunc + +func ff_v_8x8_rvi + ld t0, (a3) + .rept 8 + sd t0, (a0) + add a0, a0, a1 + .endr + + ret +endfunc +#endif diff --git a/libavcodec/riscv/vp9dsp.h b/libavcodec/riscv/vp9dsp.h index 25047ed507..f8bc6563a5 100644 --- a/libavcodec/riscv/vp9dsp.h +++ b/libavcodec/riscv/vp9dsp.h @@ -60,6 +60,12 @@ void ff_dc_129_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a); void ff_dc_129_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a); +void ff_v_32x32_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, + const uint8_t *a); +void ff_v_16x16_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, + const uint8_t *a); +void ff_v_8x8_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, + const uint8_t *a); #define VP9_8TAP_RISCV_RVV_FUNC(SIZE, type, type_idx) \ void ff_put_8tap_##type##_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \ diff --git a/libavcodec/riscv/vp9dsp_init.c b/libavcodec/riscv/vp9dsp_init.c index 69ab39004c..d249dd71b2 100644 --- a/libavcodec/riscv/vp9dsp_init.c +++ b/libavcodec/riscv/vp9dsp_init.c @@ -24,11 +24,19 @@ #include "libavcodec/vp9dsp.h" #include "vp9dsp.h" -static av_cold void vp9dsp_intrapred_init_rvv(VP9DSPContext *dsp, int bpp) +static av_cold void vp9dsp_intrapred_init_riscv(VP9DSPContext *dsp, int bpp) { - #if HAVE_RVV + #if HAVE_RV int flags = av_get_cpu_flags(); + if (bpp == 8 && flags & AV_CPU_FLAG_RVI) { +# if __riscv_xlen >= 64 + dsp->intra_pred[TX_32X32][VERT_PRED] = ff_v_32x32_rvi; + dsp->intra_pred[TX_16X16][VERT_PRED] = ff_v_16x16_rvi; + dsp->intra_pred[TX_8X8][VERT_PRED] = ff_v_8x8_rvi; +# endif + } + #if HAVE_RVV if (bpp == 8 && flags & AV_CPU_FLAG_RVV_I64 && ff_get_rv_vlenb() >= 16) { dsp->intra_pred[TX_8X8][DC_PRED] = ff_dc_8x8_rvv; dsp->intra_pred[TX_8X8][LEFT_DC_PRED] = ff_dc_left_8x8_rvv; @@ -53,9 +61,10 @@ static av_cold void vp9dsp_intrapred_init_rvv(VP9DSPContext *dsp, int bpp) dsp->intra_pred[TX_16X16][TOP_DC_PRED] = ff_dc_top_16x16_rvv; } #endif + #endif } av_cold void ff_vp9dsp_init_riscv(VP9DSPContext *dsp, int bpp, int bitexact) { - vp9dsp_intrapred_init_rvv(dsp, bpp); + vp9dsp_intrapred_init_riscv(dsp, bpp); } -- 2.45.0 _______________________________________________ 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".