* [FFmpeg-devel] [PATCH 2/2] avcodec/vvc: Don't create new thread when thread_count is 1
[not found] <20240624044744.52915-1-quinkblack@foxmail.com>
@ 2024-06-24 4:47 ` Zhao Zhili
0 siblings, 0 replies; 2+ messages in thread
From: Zhao Zhili @ 2024-06-24 4:47 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Make its behavior consistent with other decoders, e.g., H.264/H.265.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/vvc/dec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index f5603306f3..4ce2b1c6bd 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -1024,7 +1024,7 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx)
static AVOnce init_static_once = AV_ONCE_INIT;
const int cpu_count = av_cpu_count();
const int delayed = FFMIN(cpu_count, VVC_MAX_DELAYED_FRAMES);
- const int thread_count = avctx->thread_count ? avctx->thread_count : delayed;
+ int thread_count = avctx->thread_count ? avctx->thread_count : delayed;
int ret;
s->avctx = avctx;
@@ -1051,6 +1051,8 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx)
return ret;
}
+ if (thread_count == 1)
+ thread_count = 0;
s->executor = ff_vvc_executor_alloc(s, thread_count);
if (!s->executor)
return AVERROR(ENOMEM);
--
2.42.0
_______________________________________________
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
* [FFmpeg-devel] [PATCH 2/2] avcodec/vvc: Don't create new thread when thread_count is 1
[not found] <20240617051927.249039-1-quinkblack@foxmail.com>
@ 2024-06-17 5:19 ` Zhao Zhili
0 siblings, 0 replies; 2+ messages in thread
From: Zhao Zhili @ 2024-06-17 5:19 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/vvc/dec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index f5603306f3..4ce2b1c6bd 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -1024,7 +1024,7 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx)
static AVOnce init_static_once = AV_ONCE_INIT;
const int cpu_count = av_cpu_count();
const int delayed = FFMIN(cpu_count, VVC_MAX_DELAYED_FRAMES);
- const int thread_count = avctx->thread_count ? avctx->thread_count : delayed;
+ int thread_count = avctx->thread_count ? avctx->thread_count : delayed;
int ret;
s->avctx = avctx;
@@ -1051,6 +1051,8 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx)
return ret;
}
+ if (thread_count == 1)
+ thread_count = 0;
s->executor = ff_vvc_executor_alloc(s, thread_count);
if (!s->executor)
return AVERROR(ENOMEM);
--
2.25.1
_______________________________________________
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:[~2024-06-24 4:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20240624044744.52915-1-quinkblack@foxmail.com>
2024-06-24 4:47 ` [FFmpeg-devel] [PATCH 2/2] avcodec/vvc: Don't create new thread when thread_count is 1 Zhao Zhili
[not found] <20240617051927.249039-1-quinkblack@foxmail.com>
2024-06-17 5:19 ` Zhao Zhili
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