Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
cmake_minimum_required(VERSION 3.25)

set(KVAZAAR_VERSION_MAJOR 2)
set(KVAZAAR_VERSION_MINOR 3)
set(KVAZAAR_VERSION_REVISION 2)

project(kvazaar
LANGUAGES C CXX
HOMEPAGE_URL https://github.com/ultravideo/kvazaar
DESCRIPTION "An open-source HEVC encoder licensed under 3-clause BSD"
VERSION 2.3.2 )
VERSION ${KVAZAAR_VERSION_MAJOR}.${KVAZAAR_VERSION_MINOR}.${KVAZAAR_VERSION_REVISION})

option(BUILD_SHARED_LIBS "Build using shared kvazaar library" ON)

Expand Down Expand Up @@ -91,8 +95,10 @@ if(MSVC)
set(KVZ_COMPILER_VERSION "VS2017")
elseif(MSVC_VERSION LESS 1930)
set(KVZ_COMPILER_VERSION "VS2019")
else()
elseif(MSVC_VERSION LESS 1950)
set(KVZ_COMPILER_VERSION "VS2022")
else()
set(KVZ_COMPILER_VERSION "VS2026")
endif()
endif()

Expand Down Expand Up @@ -201,6 +207,10 @@ else()

endif()

target_compile_definitions(kvazaar PUBLIC KVZ_VERSION_MAJOR=${KVAZAAR_VERSION_MAJOR})
target_compile_definitions(kvazaar PUBLIC KVZ_VERSION_MINOR=${KVAZAAR_VERSION_MINOR})
target_compile_definitions(kvazaar PUBLIC KVZ_VERSION_REVISION=${KVAZAAR_VERSION_REVISION})

target_include_directories(kvazaar PUBLIC src)
target_include_directories(kvazaar PUBLIC src/extras)
target_include_directories(kvazaar PUBLIC src/strategies)
Expand Down Expand Up @@ -249,7 +259,7 @@ else()
if(BUILD_KVAZAAR_BINARY)
set_target_properties(kvazaar-bin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src)
endif()
set_target_properties(kvazaar PROPERTIES SOVERSION "7" VERSION "7.4.0")
set_target_properties(kvazaar PROPERTIES SOVERSION "7" VERSION "7.6.0")
if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2)
set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" )
set_property( SOURCE ${LIB_SOURCES_STRATEGIES_SSE41} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" )
Expand Down
6 changes: 6 additions & 0 deletions build/kvazaar_lib/kvazaar_lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<AdditionalDependencies>
</AdditionalDependencies>
</Lib>
<ClCompile>
<PreprocessorDefinitions>KVZ_VERSION_MAJOR=2;KVZ_VERSION_MINOR=3;KVZ_VERSION_REVISION=2;KVZ_COMPILER_STRING="VS2015";KVZ_COMPILE_DATE="2026-01-20";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Lib>
Expand All @@ -91,6 +94,7 @@
<ClCompile>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<PreprocessorDefinitions>KVZ_VERSION_MAJOR=2;KVZ_VERSION_MINOR=3;KVZ_VERSION_REVISION=2;KVZ_COMPILER_STRING="VS2015";KVZ_COMPILE_DATE="2026-01-20";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -103,6 +107,7 @@
<ClCompile>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<PreprocessorDefinitions>KVZ_VERSION_MAJOR=2;KVZ_VERSION_MINOR=3;KVZ_VERSION_REVISION=2;KVZ_COMPILER_STRING="VS2015";KVZ_COMPILE_DATE="2026-01-20";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -115,6 +120,7 @@
<ClCompile>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<PreprocessorDefinitions>KVZ_VERSION_MAJOR=2;KVZ_VERSION_MINOR=3;KVZ_VERSION_REVISION=2;KVZ_COMPILER_STRING="VS2015";KVZ_COMPILE_DATE="2026-01-20";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
17 changes: 15 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ AC_CONFIG_SRCDIR([src/encmain.c])
#
# Here is a somewhat sane guide to lib versioning: http://apr.apache.org/versioning.html
ver_major=7
ver_minor=5
ver_minor=6
ver_release=0

kvz_pjt_ver_major=2
kvz_pjt_ver_minor=3
kvz_pjt_ver_revision=2

# Prevents configure from adding a lot of defines to the CFLAGS
AC_CONFIG_HEADERS([config.h])

Expand Down Expand Up @@ -75,6 +79,8 @@ AM_CONDITIONAL([HAVE_SSE2], [test x"$flag_sse2" = x"true"])

KVZ_CFLAGS="-Wall -Wextra -Wvla -Wno-sign-compare -Wno-unused-parameter -I$srcdir/src -I$srcdir/src/extras -ftree-vectorize -fvisibility=hidden"
CFLAGS="$KVZ_CFLAGS $CFLAGS"
CFLAGS="-DKVZ_VERSION_MAJOR=$kvz_pjt_ver_major -DKVZ_VERSION_MINOR=$kvz_pjt_ver_minor -DKVZ_VERSION_REVISION=$kvz_pjt_ver_revision $CFLAGS"


AC_SEARCH_LIBS([log], [m c], [], [exit 1])
AC_SEARCH_LIBS([pow], [m c], [], [exit 1])
Expand Down Expand Up @@ -103,7 +109,6 @@ LIBS="$LIBS $cryptopp_LIBS"

CPPFLAGS="-DKVZ_DLL_EXPORTS $CPPFLAGS"


# We need to force AX_PTHREAD to check -pthread -lpthread since otherwise
# it only outputs -pthread for GCC. Without -lpthread GCC does not link the
# shared library against the pthread library (even though it does link the
Expand All @@ -118,6 +123,14 @@ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CC="$PTHREAD_CC"

compiler_name=`basename $CC`
escaped_compiler_name='\"'$compiler_name'\"'
CFLAGS="-DKVZ_COMPILER_STRING=$escaped_compiler_name $CFLAGS"

compile_date=`date -u +"%Y-%m-%d"`
escaped_compile_date='\"'$compile_date'\"'
CFLAGS="-DKVZ_COMPILE_DATE=$escaped_compile_date $CFLAGS"

# --enable-werror
AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [treat warnings as errors [no]])],
[CFLAGS="-Werror $CFLAGS"], []
Expand Down
9 changes: 3 additions & 6 deletions src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,9 @@ void print_usage(void)
void print_version(void)
{
fprintf(stdout,
#ifdef CMAKE_BUILD
"kvazaar " VERSION_STRING " [" KVZ_COMPILER_STRING "] " KVZ_COMPILE_DATE "\n");
#else
"Kvazaar " VERSION_STRING "\n"
"Kvazaar license: 3-clause BSD\n");
#endif
"Kvazaar %s [%s] %s\n"
"Kvazaar license: 3-clause BSD\n",
kvz_get_version_string(), kvz_get_compiler_string(), kvz_get_compile_date_string());
}


Expand Down
36 changes: 36 additions & 0 deletions src/kvazaar.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,39 @@ const kvz_api * kvz_api_get(int bit_depth)
{
return &kvz_8bit_api;
}


const char * kvz_get_version_string()
{
return VERSION_STRING;
}


int kvz_get_version_major()
{
return KVZ_VERSION_MAJOR;
}


int kvz_get_version_minor()
{
return KVZ_VERSION_MINOR;
}


int kvz_get_version_revision()
{
return KVZ_VERSION_REVISION;
}


const char * kvz_get_compiler_string()
{
return KVZ_COMPILER_STRING;
}


const char * kvz_get_compile_date_string()
{
return KVZ_COMPILE_DATE;
}
42 changes: 42 additions & 0 deletions src/kvazaar.h
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,48 @@ typedef struct kvz_api {

KVZ_PUBLIC const kvz_api * kvz_api_get(int bit_depth);


/**
* \brief Return version string
*
* Returns version string in format MAJOR.MINOR.REVISION
*
*/
KVZ_PUBLIC const char * kvz_get_version_string();


/**
* \brief Return major version number
*/
KVZ_PUBLIC int kvz_get_version_major();


/**
* \brief Return minor version number
*/
KVZ_PUBLIC int kvz_get_version_minor();


/**
* \brief Return revision version number
*/
KVZ_PUBLIC int kvz_get_version_revision();


/**
* \brief Return compiler name string
*
*/
KVZ_PUBLIC const char * kvz_get_compiler_string();


/**
* \brief Return compile date string
*
*/
KVZ_PUBLIC const char * kvz_get_compile_date_string();


#ifdef __cplusplus
}
#endif
Expand Down