* [FFmpeg-devel] lavc/libopenjpegdec: Enable slice threading
@ 2022-05-31 9:17 Tomas Härdin
2022-06-01 14:20 ` Tomas Härdin
0 siblings, 1 reply; 2+ messages in thread
From: Tomas Härdin @ 2022-05-31 9:17 UTC (permalink / raw)
To: ffmpeg-devel
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0001-lavc-libopenjpegdec-Enable-slice-threading.patch --]
[-- Type: text/x-patch, Size: 1392 bytes --]
From 230f9e23072d971f184b90a8f108517fc866461f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se>
Date: Tue, 31 May 2022 10:54:08 +0200
Subject: [PATCH] lavc/libopenjpegdec: Enable slice threading
---
libavcodec/libopenjpegdec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 58715b43ee..649aadad42 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -369,6 +369,10 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture,
// Tie decoder with decoding parameters
opj_setup_decoder(dec, &ctx->dec_params);
+ if (avctx->active_thread_type == FF_THREAD_SLICE) {
+ opj_codec_set_threads(dec, avctx->thread_count);
+ }
+
stream = opj_stream_default_create(OPJ_STREAM_READ);
if (!stream) {
@@ -505,7 +509,7 @@ const FFCodec ff_libopenjpeg_decoder = {
.p.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_JPEG2000,
- .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS,
.p.max_lowres = 31,
.p.priv_class = &openjpeg_class,
.p.wrapper_name = "libopenjpeg",
--
2.30.2
[-- Attachment #3: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] lavc/libopenjpegdec: Enable slice threading
2022-05-31 9:17 [FFmpeg-devel] lavc/libopenjpegdec: Enable slice threading Tomas Härdin
@ 2022-06-01 14:20 ` Tomas Härdin
0 siblings, 0 replies; 2+ messages in thread
From: Tomas Härdin @ 2022-06-01 14:20 UTC (permalink / raw)
To: FFmpeg development discussions and patches
I'm working on a new patchset for this and non-strict mode. Slice
threading requires openjpeg >= 2.2.0 while configure only demands
2.1.0.
/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".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-01 14:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31 9:17 [FFmpeg-devel] lavc/libopenjpegdec: Enable slice threading Tomas Härdin
2022-06-01 14:20 ` Tomas Härdin
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