Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: flow gg <hlefthleft@gmail.com>
To: "Rémi Denis-Courmont" <remi@remlab.net>,
	"FFmpeg development discussions and patches"
	<ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/7] lavc/me_cmp: R-V V pix_abs
Date: Wed, 7 Feb 2024 08:01:23 +0800
Message-ID: <CAEa-L+t6XBARAurv1jmPjBrk4iOPaij9A=brr9F4x007Xb_+Mg@mail.gmail.com> (raw)
In-Reply-To: <16107440.OcfgGqBmcW@basile.remlab.net>

I think in most cases it is like this, but specifically for this function,
using Reduction only once would be slower.

The currently submitted version roughly takes:
pix_abs_0_0_rvv_i32: 136.2

The version that uses Reduction only once takes:
pix_abs_0_0_rvv_i32: 169.2

Here is the implementation of the version that uses it only once:

func ff_pix_abs16_temp_rvv, zve32x
        vsetivli        zero, 16, e32, m4, ta, ma
        vmv.v.i         v24, 0
        vmv.s.x         v0, zero
1:
        vsetvli         zero, zero, e8, m1, tu, ma
        vle8.v          v4, (a1)
        vle8.v          v12, (a2)
        addi            a4, a4, -1
        vwsubu.vv       v16, v4, v12
        add             a1, a1, a3
        vwsubu.vv       v20, v12, v4
        vsetvli         zero, zero, e16, m2, tu, ma
        vmax.vv         v16, v16, v20
        add             a2, a2, a3
        vwadd.wv        v24, v24, v16
        bnez            a4, 1b

        vsetvli         zero, zero, e32, m4, ta, ma
        vwredsumu.vs    v0, v24, v0
        vmv.x.s         a0, v0
        ret
endfunc

Rémi Denis-Courmont <remi@remlab.net> 于2024年2月7日周三 00:58写道:

> Hi,
>
> To sum a vector, you should only reduce once at the end of the function,
> c.f.
> how it's done in existing scalar products. Reduction instructions are
> (intrinsically) slow.
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
>
>
>
_______________________________________________
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".

  reply	other threads:[~2024-02-07  0:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 15:55 flow gg
2024-02-06 16:58 ` Rémi Denis-Courmont
2024-02-07  0:01   ` flow gg [this message]
2024-02-08 19:41     ` Rémi Denis-Courmont
2024-02-08 22:39       ` flow gg
2024-02-09 10:32         ` Rémi Denis-Courmont
2024-02-09 15:34           ` flow gg
2024-02-10  9:14             ` Rémi Denis-Courmont
2024-02-10  9:15               ` Rémi Denis-Courmont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEa-L+t6XBARAurv1jmPjBrk4iOPaij9A=brr9F4x007Xb_+Mg@mail.gmail.com' \
    --to=hlefthleft@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=remi@remlab.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git