[cleanup] Change the interface function names and some other kvazaar mentions to uvg266

This commit is contained in:
Marko Viitanen 2022-04-28 22:01:02 +03:00
parent b21e745ae6
commit 61642deb82
10 changed files with 43 additions and 128 deletions

View file

@ -71,7 +71,7 @@ jobs:
runs-on: self-hosted runs-on: self-hosted
env: env:
KVAZAAR_OVERRIDE_angular_pred: generic UVG266_OVERRIDE_angular_pred: generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View file

@ -87,7 +87,7 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'safe to test') if: contains(github.event.pull_request.labels.*.name, 'safe to test')
env: env:
KVAZAAR_OVERRIDE_angular_pred: generic UVG266_OVERRIDE_angular_pred: generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

4
.gitignore vendored
View file

@ -1,8 +1,8 @@
# Build files # Build files
/bin /bin
/build/* /build/*
!/build/kvazaar_lib !/build/uvg266_lib
/build/kvazaar_lib/* /build/uvg266_lib/*
!/build/uvg266_lib/uvg266_lib.vcxproj !/build/uvg266_lib/uvg266_lib.vcxproj
!/build/uvg266_lib/uvg266_lib.vcxproj.filters !/build/uvg266_lib/uvg266_lib.vcxproj.filters
/scons_build_* /scons_build_*

View file

@ -89,7 +89,7 @@ set_target_properties(uvg266-bin PROPERTIES RUNTIME_OUTPUT_NAME uvg266)
target_link_libraries(uvg266-bin PUBLIC uvg266) target_link_libraries(uvg266-bin PUBLIC uvg266)
if(MSVC) if(MSVC)
target_include_directories(uvg266-bin PUBLIC src/threadwrapper/include) target_include_directories(uvg266 PUBLIC src/threadwrapper/include)
set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" ) set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" )
else() else()
set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" ) set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" )
@ -133,16 +133,14 @@ add_custom_target(dist
) )
# TESTS # TESTS
enable_testing()
if(EXISTS "${PROJECT_SOURCE_DIR}/greatest/greatest.h") if(EXISTS "${PROJECT_SOURCE_DIR}/greatest/greatest.h")
add_subdirectory( "tests/" ) add_subdirectory( "tests/" )
add_test( NAME Test_uvg266 COMMAND uvg266_tests ) add_test( NAME Test_uvg266 COMMAND uvg266_tests )
endif() endif()
if(NOT DEFINED MSVC) if(NOT DEFINED MSVC)
add_custom_target( add_test( NAME external_symbols COMMAND ${PROJECT_SOURCE_DIR}/tests/test_external_symbols.sh)
check
COMMAND ${PROJECT_SOURCE_DIR}/tests/test_external_symbols.sh
COMMENT "Building and running test..."
VERBATIM
)
endif() endif()

View file

@ -1,83 +0,0 @@
# Email the author if their commit either failed to build or fixed a failed build
# good -> bad, bad -> bad, bad -> good but not good -> good
notifications:
- provider: Email
to:
- '{{commitAuthorEmail}}'
on_build_success: false
on_build_failure: true
on_build_status_changed: true
# Skip commits that don't affect the code / compiling the code
skip_commits:
files:
- .gitignore
- .gitlab-ci.yml
- .travis-install.bash
- .travis.yml
- LICENSE
- CREDITS
- README.md
- docs.doxy
# Download only a zip file of the latest commit
# Downloading the whole history of the repository would be unnecessary
shallow_clone: true
# Only try building the app, don't run any tests
test: off
# Don't bother with debug builds
configuration:
- Release
# Build with multiple compilers / build suites
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
platform: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
platform: x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
MSYSTEM: MINGW32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
MSYSTEM: MINGW64
for:
-
# MinGW builds need all kinds of build scripts
matrix:
only:
- MSYSTEM: MINGW32
- MSYSTEM: MINGW64
install:
# Update core packages
- C:\msys64\usr\bin\pacman -Syyuu --noconfirm --noprogressbar
# Update non-core packages
- C:\msys64\usr\bin\pacman -Suu --noconfirm --noprogressbar
# Install required MSYS2 packages
- C:\msys64\usr\bin\pacman -S --noconfirm --noprogressbar --needed automake-wrapper make
# Now MSYS2 is up to date, do the rest of the install from a bash script
- C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./tools/appveyor-install.sh"
build_script:
- C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./tools/appveyor-build.sh"
cache:
- C:\msys64\var\cache\pacman\pkg
-
# MSVC builds only need vsyasm and the solution file
matrix:
except:
- MSYSTEM: MINGW32
- MSYSTEM: MINGW64
install:
- ps: $url = "http://ultravideo.cs.tut.fi/vsyasm.exe"
- ps: $output = "C:\Tools\vsyasm.exe"
- ps: "(New-Object System.Net.WebClient).DownloadFile($url, $output)"
- ps: '$env:Path += ";$output\.."'
build:
project: .\build\kvazaar_VS2015.sln

View file

@ -286,8 +286,8 @@ static void* strategyselector_choose_for(const strategy_list_t * const strategie
// Because VS doesn't support snprintf, let's assert that there is // Because VS doesn't support snprintf, let's assert that there is
// enough room in the buffer. Max length for strategy type is // enough room in the buffer. Max length for strategy type is
// buffersize (256) - prefix including terminating zero. // buffersize (256) - prefix including terminating zero.
assert(strlen(strategy_type) < 256 - sizeof("KVAZAAR_OVERRIDE_") ); assert(strlen(strategy_type) < 256 - sizeof("UVG266_OVERRIDE_") );
sprintf(buffer, "KVAZAAR_OVERRIDE_%s", strategy_type); sprintf(buffer, "UVG266_OVERRIDE_%s", strategy_type);
override = getenv(buffer); override = getenv(buffer);

View file

@ -53,7 +53,7 @@
#include "rate_control.h" #include "rate_control.h"
static void kvazaar_close(uvg_encoder *encoder) static void uvg266_close(uvg_encoder *encoder)
{ {
if (encoder) { if (encoder) {
// The threadqueue must be stopped before freeing states. // The threadqueue must be stopped before freeing states.
@ -87,7 +87,7 @@ static void kvazaar_close(uvg_encoder *encoder)
} }
static uvg_encoder * kvazaar_open(const uvg_config *cfg) static uvg_encoder * uvg266_open(const uvg_config *cfg)
{ {
uvg_encoder *encoder = NULL; uvg_encoder *encoder = NULL;
@ -95,17 +95,17 @@ static uvg_encoder * kvazaar_open(const uvg_config *cfg)
// TODO: Make strategies non-global // TODO: Make strategies non-global
if (!uvg_strategyselector_init(cfg->cpuid, UVG_BIT_DEPTH)) { if (!uvg_strategyselector_init(cfg->cpuid, UVG_BIT_DEPTH)) {
fprintf(stderr, "Failed to initialize strategies.\n"); fprintf(stderr, "Failed to initialize strategies.\n");
goto kvazaar_open_failure; goto uvg266_open_failure;
} }
encoder = calloc(1, sizeof(uvg_encoder)); encoder = calloc(1, sizeof(uvg_encoder));
if (!encoder) { if (!encoder) {
goto kvazaar_open_failure; goto uvg266_open_failure;
} }
encoder->control = uvg_encoder_control_init(cfg); encoder->control = uvg_encoder_control_init(cfg);
if (!encoder->control) { if (!encoder->control) {
goto kvazaar_open_failure; goto uvg266_open_failure;
} }
encoder->num_encoder_states = encoder->control->cfg.owf + 1; encoder->num_encoder_states = encoder->control->cfg.owf + 1;
@ -116,20 +116,20 @@ static uvg_encoder * kvazaar_open(const uvg_config *cfg)
// Assure that the rc data allocation was successful // Assure that the rc data allocation was successful
if(!uvg_get_rc_data(encoder->control)) { if(!uvg_get_rc_data(encoder->control)) {
goto kvazaar_open_failure; goto uvg266_open_failure;
} }
uvg_init_input_frame_buffer(&encoder->input_buffer); uvg_init_input_frame_buffer(&encoder->input_buffer);
encoder->states = calloc(encoder->num_encoder_states, sizeof(encoder_state_t)); encoder->states = calloc(encoder->num_encoder_states, sizeof(encoder_state_t));
if (!encoder->states) { if (!encoder->states) {
goto kvazaar_open_failure; goto uvg266_open_failure;
} }
for (unsigned i = 0; i < encoder->num_encoder_states; ++i) { for (unsigned i = 0; i < encoder->num_encoder_states; ++i) {
encoder->states[i].encoder_control = encoder->control; encoder->states[i].encoder_control = encoder->control;
if (!uvg_encoder_state_init(&encoder->states[i], NULL)) { if (!uvg_encoder_state_init(&encoder->states[i], NULL)) {
goto kvazaar_open_failure; goto uvg266_open_failure;
} }
encoder->states[i].frame->QP = (int8_t)cfg->qp; encoder->states[i].frame->QP = (int8_t)cfg->qp;
@ -148,8 +148,8 @@ static uvg_encoder * kvazaar_open(const uvg_config *cfg)
return encoder; return encoder;
kvazaar_open_failure: uvg266_open_failure:
kvazaar_close(encoder); uvg266_close(encoder);
return NULL; return NULL;
} }
@ -177,7 +177,7 @@ static void set_frame_info(uvg_frame_info *const info, const encoder_state_t *co
} }
static int kvazaar_headers(uvg_encoder *enc, static int uvg266_headers(uvg_encoder *enc,
uvg_data_chunk **data_out, uvg_data_chunk **data_out,
uint32_t *len_out) uint32_t *len_out)
{ {
@ -241,7 +241,7 @@ static int yuv_io_extract_field(const uvg_picture *frame_in, unsigned source_sca
} }
static int kvazaar_encode(uvg_encoder *enc, static int uvg266_encode(uvg_encoder *enc,
uvg_picture *pic_in, uvg_picture *pic_in,
uvg_data_chunk **data_out, uvg_data_chunk **data_out,
uint32_t *len_out, uint32_t *len_out,
@ -314,7 +314,7 @@ static int kvazaar_encode(uvg_encoder *enc,
} }
static int kvazaar_field_encoding_adapter(uvg_encoder *enc, static int uvg266_field_encoding_adapter(uvg_encoder *enc,
uvg_picture *pic_in, uvg_picture *pic_in,
uvg_data_chunk **data_out, uvg_data_chunk **data_out,
uint32_t *len_out, uint32_t *len_out,
@ -324,7 +324,7 @@ static int kvazaar_field_encoding_adapter(uvg_encoder *enc,
{ {
if (enc->control->cfg.source_scan_type == UVG_INTERLACING_NONE) { if (enc->control->cfg.source_scan_type == UVG_INTERLACING_NONE) {
// For progressive, simply call the normal encoding function. // For progressive, simply call the normal encoding function.
return kvazaar_encode(enc, pic_in, data_out, len_out, pic_out, src_out, info_out); return uvg266_encode(enc, pic_in, data_out, len_out, pic_out, src_out, info_out);
} }
// For interlaced, make two fields out of the input frame and call encode on them separately. // For interlaced, make two fields out of the input frame and call encode on them separately.
@ -338,11 +338,11 @@ static int kvazaar_field_encoding_adapter(uvg_encoder *enc,
if (pic_in != NULL) { if (pic_in != NULL) {
first_field = uvg_image_alloc(state->encoder_control->chroma_format, state->encoder_control->in.width, state->encoder_control->in.height); first_field = uvg_image_alloc(state->encoder_control->chroma_format, state->encoder_control->in.width, state->encoder_control->in.height);
if (first_field == NULL) { if (first_field == NULL) {
goto kvazaar_field_encoding_adapter_failure; goto uvg266_field_encoding_adapter_failure;
} }
second_field = uvg_image_alloc(state->encoder_control->chroma_format, state->encoder_control->in.width, state->encoder_control->in.height); second_field = uvg_image_alloc(state->encoder_control->chroma_format, state->encoder_control->in.width, state->encoder_control->in.height);
if (second_field == NULL) { if (second_field == NULL) {
goto kvazaar_field_encoding_adapter_failure; goto uvg266_field_encoding_adapter_failure;
} }
yuv_io_extract_field(pic_in, pic_in->interlacing, 0, first_field); yuv_io_extract_field(pic_in, pic_in->interlacing, 0, first_field);
@ -358,11 +358,11 @@ static int kvazaar_field_encoding_adapter(uvg_encoder *enc,
second_field->interlacing = pic_in->interlacing; second_field->interlacing = pic_in->interlacing;
} }
if (!kvazaar_encode(enc, first_field, &first.data_out, &first.len_out, pic_out, NULL, info_out)) { if (!uvg266_encode(enc, first_field, &first.data_out, &first.len_out, pic_out, NULL, info_out)) {
goto kvazaar_field_encoding_adapter_failure; goto uvg266_field_encoding_adapter_failure;
} }
if (!kvazaar_encode(enc, second_field, &second.data_out, &second.len_out, NULL, NULL, NULL)) { if (!uvg266_encode(enc, second_field, &second.data_out, &second.len_out, NULL, NULL, NULL)) {
goto kvazaar_field_encoding_adapter_failure; goto uvg266_field_encoding_adapter_failure;
} }
uvg_image_free(first_field); uvg_image_free(first_field);
@ -389,7 +389,7 @@ static int kvazaar_field_encoding_adapter(uvg_encoder *enc,
return 1; return 1;
kvazaar_field_encoding_adapter_failure: uvg266_field_encoding_adapter_failure:
uvg_image_free(first_field); uvg_image_free(first_field);
uvg_image_free(second_field); uvg_image_free(second_field);
uvg_bitstream_free_chunks(first.data_out); uvg_bitstream_free_chunks(first.data_out);
@ -409,10 +409,10 @@ static const uvg_api uvg_8bit_api = {
.chunk_free = uvg_bitstream_free_chunks, .chunk_free = uvg_bitstream_free_chunks,
.encoder_open = kvazaar_open, .encoder_open = uvg266_open,
.encoder_close = kvazaar_close, .encoder_close = uvg266_close,
.encoder_headers = kvazaar_headers, .encoder_headers = uvg266_headers,
.encoder_encode = kvazaar_field_encoding_adapter, .encoder_encode = uvg266_field_encoding_adapter,
.picture_alloc_csp = uvg_image_alloc, .picture_alloc_csp = uvg_image_alloc,
}; };

View file

@ -1,5 +1,5 @@
#ifndef KVAZAAR_H_ #ifndef UVG266_H_
#define KVAZAAR_H_ #define UVG266_H_
/***************************************************************************** /*****************************************************************************
* This file is part of uvg266 VVC encoder. * This file is part of uvg266 VVC encoder.
* *
@ -834,4 +834,4 @@ UVG_PUBLIC const uvg_api * uvg_api_get(int bit_depth);
} }
#endif #endif
#endif // KVAZAAR_H_ #endif // UVG266_H_

View file

@ -1,5 +1,5 @@
#ifndef KVAZAAR_INTERNAL_H_ #ifndef UVG266_INTERNAL_H_
#define KVAZAAR_INTERNAL_H_ #define UVG266_INTERNAL_H_
/***************************************************************************** /*****************************************************************************
* This file is part of uvg266 VVC encoder. * This file is part of uvg266 VVC encoder.
* *
@ -75,4 +75,4 @@ struct uvg_encoder {
unsigned frames_done; unsigned frames_done;
}; };
#endif // KVAZAAR_INTERNAL_H_ #endif // UVG266_INTERNAL_H_

View file

@ -4,7 +4,7 @@
set -eu${BASH+o pipefail} set -eu${BASH+o pipefail}
if nm -go --defined-only ../src/.libs/libuvg266.a | grep -v ' uvg_'; then if nm -go --defined-only ../lib/libuvg266.a | grep -v ' uvg_'; then
printf '%s\n' 'Only symbols prefixed with "uvg_" should be exported from libuvg266.' printf '%s\n' 'Only symbols prefixed with "uvg_" should be exported from libuvg266.'
false false
fi fi