Skip to content

Commit

Permalink
gpujpeg_parameters_chroma_subsampling: allow setting to 0
Browse files Browse the repository at this point in the history
Setting the value to GPUJPEG_SUBSAMPLING_UNKNOWN (== 0) may be useful
eg. if user sets subsampling explicitly but want to revert to implicit
setting for the encoder later.
  • Loading branch information
MartinPulec committed Apr 9, 2024
1 parent 9db18cd commit b2bf09c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
# change version also in configure.ac
project(gpujpeg VERSION 0.25.1 LANGUAGES C CUDA)
project(gpujpeg VERSION 0.25.2 LANGUAGES C CUDA)

# options
set(BUILD_OPENGL OFF CACHE STRING "Build with OpenGL support, options are: AUTO ON OFF")
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2024-04-09 - 0.25.2
----------
- allowed setting subsampling 4:0:0 for color input image
- allowed passing GPUJPEG_SUBSAMPLING_UNKNOWN to
gpujpeg_parameters_chroma_subsampling() to disable explicitly set
subsampling and return to implicit (automatic) one on the encoder

2024-04-05 - 0.25.1
----------
- added gpujpeg_default[_image]_parameters() functions returning the
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ([2.65])
# change version also in CMakeLists.txt
AC_INIT([libgpujpeg],[0.25.1],[https://github.com/CESNET/GPUJPEG/issues],[libgpujpeg],[https://github.com/CESNET/GPUJPEG])
AC_INIT([libgpujpeg],[0.25.2],[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([.])
Expand Down
2 changes: 1 addition & 1 deletion src/gpujpeg_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ gpujpeg_parameters_chroma_subsampling(struct gpujpeg_parameters* param,
}
param->comp_count += 1;
}
GPUJPEG_ASSERT(param->comp_count >= 1 && "Invalid subsampling!");
GPUJPEG_ASSERT((subsampling == GPUJPEG_SUBSAMPLING_UNKNOWN || param->comp_count >= 1) && "Invalid subsampling!");
for ( ; comp < GPUJPEG_MAX_COMPONENT_COUNT; ++comp ) {
param->sampling_factor[comp].horizontal = 0;
param->sampling_factor[comp].vertical = 0;
Expand Down

0 comments on commit b2bf09c

Please sign in to comment.