Skip to content

Commit

Permalink
CI check bitstream md5
Browse files Browse the repository at this point in the history
  • Loading branch information
gugautie committed Jan 22, 2025
1 parent 52062eb commit 0c95f5b
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 144 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ cmake_minimum_required(VERSION 3.22)
include(ExternalProject)

set(uvgVPCCenc_VER 1.0.0)
set(uvgVPCCenc_DESCR "uvgVPCCenc is a Real-Time V-PCC encoder library written in C++.")
set(uvgVPCCenc_DESCR "uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.")
set(uvgVPCCenc_URL "https://github.com/ultravideo/uvgVPCCenc")

set(KVAZAAR_REPO_URL "https://github.com/ultravideo/kvazaar.git")
set(KVAZAAR_REPO_TAGS "bb836ff1422f247b490230e9d429a2d6658cd1a1")

set(KVAZAAR_EP_UPDATE_DISCONNECTED ON)
set(PCCSUM_EP_UPDATE_DISCONNECTED ON)
set(TMC2_EP_UPDATE_DISCONNECTED ON)

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

Expand Down
4 changes: 3 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"CMAKE_BUILD_TYPE":"RelWithDebInfo",
"CMAKE_EXPORT_COMPILE_COMMANDS":true,
"ENABLE_TESTING":false,
"CHECK_PC_MD5": false,
"ENABLE_CI_TESTING":false,
"ENABLE_MY_TESTING":false,
"MY_TEST_PATH": ""
Expand Down Expand Up @@ -52,6 +53,7 @@
"CMAKE_BUILD_TYPE":"RelWithDebInfo",
"BUILD_SHARED_LIBS":false,
"ENABLE_TESTING":true,
"CHECK_PC_MD5": false,
"ENABLE_CI_TESTING":true,
"ENABLE_MY_TESTING":false
}
Expand Down Expand Up @@ -95,7 +97,7 @@
"name":"base-test",
"hidden":true,
"execution":{
"stopOnFailure":true
"stopOnFailure":false
}
},
{
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uvgVPCCenc

uvgVPCCenc is an academic open-source volumetric video encoder for the state of the art Video-based Point-Compression (V-PCC) standard. uvgVPCCenc is being developed in C++ under the BSD-3-Clause license.

The uvgVPCC encoder accepts point cloud frames as input (with geometry being positive integers), supports all voxel sizes, and runs on Linux and macOS. In version 1.0, the focus is on building a functional encoding pipeline using only essential tools and algorithms inspired by the TMC2 reference software. Prioritizing practical encoding, we’ve omitted lossless tools and those adding significant computational complexity such as geometry reconstruction. In the future we plan on developing innovative methods to reduce the massive complexity of the V-PCC encoding process.
The uvgVPCC encoder accepts point cloud frames as input (with geometry being positive integers), supports all voxel sizes, and runs on Linux. In version 1.0, the focus is on building a functional encoding pipeline using only essential tools and algorithms inspired by the TMC2 reference software. Prioritizing practical encoding, we’ve omitted lossless tools and those adding significant computational complexity such as geometry reconstruction. In the future we plan on developing innovative methods to reduce the massive complexity of the V-PCC encoding process.

uvgVPCCenc serves as a research platform for new coding tool development and other encoder research activities as well as provides a high-quality and practical V-PCC encoder for the public to use.

Expand All @@ -26,20 +26,12 @@ On Debian/Ubuntu:
```
sudo apt install cmake ninja
```
On MacOS:
```
brew install cmake ninja
```

To generate the documentation, ```doxygen``` and ```graphviz``` are required.
On Debian/Ubuntu:
```
sudo apt install doxygen graphviz
```
On MacOS:
```
brew install doxygen graphviz
```

### Compile and test uvgVPCCenc
To compile and test the encoder, please use following commands:
Expand Down
8 changes: 4 additions & 4 deletions src/lib/mapEncoding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ add_library(${KVAZAAR_STDIO_LIB} STATIC
# Add kvazaar as an external project fetched from Git
ExternalProject_Add(
kvazaar
PREFIX ${CMAKE_BINARY_DIR}/external
PREFIX ${CMAKE_BINARY_DIR}/external/kvazaar
GIT_REPOSITORY ${KVAZAAR_REPO_URL}
GIT_TAG ${KVAZAAR_REPO_TAGS}
BUILD_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/include/${STDIO_PREFIX}_stdio.h ${CMAKE_BINARY_DIR}/external/src/kvazaar/src/stdio.h
BUILD_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/include/${STDIO_PREFIX}_stdio.h ${CMAKE_BINARY_DIR}/external/kvazaar/src/kvazaar/src/stdio.h
COMMAND ${CMAKE_COMMAND} --build . --target kvazaar
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/include # Create directory for headers
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/src/kvazaar/src/kvazaar.h ${CMAKE_CURRENT_BINARY_DIR}/include/ # Copy main header file
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/src/kvazaar-build/libkvazaar.a ${CMAKE_CURRENT_BINARY_DIR}/ # Copy static library file
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/kvazaar/src/kvazaar/src/kvazaar.h ${CMAKE_CURRENT_BINARY_DIR}/include/ # Copy main header file
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/kvazaar/src/kvazaar-build/libkvazaar.a ${CMAKE_CURRENT_BINARY_DIR}/ # Copy static library file
BUILD_BYPRODUCTS libkvazaar.a
UPDATE_DISCONNECTED ${KVAZAAR_EP_UPDATE_DISCONNECTED}
CMAKE_ARGS
Expand Down
120 changes: 111 additions & 9 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,114 @@
# Add the external utility
if(CHECK_PC_MD5)

ExternalProject_Add(
tmc2
PREFIX ${CMAKE_BINARY_DIR}/external/tmc2
GIT_REPOSITORY https://github.com/MPEGGroup/mpeg-pcc-tmc2/
GIT_TAG release-v24.0
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/tmc2/install
UPDATE_DISCONNECTED ${TMC2_EP_UPDATE_DISCONNECTED}
LOG_DOWNLOAD ON
LOG_UPDATE ON
LOG_PATCH ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
LOG_TEST ON
LOG_MERGED_STDOUTERR ON
LOG_OUTPUT_ON_FAILURE ON
VERBATIM
)

ExternalProject_Add(
pccsum
PREFIX ${CMAKE_BINARY_DIR}/external/pccsum
GIT_REPOSITORY git@gitlab.tuni.fi:cs/ultravideo/pcc/utils/pccsum.git
GIT_TAG main
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/external/pccsum/install
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/pccsum/src/pccsum-build/src/app/appPccsum ${CMAKE_BINARY_DIR}/external/pccsum/install
UPDATE_DISCONNECTED ${PCCSUM_EP_UPDATE_DISCONNECTED}
LOG_DOWNLOAD ON
LOG_UPDATE ON
LOG_PATCH ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
LOG_TEST ON
LOG_MERGED_STDOUTERR ON
LOG_OUTPUT_ON_FAILURE ON
VERBATIM
)
endif()

function(get_ref_md5 ref_file test_name md5_bitstream md5_pc)
file(READ ${ref_file} csv_content)
string(REPLACE "\n" ";" csv_lines ${csv_content}) # Split rows into list

foreach(line IN LISTS csv_lines)
string(REPLACE "," ";" fields ${line})
list(GET fields 0 current_test_name)
if(current_test_name STREQUAL ${test_name})

list(GET fields 1 extracted_md5_bitstream)
list(GET fields 2 extracted_md5_pc)

set(${md5_bitstream} ${extracted_md5_bitstream} PARENT_SCOPE)
set(${md5_pc} ${extracted_md5_pc} PARENT_SCOPE)
return()
endif()
endforeach()
set(${md5_bitstream} "" PARENT_SCOPE)
set(${md5_pc} "" PARENT_SCOPE)
message(WARNING "Test name '${test_name}' not found in ${ref_file}.")
endfunction()

macro(add_test_macro test_name test_input test_nbframe test_startFrame test_nbthread test_nbloop test_uvgvpccencParam test_timeout)
get_ref_md5(${CMAKE_SOURCE_DIR}/tests/ref_md5.csv ${test_name} md5_bitstream md5_pc)

add_test(NAME ${test_name}_encoding
COMMAND uvgVPCCenc
-i ${test_input}
-n ${test_nbframe}
-s ${test_startFrame}
-o ${TEST_OUTPUT_BITSTREAM_DIR}/${test_name}.vpcc
-t ${test_nbthread}
-l ${test_nbloop}
--uvgvpcc ${test_uvgvpccencParam}
)
set_tests_properties(${test_name}_encoding PROPERTIES TIMEOUT ${test_timeout})

if(md5_bitstream STREQUAL "")
message(FATAL_ERROR "Error: ${test_name} md5_bitstream is empty. Cannot proceed with the test.")
endif()

add_test(NAME ${test_name}_md5_bitstream
COMMAND ${CMAKE_COMMAND} -E md5sum ${TEST_OUTPUT_BITSTREAM_DIR}/${test_name}.vpcc
)
set_tests_properties(${test_name}_md5_bitstream
PROPERTIES PASS_REGULAR_EXPRESSION "^${md5_bitstream}"
)
if(CHECK_PC_MD5)
if(md5_pc STREQUAL "")
message(FATAL_ERROR "Error: ${test_name} md5_pc is empty. Cannot proceed with the test.")
endif()
add_test(NAME ${test_name}_decoding
COMMAND echo decode
)
set_tests_properties(${test_name}_encoding PROPERTIES TIMEOUT ${test_timeout})

add_test(NAME ${test_name}_md5_pc
COMMAND echo pccsum
)
set_tests_properties(${test_name}_md5_pc
PROPERTIES PASS_REGULAR_EXPRESSION "^${md5_pc}"
)
endif(CHECK_PC_MD5)

endmacro()



if(ENABLE_CI_TESTING)
include(${CMAKE_SOURCE_DIR}/tests/ci_test.cmake)
endif()
Expand All @@ -17,13 +128,4 @@ if(ENABLE_MY_TESTING)
"Template can be found at ${CMAKE_SOURCE_DIR}/tests/template.cmake."
)
endif()
endif()
# Get the number of tests
get_property(test_count GLOBAL PROPERTY TESTS)

# Check and print the number of tests
if(test_count)
message(STATUS "Number of tests found: ${test_count}")
else()
message(STATUS "No tests found.")
endif()
Loading

0 comments on commit 0c95f5b

Please sign in to comment.