[FFmpeg-cvslog] avcodec/libdav1d: pass auto threads value to libdav1d

James Almer git at videolan.org
Tue Sep 21 04:31:52 EEST 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Sep 20 22:30:35 2021 -0300| [d873b5fffc8292242549c4c026023e370e15c05b] | committer: James Almer

avcodec/libdav1d: pass auto threads value to libdav1d

libdav1d 1.0.0 will be the first version supporting Dav1dSettings.n_threads == 0.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d873b5fffc8292242549c4c026023e370e15c05b
---

 libavcodec/libdav1d.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 4711337f39..e4fdaf7229 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -207,7 +207,11 @@ static av_cold int libdav1d_init(AVCodecContext *c)
 {
     Libdav1dContext *dav1d = c->priv_data;
     Dav1dSettings s;
+#if FF_DAV1D_VERSION_AT_LEAST(6,0)
+    int threads = c->thread_count;
+#else
     int threads = (c->thread_count ? c->thread_count : av_cpu_count()) * 3 / 2;
+#endif
     int res;
 
     av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version());



More information about the ffmpeg-cvslog mailing list