Commit 99c6cefd authored by emerit's avatar emerit
Browse files

Merge branch 'fix_hrtf_processing_scripts_for_3rd_party_sofa_support' of...

Merge branch 'fix_hrtf_processing_scripts_for_3rd_party_sofa_support' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec into fix_hrtf_processing_scripts_for_3rd_party_sofa_support
parents 78d21398 600f3f77
Loading
Loading
Loading
Loading
+329 −482

File changed.

Preview size limit exceeded, changes collapsed.

+30 −0
Original line number Diff line number Diff line
variables:
  EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"
  EVS_BE_WIN_TEST_DIR: "C:/Users/gitlab-runner/testvec"
  PROCESSING_SCRIPTS_BIN_DIR: "/test-bin"
  SANITIZER_TESTS: "CLANG1 CLANG2 CLANG3"
  OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4"
  OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3"
  OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB"
  OUT_FORMATS_ALL: "$OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT"
  MANUAL_PIPELINE_TYPE:
    description: "Type for the manual pipeline run. Use 'test-be-release' to run BE test against release codec."
    value: 'default'
    options:
      - 'default'
      - 'test-be-release'
      - 'test-long-self-test'
      - 'ivas-conformance'
      - 'ivas-conformance-linux'
      - 'check-clipping'
      - 'test-branch-vs-input-passthrough'

  PYTEST_ARGS: ""
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv"
  LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  SHORT_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm"
  LONG_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_ltv_basop_encoder.prm"
  TEST_SUITE: ""
  # note: currently overwrites default value from ci repo
  TESTCASE_TIMEOUT_STV_SANITIZERS: 240
+4 −4
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#        cmake --build . --config Release


cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.10)

set(CMAKE_C_STANDARD 99)

@@ -121,7 +121,7 @@ if(WMOPS)
  add_definitions("-DWMOPS=1")
endif()

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

@@ -174,7 +174,7 @@ target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_com lib_enc lib_
target_include_directories(lib_util PRIVATE lib_lc3plus lib_isar)

if(NOT WMOPS)
  add_executable(ivas_lc3plus_unit_test scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c)
  add_executable(ivas_lc3plus_unit_test scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test.c)
  target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug lib_isar)
endif()

@@ -213,7 +213,7 @@ if(COPY_EXECUTABLES_FROM_BUILD_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")
    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_float")
  endif()
endif()

IvasBrirIntExtRenderers.py

deleted100644 → 0
+0 −102
Original line number Diff line number Diff line
#!/usr/bin/env python3

import os
import subprocess

# Set/unset the flags below to activate/deactivate build/encode/decode phases
build = False
encode = True
decode = True

# Variables
fs = 48
ivasPath = './'
ivasEnc = 'IVAS_cod'
ivasDec = 'IVAS_dec'
ivasRend = 'IVAS_rend'
inPath = './in/'
bitPath = './bit/'
outPath = './out/'
hrtfPath = f'{ivasPath}scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/'
# hrtfName = f'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_{fs}000'
# brirKern = 'BRIR_Auditorium_S1_R1'
# brirName = f'{brirKern}_Combined_BRIR_{fs}kHz'
# brirFile = f'{hrtfPath}{hrtfName}+{brirName}.bin'
# brirFile = f'{hrtfPath}fastconv_{hrtfName}_{brirKern}.bin'
# brirFile = f'{hrtfPath}ivas_binaural_custom_48kHz.bin'
brirFiles = ['',f'ivas_binaural_{fs}kHz',f'ivas_binaural_custom_{fs}kHz', f'ivas_binaural_custom_no_optim_{fs}kHz', f'ivas_binaural_custom_fabian_hrir_{fs}kHz']
brirPaths = [f'{hrtfPath}{brirFiles[0]}.bin', f'{hrtfPath}{brirFiles[1]}.bin']
bitrates = [32, 80, 256]
# inFormats = ['mc 5_1', 'mc 7_1_4', 'sba 1', 'sba 2', 'sba 3']
# files = {'mc 5_1' : f'5ch_ident_{fs}', 'mc 7_1_4' : f'dirac_714_{fs}k', 'sba 1' : f'dirac_HOA1S_{fs}k' , 'sba 2' : f'dirac_HOA2S_{fs}k' , 'sba 3' : f'dirac_HOA3S_{fs}k' }
# outFormats = {'mc 5_1' : '5_1', 'mc 7_1_4' : '7_1_4', 'sba 1' : 'FOA' , 'sba 2' : 'HOA2' , 'sba 3' : 'HOA3' }
inFormats = ['mc 5_1', 'mc 7_1_4', 'sba 3']
files = {'mc 5_1' : f'5ch_ident_{fs}', 'mc 7_1_4' : f'dirac_714_{fs}k' , 'sba 3' : f'dirac_HOA3S_{fs}k' }
outFormats = {'mc 5_1' : '5_1', 'mc 7_1_4' : '7_1_4', 'sba 1' : 'FOA' , 'sba 3' : 'HOA3' }

testDir = os.getcwd()

# Build phase
if build:
    os.chdir(ivasPath)
    subprocess.run('cmake -D CMAKE_BUILD_TYPE=Release -D TARGET_PLATFORM=x86_64 -D COPY_EXECUTABLES_FROM_BUILD_DIR=true -B build -G "Visual Studio 15 2017 Win64"')
    subprocess.run('cmake --build build --config release --clean-first')
    #subprocess.run('cmake --build build --config release')
    os.chdir(testDir)

#Encode
if encode:
    for b in bitrates:
        for f in inFormats:
            cmd = f'{ivasPath}{ivasEnc} -{f} {b * 1000} {fs} {inPath}{files[f]}.wav {bitPath}{files[f]}-{b}kbps.ivas'
            subprocess.run(cmd,shell=True)

#Decode & Render
# for b in bitrates:
#     for f in inFormats:
#         for brir in brirFiles:
#             ivasFile = f'{bitPath}{files[f]}-{b}kbps.ivas'
#             outFileBase = f'{outPath}{files[f]}-{b}kbps'
#             # Decode and render binaural
#             cmd = f'{ivasPath}{ivasDec} -hrtf {hrtfPath}{brir}.bin BINAURAL {fs} {ivasFile} {outFileBase}-dec-bin-{brir}.wav'
#             subprocess.run(cmd,shell=True)

#             # Decode and render binaural IR
#             cmd = f'{ivasPath}{ivasDec} -hrtf {hrtfPath}{brir}.bin BINAURAL_ROOM_IR {fs} {ivasFile} {outFileBase}-dec-brir-{brir}.wav'
#             subprocess.run(cmd,shell=True)

#             # Decode and render binaural reverb
#             cmd = f'{ivasPath}{ivasDec} -hrtf {hrtfPath}{brir}.bin BINAURAL_ROOM_REVERB {fs} {ivasFile} {outFileBase}-dec-rev-{brir}.wav'
#             subprocess.run(cmd,shell=True)

#             # Decode pass-through
#             cmd = f'{ivasPath}{ivasDec} {outFormats[f]} {fs} {ivasFile} {outFileBase}-dec-ext.wav'
#             subprocess.run(cmd,shell=True)

#             # Render binaural
#             cmd = f'{ivasPath}{ivasRend} -i {outFileBase}-dec-ext.wav -if {outFormats[f]} -o {outFileBase}-ext-bin-{brir}.wav -of BINAURAL -fs {fs} -hrtf {hrtfPath}{brir}.bin'
#             subprocess.run(cmd,shell=True)

#             # Render binaural IR
#             cmd = f'{ivasPath}{ivasRend} -i {outFileBase}-dec-ext.wav -if {outFormats[f]} -o {outFileBase}-ext-brir-{brir}.wav -of BINAURAL_ROOM_IR -fs {fs} -hrtf {hrtfPath}{brir}.bin'
#             subprocess.run(cmd,shell=True)

#             # Render binaural reverb
#             cmd = f'{ivasPath}{ivasRend} -i {outFileBase}-dec-ext.wav -if {outFormats[f]} -o {outFileBase}-ext-rev-{brir}.wav -of BINAURAL_ROOM_REVERB -fs {fs}'
#             subprocess.run(cmd,shell=True)
            
for f in inFormats:
    outFileBase = f'{outPath}{files[f]}'
    for brir in brirFiles:

        # Render binaural
        cmd = f'{ivasPath}{ivasRend} -i {inPath}{files[f]}.wav  -if {outFormats[f]} -o {outFileBase}-rend-bin-{brir}.wav -of BINAURAL -fs {fs} -hrtf {hrtfPath}{brir}.bin'
        subprocess.run(cmd,shell=True)

        # Render binaural IR
        cmd = f'{ivasPath}{ivasRend} -i {inPath}{files[f]}.wav -if {outFormats[f]} -o {outFileBase}-rend-brir-{brir}.wav -of BINAURAL_ROOM_IR -fs {fs} -hrtf {hrtfPath}{brir}.bin -g 8'
        subprocess.run(cmd,shell=True)
        
        # Render binaural reverb
        cmd = f'{ivasPath}{ivasRend} -i  {inPath}{files[f]}.wav -if {outFormats[f]} -o {outFileBase}-rend-rev-{brir}.wav -of BINAURAL_ROOM_REVERB -fs {fs} -hrtf {hrtfPath}{brir}.bin'
        subprocess.run(cmd,shell=True)            
+1 −1
Original line number Diff line number Diff line
/******************************************************************************************************

   (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
   (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
Loading