From 3aa91f67ada015403135bbd987c39e313cf57386 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 8 Oct 2024 12:25:15 +0200 Subject: [PATCH] vcomp,vdec/gpujpeg: toggle on profiling in debug If log_level >= LOG_LEVEL_DEBUG, set the perf_stats option, which with current GPUJPEG prints the performance stats to stdout. --- src/video_compress/gpujpeg.cpp | 1 + src/video_decompress/gpujpeg.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/video_compress/gpujpeg.cpp b/src/video_compress/gpujpeg.cpp index 70d4f92f4..486dfc524 100644 --- a/src/video_compress/gpujpeg.cpp +++ b/src/video_compress/gpujpeg.cpp @@ -278,6 +278,7 @@ bool encoder_state::configure_with(struct video_desc desc) } m_encoder_param.verbose = max(0, log_level - LOG_LEVEL_INFO); + m_encoder_param.perf_stats = log_level >= LOG_LEVEL_DEBUG ? 1 : 0; m_encoder_param.segment_info = 1; gpujpeg_sampling_factor_t subsampling = m_parent_state->m_subsampling; #if !defined NEW_PARAM_IMG_NO_COMP_COUNT diff --git a/src/video_decompress/gpujpeg.c b/src/video_decompress/gpujpeg.c index 35775d583..083f112cc 100644 --- a/src/video_decompress/gpujpeg.c +++ b/src/video_decompress/gpujpeg.c @@ -86,6 +86,7 @@ static int configure_with(struct state_decompress_gpujpeg *s, struct video_desc gpujpeg_set_default_parameters(¶m); param.color_space_internal = GPUJPEG_YCBCR_BT709; // see comment bellow param.verbose = MAX(0, log_level - LOG_LEVEL_INFO); + param.perf_stats = log_level >= LOG_LEVEL_DEBUG ? 1 : 0; struct gpujpeg_image_parameters param_image; gpujpeg_image_set_default_parameters(¶m_image); param_image.width = desc.width; // size must be non-zero in order the init to succeed