Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Tomas Härdin" <git@haerdin.se>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] lavc/speedhqdec: Add AV_CODEC_CAP_SLICE_THREADS
Date: Tue, 14 May 2024 10:20:09 +0200
Message-ID: <3159d925cb848d2d8a31411518bf4f9cf7ffafb3.camel@haerdin.se> (raw)
In-Reply-To: <ce5bb50c2351c52662798f30d5aa601b4d7e002a.camel@haerdin.se>

I forgot to mention it is possible to go even further with ||izing the
decoder by separating VLC decode from IDCT. This would affect serial
performance however, since all coefficients would likely not fit in the
innermost cache. For 4k yuv444p this is 51 MiB. Even 1080p yuv420p is
still 6 MiB. For comparison, at the moment only a single DCT block is
kept, which is just 128 bytes

Another possibility could be to have two threads per slice,
interleaving VLC decode and IDCT, using double buffering on more
modestly sized buffers. Two 16-line buffers per pair of threads or 768
KiB for 4k, 3 MiB across all four thread pairs. But, this would require
mutexes between pairs of threads, which execute2() isn't designed for

A final possibility is to do just enough upfront work to find the bit
boundary between 16-line blocks within each slice. That is, doing VLC
decode but not writing coefficients anywhere. Then each group of 16
lines could be made into its own job since we know the exact start and
end bit for all of them. This would degrade serial performance and
performance with 4/8 threads but probably a win for 4k and up with
large numbers of threads

/Tomas
_______________________________________________
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".

  parent reply	other threads:[~2024-05-14  8:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 15:42 Tomas Härdin
2024-05-13 15:43 ` [FFmpeg-devel] [PATCH 2/2] lavc/speedhqdec: Reindent Tomas Härdin
2024-05-14  8:20 ` Tomas Härdin [this message]
2024-05-30 14:23 ` [FFmpeg-devel] [PATCH 1/2] lavc/speedhqdec: Add AV_CODEC_CAP_SLICE_THREADS Tomas Härdin
2024-06-03 12:54   ` Tomas Härdin

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=3159d925cb848d2d8a31411518bf4f9cf7ffafb3.camel@haerdin.se \
    --to=git@haerdin.se \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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