Skip to content

Commit 6913850

Browse files
committed
vcomp/jpegxs: set enc threading by default
as usual also for other compressions + set the number of threads according to logical core count in vdec (instead of hard-coded 10)
1 parent ae9123a commit 6913850

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/video_compress/jpegxs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
#include "debug.h"
5050
#include "lib_common.h"
51+
#include "utils/misc.h" // for get_cpu_core_count
5152
#include "video.h"
5253
#include "video_compress.h"
5354
#include "utils/video_frame_pool.h"
@@ -131,6 +132,7 @@ state_video_compress_jpegxs::state_video_compress_jpegxs(struct module *parent,
131132

132133
encoder.bpp_numerator = 3;
133134
encoder.verbose = VERBOSE_NONE;
135+
encoder.threads_num = get_cpu_core_count();
134136

135137
if(opts && opts[0] != '\0') {
136138
char *fmt = strdup(opts);

src/video_decompress/jpegxs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
#include "debug.h"
4343
#include "lib_common.h"
44+
#include "utils/misc.h" // for get_cpu_core_count
4445
#include "video.h"
4546
#include "video_decompress.h"
4647
#include "jpegxs/jpegxs_conv.h"
@@ -79,7 +80,7 @@ static void *jpegxs_decompress_init(void) {
7980
static bool configure_with(struct state_decompress_jpegxs *s, unsigned char *bitstream_buffer, size_t codestream_size)
8081
{
8182
s->decoder.verbose = VERBOSE_NONE;
82-
s->decoder.threads_num = 10;
83+
s->decoder.threads_num = get_cpu_core_count();
8384
s->decoder.use_cpu_flags = CPU_FLAGS_ALL;
8485
s->decoder.proxy_mode = proxy_mode_full;
8586

0 commit comments

Comments
 (0)