summaryrefslogtreecommitdiff
path: root/src/codec
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-04-26 15:21:42 -0400
committerAndrew Opalach <andrew@akon.city> 2025-04-26 15:21:42 -0400
commit0935c234495c4945fcfd31e5f28d62218b7794d8 (patch)
tree5ff5ea0fad58a41f1c28258e6d95ba54a7311d90 /src/codec
parentb1985414e54edf1eebe597551a48609ad08c6cfa (diff)
downloadcamu-0935c234495c4945fcfd31e5f28d62218b7794d8.tar.gz
camu-0935c234495c4945fcfd31e5f28d62218b7794d8.tar.bz2
camu-0935c234495c4945fcfd31e5f28d62218b7794d8.zip
Sink performance tweaks, cleanup and add notes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/ffmpeg/decoder.c6
-rw-r--r--src/codec/meson.build4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c
index e22f184..cae56d1 100644
--- a/src/codec/ffmpeg/decoder.c
+++ b/src/codec/ffmpeg/decoder.c
@@ -256,12 +256,14 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend
s32 cpus = 0;
if (av->codec_context->codec_type == AVMEDIA_TYPE_VIDEO) {
cpus = av_cpu_count();
- cpus = MIN(3, MAX(1, cpus / 2));
+ cpus = MIN(4, MAX(1, cpus / 2));
}
if (cpus > 0) {
av->codec_context->thread_count = cpus;
// FF_THREAD_FRAME or FF_THREAD_SLICE.
- av->codec_context->thread_type = FF_THREAD_FRAME;
+ // SLICE seems to work better based on videos that got completely choked
+ // in THREAD_FRAME mode (4k60 hevc, FFMpeg 7.1.1, AMD 3900x).
+ av->codec_context->thread_type = FF_THREAD_SLICE;
log_info("Using %i threads for decoder.", cpus);
}
}
diff --git a/src/codec/meson.build b/src/codec/meson.build
index a739de0..9401b0b 100644
--- a/src/codec/meson.build
+++ b/src/codec/meson.build
@@ -19,9 +19,7 @@ if get_option('codecs').contains('wuffs')
subdir('wuffs')
endif
-if not no_video
- codec_client_deps += [stela]
-endif
+codec_client_deps += [stela]
codecs_server = declare_dependency(sources: codec_src, dependencies: codec_server_deps)
codecs_client = declare_dependency(sources: codec_src, dependencies: codec_client_deps)