diff --git a/CMakeLists.txt b/CMakeLists.txt index 0296ea5f..ff51c0c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) # change version also in configure.ac -project(gpujpeg VERSION 0.21.0 LANGUAGES C CUDA) +project(gpujpeg VERSION 0.22.0 LANGUAGES C CUDA) # options set(BUILD_OPENGL OFF CACHE STRING "Build with OpenGL support, options are: AUTO ON OFF") diff --git a/NEWS.md b/NEWS.md index 2cfb2060..b1ceac30 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +2024-03-15 - 0.22.0 +---------- +- support for ZLUDA +- updated API - provide more information about the decompressed image in + gpujpeg_decoder_output, namely the image size + 2023-06-02 - 0.21.0 ---------- - support for larger images - until now, only pictures up to approx. 85 MP were diff --git a/configure.ac b/configure.ac index d97ec305..1b196c68 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.65]) # change version also in CMakeLists.txt -AC_INIT([libgpujpeg],[0.21.0],[https://github.com/CESNET/GPUJPEG/issues],[libgpujpeg],[https://github.com/CESNET/GPUJPEG]) +AC_INIT([libgpujpeg],[0.22.0],[https://github.com/CESNET/GPUJPEG/issues],[libgpujpeg],[https://github.com/CESNET/GPUJPEG]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/libgpujpeg/gpujpeg_decoder.h b/libgpujpeg/gpujpeg_decoder.h index 148eb28e..422b3116 100644 --- a/libgpujpeg/gpujpeg_decoder.h +++ b/libgpujpeg/gpujpeg_decoder.h @@ -70,11 +70,8 @@ struct gpujpeg_decoder_output /// Decompressed data size size_t data_size; - /// Decoded color space - enum gpujpeg_color_space color_space; - - /// Decoded pixel format - enum gpujpeg_pixel_format pixel_format; + /// Decoded image parameters + struct gpujpeg_image_parameters param_image; /// OpenGL texture struct gpujpeg_opengl_texture* texture; diff --git a/src/gpujpeg_decoder.c b/src/gpujpeg_decoder.c index d73485e4..4f6dfb28 100644 --- a/src/gpujpeg_decoder.c +++ b/src/gpujpeg_decoder.c @@ -331,8 +331,10 @@ gpujpeg_decoder_decode(struct gpujpeg_decoder* decoder, uint8_t* image, size_t i // Set decompressed image size output->data_size = coder->data_raw_size * sizeof(uint8_t); - output->color_space = decoder->coder.param_image.color_space != GPUJPEG_NONE ? decoder->coder.param_image.color_space : decoder->coder.param.color_space_internal; - output->pixel_format = decoder->coder.param_image.pixel_format; + output->param_image = decoder->coder.param_image; + if (output->param_image.color_space == GPUJPEG_NONE) { + output->param_image.color_space = decoder->coder.param.color_space_internal; + } // Set decompressed image if (output->type == GPUJPEG_DECODER_OUTPUT_INTERNAL_BUFFER) { diff --git a/src/main.c b/src/main.c index 8702c404..81d09541 100644 --- a/src/main.c +++ b/src/main.c @@ -781,12 +781,7 @@ main(int argc, char *argv[]) duration = gpujpeg_get_time(); // Save image - struct gpujpeg_image_parameters decoded_param_image = { 0 }; - struct gpujpeg_parameters decoded_param = { .verbose = param.verbose }; - gpujpeg_decoder_get_image_info(image, image_size, &decoded_param_image, &decoded_param, NULL); - decoded_param_image.color_space = decoder_output.color_space; - decoded_param_image.pixel_format = decoder_output.pixel_format; - if ( gpujpeg_image_save_to_file(output, data, data_size, &decoded_param_image) != 0 ) { + if ( gpujpeg_image_save_to_file(output, data, data_size, &decoder_output.param_image) != 0 ) { fprintf(stderr, "Failed to save image [%s]!\n", output); ret = EXIT_FAILURE; continue; }