From patchwork Mon Dec 18 15:16:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: flow gg X-Patchwork-Id: 45230 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp7402461pzf; Mon, 18 Dec 2023 07:16:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd5r7tIj5U/8h/jR0Gq/LLtUDN5YxkDuL4ytLI4RpHs8pvHSDIK/jueT8osTBFEtenUBem X-Received: by 2002:a17:907:d384:b0:a1a:541c:561b with SMTP id vh4-20020a170907d38400b00a1a541c561bmr18047272ejc.6.1702912608013; Mon, 18 Dec 2023 07:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702912607; cv=none; d=google.com; s=arc-20160816; b=tyooyFhoWpzUOXWDWActPj4OFebBPs6GBla/nMYKZqklUDpDC1WyXqnVQ8c9ScDpzN fIjnoMvtfbQdiRRM9Gye1M9+owL3manWB1vatplNETSdwcufk5y+z52SwEOZAt9RwePK rk46hbpuNW4ZrVxbc9S24eYYlk1hi85BkfErFNN3L+3sYDSvOsj3FTQPBTFeAKg9cuOb BhiD2nqY2oEV8eUKQ0sAt/eLeHmhVvV0g6cUM6+LnejbhPVRbMG1sNSFZ3IHPZCoH2/H xOlzt5elDjTFY32cQmdwDtrlvhZicnCgLecUp0aHKEFBwS073/BiMcvAstBIqWg+RgBI yrVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=zDyQrxteyyA1y4qwq4C6b58jCMjls9t8JT6JfblrH6M=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=lUK9Ked/4UQ8QGvtRkQiTlM/NHnd/JkkuTZGfPDk0ublmq61b4LtbQAV8iBErIQE3/ flSEHFdsjbO8PejET8vOvjiKcV92qiwfWTIf+6HHsrCetK3pTCzniGBViOR80LQ1H5+t IeTCvOJUS3BL6DujTL1qnDjNkgCK3PI5KknFaUVnY2fpJOEeXYs02Q+TY6xznKxf2T6Q HiwnwcZBD2sraUPDf+tFhkQPIy9wXS7QusLzsBR2hrn+731XZIEmKWO4E/5NLkwQYQI2 GIQW6PqrhsAgLT932ZKkN/g4m6T+JJ/NdSWp8QVRKxWh7drTMjdQZVLwBejuOSdjM8UY SL6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=brWpnQCQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id cd21-20020a170906b35500b00a1d5dd75972si9461873ejb.666.2023.12.18.07.16.47; Mon, 18 Dec 2023 07:16:47 -0800 (PST) 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=@gmail.com header.s=20230601 header.b=brWpnQCQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7BFDB68D2D8; Mon, 18 Dec 2023 17:16:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C3E668D213 for ; Mon, 18 Dec 2023 17:16:39 +0200 (EET) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-67f040e6722so14708916d6.3 for ; Mon, 18 Dec 2023 07:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702912598; x=1703517398; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bWzAkDRHZ7krMtcQeeS11tjjoCqTnRslfrS4oPXg/rQ=; b=brWpnQCQwYYUIbt72Jw/B/StQSO3mKpsQA83YOCjF0jzvSm8VC/iD3bLh2n9bfTCSX fVYDbg+/buIh+dxjCcpz7o1KcByB63czHyN0j0mRNJKp+F24slLTYuxzkUG699g3UvZT 9bAS13DPN7XTEkc/i6GGGfwoSSCHoSCJmG0NDBtvXmJ+IgLTA3pmTK4YRySSmQljRPVH 7f5jLSvfQWIQAMuYZO9ZkXYqQxuD2fE3KIOnmqMOxaLL3oI7kVNKV4zWzN3kCWSdm7CZ ZFkW7xDebFMObLqN5stNZMPrI5Z7jEE4qTkyCM2yHuhkWDA5RnOqcjfM5XQA7cxLYxSv NPIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702912598; x=1703517398; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bWzAkDRHZ7krMtcQeeS11tjjoCqTnRslfrS4oPXg/rQ=; b=CzrZ6TcKqF6NhhJcckbweTi7Lm2CbLC9rAEn4C3A1AIDyQW+vD005f/ycnqS/sYV2+ oWuoWeI8D0fr81xFV5WdxYNuiGrz7i7PyfJ5o4BFs9eK7TnIa5N0GXjbTjoTTkxhXOoX tzQGlcMv+O5ZYlBNu7jhS+4gPhZGNRnzhX9rYoQ2Wm49z/bLyuwLqca3Qr3TMGIcUXFI Tw+0wjoL+y0H+UaGXHbvpGvjY1SB6sw43dUYwrN1CudESmp2farAv5KcQpVmUbw5dv3h Qyu8n3svZ6EZf7AGcE0Bn8z2BaSfDiF9CyWQPbNo3/YBU4FYTSnHrAJR8kClAO1QqmhE +Isg== X-Gm-Message-State: AOJu0YwKHAcWfc6Pq6LHn9UYGvJ+nluuE97Bd3jIrqETKeLCfNFgJiIR sRZVDMFnq2IvkKz6kPuNhp65gmdFi7VigrYUvSxRXgneUEkQV+rc X-Received: by 2002:ad4:5ec8:0:b0:67f:39aa:3de9 with SMTP id jm8-20020ad45ec8000000b0067f39aa3de9mr2250173qvb.88.1702912598038; Mon, 18 Dec 2023 07:16:38 -0800 (PST) MIME-Version: 1.0 From: flow gg Date: Mon, 18 Dec 2023 23:16:27 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH 6/6] lavc/takdsp: R-V V decorrelate_sm 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: s7k7HCU3oYAJ C908: decorrelate_sm_c: 130.0 decorrelate_sm_rvv_i32: 43.7 From 3dc613feaa6c38a7df47a3fc385e2140716e0ae2 Mon Sep 17 00:00:00 2001 From: sunyuechi Date: Mon, 18 Dec 2023 22:53:39 +0800 Subject: [PATCH 6/6] lavc/takdsp: R-V V decorrelate_sm C908: decorrelate_sm_c: 130.0 decorrelate_sm_rvv_i32: 43.7 --- libavcodec/riscv/takdsp_init.c | 2 ++ libavcodec/riscv/takdsp_rvv.S | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libavcodec/riscv/takdsp_init.c b/libavcodec/riscv/takdsp_init.c index 0b4ec18086..85634d6db6 100644 --- a/libavcodec/riscv/takdsp_init.c +++ b/libavcodec/riscv/takdsp_init.c @@ -27,6 +27,7 @@ void ff_decorrelate_ls_rvv(int32_t *p1, int32_t *p2, int length); void ff_decorrelate_sr_rvv(int32_t *p1, int32_t *p2, int length); +void ff_decorrelate_sm_rvv(int32_t *p1, int32_t *p2, int length); av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp) { @@ -36,6 +37,7 @@ av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp) if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { dsp->decorrelate_ls = ff_decorrelate_ls_rvv; dsp->decorrelate_sr = ff_decorrelate_sr_rvv; + dsp->decorrelate_sm = ff_decorrelate_sm_rvv; } #endif } diff --git a/libavcodec/riscv/takdsp_rvv.S b/libavcodec/riscv/takdsp_rvv.S index 65c79e1aa9..816e765039 100644 --- a/libavcodec/riscv/takdsp_rvv.S +++ b/libavcodec/riscv/takdsp_rvv.S @@ -47,3 +47,20 @@ func ff_decorrelate_sr_rvv, zve32x bnez a2, 1b ret endfunc + +func ff_decorrelate_sm_rvv, zve32x +1: + vsetvli t0, a2, e32, m8, ta, ma + vle32.v v0, (a0) + sub a2, a2, t0 + vle32.v v8, (a1) + vsra.vi v16, v8, 1 + vsub.vv v0, v0, v16 + vse32.v v0, (a0) + sh2add a0, t0, a0 + vadd.vv v0, v0, v8 + vse32.v v0, (a1) + sh2add a1, t0, a1 + bnez a2, 1b + ret +endfunc -- 2.43.0