UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
kernels.hpp File Reference
#include <cstddef>
Include dependency graph for kernels.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int postprocess_rg48_to_r12l (void *postprocessor, void *img_custom_data, size_t img_custom_data_size, int size_x, int size_y, struct cmpto_j2k_dec_comp_format *comp_formats, int comp_count, void *input_samples, size_t input_samples_size, void *temp_buffer, size_t temp_buffer_size, void *output_buffer, size_t output_buffer_size, void *stream)
 
int preprocess_r12l_to_rg48 (void *preprocessor, void *img_custom_data, size_t img_custom_data_size, int size_x, int size_y, struct cmpto_j2k_enc_comp_format *comp_formats, int comp_count, void *input_samples, size_t input_samples_size, void *output_samples, size_t output_samples_size, void *stream)
 

Detailed Description

Author
Martin Pulec pulec.nosp@m.@ces.nosp@m.net.c.nosp@m.z

Definition in file kernels.hpp.

Function Documentation

◆ postprocess_rg48_to_r12l()

int postprocess_rg48_to_r12l ( void * postprocessor,
void * img_custom_data,
size_t img_custom_data_size,
int size_x,
int size_y,
struct cmpto_j2k_dec_comp_format * comp_formats,
int comp_count,
void * input_samples,
size_t input_samples_size,
void * temp_buffer,
size_t temp_buffer_size,
void * output_buffer,
size_t output_buffer_size,
void * vstream )
See also
cmpto_j2k_dec_postprocessor_run_callback_cuda

Definition at line 261 of file kernels.cu.

276 {
277 cudaStream_t stream = (cudaStream_t) vstream;
278 dim3 threads_per_block(256);
279 dim3 blocks((((size_x + 7) / 8) + 255) / 256, size_y);
280
282
283 if (size_x % 2 == 0) {
285 <<<blocks, threads_per_block, 0, (cudaStream_t) stream>>>(
286 (uint8_t *) input_samples, (uint8_t *) output_buffer,
287 size_x);
288 } else {
289 thread_local bool warn_print;
290 if (!warn_print) {
291 fprintf(stderr,
292 "%s: Odd width %d px will use slower kernel!\n",
293 __func__, size_x);
294 warn_print = true;
295 }
297 <<<blocks, threads_per_block, 0, (cudaStream_t) stream>>>(
298 (uint8_t *) input_samples, (uint8_t *) output_buffer,
299 size_x);
300 }
301
303
304 return cudaGetLastError();
305}
#define cudaGetLastError
static __global__ void kernel_rg48_to_r12l(uint8_t *in, uint8_t *out, unsigned size_x)
Definition kernels.cu:238
#define MEASURE_KERNEL_DURATION_START(stream)
Definition kernels.cu:50
#define MEASURE_KERNEL_DURATION_STOP(stream)
Definition kernels.cu:55

References cudaGetLastError, kernel_rg48_to_r12l(), MEASURE_KERNEL_DURATION_START, and MEASURE_KERNEL_DURATION_STOP.

Here is the call graph for this function:

◆ preprocess_r12l_to_rg48()

int preprocess_r12l_to_rg48 ( void * preprocessor,
void * img_custom_data,
size_t img_custom_data_size,
int size_x,
int size_y,
struct cmpto_j2k_enc_comp_format * comp_formats,
int comp_count,
void * input_samples,
size_t input_samples_size,
void * output_samples,
size_t output_samples_size,
void * stream )

Definition at line 453 of file kernels.cu.

459{
460 (void) preprocessor, (void) img_custom_data,
461 (void) img_custom_data_size, (void) comp_formats, (void) comp_count,
462 (void) input_samples_size, (void) output_samples_size;
463
464 cudaStream_t stream = (cudaStream_t) vstream;
465 dim3 threads_per_block(256);
466 dim3 blocks((((size_x+ 7) / 8) + 255) / 256, size_y);
467
469 if (size_x % 2 == 0) {
471 <<<blocks, threads_per_block, 0, stream>>>(
472 (uint8_t *) input_samples, (uint8_t *) output_samples,
473 size_x);
474 } else {
475 thread_local bool warn_print;
476 if (!warn_print) {
477 fprintf(stderr,
478 "%s: Odd width %d px will use slower kernel!\n",
479 __func__, size_x);
480 warn_print = true;
481 }
483 <<<blocks, threads_per_block, 0, stream>>>(
484 (uint8_t *) input_samples, (uint8_t *) output_samples,
485 size_x);
486 }
488
489 return cudaGetLastError();
490}
static __global__ void kernel_r12l_to_rg48(uint8_t *in, uint8_t *out, unsigned size_x)
Definition kernels.cu:318

References cudaGetLastError, kernel_r12l_to_rg48(), MEASURE_KERNEL_DURATION_START, and MEASURE_KERNEL_DURATION_STOP.

Here is the call graph for this function: