Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS
@ 2024-05-08 12:42 Tomas Härdin
  2024-05-08 12:42 ` [FFmpeg-devel] [PATCH 2/3] lavc/speedhqdec: Obey AVDISCARD_ALL Tomas Härdin
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tomas Härdin @ 2024-05-08 12:42 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

Hi

On a 36-core machine (Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz)
with a 7 minute 125 Mbit/s 1080p sample and -thread_type frame -threads
36 this brings CPU utilization from 117% to 3174%, 58x realtime

Without -threads 36 the utilization is only 1601% due to it being 16 by
default..

/Tomas

[-- Attachment #2: 0001-lavc-speedhqdec-Add-AV_CODEC_CAP_FRAME_THREADS.patch --]
[-- Type: text/x-patch, Size: 1327 bytes --]

From d1a7f33a1c394142b6dc14d4e8392ad786f8ba52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se>
Date: Wed, 8 May 2024 14:17:18 +0200
Subject: [PATCH 1/3] lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS

---
 libavcodec/speedhqdec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c
index d3605b0649..e54e25cb25 100644
--- a/libavcodec/speedhqdec.c
+++ b/libavcodec/speedhqdec.c
@@ -40,6 +40,7 @@
 #include "mpeg12data.h"
 #include "mpeg12vlc.h"
 #include "speedhq.h"
+#include "thread.h"
 
 #define MAX_INDEX (64 - 1)
 
@@ -433,7 +434,7 @@ static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     avctx->coded_width = FFALIGN(avctx->width, 16);
     avctx->coded_height = FFALIGN(avctx->height, 16);
 
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
+    if ((ret = ff_thread_get_buffer(avctx, frame, 0)) < 0) {
         return ret;
     }
     frame->flags |= AV_FRAME_FLAG_KEY;
@@ -649,5 +650,5 @@ const FFCodec ff_speedhq_decoder = {
     .priv_data_size = sizeof(SHQContext),
     .init           = speedhq_decode_init,
     FF_CODEC_DECODE_CB(speedhq_decode_frame),
-    .p.capabilities = AV_CODEC_CAP_DR1,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
 };
-- 
2.39.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] 11+ messages in thread

end of thread, other threads:[~2024-05-13  6:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 12:42 [FFmpeg-devel] [PATCH 1/3] lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS Tomas Härdin
2024-05-08 12:42 ` [FFmpeg-devel] [PATCH 2/3] lavc/speedhqdec: Obey AVDISCARD_ALL Tomas Härdin
2024-05-08 12:43 ` [FFmpeg-devel] [PATCH 3/3] lavc/speedhqdec: Set AV_PICTURE_TYPE_I Tomas Härdin
2024-05-08 20:01   ` Marton Balint
2024-05-08 20:06     ` James Almer
2024-05-10 12:31       ` Tomas Härdin
2024-05-10 12:48         ` Andreas Rheinhardt
2024-05-11 23:07           ` Tomas Härdin
2024-05-13  6:57             ` Tomas Härdin
2024-05-08 12:46 ` [FFmpeg-devel] [PATCH 1/3] lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS James Almer
2024-05-08 12:48   ` 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