Commit 1bf2a438 authored by emerit's avatar emerit
Browse files

update readme files ans scripts accordingly

parent a870891b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@
/* Tables generated by the script at "scripts/binauralRenderer_interface/fastconv/generate_tables_for_fastconv.m */
/* Can be replaced by your own generated HRIR tables */
/*
 * Generated on 26-Sep-2023 with Matlab version 23.2.0.2365128 (R2023b) by MUXE6256.
 * Generated on 27-Sep-2023 with Matlab version 23.2.0.2365128 (R2023b) by MUXE6256.
*/
@@ -46955,7 +46955,7 @@ const float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX] =
/*
 * Generated on 26-Sep-2023 with Matlab version 23.2.0.2365128 (R2023b) by MUXE6256.
 * Generated on 27-Sep-2023 with Matlab version 23.2.0.2365128 (R2023b) by MUXE6256.
*/
+3937 −3945

File changed.

Preview size limit exceeded, changes collapsed.

+8 −8
Original line number Diff line number Diff line
@@ -324,10 +324,10 @@ extern float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][
extern float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[15];
#endif
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40];
extern float CRendBin_Combined_BRIR_coeff_re_32kHz[15][BINAURAL_CHANNELS][2819];
extern float CRendBin_Combined_BRIR_coeff_im_32kHz[15][BINAURAL_CHANNELS][2819];
extern float CRendBin_Combined_BRIR_coeff_diffuse_re_32kHz[BINAURAL_CHANNELS][2870];
extern float CRendBin_Combined_BRIR_coeff_diffuse_im_32kHz[BINAURAL_CHANNELS][2870];
extern float CRendBin_Combined_BRIR_coeff_re_32kHz[15][BINAURAL_CHANNELS][2818];
extern float CRendBin_Combined_BRIR_coeff_im_32kHz[15][BINAURAL_CHANNELS][2818];
extern float CRendBin_Combined_BRIR_coeff_diffuse_re_32kHz[BINAURAL_CHANNELS][2868];
extern float CRendBin_Combined_BRIR_coeff_diffuse_im_32kHz[BINAURAL_CHANNELS][2868];

/* Sample Rate = 16000 */

@@ -342,10 +342,10 @@ extern float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][
extern float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[15];
#endif
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40];
extern float CRendBin_Combined_BRIR_coeff_re_16kHz[15][BINAURAL_CHANNELS][1774];
extern float CRendBin_Combined_BRIR_coeff_im_16kHz[15][BINAURAL_CHANNELS][1774];
extern float CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz[BINAURAL_CHANNELS][2522];
extern float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][2522];
extern float CRendBin_Combined_BRIR_coeff_re_16kHz[15][BINAURAL_CHANNELS][1799];
extern float CRendBin_Combined_BRIR_coeff_im_16kHz[15][BINAURAL_CHANNELS][1799];
extern float CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz[BINAURAL_CHANNELS][2474];
extern float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][2474];


 #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ project(generate_crend_ivas_tables)

message(${PROJECT_SOURCE_DIR})

option(USE_LIB_MYSOFA "dowload and use lib mysofa" ON)
option(USE_LIB_MYSOFA "dowload and use lib mysofa" OFF)

if(USE_LIB_MYSOFA)
    set(EXTERNALS_PATH ${PROJECT_SOURCE_DIR}/Externals)
+107 −0
Original line number Diff line number Diff line
<!---
   (C) 2022-2023 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
   contributors to this repository. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The IVAS codec Public Collaboration consisting of 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
   contributors to this repository retain full ownership rights in their respective contributions in
   the software. This notice grants no license of any kind, including but not limited to patent
   license, nor is any license granted by implication, estoppel or otherwise.

   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   contributions.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.
-->
# Modeling tool for All IVAS binaural renderer
# Allows to convert sofa file(s) to rom tables files (*.c|h) or binaural binary file(s)

## Requirements
- MATLAB >= R2020b
- Signal Processing Toolbox
- Python 3.9.* with pip
- Nympy (pip install numpy)
- Netcdf4 (pip install netcdf4)
- C/C++ compiler 
   - linux (ubuntu) :
      - sudo apt-get update
      - sudo apt-get install build-essential
   - windows
      - install visual studio community or other : https://visualstudio.microsoft.com/fr/vs/community/
- cmake version > 3.5

### Build generate_crend_ivas_tables
   - open a command line terminal
   - goto /scripts/binauralRenderer_interface folder 
   - mkdir build
   - cd build
   - cmake ..
   - cmake --build .
   - cd .. 
   - generate_crend_ivas_tables executable shall be in this folder
   - SofaReader.py file must be in the same folder as the executable generate_crend_ivas_tables
   - run py run.py (require matplotlib) -> no error and a figure with impulse response shall appear
   - for more details on generate_crend_ivas_tables see mixer_conv_sofa_to_rom_table_converter_readme.txt

### Build tables_format_converter in release or relWithDebugInfo. debug configuration do not work calling numpy
   - open a command line terminal
   - goto /scripts/binauralRenderer_interface/Table_Format_Converter folder
   - mkdir build
   - cd build
   - cmake ..
   - cmake --build .
   - cd .. 
   - tables_format_converter executable shall be in this folder

### matlab scripts from :
 -/scripts/binauralRenderer_interface/matlab_hrir_generation_scripts
   see readme in the folder. Convert dense set of HRIRs into HOA to binaural filters in time domain or in CLDFB domain.
   Required by generate_crend_ivas_tables, parim_bin and fastconv.     
 -/scripts/binauralRenderer_interface/param_bin  
   see readme in the folder. Generate part of rom file ivas_rom_binauralRenderer.c and/or parametric renderer binary file. To generate complete ivas_rom_binauralRenderer.c rom file see example in generate_ivas_binauralizer_tables_from_sofa.m 
 -/scripts/binauralRenderer_interface/fastconv
   see readme in the folder. Generate part of rom file ivas_rom_binauralRenderer.c and/or fastconv renderer binary file. To generate complete ivas_rom_binauralRenderer.c rom file see example in generate_ivas_binauralizer_tables_from_sofa.m . Warning the computed values for late reverberation depend on matlab OS version used. IVAS tests still BE.
 -/scripts/td_object_renderer
    see readme in the folder. Generate part of rom files ivas_rom_TdBinauralRenderer.c ivas_rom_TdBinauralRenderer.c and TD renderer binary file. Warning the computed values depend on matlab OS version used. IVAS tests still BE.  
  
### SOFA files :
   - HRIRs sofa files for testing are stored in ./HRIRs_sofa folder
   - BRIRs sofa files for testing are stored in ./BRIRs_sofa folder
   The current scripts have not been tested with other SOFA files. For other SOFA files some adaptations of the scripts may be required. Current scripts are provided as example.

See /scripts/ThirdPartyLegalNotices for related information.

## Usage

Run the following matlab script : generate_ivas_binauralizer_tables_from_sofa.m
It will generate rom files that can be used to compile IVAS decoder or renderer. By default the result it BE. I will also generate binary files that can be used with -hrtf flag in IVAS decoder or renderer command line. Using IVAS decoder or renderer with default binary files will generate BE output compare to the same command line without -hrtf flag. To test different sofa files input you need to modify the script in the section "%% Set input files". Other sofa files are available in ./HRIRs_sofa folder. Generated files are in folder ./binaural_renderers_hrtf_data.
 Generated files :
 - ivas_binaural_*kHz.bin : file containing all tables values for all IVAS binaural renderers for one sample rate.
 - ivas_binaural_td_*kHz.bin : file containing tables values for IVAS td binaural renderer for one sample rate.
 - ivas_binaural_reverb_*kHz.bin : file containing tables values for IVAS td reverberation process for one sample rate.
 - ivas_binaural_fastconv_*kHz.bin : file containing tables values for IVAS fastconv binaural renderers. All    sample rate files are the same.
- ivas_binaural_parambin_*kHz.bin : file containing tables values for IVAS prametric binaural renderers. All    sample rate files are the same.
 - ivas_binaural_td_*kHz.bin : file containing tables values for IVAS td binaural renderers for one sample rate.
 - ivas_binaural_mixconv_hrir_*kHz.bin : file containing tables values for IVAS mixer conv binaural renderer for HRIR for one sample rate.
 - ivas_binaural_mixconv_brir_*kHz.bin : file containing tables values for IVAS mixer conv binaural renderer for BRIR for one sample rate.

 Without matlab only binary files for mixer conv renderer BRIR can be generated.
   - run for example to use IVAS renderer as a BRIR convolver run successively :
      ./generate_crend_ivas_tables -lib_rend_path ./ -brir_optim_config_path ./brir_no_optim.cfg -binary_files_path ./binaural_renderers_hrtf_data  -binary_common_file_name IIS_BRIR_officialMPEG_Combined_no_optim 5 ./BRIRs_sofa/IIS_BRIR_officialMPEG_Combined.sofa 
      ./tables_format_converter -output_file_path ../binaural_renderers_hrtf_data -output_file_name brir_no_optim -input_mixerconv_brir_file_path  ../binaural_renderers_hrtf_data -input_mixerconv_brir_file_name   IIS_BRIR_officialMPEG_Combined_no_optim 
      - IVAS_rend -hrtf ./scripts/binaurelRenderer_interface/binaural_renderers_hrtf_data/brir_no_optim_48kHz.bin ... command line to complete
Loading