Commit 57efa442 authored by emerit's avatar emerit
Browse files

merge scripts with float version

parent 1b3d196a
Loading
Loading
Loading
Loading
+8405 −8405

File changed.

Preview size limit exceeded, changes collapsed.

+708 −708

File changed.

Preview size limit exceeded, changes collapsed.

+7 −2
Original line number Diff line number Diff line
@@ -13,8 +13,6 @@ set(IVAS_TRUNK_ENC_PATH ${IVAS_TRUNK_PATH}/lib_enc)
set(IVAS_TRUNK_COM_PATH ${IVAS_TRUNK_PATH}/lib_com)
set(IVAS_TRUNK_DEBUG_PATH ${IVAS_TRUNK_PATH}/lib_debug)

set(Matlab_ROOT_DIR /Applications/MATLAB_R2023b.app)

option(USE_MATLAB_ENG "Use matlab engine" OFF) # allows to use sofa file as input to the exe, but on windows requires to register matlab as a com server type in matlab "comserver('register')""
find_package(Matlab REQUIRED)
message("Matlab_VERSION = ${Matlab_VERSION}")
@@ -100,6 +98,13 @@ set(SOURCE_FILES_H
    ${IVAS_TRUNK_REND_PATH}/ivas_rom_rend.h
)

# require to be bit exact with main branch
if(MSVC)
    add_compile_options("/fp:strict")
else()
    add_compile_options("-fno-fast-math")
endif()

add_library(${PROJECT_NAME}_lib STATIC ${SOURCE_FILES_C} ${SOURCE_FILES_H})

add_executable(${PROJECT_NAME} generate_crend_ivas_tables_from_sofa.c)
+4 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ if isfolder("../matlab_hrir_generation_scripts")
    addpath("../matlab_hrir_generation_scripts");
end
sofaData = hrtf_library_loader();
sofaData.readSOFA(char(sofa_file),'Combined',true);
sofaData.readSOFA(char(sofa_file),'Combined',false);
ls_struct = get_ls_layout_config('Combined');

IR = permute(sofaData.Data.IR(:,:,:), [3 2 1]) ;
@@ -142,6 +142,9 @@ end
% Step 3: Compute EDC (Energy Decay Curve)
in_struct.num_bands = size(IR_cldfb,1);
in_struct.timeSlots = size(IR_cldfb,2);

in_struct.max_index = in_struct.timeSlots; % Needs to be changed according to IRs

if in_struct.max_index > in_struct.timeSlots
    in_struct.max_index = in_struct.timeSlots;
end
+12 −10
Original line number Diff line number Diff line
@@ -79,13 +79,17 @@ end
%% Generate C-code tables for RENDERER_BINAURAL_FASTCONV (SHD)
if generateCustomBinaryFile
    disp('Processing HRIRs (FOA) for FastConv renderer...');
    FastConv_SHD_IR_FOA_float = SHD_2_ROM(hrir_file, 1, -1);
    FastConv_SHD_IR_FOA_float = SHD_2_ROM(hrir_file, 1, -1, 5);
    
    disp('Processing HRIRs (HOA2) for FastConv renderer...');
    FastConv_SHD_IR_HOA2_float = SHD_2_ROM(hrir_file, 2, -1);
    FastConv_SHD_IR_HOA2_float = SHD_2_ROM(hrir_file, 2, -1, 5);
    
    disp('Processing HRIRs (HOA3) for FastConv renderer...');
    FastConv_SHD_IR_HOA3_float = SHD_2_ROM(hrir_file, 3, -1);
    FastConv_SHD_IR_HOA3_float = SHD_2_ROM(hrir_file, 3, -1, 5);

    %% Generate C-code tables for RENDERER_BINAURAL_FASTCONV (SD)
    disp('Processing HRIRs (SD) for FastConv renderer...');
    FastConv_SD_IR_float = SD_2_ROM(hrir_file, 5);    
else
    disp('Processing HRIRs (FOA) for FastConv renderer...');
    FastConv_SHD_IR_FOA_float = SHD_2_ROM(hrir_file, 1, 128);
@@ -95,19 +99,17 @@ else
    
    disp('Processing HRIRs (HOA3) for FastConv renderer...');
    FastConv_SHD_IR_HOA3_float = SHD_2_ROM(hrir_file, 3, 128);
end

    %% Generate C-code tables for RENDERER_BINAURAL_FASTCONV (SD)
    disp('Processing HRIRs (SD) for FastConv renderer...');
    FastConv_SD_IR_float = SD_2_ROM(hrir_file);
end


%% Generate C-code tables for RENDERER_BINAURAL_FASTCONV_ROOM (SD)
disp('Processing BRIRs (SD) for FastConv renderer...');
FastConv_SD_BRIR_float = generate_BRIR_CLDFB_FASTCONV(brir_file);
if generateCustomBinaryFile == true
    FastConv_SD_BRIR_float.rev_param.rt60 = FastConv_SD_BRIR_float.rev_param.rt60 * 2;
    FastConv_SD_BRIR_float.rev_param.nrgLr = FastConv_SD_BRIR_float.rev_param.nrgLr * 2;
else
if generateCustomBinaryFile == false
    FastConv_SD_BRIR_float.rev_param.rt60 = [0.420013, 0.206696, 0.203613, 0.207458, 0.217255, 0.236176, 0.230164, 0.228912, 0.228210, 0.219788, 0.225983, 0.220184, 0.222015, 0.223114, 0.223572, 0.227478, 0.227905, 0.223450, 0.219910, 0.218597, 0.220428, 0.218262, 0.213257, 0.210327, 0.207428, 0.198761, 0.196259, 0.194916, 0.190338, 0.184509, 0.180328, 0.176178, 0.176514, 0.177582, 0.183594, 0.195923, 0.203247, 0.208405, 0.214661, 0.220001, 0.222931, 0.230408, 0.233917, 0.233643, 0.236328, 0.237427, 0.241638, 0.241119, 0.238861, 0.242371, 0.247253, 0.245941, 0.248566, 0.245392, 0.243958, 0.244110, 0.239014, 0.241791, 0.234833, 0.253052];
end

Loading