Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Thilo Schunck via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Cc: Thilo Schunck <Thilo.Schunck@apartis.com>
Subject: [FFmpeg-devel] [RFC] performance tuning, memcpy
Date: Wed, 5 Nov 2025 07:48:48 +0000
Message-ID: <AS8PR05MB8741D752AC0AFA4C226655E8EAC5A@AS8PR05MB8741.eurprd05.prod.outlook.com> (raw)

Hi Team!

Apologies for maybe breaking submit rules but as of now I don't know better :-)

I figured out on arm "hwdownload" is quite slow.
I turns out this is caused by imgutils.c image_copy_plane which does a memcpy loop

     for (;height > 0; height--) {

        memcpy(dst, src, bytewidth);

        dst += dst_linesize;
        src += src_linesize;
    }

As a POC, quick'n dirty I create 4 threads and split the copy. In my case this improved fps from about ~26 to 51

./ffmpeg -hide_banner -hwaccel v4l2request -hwaccel_output_format drm_prime \
 -threads 4 \
 -i ../Big_Buck_Bunny_720_10s_10MB.mp4 \
 -filter_complex "[0:v]hwdownload,format=nv12[myOut]" -map "[myOut]"  \
 -f null -

Maybe someone is interested in this improvement with cleaned code. 
My PoC uses hard coded 4 threads which is for sure bad ...

Btw. This may apply to other locations as well.


Also, but specific for arm there is a tuned memcpy replacement:
https://github.com/simonjhall/copies-and-fills/
which also speeds up ffmpeg (and of course everything else).


 Best from Germany
     Thilo

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

             reply	other threads:[~2025-11-10 14:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  7:48 Thilo Schunck via ffmpeg-devel [this message]
2025-11-11  0:17 ` [FFmpeg-devel] " Niklas Haas via ffmpeg-devel

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=AS8PR05MB8741D752AC0AFA4C226655E8EAC5A@AS8PR05MB8741.eurprd05.prod.outlook.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=Thilo.Schunck@apartis.com \
    /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