Commit 2eaf90f0 authored by vaillancour's avatar vaillancour
Browse files

update to latest main

parents f33b685c 43ca007c
Loading
Loading
Loading
Loading
Loading

.gitattributes

0 → 100644
+24 −0
Original line number Diff line number Diff line
# Default behavior. Converts all text files to use LF in repository.
* text=auto

# List all known generic text files
*.c text
*.csv text
*.h text
*.json text
*.m text
*.md text
*.prm text
*.py text
*.txt text

# Set Windows specific text files to always use CRLF in working tree.
*.bat text eol=crlf
*.cmd text eol=crlf
*.sln text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf

# Set Unix specific text files to always use LF (also covers Windows subsystem for Linux) in working tree
*.sh text eol=lf

.gitignore

0 → 100644
+86 −0
Original line number Diff line number Diff line
# .gitignore for IVAS public collaboration Git repository

# Compiler output Unix
IVAS_cod
IVAS_dec
IVAS_rend
ISAR_post_rend
ambi_converter
obj/
*.a
*.o
*.P

# default CMake
build*/**/*

# Compiler output VS2017
IVAS_cod.exe
IVAS_dec.exe
IVAS_rend.exe
ISAR_post_rend.exe
ambi_converter.exe
*.user
.vs/
Debug_*/
Release_*/
*.obj
*.pdb

# Standalone TD object renderer
scripts/td_object_renderer/object_renderer_standalone/renderer_standalone
scripts/td_object_renderer/object_renderer_standalone/renderer_standalone.exe

# General/scripts
.DS_Store
.vscode
.cache
.idea
*.log
*.bak
.\#*
scripts/c-code_instrument/
scripts/ifdef_instrument.list
scripts/ref/
scripts/test/
scripts/out/
scripts/self_test_summary.txt
scripts/cppp/
binary/
tests/**/[c|d]ut
tests/**/ref
tests/*/testv
tests/hrtf_binary_loading/bitstream/*
tests/hrtf_binary_loading/dec_out_*/*
scripts/testv/*_cut*.pcm
scripts/testv/*_cut*.wav
scripts/testv/stvOMASA_*.met
scripts/testv/stvOMASA_*.csv
scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav
scripts/testv/stvOMASA_3ISM_1MASA1TC48c.wav
scripts/testv/stvO*
# default reference binary name
IVAS_cod_ref*
IVAS_dec_ref*
IVAS_rend_ref*
ISAR_post_rend_ref*

# Python files that pop up when running scripts
__pycache__/
*.py[cod]
*$py.class

# history
.history/

#externals
Externals/

# coan output files that are created when cleaning out switches
coan_out_*

# Additional ignored locations for the BASOP repo
/ci
/scripts
/tests
/pytest.ini
+16 −2102

File changed.

Preview size limit exceeded, changes collapsed.

+25 −0
Original line number Diff line number Diff line
<!--- Basic information that is useful -->
- Related issues:
- Requested reviewers: 

### Reason why this change is needed

* This may be a direct copy from the issue.

### Description of the change

* Describe what is done.

### Affected operating points

* Describe here as well as possible what operating points are affected and how
* In minimum, there should be a status for bitstream compatibility and output bit exactness
* For bitstream compatibility, the following levels are helpful for describing encoder
  1. Produced bitstream is BE compared to previous state.
  2. Produced bitstream is non-BE but it is fully backwards compatible for decoding. Decoded output may differ.
  3. Produced bitstream is non-BC. Old decoder cannot decode the produced bitstream correctly.
* For output difference, use BE or non-BE. Additionally, amount of difference can be presented.


<!--- By default, no labels are added as they often come from the issue. Add labels if there is no issue for this. -->

CMakeLists.txt

0 → 100644
+244 −0
Original line number Diff line number Diff line
# CMake file for IVAS
#
# Usage with Unix Makefiles (Linux, OS/X):
#   # create build directory
#   mkdir build ; cd build
#   # call CMake to generate build system, e.g. one of the following:
#   cmake -D CMAKE_BUILD_TYPE=Debug ../
#   cmake -D CMAKE_BUILD_TYPE=Release ../
#   cmake -D CMAKE_BUILD_TYPE=Debug -D TARGET_PLATFORM=x86_64 ../
#   # build project
#   make -j8
#
# Usage with Visual Studio
#   1) download CMake from https://cmake.org/download/, don't use the Cygwin version!
#   2.1) build project using IDE
#        In CMake GUI select the source dir (root of stereo-evs) and a new binary directory
#        and press "Configure" and "Generate". Then open the Visual Studio solution file generated
#        in the build directory.
#   2.2) build project using command line
#        # create build directory
#        mkdir build ; cd build
#        # call CMake to generate build system, e.g. one of the following:
#        cmake ../
#        cmake -G "Visual Studio 12 2013" ../
#        cmake -G "Visual Studio 12 2013 Win64" ../
#        # open the Visual Studio solution file generated in the build directory
#        # or build on command line, e.g.:
#        cmake --build . --config Debug
#        cmake --build . --config Release


cmake_minimum_required(VERSION 3.10)

set(CMAKE_C_STANDARD 99)

# configuration options for UNIX
if(UNIX)
  set(TARGET_PLATFORM ""  CACHE STRING "i686 / x86_64")
  set(CLANG           ""  CACHE STRING "1=msan / 2=asan / 3=usan")
  set(GCOV            OFF CACHE BOOL   "enable GCOV")
  set(STRIP           OFF CACHE BOOL   "enable STRIP")

  if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "")
  endif()
  # TARGET_PLATFORM
  if("${TARGET_PLATFORM}" MATCHES "i386" OR
     "${TARGET_PLATFORM}" MATCHES "i586" OR
     "${TARGET_PLATFORM}" MATCHES "i686"
  )
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
  elseif("${TARGET_PLATFORM}" MATCHES "x86_64")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
  endif()
  # C compiler flags
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off")  # disable floating point operation contraction
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-implicit-fallthrough")
  # to be uncommented in CI
  # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")

  # CLANG
  if(CLANG)
    find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED)
    set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "")
    if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory")
    elseif("${CLANG}" MATCHES "2" OR "${CLANG}" MATCHES "asan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
    elseif("${CLANG}" MATCHES "3" OR "${CLANG}" MATCHES "usan")
      # NOTE: keep in sync with list in Makefile
      set(USAN_CHECKS_ENABLE
        undefined # Default checks
        # Extra checks
        float-divide-by-zero
        implicit-conversion
        local-bounds
      )
      list(JOIN USAN_CHECKS_ENABLE "," USAN_CHECKS_ENABLE)

      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${USAN_CHECKS_ENABLE} -fsanitize-recover=${USAN_CHECKS_ENABLE}")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${USAN_CHECKS_ENABLE} -fsanitize-recover=${USAN_CHECKS_ENABLE}")
    else()
      message(FATAL_ERROR "Unknown CLANG setting: ${CLANG}")
    endif()
  endif()
  # GCOV
  if(GCOV)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
  endif()
  # STRIP
  if(STRIP)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdata-sections -ffunction-sections")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-gc-sections -static")
  endif()

  message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
  message("CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
  # write settings in CMake cache
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "")
  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "")
  set(CMAKE_C_FLAGS_DEBUG   "-O0 -g3" CACHE STRING "")
  set(CMAKE_C_FLAGS_RELEASE "-O2 -DRELEASE" CACHE STRING "") # TODO should contain -DNDEBUG to disable assert()
elseif(WIN32)
  # MSVC compiler flags
  add_definitions(
    -D_CRT_SECURE_NO_WARNINGS
    /MP
  )
endif()

# configuration options for all platforms
set(WMOPS OFF CACHE BOOL "enable WMOPS")
if(WMOPS)
  add_definitions("-DWMOPS=1")
endif()

project(stereo-evs LANGUAGES C)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # make Visual Studio projects look nicer
include(CTest)

file(GLOB libBasopSrcs "lib_basop/*.c")
file(GLOB libBasopHeaders "lib_basop/*.h")
add_library(lib_basop ${libBasopSrcs} ${libBasopHeaders})
if(UNIX)
  target_link_libraries(lib_basop PRIVATE m)
endif()
target_include_directories(lib_basop PUBLIC lib_basop PRIVATE lib_com lib_enc lib_dec lib_rend lib_debug lib_isar)
target_include_directories(lib_basop PRIVATE lib_lc3plus)

file(GLOB libComSrcs "lib_com/*.c")
file(GLOB libComHeaders "lib_com/*.h")
add_library(lib_com ${libComSrcs} ${libComHeaders})
if(UNIX)
  target_link_libraries(lib_com PRIVATE m)
endif()
target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_basop lib_enc lib_dec lib_rend lib_debug lib_isar)
target_include_directories(lib_com PRIVATE lib_lc3plus)

file(GLOB libDebugSrcs "lib_debug/*.c")
file(GLOB libDebugHeaders "lib_debug/*.h")
add_library(lib_debug ${libDebugSrcs} ${libDebugHeaders})
target_link_libraries(lib_debug lib_basop lib_com)
target_include_directories(lib_debug PUBLIC lib_debug PRIVATE lib_basop lib_enc lib_dec lib_rend lib_isar)

file(GLOB libEncSrcs "lib_enc/*.c")
file(GLOB libEncHeaders "lib_enc/*.h")
add_library(lib_enc ${libEncSrcs} ${libEncHeaders})
target_link_libraries(lib_enc lib_basop lib_com lib_debug)
target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_basop lib_dec lib_rend lib_isar)
target_include_directories(lib_enc PRIVATE lib_lc3plus)

file(GLOB libLC3plusSrcs "lib_lc3plus/*.c")
file(GLOB libLC3plusHeaders "lib_lc3plus/*.h")
add_library(lib_lc3plus ${libLC3plusSrcs} ${libLC3plusHeaders})
target_include_directories(lib_lc3plus PUBLIC lib_lc3plus PRIVATE lib_basop lib_com lib_debug)

file(GLOB libRendSrcs "lib_rend/*.c")
file(GLOB libRendHeaders "lib_rend/*.h")

add_library(lib_rend ${libRendSrcs} ${libRendHeaders})
target_link_libraries(lib_rend lib_dec lib_basop lib_com lib_debug) # Todo refactor: This dependency on lib_dec should be removed.
target_link_libraries(lib_rend lib_lc3plus lib_isar)
target_include_directories(lib_rend PUBLIC lib_rend PRIVATE lib_basop lib_enc lib_isar)


file(GLOB libDecSrcs "lib_dec/*.c")
file(GLOB libDecHeaders "lib_dec/*.h")
add_library(lib_dec ${libDecSrcs} ${libDecHeaders})
target_link_libraries(lib_dec lib_com lib_basop lib_rend lib_debug lib_isar)
target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_basop lib_enc lib_isar lib_util)

file(GLOB libUtilSrcs "lib_util/*.c")
file(GLOB libUtilHeaders "lib_util/*.h")
add_library(lib_util ${libUtilSrcs} ${libUtilHeaders})
target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_basop lib_com lib_enc lib_dec lib_rend lib_debug)
target_include_directories(lib_util PRIVATE lib_lc3plus lib_isar)

if(NOT WMOPS)
  add_executable(ivas_lc3plus_unit_test ${CMAKE_SOURCE_DIR}/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c)
  target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_basop lib_debug lib_isar)
endif()

file(GLOB libISARSrcs "lib_isar/*.c")
file(GLOB libISARHeaders "lib_isar/*.h")

add_library(lib_isar ${libISARSrcs} ${libISARHeaders})
target_link_libraries(lib_isar lib_basop lib_com lib_debug lib_lc3plus) # Todo refactor: This dependency on lib_dec should be removed.
target_include_directories(lib_isar PUBLIC lib_isar PRIVATE lib_basop lib_enc lib_dec lib_rend)


add_executable(IVAS_cod apps/encoder.c)
target_link_libraries(IVAS_cod lib_enc lib_util)
if(WIN32)
  target_link_libraries(IVAS_cod Ws2_32)
endif()

add_executable(IVAS_cod_fmtsw apps/encoder_fmtsw.c)
target_link_libraries(IVAS_cod_fmtsw lib_enc lib_util)
if(WIN32)
  target_link_libraries(IVAS_cod_fmtsw Ws2_32)
endif()

add_executable(IVAS_dec apps/decoder.c)
target_link_libraries(IVAS_dec lib_dec lib_util)
if(WIN32)
  target_link_libraries(IVAS_dec Ws2_32)
endif()

add_executable(IVAS_rend apps/renderer.c)
target_link_libraries(IVAS_rend lib_rend lib_util lib_isar lib_com)
target_include_directories(IVAS_rend PRIVATE lib_enc)

add_executable(ISAR_post_rend apps/isar_post_rend.c)
target_link_libraries(ISAR_post_rend lib_basop lib_isar lib_util lib_com)
target_include_directories(ISAR_post_rend PRIVATE lib_basop lib_isar)

add_executable(ambi_converter apps/ambi_converter.c)
target_link_libraries(ambi_converter lib_util lib_com lib_basop lib_debug)
if(UNIX)
  target_link_libraries(ambi_converter m)
endif()
target_include_directories(ambi_converter PRIVATE lib_basop lib_util lib_com lib_debug)

if(COPY_EXECUTABLES_FROM_BUILD_DIR)
  # Optionally copy executables to the same place where Make puts them (useful for tests that expect executables in specific places)
  add_custom_command(TARGET IVAS_cod POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_cod>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET IVAS_cod_fmtsw POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_cod_fmtsw>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET IVAS_dec POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_dec>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET IVAS_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_rend>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET ISAR_post_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:ISAR_post_rend>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  if (NOT WMOPS)
    add_custom_command(TARGET ivas_lc3plus_unit_test POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:ivas_lc3plus_unit_test>" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/split_rendering/lc3plus_basop")
  endif()
endif()

# Allow creating packages for CMake install
install(TARGETS lib_enc lib_dec lib_rend lib_basop lib_com lib_util ARCHIVE DESTINATION lib)
Loading