diff --git a/CMakeLists.txt b/CMakeLists.txt index ecd8f11c5a38519a46fbc71a558563dac45b782f..84a44e4e35e62f14239eb0e588586089a2016977 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,65 +125,74 @@ 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_enc lib_dec lib_rend lib_debug lib_isar) +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_com) -target_include_directories(lib_debug PUBLIC lib_debug PRIVATE lib_enc lib_dec lib_rend lib_isar) +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_com lib_debug) -target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend lib_isar) +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_com lib_debug) +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_com lib_debug) # Todo refactor: This dependency on lib_dec should be removed. +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_enc 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_rend lib_debug lib_isar) -target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_enc lib_isar) +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) 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_com lib_enc lib_dec lib_rend lib_debug) +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_debug lib_isar) + target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_basop lib_com 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_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_enc lib_dec lib_rend) +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) @@ -199,12 +208,12 @@ if(WIN32) endif() add_executable(IVAS_rend apps/renderer.c) -target_link_libraries(IVAS_rend lib_rend lib_util lib_isar) +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_isar lib_util) -target_include_directories(ISAR_post_rend PRIVATE lib_isar) +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) 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) @@ -218,4 +227,4 @@ if(COPY_EXECUTABLES_FROM_BUILD_DIR) endif() # Allow creating packages for CMake install -install(TARGETS lib_enc lib_dec lib_rend lib_com lib_util ARCHIVE DESTINATION lib) +install(TARGETS lib_enc lib_dec lib_rend lib_basop lib_com lib_util ARCHIVE DESTINATION lib) diff --git a/Makefile b/Makefile index 62306b6749442b18f2a15e583a3702028876336a..956958096437a942ba76175e1512f9edcf5fd697 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ - # GNU Makefile # Paths +SRC_LIBBASOP = lib_basop SRC_LIBCOM = lib_com SRC_LIBDEBUG = lib_debug SRC_LIBDEC = lib_dec @@ -16,13 +16,14 @@ OBJDIR = obj INCLUDE_SPLIT = 1 -SRC_DIRS = $(sort -u $(SRC_LIBCOM) $(SRC_LIBDEBUG) $(SRC_LIBDEC) $(SRC_LIBENC) $(SRC_LIBREND) $(SRC_LIBISAR) $(SRC_LC3PLUS) $(SRC_LIBUTIL) $(SRC_APP)) +SRC_DIRS = $(sort -u $(SRC_LIBBASOP) $(SRC_LIBCOM) $(SRC_LIBDEBUG) $(SRC_LIBDEC) $(SRC_LIBENC) $(SRC_LIBREND) $(SRC_LIBISAR) $(SRC_LC3PLUS) $(SRC_LIBUTIL) $(SRC_APP)) # Name of CLI binaries CLI_APIDEC ?= IVAS_dec CLI_APIENC ?= IVAS_cod CLI_APIREND ?= IVAS_rend CLI_APIPOSTREND ?= ISAR_post_rend +LIB_LIBBASOP ?= libivasbasop.a LIB_LIBCOM ?= libivascom.a LIB_LIBDEBUG ?= libivasdebug.a LIB_LIBDEC ?= libivasdec.a @@ -148,6 +149,7 @@ SRCS_SPLIT_REND = ivas_CQMFDecoder.c ivas_CQMFEncoder.c ivas_PerceptualModel.c i ############################################################################### +SRCS_LIBBASOP = $(foreach DIR,$(SRC_LIBBASOP),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) SRCS_LIBCOM = $(foreach DIR,$(SRC_LIBCOM),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) SRCS_LIBDEBUG = $(foreach DIR,$(SRC_LIBDEBUG),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) SRCS_LIBDEC = $(foreach DIR,$(SRC_LIBDEC),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c))) @@ -162,6 +164,7 @@ else # SRCS_LIBUTIL := $(filter-out $(SRCS_SPLIT_REND),$(SRCS_LIBUTIL)) endif +OBJS_LIBBASOP = $(addprefix $(OBJDIR)/,$(SRCS_LIBBASOP:.c=.o)) OBJS_LIBCOM = $(addprefix $(OBJDIR)/,$(SRCS_LIBCOM:.c=.o)) OBJS_LIBDEBUG = $(addprefix $(OBJDIR)/,$(SRCS_LIBDEBUG:.c=.o)) OBJS_LIBDEC = $(addprefix $(OBJDIR)/,$(SRCS_LIBDEC:.c=.o)) @@ -175,7 +178,7 @@ OBJS_CLI_APIENC = $(OBJDIR)/encoder.o OBJS_CLI_APPREND = $(OBJDIR)/renderer.o OBJS_CLI_APPPOSTREND = $(OBJDIR)/isar_post_rend.o -DEPS = $(addprefix $(OBJDIR)/,$(SRCS_LIBCOM:.c=.P) $(SRCS_LIBDEBUG:.c=.P) $(SRCS_LIBDEC:.c=.P) \ +DEPS = $(addprefix $(OBJDIR)/,$(SRCS_LIBBASOP:.c=.P) $(SRCS_LIBCOM:.c=.P) $(SRCS_LIBDEBUG:.c=.P) $(SRCS_LIBDEC:.c=.P) \ $(SRCS_LIBENC:.c=.P) $(SRCS_LIBUTIL:.c=.P) $(SRCS_LIBREND:.c=.P) $(SRCS_LIBISAR:.c=.P) \ $(SRCS_LC3PLUS:.c=.P)) @@ -188,6 +191,9 @@ all: $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND) $(CLI_APIPOSTREND) $(OBJDIR): $(QUIET)mkdir -p $(OBJDIR) +$(LIB_LIBBASOP): $(OBJS_LIBBASOP) + $(QUIET_AR)$(AR) rcs $@ $^ + $(LIB_LIBCOM): $(OBJS_LIBCOM) $(QUIET_AR)$(AR) rcs $@ $^ @@ -213,38 +219,38 @@ else endif # Dependency on OBJS_LIBCOM added temporarily for unit-test to work -$(LIB_LIBUTIL): $(OBJS_LIBUTIL) $(OBJS_LIBCOM) +$(LIB_LIBUTIL): $(OBJS_LIBUTIL) $(OBJS_LIBBASOP) $(OBJS_LIBCOM) $(QUIET_AR)$(AR) rcs $@ $^ -$(CLI_APIENC): $(OBJS_CLI_APIENC) $(LIB_LIBENC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIENC) -L. -livasenc -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIENC) +$(CLI_APIENC): $(OBJS_CLI_APIENC) $(LIB_LIBBASOP) $(LIB_LIBENC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIENC) -L. -livasbasop -livasenc -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIENC) -$(CLI_APIDEC): $(OBJS_CLI_APIDEC) $(LIB_LIBDEC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) $(LIB_LIBISAR) +$(CLI_APIDEC): $(OBJS_CLI_APIDEC) $(LIB_LIBBASOP) $(LIB_LIBDEC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) $(LIB_LIBISAR) ifeq "$(INCLUDE_SPLIT)" "1" - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasdec -livascom -livasutil -livasdebug -llc3plus $(LDLIBS) -o $(CLI_APIDEC) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasbasop -livasdec -livascom -livasutil -livasdebug -llc3plus $(LDLIBS) -o $(CLI_APIDEC) else - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasdec -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIDEC) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasbasop -livasdec -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIDEC) endif -$(CLI_APIREND): $(OBJS_CLI_APPREND) $(LIB_LIBREND) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LIBDEC) $(LIB_LC3PLUS) $(LIB_LIBISAR) +$(CLI_APIREND): $(OBJS_CLI_APPREND) $(LIB_LIBBASOP) $(LIB_LIBREND) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LIBDEC) $(LIB_LC3PLUS) $(LIB_LIBISAR) ifeq "$(INCLUDE_SPLIT)" "1" - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -lisar -livasdec -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIREND) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasbasop -livasrend -lisar -livasdec -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIREND) else - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -livasdec -livasutil -livasdebug -livascom $(LDLIBS) -o $(CLI_APIREND) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasbasop -livasrend -livasdec -livasutil -livasdebug -livascom $(LDLIBS) -o $(CLI_APIREND) endif -$(CLI_APIPOSTREND): $(OBJS_CLI_APPPOSTREND) $(LIB_LIBISAR) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) +$(CLI_APIPOSTREND): $(OBJS_CLI_APPPOSTREND) $(LIB_LIBBASOP) $(LIB_LIBISAR) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) ifeq "$(INCLUDE_SPLIT)" "1" - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPPOSTREND) -L. -lisar -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIPOSTREND) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPPOSTREND) -L. -livasbasop -lisar -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIPOSTREND) endif -libs: $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBREND) $(LIB_LIBISAR) $(LIB_LC3PLUS) $(LIB_LIBUTIL) +libs: $(LIB_LIBBASOP) $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBREND) $(LIB_LIBISAR) $(LIB_LC3PLUS) $(LIB_LIBUTIL) clean: $(QUIET)$(RM) $(OBJS_LIBENC) $(OBJS_LIBDEC) $(DEPS) $(QUIET)$(RM) $(DEPS:.P=.d) $(QUIET)test ! -d $(OBJDIR) || rm -rf $(OBJDIR) - $(QUIET)$(RM) $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND) $(CLI_APIPOSTREND) $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBUTIL) $(LIB_LIBREND) $(LIB_LIBISAR) $(LIB_LC3PLUS) + $(QUIET)$(RM) $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND) $(CLI_APIPOSTREND) $(LIB_LIBENC) $(LIB_LIBDEBUG) $(OBJS_LIBBASOP) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBUTIL) $(LIB_LIBREND) $(LIB_LIBISAR) $(LIB_LC3PLUS) $(OBJDIR)/%.o : %.c | $(OBJDIR) $(QUIET_CC)$(CC) $(CFLAGS) -c -MD -o $@ $< diff --git a/Workspace_msvc/Workspace_msvc.sln b/Workspace_msvc/Workspace_msvc.sln index ac2e76b52f0224eefb2fb6c56cbd2a41be66812c..a87706281425321fc00be09891067b01d53125ee 100644 --- a/Workspace_msvc/Workspace_msvc.sln +++ b/Workspace_msvc/Workspace_msvc.sln @@ -15,10 +15,19 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_debug", "lib_debug.vcxproj", "{54509728-928B-44D9-A118-A6F92F08B34F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decoder", "decoder.vcxproj", "{E3DCBC31-7FC9-D127-E000-529F8460D5FD}" + ProjectSection(ProjectDependencies) = postProject + {63747FE7-94BA-410C-8D7F-EB47555DD994} = {63747FE7-94BA-410C-8D7F-EB47555DD994} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder", "encoder.vcxproj", "{B3FC9DFC-7268-8660-7C0D-B60BAF02C554}" + ProjectSection(ProjectDependencies) = postProject + {63747FE7-94BA-410C-8D7F-EB47555DD994} = {63747FE7-94BA-410C-8D7F-EB47555DD994} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "renderer", "renderer.vcxproj", "{12B4C8A5-1E06-4E30-B443-D1F916F52B47}" + ProjectSection(ProjectDependencies) = postProject + {63747FE7-94BA-410C-8D7F-EB47555DD994} = {63747FE7-94BA-410C-8D7F-EB47555DD994} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_lc3plus", "lib_lc3plus.vcxproj", "{95030B82-70CD-4C6B-84D4-61096035BEA2}" EndProject @@ -30,6 +39,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_isar", "lib_isar.vcxproj", "{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isar_post_rend", "isar_post_rend.vcxproj", "{12374ADC-0E5C-4FDD-B903-71D572413831}" + ProjectSection(ProjectDependencies) = postProject + {B3FC9DFC-7268-8660-7C0D-B60BAF02C554} = {B3FC9DFC-7268-8660-7C0D-B60BAF02C554} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_basop", "lib_basop.vcxproj", "{63747FE7-94BA-410C-8D7F-EB47555DD994}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -111,6 +125,12 @@ Global {12374ADC-0E5C-4FDD-B903-71D572413831}.Release|Win32.ActiveCfg = Release|Win32 {12374ADC-0E5C-4FDD-B903-71D572413831}.Release|Win32.Build.0 = Release|Win32 {12374ADC-0E5C-4FDD-B903-71D572413831}.Release|x64.ActiveCfg = Release|Win32 + {63747FE7-94BA-410C-8D7F-EB47555DD994}.Debug|Win32.ActiveCfg = Debug|Win32 + {63747FE7-94BA-410C-8D7F-EB47555DD994}.Debug|Win32.Build.0 = Debug|Win32 + {63747FE7-94BA-410C-8D7F-EB47555DD994}.Debug|x64.ActiveCfg = Debug|Win32 + {63747FE7-94BA-410C-8D7F-EB47555DD994}.Release|Win32.ActiveCfg = Release|Win32 + {63747FE7-94BA-410C-8D7F-EB47555DD994}.Release|Win32.Build.0 = Release|Win32 + {63747FE7-94BA-410C-8D7F-EB47555DD994}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Workspace_msvc/decoder.vcxproj b/Workspace_msvc/decoder.vcxproj index 767d89e79e13776c18d8164bef135613f13a164e..160d4f7df7972204f12dd6a414e480e0a48b6a22 100644 --- a/Workspace_msvc/decoder.vcxproj +++ b/Workspace_msvc/decoder.vcxproj @@ -68,7 +68,7 @@ Disabled - ..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;..\lib_isar;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;..\lib_isar;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions) EnableFastChecks @@ -113,7 +113,7 @@ Neither false false - ..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;..\lib_isar;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;..\lib_isar;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -155,13 +155,16 @@ + + {63747fe7-94ba-410c-8d7f-eb47555dd994} + {e822ddaf-0f5f-4cd0-a694-38ae69de74d3} false {869a305e-d99e-4c3a-bdb3-aa57abcce619} - + {2fa8f384-0775-f3b7-f8c3-85209222fc70} false @@ -175,4 +178,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/encoder.vcxproj b/Workspace_msvc/encoder.vcxproj index 122e3e4e09e73ab0f184cd5261d8b344475b97f9..1dae36d47534d57b9ab13d410a7e9e08985ba322 100644 --- a/Workspace_msvc/encoder.vcxproj +++ b/Workspace_msvc/encoder.vcxproj @@ -68,7 +68,7 @@ Disabled - ..\lib_enc;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_enc;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions) EnableFastChecks @@ -121,7 +121,7 @@ Neither false false - ..\lib_enc;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_enc;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -160,6 +160,9 @@ + + {63747fe7-94ba-410c-8d7f-eb47555dd994} + {824da4cf-06f0-45c9-929a-8792f0e19c3e} false @@ -177,4 +180,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/isar_post_rend.vcxproj b/Workspace_msvc/isar_post_rend.vcxproj index 170ff20545a4ac5c7d610daac49ba963ad4d88b4..0f2063d852538fcc352bb27d389837faeb87c13c 100644 --- a/Workspace_msvc/isar_post_rend.vcxproj +++ b/Workspace_msvc/isar_post_rend.vcxproj @@ -65,7 +65,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions) EnableFastChecks @@ -110,7 +110,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -150,6 +150,9 @@ + + {63747fe7-94ba-410c-8d7f-eb47555dd994} + {54509728-928B-44D9-A118-A6F92F08B34F} false diff --git a/Workspace_msvc/lib_basop.vcxproj b/Workspace_msvc/lib_basop.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..8d4f252b5b42ecff0e5c3ae82a622af937ca043c --- /dev/null +++ b/Workspace_msvc/lib_basop.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + + + + + {63747FE7-94BA-410C-8D7F-EB47555DD994} + common + 10.0.17763.0 + + + + StaticLibrary + v141 + false + MultiByte + + + StaticLibrary + v141 + false + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.27428.2015 + + + .\Debug_$(ProjectName)\ + .\Debug_$(ProjectName)\ + libivascom + + + .\Release_$(ProjectName)\ + .\Release_$(ProjectName)\ + libivascom + + + + + + + Disabled + ..\lib_isar;..\lib_lc3plus;..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;.%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions); + + EnableFastChecks + MultiThreadedDebug + + + $(IntDir)$(ProjectName).pdb + Level4 + true + OldStyle + Default + %(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c0c + + + WS2_32.lib; %(AdditionalDependencies) + $(OutDir)$(TargetName).lib + true + + + + + + + + MaxSpeed + AnySuitable + false + Neither + false + false + ..\lib_isar;..\lib_lc3plus;..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;.%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) + true + + Default + MultiThreaded + true + + + $(IntDir)$(ProjectName).pdb + Level4 + true + + Default + %(DisableSpecificWarnings) + false + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c0c + + + WS2_32.lib; %(AdditionalDependencies) + $(OutDir)$(TargetName).lib + true + + + + + + + + + + + \ No newline at end of file diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index 187cc5baa514e1987012e36f1038976c824307c9..ee67280d0dd1f64ad9424857fd969cdaebef2b63 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -59,7 +59,7 @@ Disabled - ..\lib_isar;..\lib_lc3plus;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;.%(AdditionalIncludeDirectories) + ..\lib_isar;..\lib_lc3plus;..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions); EnableFastChecks @@ -95,7 +95,7 @@ Neither false false - ..\lib_isar;..\lib_lc3plus;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;.%(AdditionalIncludeDirectories) + ..\lib_isar;..\lib_lc3plus;..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -127,7 +127,6 @@ - @@ -141,19 +140,13 @@ - - - - - - @@ -337,4 +330,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index 177c5315642a080fa71d2f119fabf001883016a3..e8bbb17e9b0e6ab35342975185aa9d5a4fdfdeb8 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -166,9 +166,6 @@ common_all_c - - common_all_c - common_all_c @@ -196,9 +193,6 @@ common_all_c - - common_all_c - common_all_c @@ -217,24 +211,9 @@ common_all_c - - common_all_c - - - common_all_c - - - common_all_c - - - common_all_c - common_all_c - - common_all_c - common_all_c diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index e52c492f7643344e7910f2eb05488e99e4ade582..ef9c58a89b4c4818ed2eef065e2e642903b850c4 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -56,7 +56,7 @@ Disabled - ..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;DBG_WAV_WRITER;$(Macros);%(PreprocessorDefinitions) false @@ -83,7 +83,7 @@ AnySuitable false false - ..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -120,4 +120,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index f18efbed4952b8d816016d9ba4431a2349ccd65d..9d98513e8525267717e9437c90abc1522d0129f1 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -68,7 +68,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -109,7 +109,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true @@ -350,4 +350,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index 63dfdb6c28ca1fba16dc77cb9a338b5e9287d39e..93a2a85486561bebdb5cba3e8dec8989a68afb61 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -68,7 +68,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -112,7 +112,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -369,4 +369,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_isar.vcxproj b/Workspace_msvc/lib_isar.vcxproj index 95f64b54fd3e510cb3c45c9f40f2fc733572e77f..0271901c88b4c9ad236ff5e34d925f4d7c107e4c 100644 --- a/Workspace_msvc/lib_isar.vcxproj +++ b/Workspace_msvc/lib_isar.vcxproj @@ -60,7 +60,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions); EnableFastChecks @@ -95,7 +95,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true @@ -182,4 +182,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_lc3plus.vcxproj b/Workspace_msvc/lib_lc3plus.vcxproj index 22b5cddd3c55c39f43af6dfa39ec652305880ff2..71bb8e2a1f8e5301dc9c4eb265b25c53f244daca 100644 --- a/Workspace_msvc/lib_lc3plus.vcxproj +++ b/Workspace_msvc/lib_lc3plus.vcxproj @@ -65,7 +65,7 @@ Level3 - ..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories) Disabled MultiThreadedDebug WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) @@ -84,7 +84,7 @@ Level3 - ..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories) MaxSpeed MultiThreaded true diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index ff8946cc05ad785f675a2bdac42b09dae55d0665..c39806d47edcb1f3165b7ddbdcd9643b9e71c6ec 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -68,7 +68,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -109,7 +109,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true @@ -199,7 +199,7 @@ {95030B82-70CD-4C6B-84D4-61096035BEA2} false - + @@ -209,4 +209,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_rend.vcxproj.filters b/Workspace_msvc/lib_rend.vcxproj.filters index 820a5c044354c8b35ceabc1855256052b4915b24..2494e2ee2e8a44233535a78999c15448adf0ce04 100644 --- a/Workspace_msvc/lib_rend.vcxproj.filters +++ b/Workspace_msvc/lib_rend.vcxproj.filters @@ -31,9 +31,6 @@ rend_c - - rend_c - rend_c diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index b6b7fedfa8984c43465af1b5b317a84a2118dd67..2ffd5bcf58e41358543f1417033f4edcb64729d8 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -55,7 +55,7 @@ Disabled - ..\lib_isar;..\lib_lc3plus;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_util;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_isar;..\lib_lc3plus;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_util;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);ZLIB_WINAPI;%(PreprocessorDefinitions) false @@ -79,7 +79,7 @@ AnySuitable false false - ..\lib_isar;..\lib_lc3plus;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_util;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_isar;..\lib_lc3plus;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_util;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -123,7 +123,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -160,4 +160,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/renderer.vcxproj b/Workspace_msvc/renderer.vcxproj index a88ac29a52af6e031458cd3defb30206cf0d4f29..d6abf6aa31f8d2214eb354d83acc07bacdef91ae 100644 --- a/Workspace_msvc/renderer.vcxproj +++ b/Workspace_msvc/renderer.vcxproj @@ -65,7 +65,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions) EnableFastChecks @@ -110,7 +110,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) + ..\lib_basop;..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_rend;..\lib_lc3plus;.%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true @@ -150,6 +150,9 @@ + + {63747fe7-94ba-410c-8d7f-eb47555dd994} + {54509728-928B-44D9-A118-A6F92F08B34F} false @@ -160,7 +163,7 @@ {869a305e-d99e-4c3a-bdb3-aa57abcce619} - + {2FA8F384-0775-F3B7-F8C3-85209222FC70} false @@ -182,4 +185,4 @@ - + \ No newline at end of file diff --git a/apps/decoder.c b/apps/decoder.c index 5c785db397e2dcfbc5b8e5454f1dd61006ec4104..b7660a97e575b665c207cfdfb144900d933a2a82 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -141,7 +141,7 @@ typedef struct hrtfFileReader *hrtfReader; char *hrtfFileName; - IVAS_DEC_HRTF_HANDLE *hHrtfTD; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; @@ -202,7 +202,7 @@ int main( #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; #else - IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #endif @@ -595,7 +595,7 @@ int main( } /*------------------------------------------------------------------------------------------* - * Load HRTF binary file data + * Initialize HRTF binary file data *------------------------------------------------------------------------------------------*/ if ( arg.hrtfReaderEnabled ) @@ -727,6 +727,7 @@ int main( goto cleanup; } #endif + /*-----------------------------------------------------------------* * Decoding *-----------------------------------------------------------------*/ @@ -789,7 +790,9 @@ cleanup: if ( arg.hrtfReaderEnabled ) { #ifdef FIX_CREND_SIMPLIFY_CODE + IVAS_DEC_GetHrtfTDrendHandle( hIvasDec, &hHrtfBinary.hHrtfTD ); destroy_td_hrtf( hHrtfBinary.hHrtfTD ); + IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfBinary.hHrtfStatistics ); destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); #else IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); @@ -808,6 +811,7 @@ cleanup: } #ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD + // TODO: /* This free differs from float version and is done always. This should be safe to do even though we leave a return * value as not handled. This is needed as HRTF statistics from ROM are currently converted from float values. */ #ifdef FIX_CREND_SIMPLIFY_CODE diff --git a/apps/renderer.c b/apps/renderer.c index 97de605325dc1303f6f91c20f88a41cfa005e184..f50f184fbeeaa28038a0dca43879c0952adcc5e7 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -755,7 +755,7 @@ int main( #endif IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; - IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; IsmPositionProvider *positionProvider = NULL; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; @@ -994,7 +994,7 @@ int main( if ( hrtfFileReader != NULL ) { - if ( ( error = IVAS_REND_GetHrtfHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_REND_GetHrtfTdHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; @@ -1023,6 +1023,7 @@ int main( fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } + IVAS_AUDIO_CONFIG hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4; if ( args.inConfig.ambisonicsBuses->audioConfig != IVAS_AUDIO_CONFIG_INVALID && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -2769,7 +2770,6 @@ static CmdlnArgs defaultArgs( #ifdef FIX_CREND_SIMPLIFY_CODE args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; - for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) #else for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) diff --git a/lib_com/basop32.c b/lib_basop/basop32.c similarity index 100% rename from lib_com/basop32.c rename to lib_basop/basop32.c diff --git a/lib_com/basop32.h b/lib_basop/basop32.h similarity index 100% rename from lib_com/basop32.h rename to lib_basop/basop32.h diff --git a/lib_com/complex_basop.c b/lib_basop/complex_basop.c similarity index 100% rename from lib_com/complex_basop.c rename to lib_basop/complex_basop.c diff --git a/lib_com/complex_basop.h b/lib_basop/complex_basop.h similarity index 100% rename from lib_com/complex_basop.h rename to lib_basop/complex_basop.h diff --git a/lib_com/enh1632.c b/lib_basop/enh1632.c similarity index 100% rename from lib_com/enh1632.c rename to lib_basop/enh1632.c diff --git a/lib_com/enh1632.h b/lib_basop/enh1632.h similarity index 100% rename from lib_com/enh1632.h rename to lib_basop/enh1632.h diff --git a/lib_com/enh32.c b/lib_basop/enh32.c similarity index 100% rename from lib_com/enh32.c rename to lib_basop/enh32.c diff --git a/lib_com/enh32.h b/lib_basop/enh32.h similarity index 100% rename from lib_com/enh32.h rename to lib_basop/enh32.h diff --git a/lib_com/enh40.c b/lib_basop/enh40.c similarity index 100% rename from lib_com/enh40.c rename to lib_basop/enh40.c diff --git a/lib_com/enh40.h b/lib_basop/enh40.h similarity index 100% rename from lib_com/enh40.h rename to lib_basop/enh40.h diff --git a/lib_com/enh64.c b/lib_basop/enh64.c similarity index 100% rename from lib_com/enh64.c rename to lib_basop/enh64.c diff --git a/lib_com/enh64.h b/lib_basop/enh64.h similarity index 100% rename from lib_com/enh64.h rename to lib_basop/enh64.h diff --git a/lib_com/enhUL32.c b/lib_basop/enhUL32.c similarity index 100% rename from lib_com/enhUL32.c rename to lib_basop/enhUL32.c diff --git a/lib_com/enhUL32.h b/lib_basop/enhUL32.h similarity index 100% rename from lib_com/enhUL32.h rename to lib_basop/enhUL32.h diff --git a/lib_com/move.h b/lib_basop/move.h similarity index 100% rename from lib_com/move.h rename to lib_basop/move.h diff --git a/lib_com/stl.h b/lib_basop/stl.h similarity index 100% rename from lib_com/stl.h rename to lib_basop/stl.h diff --git a/lib_com/typedef.h b/lib_basop/typedef.h similarity index 100% rename from lib_com/typedef.h rename to lib_basop/typedef.h diff --git a/lib_com/typedefs.h b/lib_basop/typedefs.h similarity index 100% rename from lib_com/typedefs.h rename to lib_basop/typedefs.h diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index cdbae021b4a9cd335840162e95e17cd8b79bd125..112d826079cd4f80204a821ac10370c21da53fb4 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -179,13 +179,13 @@ typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; #ifdef FIX_CREND_SIMPLIFY_CODE -typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; +typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_TD_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; typedef struct ivas_hrtf_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; #else -typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; +typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_TD_HANDLE; typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 8e6374783a55bb6a70be25ba4b66dc3bbe3afbf9..69822b590c9f8492575213d00b803365948642e7 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1652,6 +1652,7 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ +#ifndef FIX_CREND_SIMPLIFY_CODE typedef enum { BINAURAL_INPUT_AUDIO_CONFIG_INVALID, @@ -1662,14 +1663,12 @@ typedef enum BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED /* Not used */ } BINAURAL_INPUT_AUDIO_CONFIG; - +#endif #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) - - /*----------------------------------------------------------------------------------* * TD Binaural Object renderer *----------------------------------------------------------------------------------*/ diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 87dce6d2f05a9675d62eed07a97f6c9376205b2a..0576e4760daa3a7cad29b9e5c03545858eeeadd9 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -6713,8 +6713,7 @@ void ivas_set_qmetadata_maxbit_req_fx( * Binaural FastConv Renderer Prototypes *-----------------------------------------------------------------------------------*/ - -void ivas_binaural_hrtf_close( +void ivas_binaural_hrtf_close_fx( HRTFS_FASTCONV_HANDLE *hHrtfFastConv /* i/o: decoder binaural hrtf handle */ ); diff --git a/lib_com/options.h b/lib_com/options.h index ffe156d35966fb2da2d6c53a979afebb25a378ad..9b2f883cedcca55d7f46d3487cd7a2990721d6d2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -121,11 +121,11 @@ #define FIX_CREND_SIMPLIFY_CODE #ifdef FIX_CREND_SIMPLIFY_CODE #define FIX_989_TD_REND_ROM /* Eri: Clean-up for TD renderer and completion of ROM generation tool */ -//#define USE_REVERB_16BIT_ROM /* if desactivated old rom hrtf tables is used */ -//#define USE_TDREND_16BIT_ROM /* if desactivated old rom hrtf tables is used. when active some tests case with 4 ISM fail due to owerflow in round_fixed function */ -//#define USE_FASTCONV_PARAMBIN_16BIT_ROM /* if desactivated old rom hrtf tables is used */ +#define USE_REVERB_16BIT_ROM /* if desactivated old rom hrtf tables is used */ +#define USE_TDREND_16BIT_ROM /* if desactivated old rom hrtf tables is used. when active some tests case with 4 ISM fail due to owerflow in round_fixed function */ +#define USE_FASTCONV_PARAMBIN_16BIT_ROM /* if desactivated old rom hrtf tables is used */ #define FIX_HRTF_LOAD /* VA: issue 1187: fix memory issue when HRTFs are loaded from a binary file */ -#define FIX_HRTF_LOAD_KEEP_BE // VA: temp. hack to keep BE when FIX_HRTF_LOAD is activated - the code will be removed once HRTF updates are stable +//#define FIX_HRTF_LOAD_KEEP_BE // VA: temp. hack to keep BE when FIX_HRTF_LOAD is activated - the code will be removed once HRTF updates are stable #endif #define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/ diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 4691523c696152cfea01148d5112bbca46d4be35..a92d8a3d58e67282c2d78929eae13697e613d3f5 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -211,13 +211,13 @@ static ivas_error ivas_binRenderer_convModuleOpen( hBinRenConvModule->numTaps = hHrtf->ntaps; move16(); #endif + IF( EQ_16( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { #ifndef FIX_CREND_SIMPLIFY_CODE hBinRenConvModule->numTaps = BINAURAL_NTAPS_MAX; move16(); #endif - /* Use variable order filtering */ bandIdx = 0; move16(); @@ -261,7 +261,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( move16(); } #endif - /* Use fixed order filtering */ bandIdx = 0; move16(); @@ -377,7 +376,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( { FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { - #ifdef FIX_CREND_SIMPLIFY_CODE Word16 tmp; tmp = chIdx; @@ -385,6 +383,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( Word16 tmp = 0; #endif move16(); + IF( isLoudspeaker ) { IF( EQ_16( input_config, IVAS_AUDIO_CONFIG_5_1 ) ) @@ -517,16 +516,19 @@ static ivas_error ivas_binRenderer_convModuleOpen( return IVAS_ERR_OK; } + /*-------------------------------------------------------------------------* * ivas_init_binaural_hrtf() * * initialize memory for HrtfFastConv structure elements *-------------------------------------------------------------------------*/ + void ivas_init_binaural_hrtf_fx( HRTFS_FASTCONV *HrtfFastConv /* i/o: FASTCONV HRTF structure */ ) { Word16 i; + #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->leftReal_fx = NULL; HrtfFastConv->leftImag_fx = NULL; @@ -536,13 +538,6 @@ void ivas_init_binaural_hrtf_fx( move32(); HrtfFastConv->n_channels = 0; move16(); -#ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM - HrtfFastConv->FASTCONV_latency_s_Q_fx = 0; - HrtfFastConv->FASTCONV_taps_s_Q_fx = 0; - HrtfFastConv->FASTCONV_reverbTime_s_Q_fx = 0; - HrtfFastConv->FASTCONV_reverbEne_s_Q_fx = 0; -#endif - #else HrtfFastConv->leftHRIRReal_HOA3_fx = NULL; HrtfFastConv->leftHRIRImag_HOA3_fx = NULL; @@ -584,7 +579,18 @@ void ivas_init_binaural_hrtf_fx( #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->ntaps = 0; move16(); +#ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM + HrtfFastConv->FASTCONV_latency_s_Q_fx = 0; + move16(); + HrtfFastConv->FASTCONV_taps_s_Q_fx = 0; + move16(); + HrtfFastConv->FASTCONV_reverbTime_s_Q_fx = 0; + move16(); + HrtfFastConv->FASTCONV_reverbEne_s_Q_fx = 0; + move16(); #endif +#endif + FOR( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) { HrtfFastConv->fastconvReverberationTimes_fx[i] = 0; @@ -596,11 +602,13 @@ void ivas_init_binaural_hrtf_fx( return; } + /*-------------------------------------------------------------------------* * ivas_alloc_pppMem() * * Allocate memory for tripple pointer elements *-------------------------------------------------------------------------*/ + static ivas_error ivas_alloc_pppMem_fx( Word32 ****pppMem, /*Qx*/ const Word16 dim1, @@ -637,11 +645,13 @@ IF( allocate_init_flag == 0 ) return IVAS_ERR_OK; } + /*-------------------------------------------------------------------------* * ivas_allocate_binaural_hrtf() * * Allocate memory for HrtfFastConv structure elements *-------------------------------------------------------------------------*/ + ivas_error ivas_allocate_binaural_hrtf_fx( HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ #ifdef FIX_CREND_SIMPLIFY_CODE @@ -657,6 +667,7 @@ ivas_error ivas_allocate_binaural_hrtf_fx( #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->n_channels = n_channels; move16(); + test(); test(); test(); @@ -842,6 +853,7 @@ ivas_error ivas_allocate_binaural_hrtf_fx( return IVAS_ERR_OK; } + /*-------------------------------------------------------------------------* * ivas_binaural_hrtf_open() * @@ -883,24 +895,30 @@ static ivas_error ivas_binaural_hrtf_open_fx( { #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_HRIR_latency_s_fx; + move32(); #ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM - HrtfFastConv->FASTCONV_latency_s_Q_fx = sub( Q31, FASTCONV_factor_Q_HRIR_latency_s_fx ); - HrtfFastConv->FASTCONV_taps_s_Q_fx = sub( Q15, FASTCONV_factor_Q_HRIR_fx ); + HrtfFastConv->FASTCONV_latency_s_Q_fx = Q31 - FASTCONV_factor_Q_HRIR_latency_s_fx; + move16(); + HrtfFastConv->FASTCONV_taps_s_Q_fx = Q15 - FASTCONV_factor_Q_HRIR_fx; + move16(); #endif HrtfFastConv->ntaps = BINAURAL_NTAPS; move16(); #else HrtfFastConv->FASTCONV_HRIR_latency_s_fx = FASTCONV_HRIR_latency_s_fx; -#endif move32(); +#endif } IF( EQ_32( input_config, IVAS_AUDIO_CONFIG_HOA2 ) ) { #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_HOA2_latency_s_fx; + move32(); #ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM - HrtfFastConv->FASTCONV_latency_s_Q_fx = sub( Q31, FASTCONV_factor_Q_HOA2_latency_s_fx ); - HrtfFastConv->FASTCONV_taps_s_Q_fx = sub( Q15, FASTCONV_factor_Q_HOA2_fx ); + HrtfFastConv->FASTCONV_latency_s_Q_fx = Q31 - FASTCONV_factor_Q_HOA2_latency_s_fx; + move16(); + HrtfFastConv->FASTCONV_taps_s_Q_fx = Q15 - FASTCONV_factor_Q_HOA2_fx; + move16(); #endif HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; @@ -914,9 +932,12 @@ static ivas_error ivas_binaural_hrtf_open_fx( { #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_HOA3_latency_s_fx; + move32(); #ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM - HrtfFastConv->FASTCONV_latency_s_Q_fx = sub( Q31, FASTCONV_factor_Q_HOA3_latency_s_fx ); - HrtfFastConv->FASTCONV_taps_s_Q_fx = sub( Q15, FASTCONV_factor_Q_HOA3_fx ); + HrtfFastConv->FASTCONV_latency_s_Q_fx = Q31 - FASTCONV_factor_Q_HOA3_latency_s_fx; + move16(); + HrtfFastConv->FASTCONV_taps_s_Q_fx = Q15 - FASTCONV_factor_Q_HOA3_fx; + move16(); #endif HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; move16(); @@ -929,9 +950,12 @@ static ivas_error ivas_binaural_hrtf_open_fx( { #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_FOA_latency_s_fx; + move32(); #ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM - HrtfFastConv->FASTCONV_latency_s_Q_fx = sub( Q31, FASTCONV_factor_Q_FOA_latency_s_fx ); - HrtfFastConv->FASTCONV_taps_s_Q_fx = sub( Q15, FASTCONV_factor_Q_FOA_fx ); + HrtfFastConv->FASTCONV_latency_s_Q_fx = Q31 - FASTCONV_factor_Q_FOA_latency_s_fx; + move16(); + HrtfFastConv->FASTCONV_taps_s_Q_fx = Q15 - FASTCONV_factor_Q_FOA_fx; + move16(); #endif HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; move16(); @@ -945,11 +969,16 @@ static ivas_error ivas_binaural_hrtf_open_fx( { #ifdef FIX_CREND_SIMPLIFY_CODE HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_BRIR_latency_s_fx; + move32(); #ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM - HrtfFastConv->FASTCONV_latency_s_Q_fx = sub( Q31, FASTCONV_factor_Q_BRIR_latency_s_fx ); - HrtfFastConv->FASTCONV_taps_s_Q_fx = sub( Q15, FASTCONV_factor_Q_BRIR_fx ); - HrtfFastConv->FASTCONV_reverbTime_s_Q_fx = sub( Q15, FASTCONV_factor_Q_reverberationTimes_fx ); - HrtfFastConv->FASTCONV_reverbEne_s_Q_fx = sub( Q15, FASTCONV_factor_Q_reverberationEneCorrections_fx ); + HrtfFastConv->FASTCONV_latency_s_Q_fx = Q31 - FASTCONV_factor_Q_BRIR_latency_s_fx; + move16(); + HrtfFastConv->FASTCONV_taps_s_Q_fx = Q15 - FASTCONV_factor_Q_BRIR_fx; + move16(); + HrtfFastConv->FASTCONV_reverbTime_s_Q_fx = Q15 - FASTCONV_factor_Q_reverberationTimes_fx; + move16(); + HrtfFastConv->FASTCONV_reverbEne_s_Q_fx = Q15 - FASTCONV_factor_Q_reverberationEneCorrections_fx; + move16(); #endif HrtfFastConv->ntaps = BINAURAL_NTAPS_MAX; move16(); @@ -968,6 +997,8 @@ static ivas_error ivas_binaural_hrtf_open_fx( #ifdef FIX_CREND_SIMPLIFY_CODE n_channels = 0; + move16(); + test(); test(); IF( ( EQ_32( renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) && NE_32( input_config, IVAS_AUDIO_CONFIG_INVALID ) ) @@ -1004,6 +1035,7 @@ static ivas_error ivas_binaural_hrtf_open_fx( FOR( i = 0; i < BINAURAL_CONVBANDS; i++ ) { #ifdef FIX_CREND_SIMPLIFY_CODE + test(); test(); IF( EQ_32( renderer_type, RENDERER_BINAURAL_FASTCONV ) && EQ_32( HrtfFastConv->n_channels, HRTF_LS_CHANNELS ) ) #else @@ -1060,6 +1092,7 @@ static ivas_error ivas_binaural_hrtf_open_fx( #endif } } + #ifdef FIX_CREND_SIMPLIFY_CODE test(); IF( EQ_32( input_config, IVAS_AUDIO_CONFIG_HOA3 ) && EQ_32( HrtfFastConv->n_channels, HOA3_CHANNELS ) ) @@ -1089,6 +1122,7 @@ static ivas_error ivas_binaural_hrtf_open_fx( #endif } } + #ifdef FIX_CREND_SIMPLIFY_CODE /* Note: IVAS_AUDIO_CONFIG_HOA2 and IVAS_AUDIO_CONFIG_FOA input configs. are not relevant in internal renderer as SBA to binaural always synthesizes HOA3 output for binauralization. However, the external renderer can use them. */ @@ -1120,7 +1154,9 @@ static ivas_error ivas_binaural_hrtf_open_fx( #endif } } + #ifdef FIX_CREND_SIMPLIFY_CODE + test(); IF( EQ_32( input_config, IVAS_AUDIO_CONFIG_FOA ) && EQ_32( HrtfFastConv->n_channels, FOA_CHANNELS ) ) #else IF( EQ_32( input_config, IVAS_AUDIO_CONFIG_FOA ) ) @@ -1149,6 +1185,7 @@ static ivas_error ivas_binaural_hrtf_open_fx( } } } + #ifdef USE_FASTCONV_PARAMBIN_16BIT_ROM Copy_Scale_sig_16_32_r( fastconvReverberationTimes_fx, HrtfFastConv->fastconvReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX, Q26 - FASTCONV_factor_Q_reverberationTimes_fx ); Copy_Scale_sig_16_32_r( fastconvReverberationEneCorrections_fx, HrtfFastConv->fastconvReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX, Q31 - FASTCONV_factor_Q_reverberationTimes_fx ); @@ -1359,8 +1396,6 @@ ivas_error ivas_rend_openCldfbRend( Word16 convBand; ivas_error error; - error = IVAS_ERR_OK; - /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -1404,6 +1439,7 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; hBinRenderer->hInputSetup->output_config = inConfig; #endif + IF( ( error = getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ) ) != IVAS_ERR_OK ) { return error; @@ -1454,14 +1490,16 @@ ivas_error ivas_rend_openCldfbRend( pCldfbRend->hCldfbRend = hBinRenderer; move32(); - return error; + return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_binRenderer_open() * * Open fastconv binaural renderer handle *-------------------------------------------------------------------------*/ + ivas_error ivas_binRenderer_open_fx( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) @@ -1471,9 +1509,6 @@ ivas_error ivas_binRenderer_open_fx( ivas_error error; const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; - error = IVAS_ERR_OK; - move32(); - /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -1502,7 +1537,7 @@ ivas_error ivas_binRenderer_open_fx( hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; move16(); } - else + ELSE { hBinRenderer->numPoses = 1; move16(); @@ -1662,7 +1697,7 @@ ivas_error ivas_binRenderer_open_fx( { pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); } - IF( NE_32( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx, NULL ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_binaural_reverb_init_fx( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx, NULL ) ), IVAS_ERR_OK ) ) { return error; } @@ -1703,14 +1738,16 @@ ivas_error ivas_binRenderer_open_fx( /* Copy the handles to main handle */ st_ivas->hBinRenderer = hBinRenderer; - return error; + return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_binRenderer_convModuleClose() * * Close convolution module handle of fastconv binaural renderer *------------------------------------------------------------------------*/ + static void ivas_binRenderer_convModuleClose_fx( BINAURAL_RENDERER_HANDLE *hBinRenderer, /* i/o: fastconv binaural renderer handle */ const Word16 num_poses /* i : number of poses */ @@ -1860,18 +1897,20 @@ static void ivas_free_pppHrtfMem_fx( return; } + /*------------------------------------------------------------------------- * ivas_binaural_hrtf_close() * * Close fastconv binaural renderer hrtf memories *------------------------------------------------------------------------*/ -void ivas_binaural_hrtf_close( + +void ivas_binaural_hrtf_close_fx( HRTFS_FASTCONV_HANDLE *hHrtfFastConv /* i : fastconv HRTF handle */ ) { Word16 allocate_init_flag; #ifdef FIX_CREND_SIMPLIFY_CODE - int16_t n_channels; + Word16 n_channels; #endif test(); @@ -2140,6 +2179,7 @@ void ivas_binRenderer_fx( rotateFrame_shd_cldfb( RealBuffer_fx, ImagBuffer_fx, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); #endif } + ivas_binRenderer_filterModule_fx( Cldfb_RealBuffer_Binaural_fx[pos_idx], Cldfb_ImagBuffer_Binaural_fx[pos_idx], RealBuffer_fx, ImagBuffer_fx, numTimeSlots, hBinRenderer, pos_idx, *Q_in ); } } diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index dfe167a78ae842c785427e9901cf6770880f666b..a2b3096a97bf6dcec56ef561a7a906f2252f086e 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -1066,7 +1066,7 @@ ivas_error ivas_dirac_dec_config_fx( IF( !need_parambin ) { - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); } need_dirac_rend = 0; diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index bb53a60b99ecfc51e835dcb505b8cae0728a38d5..264012936221b233c80fc7a8993f45385827d4de 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1197,7 +1197,7 @@ static ivas_error ivas_read_format( move16(); st_ivas->sba_order = add( st_ivas->sba_order, shl( st_ivas->bit_stream[( *num_bits_read ) + 1 + SBA_PLANAR_BITS], 1 ) ); move16(); - if ( st_ivas->sba_order == 0 ) + IF( st_ivas->sba_order == 0 ) { st_ivas->ivas_format = SBA_ISM_FORMAT; move32(); @@ -1467,6 +1467,7 @@ ivas_error ivas_init_decoder_front( return error; } } + /*-------------------------------------------------------------------* * Allocate and initialize external orientation handle *--------------------------------------------------------------------*/ @@ -1482,6 +1483,7 @@ ivas_error ivas_init_decoder_front( /*-------------------------------------------------------------------* * Allocate and initialize combined orientation handle *--------------------------------------------------------------------*/ + test(); IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { @@ -1517,7 +1519,7 @@ ivas_error ivas_init_decoder_front( return error; } - IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_HRTF_statistics_binary_open_fx( &st_ivas->hHrtfStatistics ) ), IVAS_ERR_OK ) ) { return error; } @@ -1526,12 +1528,17 @@ ivas_error ivas_init_decoder_front( /*-------------------------------------------------------------------* * Allocate and initialize Binaural Renderer configuration handle *--------------------------------------------------------------------*/ + + test(); + test(); + test(); + test(); test(); test(); IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_STEREO ) && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) { - IF( NE_32( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_render_config_open_fx( &( st_ivas->hRenderConfig ) ) ), IVAS_ERR_OK ) ) { return error; } @@ -1728,7 +1735,7 @@ ivas_error ivas_init_decoder_fx( IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { - IF( NE_32( ( error = ivas_HRTF_statistics_init( &st_ivas->hHrtfStatistics, output_Fs ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_HRTF_statistics_init_fx( &st_ivas->hHrtfStatistics, output_Fs ) ), IVAS_ERR_OK ) ) { return error; } @@ -2476,7 +2483,6 @@ ivas_error ivas_init_decoder_fx( } } - ivas_mcmasa_split_brate_fx( st_ivas->hOutSetup.separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe ); FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) @@ -2664,12 +2670,18 @@ ivas_error ivas_init_decoder_fx( } #ifdef FIX_CREND_SIMPLIFY_CODE - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), - IVAS_ERR_OK ) + Word16 num_poses = 1; + move16(); + if ( st_ivas->hSplitBinRend != NULL ) + { + num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; + move16(); + } + + IF( NE_32( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, num_poses ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), + IF( NE_32( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, + st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #endif { @@ -3421,21 +3433,21 @@ void ivas_destroy_dec_fx( } /* Parametric binaural renderer handle */ - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); /* Crend handle */ #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); + ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ) ); #else - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); + ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); #endif /* Reverb handle */ - ivas_reverb_close( &st_ivas->hReverb ); + ivas_reverb_close_fx( &st_ivas->hReverb ); /* LS config converter handle */ - ivas_ls_setup_conversion_close_fx( &st_ivas->hLsSetUpConversion ); + /* Custom LS configuration handle */ IF( st_ivas->hLsSetupCustom != NULL ) { @@ -3480,7 +3492,7 @@ void ivas_destroy_dec_fx( #endif /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); + ivas_binaural_hrtf_close_fx( &st_ivas->hHrtfFastConv ); /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close_fx( &st_ivas->hHrtfFastConv ); @@ -3489,10 +3501,10 @@ void ivas_destroy_dec_fx( ivas_HRTF_parambin_binary_close_fx( &st_ivas->hHrtfParambin ); /* HRTF statistics */ - ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics ); + ivas_HRTF_statistics_close_fx( &st_ivas->hHrtfStatistics ); /* Config. Renderer */ - ivas_render_config_close( &( st_ivas->hRenderConfig ) ); + ivas_render_config_close_fx( &( st_ivas->hRenderConfig ) ); /* Limiter struct */ ivas_limiter_close_fx( &( st_ivas->hLimiter ) ); diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index ab404b2a9b730b3d496df7bba9fb849754774408..d7caec1ac312a200a70993aede018649489512aa 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -212,7 +212,8 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { /* close the parametric binaural renderer */ - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); + /* Open the TD Binaural renderer */ test(); IF( st_ivas->hHrtfTD == NULL || st_ivas->hBinRendererTd == NULL ) @@ -245,13 +246,13 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { /* close the parametric binaural renderer */ - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); /* Open Crend Binaural renderer */ #ifdef FIX_CREND_SIMPLIFY_CODE - IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #endif st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; @@ -288,7 +289,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { - ivas_reverb_close( &st_ivas->hReverb ); + ivas_reverb_close_fx( &st_ivas->hReverb ); } } ELSE @@ -312,9 +313,9 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( /* close the crend binaural renderer */ #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); + ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ) ); #else - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); + ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); #endif } } diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index fe36c1ea2fdbfebcbc76fd2e695be57f4d65a0dc..a1988168cc491fed46256a4d16a7b7089a2bdbd6 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2085,7 +2085,7 @@ ivas_error ivas_jbm_dec_render_fx( scale_sig32( p_output_fx[i], *nSamplesRendered, negate( sub( 11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q11 } - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -2325,8 +2325,8 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE { - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, + &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; @@ -2750,8 +2750,8 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( *st_ivas->hCrendWrapper->p_io_qfactor = 11; move16(); - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, - NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ), + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, + NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; @@ -2798,8 +2798,8 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( *st_ivas->hCrendWrapper->p_io_qfactor = 11; move16(); - IF( NE_32( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : st_ivas->hTcBuffer->tc_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ), + IF( NE_32( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, + hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : st_ivas->hTcBuffer->tc_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ), IVAS_ERR_OK ) ) { return error; diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index e3964ae25ca6ce76b8d8a5870e2f1a8bd7dca7a9..3db8945f37513099b39d3eca07c58dc06671e509 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -201,6 +201,7 @@ ivas_error ivas_masa_decode_fx( st_ivas->nchan_ism = sub( 5, add( st_ivas->bit_stream[bits_per_frame - 3], shl( st_ivas->bit_stream[bits_per_frame - 2], 1 ) ) ); #endif } + test(); #ifdef FIX_CREND_SIMPLIFY_CODE IF( EQ_32( ivas_format, MASA_FORMAT ) && GT_16( st_ivas->nchan_ism, 0 ) ) @@ -1748,7 +1749,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_DISABLE ) || EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) { /* close all unnecessary parametric decoding and rendering */ - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); @@ -1759,7 +1760,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( IF( st_ivas->hDirAC != NULL ) { /* close all unnecessary parametric decoding and rendering */ - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 1a745c4a24bcdfa15ce19d4f5e5d8dafe0f04a63..cb533bb5a0328bcdaf20013c484d0184613e08ce 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1444,9 +1444,9 @@ static ivas_error ivas_mc_dec_reconfig_fx( IF( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || NE_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) ) { #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); + ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ) ); #else - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); + ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); #endif } @@ -1462,7 +1462,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( test(); IF( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) && NE_16( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) { - ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); + ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); } } @@ -1497,7 +1497,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( } IF( EQ_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { - IF( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper, 1 ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_rend_initCrendWrapper_fx( &st_ivas->hCrendWrapper, 1 ) ) != IVAS_ERR_OK ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); } @@ -1513,9 +1513,9 @@ static ivas_error ivas_mc_dec_reconfig_fx( ELSE IF( st_ivas->hCrendWrapper == NULL && ( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) ) { #ifdef FIX_CREND_SIMPLIFY_CODE - IF( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else - IF( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #endif { return error; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 0dc09e13539f246cd62041f5dc2b9dea8871b822..c87b4292c2582e7a4f7093557c8803bb9a4cf1ac 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -145,10 +145,10 @@ ivas_error IVAS_DEC_FeedFrame_Serial( #ifdef FIX_CREND_SIMPLIFY_CODE ivas_error IVAS_DEC_ReadFormat( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ - IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec,/* o: secondary binaural renderer type */ - IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ + IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec, /* o : secondary binaural renderer type */ + IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ ); #endif @@ -274,13 +274,18 @@ ivas_error IVAS_DEC_VoIP_GetSamples( UWord16 nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ Word16 *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels Q0 */ const UWord32 systemTimestamp_ms, /* i : current system timestamp */ +#ifdef FIX_CREND_SIMPLIFY_CODE #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriterFn jbmWriterFn, void* jbmWriter, #endif -#ifdef FIX_CREND_SIMPLIFY_CODE - bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ - UWord16 *nSamplesRendered /* o : number of samples rendered */ + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + UWord16 *nSamplesRendered /* o : number of samples rendered */ +#else + #ifdef SUPPORT_JBM_TRACEFILE + JbmTraceFileWriterFn jbmWriterFn, + void* jbmWriter +#endif #endif ); @@ -375,13 +380,13 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( ivas_error IVAS_DEC_GetHrtfHandle( #endif IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ); /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( @@ -401,13 +406,13 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle( #ifdef FIX_CREND_SIMPLIFY_CODE ivas_error IVAS_DEC_HRTF_binary_open( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_BIN_RENDERER_TYPE binaural_renderer /* i : binaural renderer type */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const IVAS_BIN_RENDERER_TYPE binaural_renderer /* i : binaural renderer type */ ); ivas_error IVAS_DEC_HRTF_binary_close( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_BIN_RENDERER_TYPE binaural_renderer_old /* i : previous binaural renderer type */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const IVAS_BIN_RENDERER_TYPE binaural_renderer_old /* i : previous binaural renderer type */ ); #endif diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index d1c857d2e78a9ca1a12536e1959f072a5e10e25a..c3dffd26f69091d171de9283230832a006b41b9f 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1626,6 +1626,15 @@ static ivas_error IVAS_DEC_Setup( * - reconfigure the decoder when the number of TC or IVAS total bitrate change *----------------------------------------------------------------*/ +#if 1 + if ( st_ivas->bfi == 0 ) + { + if ( ( error = ivas_dec_setup( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#else IF( st_ivas->bfi == 0 ) { Word32 ivas_total_brate; @@ -1746,6 +1755,7 @@ static ivas_error IVAS_DEC_Setup( } } } +#endif *nTransportChannels = (UWord8) st_ivas->hTcBuffer->nchan_transport_jbm; *nTcBufferGranularity = (UWord16) st_ivas->hTcBuffer->n_samples_granularity; @@ -2642,8 +2652,8 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( ivas_error IVAS_DEC_GetHrtfHandle( #endif - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ) { test(); @@ -2666,8 +2676,12 @@ ivas_error IVAS_DEC_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef FIX_CREND_SIMPLIFY_CODE + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ +#else IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ +#endif ) { test(); @@ -2678,7 +2692,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( return IVAS_ERR_WRONG_PARAMS; } - *hSetOfHRTF = &hIvasDec->st_ivas->hHrtfCrend; + *hHrtfCrend = &hIvasDec->st_ivas->hHrtfCrend; #else IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) { @@ -2687,6 +2701,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; #endif + return IVAS_ERR_OK; } @@ -2835,7 +2850,7 @@ ivas_error IVAS_DEC_HRTF_binary_open( test(); IF( st_ivas->hHrtfStatistics == NULL && ( EQ_32( binaural_renderer, IVAS_BIN_RENDERER_TYPE_FASTCONV ) || EQ_32( binaural_renderer, IVAS_BIN_RENDERER_TYPE_CREND ) ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - IF( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_HRTF_statistics_binary_open_fx( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK ) { return error; } @@ -2887,7 +2902,7 @@ ivas_error IVAS_DEC_HRTF_binary_close( IF( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) { /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); + ivas_binaural_hrtf_close_fx( &st_ivas->hHrtfFastConv ); /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close_fx( &st_ivas->hHrtfFastConv ); @@ -3063,7 +3078,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( IF( hIvasDec->st_ivas->hDiracDecBin[0] != NULL && hIvasDec->st_ivas->hDiracDecBin[0]->hReverb != NULL ) { ivas_binaural_reverb_close_fx( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ) ); - IF( ( error = ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_binaural_reverb_init_fx( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -3074,7 +3089,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( IF( hIvasDec->st_ivas->hBinRenderer != NULL && hIvasDec->st_ivas->hBinRenderer->hReverb != NULL ) { ivas_binaural_reverb_close_fx( &( hIvasDec->st_ivas->hBinRenderer->hReverb ) ); - IF( ( error = ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hBinRenderer->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hBinRenderer->conv_band, hIvasDec->st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_binaural_reverb_init_fx( &( hIvasDec->st_ivas->hBinRenderer->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hBinRenderer->conv_band, hIvasDec->st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -3484,7 +3499,9 @@ ivas_error IVAS_DEC_TSM_SetQuality( return IVAS_ERR_OK; } + #ifdef FIX_CREND_SIMPLIFY_CODE + /*---------------------------------------------------------------------* * renderer_type_to_mode() * @@ -3745,13 +3762,18 @@ ivas_error IVAS_DEC_VoIP_GetSamples( UWord16 nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ Word16 *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels Q0 */ const UWord32 systemTimestamp_ms, /* i : current system timestamp */ +#ifdef FIX_CREND_SIMPLIFY_CODE #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter, #endif -#ifdef FIX_CREND_SIMPLIFY_CODE bool *bitstreamReadDone, /* o : that bitstream was read */ UWord16 *nSamplesRendered /* o : number of samples rendered */ +#else +#ifdef SUPPORT_JBM_TRACEFILE + JbmTraceFileWriterFn jbmWriterFn, + void *jbmWriter +#endif #endif ) { @@ -3781,9 +3803,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nOutChannels = (UWord8) st_ivas->hDecoderConfig->nchan_out; #ifndef FIX_CREND_SIMPLIFY_CODE nSamplesRendered = 0; -#endif move16(); move16(); +#endif move16(); IF( nSamplesPerChannel == 0 ) diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 60849b7ba774e03d0169dd975c5b859fc714281c..45d923b3e6f017a63292b87fa1df348db9a415ec 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -56,7 +56,7 @@ * Initialize hHrtf handle *------------------------------------------------------------------------*/ -ivas_error ivas_Crend_hrtf_init( +ivas_error ivas_Crend_hrtf_init_fx( HRTFS_CREND_DATA *hHrtf /* i/o: HRTF handle */ #else /*------------------------------------------------------------------------- @@ -128,6 +128,7 @@ ivas_error ivas_hrtf_init( return IVAS_ERR_OK; } + #ifdef FIX_CREND_SIMPLIFY_CODE /*------------------------------------------------------------------------- * ivas_hrtf_open() @@ -135,7 +136,7 @@ ivas_error ivas_hrtf_init( * Open hHrtf handle for Crend renderer *------------------------------------------------------------------------*/ -static ivas_error ivas_hrtf_open( +static ivas_error ivas_hrtf_open_fx( HRTFS_CREND_HANDLE *hHrtf_out /* o : HRTF handle */ ) { @@ -149,14 +150,14 @@ static ivas_error ivas_hrtf_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } - IF( ( error = ivas_Crend_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_Crend_hrtf_init_fx( hHrtf ) ) != IVAS_ERR_OK ) #else /*------------------------------------------------------------------------- * ivas_hrtf_open() * * Open hHrtf handle *------------------------------------------------------------------------*/ -static ivas_error ivas_hrtf_open( +static ivas_error ivas_hrtf_open_fx( HRTFS_HANDLE *hHrtf_out /* o : HRTF handle */ ) { @@ -194,7 +195,11 @@ static ivas_error ivas_hrtf_open( *------------------------------------------------------------------------*/ static void ivas_hrtf_close( +#ifdef FIX_CREND_SIMPLIFY_CODE + HRTFS_CREND_HANDLE *hHrtf /* i/o: Crend HRTF handle */ +#else HRTFS_HANDLE *hHrtf /* i/o: HRTF handle */ +#endif ) { test(); @@ -208,8 +213,10 @@ static void ivas_hrtf_close( return; } + + /*------------------------------------------------------------------------- - * initCrend_from_rom() + * ivas_rend_initCrend() * * Allocate and initialize crend renderer handle *------------------------------------------------------------------------*/ @@ -220,7 +227,7 @@ static ivas_error ivas_rend_initCrend_fx( const AUDIO_CONFIG outConfig, #ifdef FIX_CREND_SIMPLIFY_CODE HRTFS_CREND_HANDLE hHrtfCrend, - const int16_t ext_rend_flag, + const Word16 ext_rend_flag, #else HRTFS_CREND_HANDLE hSetOfHRTF, #endif @@ -271,7 +278,7 @@ static ivas_error ivas_rend_initCrend_fx( ELSE { /* create new handle when HRTF is loaded from ROM, or external renderer is used */ - IF( NE_32( ( error = ivas_hrtf_open( &hHrtf ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_hrtf_open_fx( &hHrtf ) ), IVAS_ERR_OK ) ) { return error; } @@ -285,7 +292,7 @@ static ivas_error ivas_rend_initCrend_fx( } } #else - IF( NE_32( ivas_hrtf_open( &hHrtf ), IVAS_ERR_OK ) ) + IF( NE_32( ivas_hrtf_open_fx( &hHrtf ), IVAS_ERR_OK ) ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for HRTF handle" ); } @@ -304,6 +311,10 @@ static ivas_error ivas_rend_initCrend_fx( return IVAS_ERR_INTERNAL_FATAL; } +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( hHrtf->init_from_rom ) + { +#else test(); test(); test(); @@ -319,10 +330,6 @@ static ivas_error ivas_rend_initCrend_fx( test(); test(); test(); -#ifdef FIX_CREND_SIMPLIFY_CODE - IF( hHrtf->init_from_rom ) - { -#else IF( ( hSetOfHRTF == NULL ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) || @@ -331,9 +338,9 @@ static ivas_error ivas_rend_initCrend_fx( ( ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { -#endif hHrtf->init_from_rom = 1; move16(); +#endif IF( EQ_32( inConfigType, IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ) { hHrtf->max_num_ir = sub( hHrtf->max_num_ir, 1 ); /* subtract LFE */ @@ -352,9 +359,6 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_Combined_BRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_Combined_BRIR_inv_diffuse_weight_Q_48kHz_fx; hHrtf->factor_Q_pOut_to_bin = Q15 - CRendBin_Combined_BRIR_coeff_Q_48kHz_fx; - move16(); - move16(); - move16(); #endif } ELSE @@ -366,14 +370,17 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_Combined_HRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_Combined_HRIR_inv_diffuse_weight_Q_48kHz_fx; hHrtf->factor_Q_pOut_to_bin = Q15 - CRendBin_Combined_HRIR_coeff_Q_48kHz_fx; - move16(); - move16(); - move16(); #endif } move32(); move16(); move16(); +#ifdef FIX_CREND_SIMPLIFY_CODE + move16(); + move16(); + move16(); +#endif + FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) @@ -409,9 +416,6 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_Combined_BRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_Combined_BRIR_inv_diffuse_weight_Q_32kHz_fx; hHrtf->factor_Q_pOut_to_bin = Q15 - CRendBin_Combined_BRIR_coeff_Q_32kHz_fx; - move16(); - move16(); - move16(); #endif } ELSE @@ -423,14 +427,16 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_Combined_HRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_Combined_HRIR_inv_diffuse_weight_Q_32kHz_fx; hHrtf->factor_Q_pOut_to_bin = Q15 - CRendBin_Combined_HRIR_coeff_Q_32kHz_fx; - move16(); - move16(); - move16(); #endif } move32(); move16(); move16(); +#ifdef FIX_CREND_SIMPLIFY_CODE + move16(); + move16(); + move16(); +#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { @@ -467,9 +473,6 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_Combined_BRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_Combined_BRIR_inv_diffuse_weight_Q_16kHz_fx; hHrtf->factor_Q_pOut_to_bin = Q15 - CRendBin_Combined_BRIR_coeff_Q_16kHz_fx; - move16(); - move16(); - move16(); #endif } ELSE @@ -481,14 +484,16 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_Combined_HRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_Combined_HRIR_inv_diffuse_weight_Q_16kHz_fx; hHrtf->factor_Q_pOut_to_bin = Q15 - CRendBin_Combined_HRIR_coeff_Q_16kHz_fx; - move16(); - move16(); - move16(); #endif } move32(); move16(); move16(); +#ifdef FIX_CREND_SIMPLIFY_CODE + move16(); + move16(); + move16(); +#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { @@ -646,6 +651,9 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->latency_s_fx = CRendBin_HOA3_HRIR_latency_s_fx; // Q31 hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_48kHz; hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; + move32(); + move16(); + move16(); #ifdef FIX_CREND_SIMPLIFY_CODE hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_HOA3_HRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_48kHz_fx; @@ -654,9 +662,6 @@ static ivas_error ivas_rend_initCrend_fx( move16(); move16(); #endif - move32(); - move16(); - move16(); FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { @@ -693,6 +698,9 @@ static ivas_error ivas_rend_initCrend_fx( hHrtf->latency_s_fx = CRendBin_HOA3_HRIR_latency_s_fx; // Q31 hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_32kHz; hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; + move32(); + move16(); + move16(); #ifdef FIX_CREND_SIMPLIFY_CODE hHrtf->factor_Q_latency_s_fx = Q31 - CRendBin_HOA3_HRIR_Q_latency_s_fx; hHrtf->factor_Q_inv_diffuse_weight = Q15 - CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_32kHz_fx; @@ -701,9 +709,6 @@ static ivas_error ivas_rend_initCrend_fx( move16(); move16(); #endif - move32(); - move16(); - move16(); FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { @@ -809,7 +814,6 @@ static ivas_error ivas_rend_initCrend_fx( move16(); #endif - FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) @@ -905,7 +909,6 @@ static ivas_error ivas_rend_initCrend_fx( move16(); #endif - FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) @@ -1007,6 +1010,7 @@ static ivas_error ivas_rend_initCrend_fx( move16(); move16(); #endif + FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) @@ -1112,7 +1116,6 @@ static ivas_error ivas_rend_initCrend_fx( move16(); hHrtf->gain_lfe_fx = GAIN_LFE_FX; move16(); - #ifdef FIX_CREND_SIMPLIFY_CODE } @@ -1135,7 +1138,6 @@ static ivas_error ivas_rend_initCrend_fx( move16(); move16(); - FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { hHrtf->num_iterations_diffuse[j] = hHrtfCrend->num_iterations_diffuse[j]; @@ -1229,7 +1231,7 @@ static ivas_error ivas_rend_initCrend_fx( MOVE( 3 ); #undef WMC_TOOL_SKIP } - else + ELSE { hHrtf->pIndex_frequency_max[i][j] = hHrtfCrend->pIndex_frequency_max[tmp][j]; hHrtf->pOut_to_bin_re_fx[i][j] = hHrtfCrend->pOut_to_bin_re_fx[tmp][j]; @@ -1740,18 +1742,20 @@ static ivas_error ivas_er_init_handle( { return error; } + return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_rend_initCrendWrapper() * * Allocate and initialize crend renderer handle *------------------------------------------------------------------------*/ -ivas_error ivas_rend_initCrendWrapper( +ivas_error ivas_rend_initCrendWrapper_fx( CREND_WRAPPER_HANDLE *pCrend, - const int16_t num_poses ) + const Word16 num_poses ) { Word16 i; CREND_HANDLE hCrend; @@ -1839,11 +1843,11 @@ ivas_error ivas_rend_openMultiBinCrend( const Word32 output_Fs ) { #ifdef FIX_CREND_SIMPLIFY_CODE - return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, 0, pMultiBinPoseData->num_poses ); + return ivas_rend_openCrend_fx( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, 0, pMultiBinPoseData->num_poses ); #else ivas_error error; - if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend_fx( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) { return error; } @@ -1858,7 +1862,7 @@ ivas_error ivas_rend_openMultiBinCrend( * Allocate and initialize crend renderer handle *------------------------------------------------------------------------*/ -ivas_error ivas_rend_openCrend( +ivas_error ivas_rend_openCrend_fx( CREND_WRAPPER_HANDLE *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, @@ -1871,21 +1875,22 @@ ivas_error ivas_rend_openCrend( HRTFS_STATISTICS_HANDLE hHrtfStatistics, const Word32 output_Fs, #ifdef FIX_CREND_SIMPLIFY_CODE - const int16_t ext_rend_flag, + const Word16 ext_rend_flag, #endif const Word16 num_poses ) { Word16 i, subframe_length; Word32 max_total_ir_len; +#ifdef FIX_CREND_SIMPLIFY_CODE + HRTFS_CREND_HANDLE hHrtf; +#else HRTFS_HANDLE hHrtf; +#endif CREND_HANDLE hCrend; ivas_error error; Word16 pos_idx; - error = IVAS_ERR_OK; - move16(); - - IF( ( error = ivas_rend_initCrendWrapper( pCrend, num_poses ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_rend_initCrendWrapper_fx( pCrend, num_poses ) ) != IVAS_ERR_OK ) { return error; } @@ -1904,7 +1909,7 @@ ivas_error ivas_rend_openCrend( } } - for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hCrend = ( *pCrend )->hCrend[pos_idx]; hHrtf = ( *pCrend )->hHrtfCrend; @@ -2066,16 +2071,18 @@ ivas_error ivas_rend_openCrend( ( *pCrend )->hCrend[pos_idx] = hCrend; } + return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_rend_closeCrend() * * Deallocate Crend renderer handle *------------------------------------------------------------------------*/ -void ivas_rend_closeCrend( +void ivas_rend_closeCrend_fx( CREND_WRAPPER_HANDLE *pCrend #ifndef FIX_CREND_SIMPLIFY_CODE , @@ -2169,7 +2176,7 @@ void ivas_rend_closeCrend( hCrend->hTrack = NULL; } - ivas_reverb_close( &hCrend->hReverb ); + ivas_reverb_close_fx( &hCrend->hReverb ); IF( hCrend->reflections != NULL ) { @@ -2215,7 +2222,7 @@ void ivas_rend_closeCldfbRend( } ivas_binRenderer_close_fx( &pCldfbRend->hCldfbRend ); - ivas_binaural_hrtf_close( &pCldfbRend->hHrtfFastConv ); + ivas_binaural_hrtf_close_fx( &pCldfbRend->hHrtfFastConv ); ivas_HRTF_fastconv_binary_close_fx( &pCldfbRend->hHrtfFastConv ); return; @@ -2228,7 +2235,7 @@ void ivas_rend_closeCldfbRend( *-----------------------------------------------------------------------------------------*/ #ifdef FIX_CREND_SIMPLIFY_CODE -static ivas_error ivas_rend_crendConvolver( +static ivas_error ivas_rend_crendConvolver_fx( const CREND_WRAPPER *pCrend, AUDIO_CONFIG inConfig, AUDIO_CONFIG outConfig, @@ -2391,12 +2398,12 @@ static ivas_error ivas_rend_crendConvolver( index_in = add( hCrend->diffuse_delay_line_rw_index, add( m, 1 ) ); index_in = index_in % pCrend->hHrtfCrend->num_iterations_diffuse[0]; offset_diffuse = L_mult0( index_in, subframe_length ); - if ( pCrend->hHrtfCrend->same_inv_diffuse_weight ) + IF( pCrend->hHrtfCrend->same_inv_diffuse_weight ) { pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse]; pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[0][offset_diffuse]; } - else + ELSE { pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[j][offset_diffuse]; pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[j][offset_diffuse]; @@ -2433,7 +2440,7 @@ static ivas_error ivas_rend_crendConvolver( return IVAS_ERR_OK; } #else -static ivas_error ivas_rend_crendConvolver( +static ivas_error ivas_rend_crendConvolver_fx( const CREND_WRAPPER *pCrend, AUDIO_CONFIG inConfig, AUDIO_CONFIG outConfig, @@ -2669,7 +2676,7 @@ static ivas_error ivas_rend_crendConvolver( * *-----------------------------------------------------------------------------------------*/ -ivas_error ivas_rend_crendProcessSubframe( +ivas_error ivas_rend_crendProcessSubframe_fx( const CREND_WRAPPER *pCrend, /* i/o: Crend wrapper handle */ const AUDIO_CONFIG inConfig, /* i : input audio configuration */ const AUDIO_CONFIG outConfig, /* i : output audio configuration */ @@ -2833,7 +2840,7 @@ ivas_error ivas_rend_crendProcessSubframe( test(); IF( EQ_32( inConfigType, IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || EQ_32( inConfigType, IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { - IF( NE_32( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local_fx, p_pcm_tmp_fx, output_Fs, 0, pos_idx ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendConvolver_fx( pCrend, inConfig, outConfig, tc_local_fx, p_pcm_tmp_fx, output_Fs, 0, pos_idx ) ), IVAS_ERR_OK ) ) { return error; } @@ -2857,7 +2864,6 @@ ivas_error ivas_rend_crendProcessSubframe( p_pcm_tmp_fx[ch] += subframe_len; } #endif - if ( hTcBuffer != NULL ) { hTcBuffer->slots_rendered = add( hTcBuffer->subframe_nbslots[subframe_idx], hTcBuffer->slots_rendered ); @@ -2868,8 +2874,9 @@ ivas_error ivas_rend_crendProcessSubframe( { return IVAS_ERR_INVALID_INPUT_FORMAT; } + #ifdef FIX_CREND_SIMPLIFY_CODE - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { /* move to output */ Copy32( pcm_tmp_fx[ch], p_output_fx[ch], subframe_len ); @@ -2877,6 +2884,7 @@ ivas_error ivas_rend_crendProcessSubframe( p_output_fx[ch] += subframe_len; } #endif + /* update combined orientation access index */ ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_len ); } @@ -2901,6 +2909,7 @@ ivas_error ivas_rend_crendProcessSubframe( MVR2R_WORD32( pcm_tmp_fx[ch], output[ch], n_samples_to_render ); // Qx } #endif + if ( hTcBuffer != NULL ) { hTcBuffer->subframes_rendered = last_sf; @@ -3050,8 +3059,8 @@ ivas_error ivas_rend_crendProcessSubframesSplitBin( Copy32( hCombinedOrientationData->Rmat_prev_fx[pos_idx][i], pCombinedOrientationDataLocal->Rmat_prev_fx[0][i], 3 ); } - IF( ( error = ivas_rend_crendProcessSubframe( pCrend, inConfig, outConfig, hDecoderConfig, pCombinedOrientationDataLocal, - hIntSetup, hEFAPdata, hTcBuffer, p_tmpInputBuffer, p_tmpInputBuffer, n_samples_to_render, output_Fs, pos_idx ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_rend_crendProcessSubframe_fx( pCrend, inConfig, outConfig, hDecoderConfig, pCombinedOrientationDataLocal, + hIntSetup, hEFAPdata, hTcBuffer, p_tmpInputBuffer, p_tmpInputBuffer, n_samples_to_render, output_Fs, pos_idx ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 66cc455eb9d6fbd2b7684346be40916c8a7aaf20..e2bb6efb08d2dc24f5e0525b48e0d870c4377193 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -301,6 +301,7 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( } hDiracDecBin->q_earlyPartEneCorrection = Q28; move16(); + /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ test(); test(); @@ -312,8 +313,7 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( IF( hDiracDecBin->hReverb == NULL && EQ_16( pos_idx, 0 ) ) /* open reverb only for the main direction */ { - - IF( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx, hDiracDecBin->earlyPartEneCorrection_fx ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_binaural_reverb_init_fx( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx, hDiracDecBin->earlyPartEneCorrection_fx ) ), IVAS_ERR_OK ) ) { return error; } @@ -414,15 +414,18 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( return error; } } + return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_dirac_dec_close_binaural_data() * * Close parametric binaural renderer *------------------------------------------------------------------------*/ -void ivas_dirac_dec_close_binaural_data( + +void ivas_dirac_dec_close_binaural_data_fx( DIRAC_DEC_BIN_HANDLE *hBinaural /* i/o: decoder DirAC binaural data handle */ ) { diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 712213775cf94767cb01967d8d08595c1f93c99c..57132210b0aace3f60a8a4d13f942ee70c6481e2 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -82,7 +82,9 @@ void ivas_HRTF_binary_close_fx( return; } + #ifdef FIX_CREND_SIMPLIFY_CODE + /*-----------------------------------------------------------------------* * ivas_HRTF_CRend_binary_open() * @@ -99,7 +101,7 @@ ivas_error ivas_HRTF_CRend_binary_open_fx( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } - IF( ( error = ivas_Crend_hrtf_init( *hHrtfCrend ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_Crend_hrtf_init_fx( *hHrtfCrend ) ) != IVAS_ERR_OK ) { return error; } @@ -121,7 +123,7 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_int16( { *buffer = (Word16 *) malloc( mem_size ); - if ( *buffer == NULL ) + IF( *buffer == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); } @@ -158,6 +160,7 @@ ivas_error ivas_HRTF_CRend_binary_open_fx( #endif #ifdef FIX_CREND_SIMPLIFY_CODE + /*-------------------------------------------------------------------* * ivas_HRTF_CRend_binary_close() * @@ -211,6 +214,7 @@ void ivas_HRTF_CRend_binary_close_fx( free( *hHrtfCrend ); *hHrtfCrend = NULL; + return; } #else @@ -328,7 +332,7 @@ void ivas_HRTF_parambin_binary_close_fx( * Allocate HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ -ivas_error ivas_HRTF_statistics_binary_open( +ivas_error ivas_HRTF_statistics_binary_open_fx( HRTFS_STATISTICS **hHrtfStatistics ) { *hHrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ); @@ -337,6 +341,13 @@ ivas_error ivas_HRTF_statistics_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } +#ifdef FIX_CREND_SIMPLIFY_CODE + ( *hHrtfStatistics )->average_energy_l_dyn = NULL; + ( *hHrtfStatistics )->average_energy_r_dyn = NULL; + ( *hHrtfStatistics )->inter_aural_coherence_dyn = NULL; + ( *hHrtfStatistics )->fromROM = 1; +#endif + return IVAS_ERR_OK; } @@ -347,7 +358,7 @@ ivas_error ivas_HRTF_statistics_binary_open( * Close HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ -void ivas_HRTF_statistics_close( +void ivas_HRTF_statistics_close_fx( HRTFS_STATISTICS **hHrtfStatistics ) { test(); @@ -369,7 +380,7 @@ void ivas_HRTF_statistics_close( * Allocates HRTF statistics handle and initializes from ROM *-----------------------------------------------------------------------*/ -ivas_error ivas_HRTF_statistics_init( +ivas_error ivas_HRTF_statistics_init_fx( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, #ifdef FIX_CREND_SIMPLIFY_CODE const Word32 sampleRate @@ -427,7 +438,7 @@ ivas_error ivas_HRTF_statistics_init( HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; - break; + BREAK; case 32000: HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); IF( HrtfStatistics->average_energy_l_dyn == NULL ) @@ -456,7 +467,7 @@ ivas_error ivas_HRTF_statistics_init( HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; - break; + BREAK; case 16000: HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( Word32 ) ); IF( HrtfStatistics->average_energy_l_dyn == NULL ) @@ -485,7 +496,7 @@ ivas_error ivas_HRTF_statistics_init( HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; - break; + BREAK; } HrtfStatistics->fromROM = TRUE; diff --git a/lib_rend/ivas_mcmasa_ana_fx.c b/lib_rend/ivas_mcmasa_ana_fx.c index 4dee666004b0802699ec594ea1b767e6543e02b7..0236b080b5da2c5179acc2aac1bc8e06b3dd945a 100644 --- a/lib_rend/ivas_mcmasa_ana_fx.c +++ b/lib_rend/ivas_mcmasa_ana_fx.c @@ -60,13 +60,12 @@ /* Structure for covariance matrix */ typedef struct { - float xr[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; - float xi[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; Word32 xr_fx[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; Word32 xi_fx[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; Word16 xr_e[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; /*Stores exponent for xr_fx*/ Word16 xi_e[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; /*Stores exponent for xi_fx*/ } CovarianceMatrix; + void ivas_mcmasa_param_est_ana_fx( MCMASA_ANA_HANDLE hMcMasa, /* i : McMASA analyzer structure */ Word32 data_fx[][L_FRAME48k], /* i : Audio frame in MC-format */ @@ -80,7 +79,6 @@ void ivas_mcmasa_param_est_ana_fx( const Word16 nchan_inp /* i : Number of input channels */ ); - static void computeVerticalDiffuseness_fx( Word32 **buffer_intensity, /* i : Intensity vectors */ const Word32 *buffer_energy, /* i : Energy */ @@ -88,6 +86,7 @@ static void computeVerticalDiffuseness_fx( Word32 *diffuseness, /* o : Estimated diffuseness Q31 */ Word16 *buffer_intensity_q, Word16 *buffer_energy_q ); + static void compute_cov_mtx_fx( Word32 sr[MCMASA_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Input matrix, real, s[ch][freq] */ Word32 si[MCMASA_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Input matrix, imag, s[ch][freq] */ @@ -96,6 +95,7 @@ static void compute_cov_mtx_fx( CovarianceMatrix *COVls, /* o : Output matrix, contains upper part of cov mtx */ Word16 inp_exp /* i : Stores exponent for sr and si */ ); + static void computeEvenLayout_fx( const Word32 *ls_azimuth, /* i: Q22 */ Word32 *ls_azimuth_even, /* o: Q22 */ diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index b5a0a8d6e206ce31e661aed90ac8b4dfae77f1af..68c312ff047c2cd4bbef38ab61bfedeaaf54c7ba 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -235,7 +235,7 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ ); -void ivas_dirac_dec_close_binaural_data( +void ivas_dirac_dec_close_binaural_data_fx( DIRAC_DEC_BIN_HANDLE *hBinaural /* i/o: decoder DirAC binaural data handle */ ); @@ -626,7 +626,7 @@ void ivas_HRTF_CRend_binary_close_fx( HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ ); -ivas_error ivas_HRTF_statistics_init( +ivas_error ivas_HRTF_statistics_init_fx( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ const int32_t sampleRate /* i : Sample rate */ ); @@ -640,17 +640,21 @@ void ivas_HRTF_CRend_binary_close_fx( HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ ); -ivas_error ivas_HRTF_statistics_init( +ivas_error ivas_HRTF_statistics_init_fx( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ +#ifdef FIX_CREND_SIMPLIFY_CODE const Word32 sampleRate /* i : Sample rate */ +#else + Word32 sampleRate +#endif ); #endif -void ivas_HRTF_statistics_close( +void ivas_HRTF_statistics_close_fx( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); -ivas_error ivas_HRTF_statistics_binary_open( +ivas_error ivas_HRTF_statistics_binary_open_fx( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); @@ -903,7 +907,7 @@ void TDREND_firfilt_fx( * Crend renderer *----------------------------------------------------------------------------------*/ -ivas_error ivas_rend_openCrend( +ivas_error ivas_rend_openCrend_fx( CREND_WRAPPER_HANDLE *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, @@ -911,7 +915,7 @@ ivas_error ivas_rend_openCrend( #ifdef FIX_CREND_SIMPLIFY_CODE HRTFS_CREND_HANDLE hHrtfCrend, #else - HRTFS_CREND_HANDLE hSetOfHRTF, + HRTFS_CREND_HANDLE hSetOfHRTF, #endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const Word32 output_Fs, @@ -922,18 +926,18 @@ ivas_error ivas_rend_openCrend( ); #ifdef FIX_CREND_SIMPLIFY_CODE -void ivas_rend_closeCrend( +void ivas_rend_closeCrend_fx( CREND_WRAPPER_HANDLE *pCrend ); #else -void ivas_rend_closeCrend( +void ivas_rend_closeCrend_fx( CREND_WRAPPER_HANDLE *pCrend, const Word16 num_poses ); #endif #ifdef FIX_CREND_SIMPLIFY_CODE -ivas_error ivas_Crend_hrtf_init( +ivas_error ivas_Crend_hrtf_init_fx( HRTFS_CREND_DATA *hHrtf /* i/o: Crend HRTF handle */ ); #else @@ -942,12 +946,12 @@ ivas_error ivas_hrtf_init( ); #endif -ivas_error ivas_rend_initCrendWrapper( +ivas_error ivas_rend_initCrendWrapper_fx( CREND_WRAPPER_HANDLE *pCrend, const Word16 num_poses ); -ivas_error ivas_rend_crendProcessSubframe( +ivas_error ivas_rend_crendProcessSubframe_fx( const CREND_WRAPPER *pCrend, /* i/o: Crend wrapper handle */ const AUDIO_CONFIG inConfig, /* i : input audio configuration */ const AUDIO_CONFIG outConfig, /* i : output audio configuration */ @@ -968,7 +972,7 @@ ivas_error ivas_rend_crendProcessSubframe( * Reverberator *----------------------------------------------------------------------------------*/ -ivas_error ivas_binaural_reverb_init( +ivas_error ivas_binaural_reverb_init_fx( REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ const Word16 numBins, /* i : number of CLDFB bins */ @@ -1001,7 +1005,7 @@ ivas_error ivas_reverb_open_fx( const Word32 output_Fs /* i : output sampling rate */ ); -void ivas_reverb_close( +void ivas_reverb_close_fx( REVERB_HANDLE *hReverb /* i/o: Reverberator handle */ ); @@ -1372,11 +1376,11 @@ ivas_error combine_external_and_head_orientations_rend( * Renderer configuration *----------------------------------------------------------------------------------*/ -ivas_error ivas_render_config_open( +ivas_error ivas_render_config_open_fx( RENDER_CONFIG_HANDLE *hRenderConfig /* i/o: Renderer config handle */ ); -void ivas_render_config_close( +void ivas_render_config_close_fx( RENDER_CONFIG_HANDLE *hRenderConfig /* i/o: Renderer config handle */ ); diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index ca2d7ef9fb21dbf4a87d635699f2492f6a22b37b..00bd26301881a84c612aca8ab5f7c1b3bdfb1087 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -56,7 +56,7 @@ * Allocates the renderer configuration structure *-----------------------------------------------------------------------*/ -ivas_error ivas_render_config_open( +ivas_error ivas_render_config_open_fx( RENDER_CONFIG_HANDLE *hRenderConfig /* i/o: Renderer config handle */ ) { @@ -76,7 +76,7 @@ ivas_error ivas_render_config_open( * Deallocates the renderer configuration structure *-------------------------------------------------------------------*/ -void ivas_render_config_close( +void ivas_render_config_close_fx( RENDER_CONFIG_HANDLE *hRenderConfig /* i/o: Renderer config handle */ ) { diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index b836af9e4bbdb72015ca8c37c42b3917f025c482..b0c2210f387ef1fe22f3ae8b7276d56b81e5c8da 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1759,7 +1759,7 @@ ivas_error ivas_reverb_open_fx( * Deallocate Crend reverberation handle *------------------------------------------------------------------------*/ -void ivas_reverb_close( +void ivas_reverb_close_fx( REVERB_HANDLE *hReverb_in /* i/o: Reverberator handle */ ) { @@ -2473,7 +2473,7 @@ static ivas_error ivas_binaural_reverb_open_fx( * Initialize binaural room reverberator handle for FastConv renderer *------------------------------------------------------------------------*/ -ivas_error ivas_binaural_reverb_init( +ivas_error ivas_binaural_reverb_init_fx( REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ const Word16 numBins, /* i : number of CLDFB bins */ diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index e9a3a20cec977b679fc4a9815b6bf9a5b4466d3a..bd20957cfae98a5aad286d199f734b9e815b6bd2 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -68,8 +68,8 @@ extern const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_Q_48kHz_fx; extern const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; extern const Word16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_Combined_HRIR_coeff_Q_48kHz_fx; -extern const Word16 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; -extern const Word16 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; +extern const Word16 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_Combined_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_Combined_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]; @@ -84,8 +84,8 @@ extern const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_Q_32kHz_fx; extern const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; extern const Word16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_Combined_HRIR_coeff_Q_32kHz_fx; -extern const Word16 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; -extern const Word16 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; +extern const Word16 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_Combined_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_Combined_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]; @@ -100,8 +100,8 @@ extern const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_Q_16kHz_fx; extern const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; extern const Word16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_Combined_HRIR_coeff_Q_16kHz_fx; -extern const Word16 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; -extern const Word16 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; +extern const Word16 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_Combined_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_Combined_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]; @@ -123,8 +123,8 @@ extern const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_Q_48kHz_fx; extern const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]; extern const Word16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_FOA_HRIR_coeff_Q_48kHz_fx; -extern const Word16 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240]; -extern const Word16 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240]; +extern const Word16 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_FOA_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_FOA_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]; @@ -139,10 +139,10 @@ extern const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_Q_32kHz_fx; extern const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]; extern const Word16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_FOA_HRIR_coeff_Q_32kHz_fx; -extern const Word16 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160]; -extern const Word16 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160]; -extern Word16 *CRendBin_FOA_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]; -extern Word16 *CRendBin_FOA_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]; +extern const Word16 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 *CRendBin_FOA_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]; +extern const Word16 *CRendBin_FOA_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]; /* Sample Rate = 16000 */ @@ -155,8 +155,8 @@ extern const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_Q_16kHz_fx; extern const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]; extern const Word16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_FOA_HRIR_coeff_Q_16kHz_fx; -extern const Word16 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80]; -extern const Word16 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80]; +extern const Word16 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_FOA_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_FOA_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]; @@ -178,8 +178,8 @@ extern const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_48kHz_fx; extern const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]; extern const Word16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_HOA2_HRIR_coeff_Q_48kHz_fx; -extern const Word16 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; -extern const Word16 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; +extern const Word16 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]; @@ -194,10 +194,10 @@ extern const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_32kHz_fx; extern const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]; extern const Word16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_HOA2_HRIR_coeff_Q_32kHz_fx; -extern const Word16 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; -extern const Word16 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; -extern Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]; -extern Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]; +extern const Word16 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]; +extern const Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]; /* Sample Rate = 16000 */ @@ -210,8 +210,8 @@ extern const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_16kHz_fx; extern const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]; extern const Word16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_HOA2_HRIR_coeff_Q_16kHz_fx; -extern const Word16 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; -extern const Word16 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; +extern const Word16 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_HOA2_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]; @@ -233,8 +233,8 @@ extern const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_48kHz_fx; extern const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]; extern const Word16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_HOA3_HRIR_coeff_Q_48kHz_fx; -extern const Word16 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; -extern const Word16 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; +extern const Word16 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]; @@ -249,8 +249,8 @@ extern const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_32kHz_fx; extern const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]; extern const Word16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_HOA3_HRIR_coeff_Q_32kHz_fx; -extern const Word16 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; -extern const Word16 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; +extern const Word16 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]; extern const Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]; extern const Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]; @@ -265,10 +265,10 @@ extern const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_16kHz_fx; extern const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]; extern const Word16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern const Word16 CRendBin_HOA3_HRIR_coeff_Q_16kHz_fx; -extern const Word16 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; -extern const Word16 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; -extern Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]; -extern Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]; +extern const Word16 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]; +extern const Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]; +extern const Word16 *CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]; diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index 108e347693418c68740f14e3d9e9a11165bdef4f..b171a1a6ad893b2a6f4360946448a227b8a63fd6 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -63,7 +63,7 @@ const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_Q_48kHz_fx = 0; const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_Combined_HRIR_coeff_Q_48kHz_fx = 13; -const Word16 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {9023, 9189, 9544, 10030, 10304, 9998, 9415, 9346, 9713, 9241, 7392, 5799, 6456, 9007, 11265, 12165, 12697, 13890, 15372, 16348, 16723, 16621, 15741, 13934, 11864, 10465, 10027, 10196, 10633, 11326, 12414, 13935, 15718, 17389, 18563, 19084, 19084, 18795, 18365, 17805, 17077, 16205, 15332, 14636, 14187, 13928, 13755, 13573, 13291, 12856, 12306, 11735, 11213, 10764, 10390, 10087, 9849, 9671, 9533, 9389, 9189, 8912, 8549, 8058, 7388, 6545, 5598, 4643, 3777, 3086, 2616, 2354, 2260, 2295, 2422, 2588, 2744, 2860, 2927, 2957, 2972, 2990, 3020, 3075, 3175, 3332, 3538, 3791, 4094, 4442, 4803, 5143, 5438, 5669, 5821, 5881, 5847, 5727, 5537, 5298, 5027, 4741, 4462, 4208, 3977, 3762, 3576, 3437, 3352, 3316, 3339, 3431, 3589, 3802, 4065, 4378, 4738, 5146, 5606, 6116, 6673, 7286, 7964, 8695, 9464, 10275, 11137, 12029, 12919, 13789, 14632, 15419, 16093, 16606, 16931, 17039, 16886, 16430, 15670, 14641, 13368, 11859, 10147, 8302, 6388, 4421, 2405, 394, -1557, -3444, -5296, -7097, -8801, -10409, -11967, -13484, -14927, -16287, -17598, -18877, -20098, -21229, -22273, -23239, -24107, -24831, -25379, -25758, -25976, -26001, -25804, -25413, -24876, -24190, -23321, -22296, -21173, -19937, -18524, -16939, -15225, -13340, -11198, -8799, -6192, -3340, -194, 3149, 6529, 9870, 13065, 15819, @@ -185,7 +185,7 @@ const Word16 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL 4992, 4843, 4478, 3871, 3032, 2035, 929, -265, -1372, -1979, -1776, -970, -179, 157, 117, 17, 3, 14, -1, -10, 3, 8, -3, -6, 3, 5, -3, -4, 3, 3, -3, -2, 2, 2, -2, -1, 2, 1, -2, -1, 1, 0, -1, 0, 1, 0, 0, 1 } } }; -const Word16 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {178, 510, 733, 655, 163, -364, -316, 117, -52, -931, -943, 1158, 4167, 5703, 5232, 4349, 4204, 4188, 3384, 1910, 277, -1460, -3229, -4362, -4229, -3057, -1633, -446, 530, 1436, 2219, 2643, 2436, 1482, -42, -1753, -3328, -4661, -5808, -6836, -7720, -8357, -8674, -8739, -8722, -8772, -8949, -9261, -9670, -10079, -10381, -10539, -10586, -10570, -10525, -10476, -10443, -10452, -10535, -10713, -10970, -11275, -11621, -11996, -12338, -12547, -12541, -12287, -11797, -11124, -10363, -9603, -8897, -8277, -7767, -7377, -7092, -6876, -6691, -6504, -6298, -6073, -5831, -5567, -5289, -5019, -4777, -4567, -4404, -4316, -4324, -4426, -4609, -4860, -5159, -5484, -5804, -6094, -6332, -6507, -6615, -6650, -6612, -6519, -6384, -6207, -5977, -5702, -5398, -5071, -4722, -4366, -4020, -3694, -3388, -3105, -2847, -2616, -2417, -2258, -2140, -2067, -2056, -2128, -2288, -2535, -2893, -3393, -4047, -4850, -5815, -6971, -8324, -9851, -11523, -13323, -15225, -17166, -19066, -20869, -22547, -24067, -25369, -26420, -27240, -27855, -28251, -28409, -28367, -28181, -27857, -27373, -26749, -26043, -25267, -24389, -23404, -22347, -21231, -20025, -18700, -17270, -15753, -14138, -12400, -10541, -8600, -6608, -4565, -2473, -380, 1654, 3631, 5579, 7473, 9262, 10963, 12631, 14253, 15767, 17182, 18544, 19804, 20853, 21662, 22219, 22392, 22007, 21013, 19394, 17024, 13829, @@ -321,7 +321,7 @@ const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_Q_32kHz_fx = 0; const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_Combined_HRIR_coeff_Q_32kHz_fx = 13; -const Word16 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {10018, 10185, 10541, 11028, 11305, 11001, 10420, 10353, 10723, 10251, 8401, 6806, 7463, 10015, 12273, 13170, 13701, 14890, 16369, 17343, 17714, 17607, 16722, 14912, 12840, 11438, 10999, 11168, 11604, 12297, 13384, 14904, 16684, 18352, 19523, 20041, 20037, 19745, 19312, 18750, 18020, 17146, 16269, 15567, 15111, 14846, 14669, 14482, 14193, 13752, 13196, 12617, 12088, 11633, 11252, 10942, 10697, 10513, 10369, 10218, 10011, 9729, 9360, 8862, 8186, 7337, 6383, 5419, 4545, 3845, 3366, 3094, 2991, 3016, 3132, 3287, 3433, 3538, 3593, 3611, 3614, 3619, 3636, 3678, 3765, 3908, 4101, 4340, 4628, 4961, 5307, 5632, 5910, 6126, 6262, 6305, 6253, 6114, 5906, 5647, 5355, 5047, 4745, 4466, 4209, 3968, 3755, 3587, 3471, 3405, 3396, 3454, 3578, 3757, 3984, 4256, 4572, 4933, 5348, 5817, 6336, 6907, 7535, 8209, 8917, 9661, 10450, 11270, 12088, 12883, 13647, 14349, 14927, 15321, 15501, 15434, 15065, 14350, 13289, 11919, 10261, 8331, 6171, 3858, 1457, -1006, -3504, -5976, -8359, -10636, -12802, -14820, -16639, -18245, -19652, -20848, -21798, -22500, -22977, -23229 }, @@ -413,7 +413,7 @@ const Word16 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL 4978, 5508, 6025, 6505, 6920, 7247, 7485, 7642, 7722, 7721, 7643, 7501, 7293, 7005, 6629, 6178, 5665, 5095, 4471, 3818, 3163, 2517, 1882, 1267, 691, 163, -326, -786, -1214, -1609, -1985, -2360, -2736, -3102, -3452, -3785, -4093, -4355, -4557, -4704, -4805, -4864, -4881, -4868, -4844, -4819, -4799, -4789, -4802, -4850, -4935, -5053, -5203, -5389, -5606, -5843, -6084, -6325, -6560, -6775, -6955, -7093, -7191, -7245 } } }; -const Word16 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {186, 534, 772, 709, 231, -282, -222, 225, 67, -802, -804, 1310, 4332, 5880, 5419, 4547, 4413, 4409, 3617, 2155, 535, -1189, -2944, -4062, -3913, -2725, -1285, -83, 906, 1826, 2622, 3058, 2863, 1922, 411, -1287, -2848, -4167, -5300, -6313, -7185, -7810, -8117, -8170, -8141, -8175, -8339, -8638, -9033, -9428, -9716, -9859, -9890, -9858, -9798, -9732, -9683, -9675, -9741, -9903, -10143, -10432, -10761, -11120, -11447, -11640, -11618, -11349, -10843, -10155, -9378, -8600, -7878, -7241, -6714, -6306, -6004, -5771, -5567, -5361, -5137, -4893, -4631, -4348, -4051, -3761, -3498, -3268, -3085, -2975, -2962, -3043, -3205, -3433, -3711, -4014, -4313, -4581, -4798, -4952, -5038, -5050, -4991, -4875, -4717, -4515, -4261, -3961, -3631, -3278, -2903, -2519, -2145, -1791, -1458, -1148, -862, -597, -360, -162, -12, 88, 123, 75, -59, -279, -604, -1068, -1689, -2462, -3403, -4544, -5895, -7430, -9116, -10933, -12850, -14791, -16665, -18411, -19993, -21359, -22443, -23212, -23675, -23842, -23697, -23225, -22457, -21435, -20166, -18645, -16904, -14999, -12951, -10762, -8459, -6093, -3687, -1237 }, @@ -519,7 +519,7 @@ const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_Q_16kHz_fx = 0; const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_Combined_HRIR_coeff_Q_16kHz_fx = 13; -const Word16 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { 10176, 10343, 10699, 11186, 11462, 11155, 10569, 10496, 10858, 10378, 8519, 6917, 7568, 10113, 12363, 13255, 13782, 14968, 16442, 17411, 17777, 17662, 16766, 14943, 12855, 11437, 10982, 11136, 11556, 12232, 13302, 14805, 16567, 18217, 19370, 19869, 19843, 19527, 19069, 18480, 17719, 16811, 15902, 15168, 14680, 14383, 14173, 13951, 13626, 13147, 12548, 11922, 11341, 10830, 10389, 10014, 9702, 9449, 9234, 9007, 8719, 8349, 7879, 7264, 6453, 5447, 4314, 3154, 2073, 1159, 459, -38, -371, -583, -711, -795, -868, -943, -1011, -1051 }, { 7990, 8145, 7183, 4943, 2800, 1461, 202, -1272, -1961, -1222, 106, 822, 458, -1098, -3788, -6699, -8354, -8272, -7370, -6479, -5445, -4075, -2920, -2470, -2368, -2034, -1470, -874, 4, 1492, 3327, 4928, 6145, 7235, 8163, 8433, 7713, 6322, 4897, 3775, 2865, 1994, 1129, 264, -668, -1684, -2666, -3487, -4132, -4634, -4966, -5082, -4989, -4732, -4343, -3855, -3313, -2735, -2097, -1388, -634, 131, 871, 1525, 2021, 2334, 2490, 2523, 2449, 2292, 2094, 1896, 1727, 1599, 1508, 1440, 1377, 1311, 1248, 1208 } @@ -581,7 +581,7 @@ const Word16 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL { 8979, 8928, 9106, 9705, 10482, 10892, 10637, 9976, 9361, 8934, 8597, 8419, 8650, 9299, 10028, 10515, 10716, 10680, 10366, 9782, 9137, 8665, 8381, 8126, 7795, 7409, 7008, 6593, 6163, 5738, 5320, 4889, 4432, 3964, 3509, 3103, 2799, 2654, 2686, 2853, 3094, 3371, 3667, 3960, 4213, 4409, 4555, 4668, 4760, 4845, 4938, 5053, 5193, 5354, 5516, 5651, 5736, 5758, 5706, 5572, 5362, 5103, 4813, 4491, 4125, 3710, 3244, 2723, 2149, 1552, 973, 453, 18, -320, -559, -718, -822, -893, -939, -964 } } }; -const Word16 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { 195, 561, 817, 772, 310, -188, -112, 351, 211, -639, -620, 1516, 4560, 6130, 5693, 4845, 4734, 4750, 3977, 2534, 931, -778, -2518, -3620, -3454, -2247, -785, 438, 1449, 2391, 3210, 3668, 3495, 2576, 1087, -591, -2132, -3431, -4543, -5536, -6386, -6986, -7265, -7290, -7232, -7239, -7375, -7648, -8017, -8387, -8652, -8773, -8780, -8723, -8635, -8540, -8457, -8415, -8448, -8576, -8784, -9045, -9349, -9682, -9979, -10135, -10059, -9712, -9103, -8288, -7357, -6401, -5474, -4602, -3799, -3065, -2380, -1713, -1038, -348 }, { -657, -2549, -4974, -6484, -6559, -6229, -6052, -5291, -3657, -2288, -2276, -3453, -5084, -6570, -7089, -5805, -3048, -282, 1554, 2807, 3913, 4545, 4440, 4159, 4334, 4849, 5320, 5820, 6515, 7047, 6879, 6027, 4914, 3637, 1895, -340, -2504, -3974, -4666, -4963, -5187, -5383, -5501, -5560, -5547, -5349, -4885, -4215, -3439, -2581, -1635, -650, 294, 1155, 1917, 2558, 3082, 3523, 3890, 4148, 4265, 4225, 4016, 3632, 3116, 2549, 1998, 1488, 1038, 675, 415, 249, 155, 102, 64, 27, -12, -40, -43, -18 } @@ -664,7 +664,7 @@ const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_Q_48kHz_fx = 0; const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]={{0, 0, 0, 0},{0, 0, 0, 0}}; const Word16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_FOA_HRIR_coeff_Q_48kHz_fx = 14; -const Word16 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {15831, 12015, 6081, 228, -4182, -7041, -8906, -10180, -10812, -10551, -9307, -7250, -4684, -1918, 791, 3247, 5333, 7035, 8406, 9503, 10331, 10868, 11128, 11185, 11114, 10932, 10612, 10153, 9599, 9002, 8387, 7766, 7156, 6571, 6010, 5460, 4919, 4395, 3899, 3430, 2976, 2527, 2078, 1633, 1192, 757, 333, -79, -480, -873, -1257, -1630, -1991, -2340, -2674, -2992, -3293, -3578, -3850, -4108, -4354, -4586, -4808, -5019, -5218, -5403, -5577, -5741, -5899, -6051, -6200, -6349, -6498, -6648, -6800, -6959, -7125, -7298, -7480, -7674, -7877, -8086, -8299, -8516, -8731, -8938, -9133, -9317, -9492, -9660, -9820, -9967, -10098, -10210, -10306, -10390, -10461, -10523, -10579, -10628, -10672, -10713, -10754, -10798, -10847, -10903, -10962, -11026, -11097, -11181, -11275, -11374, -11471, -11564, -11653, -11735, -11814, -11890, -11960, -12026, -12089, -12151, -12212, -12271, -12328, -12380, -12427, -12469, -12508, -12543, -12572, -12596, -12616, -12633, -12648, -12665, -12685, -12705, -12724, -12745, -12766, -12786, -12808, -12832, -12855, -12876, -12896, -12914, -12928, -12939, -12951, -12964, -12976, -12987, -13000, -13012, -13021, -13025, -13028, -13027, -13023, -13018, -13016, -13014, -13012, -13014, -13018, -13020, -13018, -13018, -13018, -13015, -13011, -13011, -13011, -13009, -13007, -13007, -13004, -13000, -13001, -13009, -13016, -13024, -13041, -13062, -13077, -13092, -13114, -13133, -13145, -13157, @@ -698,7 +698,7 @@ const Word16 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS -5179, -5030, -4931, -4904, -4798, -4598, -4543, -4640, -4526, -4189, -4192, -4573, -4392, -3326, -2782, -4026, -5986, -6628, -5926, -5487, -5621, -5104, -3945, -3920, -5677, -7463, -7728, -7183, -7185, -7661, -7815, -7559, -7022, -5771, -3819, -2515, -3074, -4758, -5745, -5508, -5158, -5525, -6039, -5894, -5470, -5899, -7430, -8879 } } }; -const Word16 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {-3812, -10154, -13424, -13506, -11577, -8956, -6265, -3457, -373, 2864, 5885, 8325, 9988, 10835, 10931, 10408, 9448, 8231, 6876, 5425, 3888, 2316, 796, -615, -1926, -3178, -4370, -5457, -6403, -7214, -7911, -8507, -9012, -9445, -9829, -10173, -10473, -10726, -10943, -11141, -11329, -11506, -11665, -11804, -11920, -12014, -12086, -12140, -12180, -12205, -12214, -12207, -12184, -12148, -12099, -12038, -11969, -11895, -11818, -11736, -11653, -11568, -11483, -11397, -11309, -11224, -11144, -11071, -11005, -10946, -10896, -10853, -10816, -10784, -10759, -10740, -10722, -10706, -10689, -10668, -10637, -10595, -10541, -10473, -10386, -10282, -10167, -10045, -9918, -9785, -9643, -9491, -9334, -9175, -9022, -8873, -8733, -8601, -8478, -8363, -8258, -8164, -8082, -8009, -7944, -7883, -7825, -7771, -7723, -7674, -7618, -7550, -7472, -7386, -7296, -7202, -7108, -7011, -6912, -6814, -6718, -6621, -6524, -6426, -6325, -6221, -6117, -6014, -5912, -5810, -5709, -5611, -5517, -5427, -5344, -5265, -5189, -5113, -5038, -4965, -4892, -4820, -4750, -4678, -4604, -4529, -4454, -4377, -4301, -4229, -4159, -4090, -4020, -3952, -3883, -3812, -3739, -3668, -3598, -3529, -3464, -3404, -3347, -3291, -3238, -3187, -3133, -3077, -3024, -2972, -2920, -2869, -2822, -2777, -2729, -2683, -2640, -2597, -2554, -2517, -2486, -2452, -2416, -2384, -2352, -2311, -2266, -2225, -2181, -2127, -2073, -2025, @@ -746,7 +746,7 @@ const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_Q_32kHz_fx = 0; const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]={{0, 0, 0, 0},{0, 0, 0, 0}}; const Word16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_FOA_HRIR_coeff_Q_32kHz_fx = 14; -const Word16 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {16374, 12559, 6625, 772, -3639, -6498, -8364, -9640, -10273, -10013, -8769, -6710, -4142, -1374, 1338, 3796, 5884, 7586, 8957, 10053, 10879, 11413, 11670, 11724, 11650, 11464, 11141, 10679, 10123, 9523, 8906, 8284, 7673, 7087, 6524, 5974, 5432, 4907, 4410, 3939, 3483, 3032, 2581, 2132, 1688, 1249, 821, 404, -1, -399, -788, -1167, -1533, -1886, -2224, -2547, -2852, -3142, -3418, -3680, -3929, -4165, -4390, -4605, -4808, -4997, -5174, -5343, -5506, -5662, -5816, -5970, -6125, -6281, -6440, -6606, -6779, -6960, -7150, -7353, -7564, -7782, -8004, -8229, -8453, -8669, -8872, -9065, -9248, -9424, -9592, -9747, -9885, -10005, -10110, -10203, -10284, -10356, -10422, -10483, -10539, -10592, -10646, -10704, -10768, -10839, -10913, -10993, -11081, -11181, -11293, -11410, -11525, -11636, -11743, -11845, -11943, -12037, -12128, -12214, -12298, -12382, -12466, -12549, -12632, -12713, -12790, -12864, -12938, -13010, -13080, -13148, -13215, -13282, -13350, -13423, -13502, -13584, -13667, -13753, -13841, -13931, -14022, -14115, -14208, -14297, -14383, -14465, -14542, -14614, -14682, -14747, -14807, -14860, -14906, -14946, -14978, -15000, -15014, -15021 }, @@ -772,7 +772,7 @@ const Word16 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS 1586, 1781, 1908, 1968, 1992, 1998, 1973, 1878, 1689, 1423, 1123, 818, 503, 150, -247, -658, -1040, -1370, -1661, -1943, -2239, -2542, -2824, -3059, -3244, -3397, -3542, -3698, -3869, -4045, -4212, -4371, -4530, -4698, -4879, -5075, -5288, -5512, -5740, -5969, -6197, -6419, -6631, -6831, -7015, -7175, -7305, -7402, -7463, -7485, -7474, -7435, -7378, -7309, -7235, -7165, -7101, -7046, -7002, -6968, -6941, -6919, -6906, -6902 } } }; -const Word16 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {-3808, -10142, -13405, -13479, -11543, -8915, -6216, -3400, -307, 2940, 5970, 8421, 10092, 10947, 11050, 10533, 9578, 8366, 7015, 5568, 4037, 2470, 955, -449, -1753, -2997, -4181, -5260, -6198, -6999, -7687, -8274, -8771, -9196, -9572, -9908, -10200, -10446, -10656, -10848, -11029, -11200, -11353, -11486, -11596, -11684, -11749, -11796, -11829, -11846, -11847, -11831, -11800, -11755, -11696, -11626, -11548, -11464, -11377, -11286, -11193, -11099, -11005, -10910, -10814, -10720, -10632, -10551, -10477, -10410, -10352, -10303, -10258, -10218, -10186, -10159, -10133, -10108, -10083, -10053, -10013, -9961, -9897, -9818, -9720, -9605, -9479, -9346, -9208, -9063, -8910, -8747, -8579, -8411, -8247, -8090, -7940, -7799, -7666, -7543, -7428, -7325, -7233, -7151, -7075, -7003, -6934, -6870, -6810, -6749, -6681, -6600, -6509, -6409, -6305, -6198, -6089, -5979, -5867, -5755, -5645, -5536, -5427, -5317, -5204, -5089, -4974, -4859, -4745, -4631, -4516, -4403, -4292, -4183, -4078, -3974, -3869, -3761, -3649, -3533, -3414, -3289, -3160, -3024, -2880, -2728, -2570, -2406, -2236, -2063, -1886, -1704, -1515, -1322, -1126, -926, -721, -515, -309, -103 }, @@ -812,7 +812,7 @@ const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_Q_16kHz_fx = 0; const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]={{0, 0, 0, 0},{0, 0, 0, 0}}; const Word16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_FOA_HRIR_coeff_Q_16kHz_fx = 14; -const Word16 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { 17330, 13516, 7582, 1726, -2688, -5552, -7423, -8704, -9342, -9086, -7847, -5795, -3236, -478, 2220, 4665, 6741, 8432, 9794, 10881, 11699, 12224, 12470, 12511, 12421, 12217, 11874, 11391, 10812, 10190, 9552, 8908, 8275, 7665, 7077, 6500, 5927, 5369, 4836, 4326, 3830, 3336, 2842, 2350, 1862, 1381, 908, 445, -10, -461, -909, -1352, -1789, -2219, -2641, -3052, -3450, -3835, -4212, -4581, -4944, -5305, -5672, -6049, -6440, -6849, -7282, -7745, -8240, -8765, -9317, -9887, -10463, -11029, -11564, -12051, -12469, -12800, -13030, -13148 }, { 17330, 13516, 7582, 1726, -2688, -5552, -7423, -8704, -9342, -9086, -7847, -5795, -3236, -478, 2220, 4665, 6741, 8432, 9794, 10881, 11699, 12224, 12470, 12511, 12421, 12217, 11874, 11391, 10812, 10190, 9552, 8908, 8275, 7665, 7077, 6500, 5927, 5369, 4836, 4326, 3830, 3336, 2842, 2350, 1862, 1381, 908, 445, -10, -461, -909, -1352, -1789, -2219, -2641, -3052, -3450, -3835, -4212, -4581, -4944, -5305, -5672, -6049, -6440, -6849, -7282, -7745, -8240, -8765, -9317, -9887, -10463, -11029, -11564, -12051, -12469, -12800, -13030, -13148 } @@ -830,7 +830,7 @@ const Word16 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS { 1339, 1774, 1762, 821, -356, -677, 43, 908, 965, 95, -1092, -1953, -2248, -2130, -1905, -1772, -1670, -1364, -706, 226, 1256, 2270, 3200, 3967, 4549, 5054, 5628, 6285, 6912, 7414, 7796, 8075, 8211, 8142, 7852, 7369, 6719, 5918, 5004, 4052, 3141, 2313, 1572, 909, 317, -214, -707, -1176, -1621, -2021, -2355, -2605, -2766, -2845, -2876, -2901, -2950, -3031, -3141, -3280, -3440, -3603, -3755, -3901, -4048, -4192, -4325, -4452, -4576, -4684, -4761, -4816, -4862, -4893, -4893, -4877, -4867, -4860, -4840, -4816 } } }; -const Word16 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { -3791, -10093, -13324, -13368, -11400, -8739, -6007, -3157, -30, 3250, 6313, 8795, 10498, 11385, 11522, 11042, 10126, 8952, 7641, 6232, 4737, 3205, 1723, 351, -921, -2132, -3281, -4324, -5224, -5987, -6635, -7183, -7641, -8028, -8367, -8666, -8922, -9130, -9302, -9453, -9591, -9716, -9821, -9905, -9965, -10002, -10018, -10018, -10004, -9976, -9932, -9871, -9793, -9699, -9588, -9461, -9323, -9178, -9028, -8875, -8721, -8569, -8420, -8271, -8118, -7960, -7791, -7603, -7385, -7125, -6810, -6428, -5967, -5419, -4783, -4058, -3252, -2377, -1449, -487 }, { -3791, -10093, -13324, -13368, -11400, -8739, -6007, -3157, -30, 3250, 6313, 8795, 10498, 11385, 11522, 11042, 10126, 8952, 7641, 6232, 4737, 3205, 1723, 351, -921, -2132, -3281, -4324, -5224, -5987, -6635, -7183, -7641, -8028, -8367, -8666, -8922, -9130, -9302, -9453, -9591, -9716, -9821, -9905, -9965, -10002, -10018, -10018, -10004, -9976, -9932, -9871, -9793, -9699, -9588, -9461, -9323, -9178, -9028, -8875, -8721, -8569, -8420, -8271, -8118, -7960, -7791, -7603, -7385, -7125, -6810, -6428, -5967, -5419, -4783, -4058, -3252, -2377, -1449, -487 } @@ -869,7 +869,7 @@ const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_48kHz_fx = 0; const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_HOA2_HRIR_coeff_Q_48kHz_fx = 14; -const Word16 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {15654, 10415, 2730, -4074, -8334, -10258, -10654, -9905, -8002, -5055, -1475, 2185, 5438, 7939, 9524, 10211, 10145, 9496, 8391, 6919, 5173, 3290, 1421, -349, -2021, -3619, -5104, -6396, -7451, -8282, -8922, -9389, -9705, -9904, -10021, -10074, -10071, -10031, -9973, -9908, -9833, -9738, -9614, -9458, -9271, -9056, -8815, -8551, -8264, -7955, -7624, -7274, -6912, -6543, -6172, -5802, -5442, -5094, -4757, -4427, -4105, -3790, -3481, -3175, -2874, -2581, -2296, -2017, -1744, -1480, -1222, -965, -709, -456, -204, 53, 315, 576, 840, 1114, 1396, 1679, 1956, 2231, 2508, 2783, 3045, 3294, 3537, 3779, 4017, 4237, 4434, 4614, 4783, 4941, 5078, 5193, 5296, 5399, 5510, 5624, 5739, 5856, 5983, 6129, 6292, 6465, 6642, 6822, 7008, 7197, 7388, 7575, 7755, 7923, 8079, 8226, 8365, 8498, 8625, 8748, 8867, 8983, 9097, 9207, 9311, 9407, 9497, 9578, 9651, 9717, 9781, 9844, 9907, 9970, 10034, 10097, 10159, 10222, 10288, 10357, 10431, 10510, 10591, 10673, 10754, 10836, 10914, 10988, 11061, 11131, 11195, 11254, 11308, 11357, 11398, 11430, 11456, 11476, 11491, 11503, 11517, 11531, 11545, 11565, 11590, 11613, 11633, 11654, 11674, 11689, 11702, 11717, 11731, 11741, 11751, 11765, 11777, 11789, 11808, 11836, 11866, 11900, 11943, 11994, 12042, 12090, 12146, 12202, 12248, 12294, @@ -943,7 +943,7 @@ const Word16 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNE 106, 113, 117, 154, 181, 151, 139, 211, 263, 209, 210, 410, 568, 400, 185, 485, 1257, 1808, 1774, 1568, 1649, 1867, 1844, 1592, 1426, 1508, 1757, 2043, 2262, 2358, 2391, 2423, 2234, 1356, -299, -1949, -2487, -1766, -905, -877, -1184, -789, -61, -304, -1022, 446, 5115, 9652 } } }; -const Word16 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {-4581, -11759, -14379, -12696, -8766, -4424, -345, 3439, 6770, 9228, 10441, 10312, 8993, 6797, 4109, 1296, -1387, -3807, -5911, -7653, -8972, -9828, -10256, -10360, -10227, -9864, -9250, -8414, -7440, -6408, -5360, -4322, -3325, -2391, -1520, -704, 57, 761, 1416, 2041, 2651, 3255, 3851, 4434, 4997, 5540, 6060, 6556, 7029, 7477, 7897, 8284, 8636, 8954, 9238, 9488, 9709, 9908, 10091, 10260, 10415, 10559, 10693, 10817, 10928, 11028, 11121, 11208, 11287, 11362, 11436, 11510, 11580, 11648, 11716, 11783, 11844, 11899, 11953, 12001, 12036, 12052, 12056, 12053, 12038, 12005, 11955, 11899, 11841, 11775, 11691, 11590, 11484, 11381, 11280, 11176, 11072, 10978, 10906, 10855, 10815, 10781, 10753, 10736, 10732, 10734, 10729, 10713, 10687, 10654, 10612, 10559, 10493, 10412, 10318, 10215, 10107, 9998, 9888, 9780, 9671, 9563, 9454, 9346, 9236, 9123, 9006, 8888, 8770, 8652, 8539, 8432, 8332, 8236, 8145, 8058, 7973, 7889, 7808, 7732, 7658, 7586, 7515, 7441, 7362, 7278, 7192, 7099, 7002, 6902, 6800, 6694, 6583, 6472, 6359, 6243, 6126, 6012, 5902, 5795, 5695, 5604, 5518, 5436, 5360, 5288, 5213, 5135, 5058, 4983, 4907, 4831, 4760, 4692, 4624, 4558, 4499, 4443, 4388, 4341, 4301, 4261, 4217, 4177, 4137, 4088, 4032, 3977, 3919, 3848, 3773, 3705, @@ -1031,7 +1031,7 @@ const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_32kHz_fx = 0; const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_HOA2_HRIR_coeff_Q_32kHz_fx = 14; -const Word16 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {14867, 9627, 1943, -4863, -9124, -11050, -11449, -10700, -8798, -5849, -2267, 1398, 4655, 7159, 8747, 9436, 9371, 8722, 7617, 6145, 4399, 2517, 648, -1120, -2791, -4386, -5868, -7157, -8209, -9037, -9674, -10139, -10452, -10649, -10765, -10815, -10812, -10770, -10711, -10644, -10567, -10470, -10344, -10185, -9994, -9775, -9529, -9259, -8967, -8652, -8314, -7958, -7589, -7213, -6835, -6459, -6092, -5738, -5395, -5059, -4731, -4411, -4097, -3785, -3479, -3181, -2891, -2606, -2328, -2057, -1793, -1529, -1265, -1004, -742, -475, -204, 68, 343, 629, 923, 1218, 1507, 1794, 2084, 2371, 2645, 2906, 3160, 3415, 3664, 3896, 4104, 4295, 4476, 4647, 4798, 4927, 5045, 5164, 5290, 5423, 5556, 5693, 5841, 6007, 6193, 6389, 6590, 6795, 7006, 7221, 7438, 7653, 7859, 8054, 8239, 8414, 8582, 8744, 8902, 9057, 9210, 9362, 9514, 9666, 9815, 9960, 10103, 10241, 10376, 10509, 10646, 10787, 10932, 11082, 11239, 11399, 11563, 11730, 11905, 12085, 12271, 12463, 12657, 12849, 13039, 13223, 13400, 13565, 13720, 13863, 13991, 14102, 14197, 14278, 14343, 14391, 14424, 14441 }, @@ -1087,7 +1087,7 @@ const Word16 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNE 690, 513, 259, -48, -405, -824, -1301, -1799, -2264, -2664, -2998, -3279, -3503, -3651, -3705, -3673, -3578, -3450, -3306, -3145, -2956, -2743, -2522, -2318, -2145, -2000, -1864, -1713, -1531, -1331, -1131, -941, -757, -575, -389, -192, 20, 242, 467, 692, 917, 1138, 1352, 1562, 1765, 1956, 2125, 2267, 2376, 2445, 2472, 2458, 2409, 2332, 2232, 2116, 1985, 1847, 1710, 1581, 1461, 1360, 1288, 1252 } } }; -const Word16 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {-4586, -11776, -14408, -12737, -8819, -4486, -417, 3358, 6682, 9133, 10338, 10200, 8870, 6662, 3962, 1136, -1559, -3993, -6109, -7862, -9192, -10058, -10495, -10609, -10485, -10133, -9529, -8703, -7740, -6720, -5684, -4658, -3673, -2751, -1892, -1088, -338, 355, 1000, 1614, 2214, 2808, 3395, 3969, 4523, 5057, 5568, 6055, 6517, 6955, 7365, 7741, 8081, 8386, 8658, 8896, 9103, 9289, 9458, 9614, 9755, 9885, 10006, 10117, 10215, 10303, 10384, 10458, 10525, 10588, 10651, 10714, 10774, 10830, 10887, 10943, 10992, 11035, 11076, 11112, 11132, 11134, 11124, 11106, 11075, 11025, 10960, 10887, 10813, 10730, 10629, 10512, 10389, 10271, 10156, 10037, 9918, 9811, 9725, 9659, 9605, 9557, 9514, 9483, 9464, 9449, 9428, 9396, 9352, 9300, 9240, 9167, 9081, 8979, 8863, 8738, 8609, 8478, 8347, 8217, 8088, 7960, 7832, 7705, 7577, 7445, 7311, 7175, 7038, 6900, 6765, 6634, 6507, 6381, 6255, 6128, 5997, 5860, 5719, 5574, 5423, 5264, 5094, 4912, 4712, 4497, 4265, 4018, 3753, 3474, 3183, 2878, 2561, 2235, 1903, 1566, 1223, 876, 527, 176 }, @@ -1157,7 +1157,7 @@ const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_16kHz_fx = 0; const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_HOA2_HRIR_coeff_Q_16kHz_fx = 14; -const Word16 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { 14067, 8828, 1144, -5663, -9925, -11850, -12245, -11491, -9580, -6622, -3030, 642, 3905, 6415, 8009, 8707, 8652, 8015, 6923, 5465, 3732, 1863, 7, -1748, -3404, -4983, -6448, -7717, -8747, -9552, -10166, -10608, -10898, -11071, -11161, -11184, -11151, -11076, -10981, -10875, -10757, -10616, -10444, -10238, -10001, -9735, -9442, -9123, -8780, -8410, -8013, -7591, -7149, -6695, -6230, -5762, -5298, -4843, -4393, -3945, -3496, -3043, -2580, -2096, -1589, -1054, -485, 123, 769, 1449, 2157, 2885, 3617, 4331, 5005, 5617, 6142, 6558, 6846, 6992 }, { 14067, 8828, 1144, -5663, -9925, -11850, -12245, -11491, -9580, -6622, -3030, 642, 3905, 6415, 8009, 8707, 8652, 8015, 6923, 5465, 3732, 1863, 7, -1748, -3404, -4983, -6448, -7717, -8747, -9552, -10166, -10608, -10898, -11071, -11161, -11184, -11151, -11076, -10981, -10875, -10757, -10616, -10444, -10238, -10001, -9735, -9442, -9123, -8780, -8410, -8013, -7591, -7149, -6695, -6230, -5762, -5298, -4843, -4393, -3945, -3496, -3043, -2580, -2096, -1589, -1054, -485, 123, 769, 1449, 2157, 2885, 3617, 4331, 5005, 5617, 6142, 6558, 6846, 6992 } @@ -1195,7 +1195,7 @@ const Word16 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNE { 0, 1199, 1697, 220, -2501, -4949, -6134, -5433, -2464, 2114, 6515, 9322, 10555, 10845, 10217, 8358, 5587, 2791, 514, -1389, -3245, -5092, -6736, -8010, -8895, -9511, -9994, -10377, -10578, -10531, -10248, -9759, -9070, -8191, -7162, -6028, -4827, -3597, -2385, -1235, -187, 734, 1543, 2276, 2944, 3526, 4000, 4370, 4653, 4873, 5065, 5253, 5432, 5581, 5682, 5730, 5724, 5663, 5552, 5399, 5217, 5012, 4788, 4544, 4282, 4007, 3718, 3414, 3101, 2793, 2493, 2201, 1923, 1677, 1466, 1287, 1139, 1033, 974, 951 } } }; -const Word16 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { -4603, -11826, -14491, -12854, -8967, -4664, -623, 3123, 6417, 8835, 10005, 9830, 8464, 6222, 3489, 631, -2096, -4562, -6712, -8500, -9866, -10768, -11242, -11391, -11302, -10983, -10414, -9622, -8695, -7712, -6714, -5726, -4780, -3897, -3076, -2309, -1595, -940, -333, 242, 801, 1351, 1892, 2416, 2920, 3402, 3861, 4297, 4711, 5101, 5464, 5793, 6085, 6340, 6559, 6739, 6885, 7007, 7111, 7201, 7278, 7347, 7411, 7465, 7505, 7526, 7522, 7483, 7394, 7242, 7017, 6703, 6286, 5759, 5120, 4371, 3520, 2582, 1576, 530 }, { -4603, -11826, -14491, -12854, -8967, -4664, -623, 3123, 6417, 8835, 10005, 9830, 8464, 6222, 3489, 631, -2096, -4562, -6712, -8500, -9866, -10768, -11242, -11391, -11302, -10983, -10414, -9622, -8695, -7712, -6714, -5726, -4780, -3897, -3076, -2309, -1595, -940, -333, 242, 801, 1351, 1892, 2416, 2920, 3402, 3861, 4297, 4711, 5101, 5464, 5793, 6085, 6340, 6559, 6739, 6885, 7007, 7111, 7201, 7278, 7347, 7411, 7465, 7505, 7526, 7522, 7483, 7394, 7242, 7017, 6703, 6286, 5759, 5120, 4371, 3520, 2582, 1576, 530 } @@ -1254,7 +1254,7 @@ const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_48kHz_fx = 0; const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_HOA3_HRIR_coeff_Q_48kHz_fx = 14; -const Word16 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {15982, 13492, 9482, 5102, 1170, -1922, -4355, -6659, -8796, -9889, -9322, -7308, -3801, 1614, 7308, 8833, 3596, -4183, -6538, -678, 7738, 11360, 8737, 3593, -967, -4772, -8286, -10979, -12383, -12957, -13252, -13224, -12739, -12021, -11311, -10569, -9735, -8901, -8132, -7383, -6635, -5928, -5248, -4551, -3863, -3225, -2614, -1999, -1409, -870, -352, 168, 666, 1127, 1569, 1996, 2384, 2733, 3065, 3379, 3660, 3920, 4178, 4425, 4647, 4856, 5065, 5265, 5449, 5628, 5811, 5990, 6162, 6335, 6514, 6693, 6869, 7047, 7225, 7404, 7584, 7760, 7919, 8065, 8211, 8351, 8469, 8566, 8658, 8750, 8825, 8873, 8901, 8918, 8929, 8935, 8929, 8908, 8881, 8869, 8876, 8891, 8904, 8921, 8950, 9000, 9070, 9153, 9238, 9319, 9405, 9505, 9617, 9732, 9844, 9947, 10038, 10123, 10209, 10295, 10376, 10447, 10511, 10566, 10616, 10662, 10706, 10741, 10765, 10780, 10786, 10786, 10785, 10785, 10787, 10788, 10789, 10791, 10796, 10804, 10822, 10853, 10894, 10944, 11001, 11064, 11129, 11197, 11266, 11335, 11401, 11462, 11516, 11562, 11598, 11626, 11646, 11658, 11665, 11667, 11665, 11662, 11658, 11657, 11659, 11666, 11679, 11693, 11705, 11716, 11727, 11734, 11737, 11740, 11742, 11741, 11739, 11742, 11747, 11753, 11767, 11790, 11819, 11850, 11890, 11939, 11986, 12032, 12086, 12142, 12187, 12231, @@ -1384,7 +1384,7 @@ const Word16 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNE -911, -1041, -1132, -1207, -1343, -1498, -1548, -1557, -1709, -1899, -1835, -1665, -1889, -2372, -2206, -1114, -176, -344, -1011, -1122, -970, -1482, -2212, -1748, -85, 1090, 838, 156, 195, 686, 911, 1009, 1285, 1218, 287, -807, -874, 107, 1030, 1227, 1093, 1150, 1314, 1379, 1614, 2426, 3672, 4626 } } }; -const Word16 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240]={ +const Word16 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME48k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {-2898, -7932, -11166, -12449, -12178, -11005, -9558, -7837, -5224, -1561, 2352, 5801, 8559, 9399, 6016, -1285, -7118, -5634, 2040, 7966, 6108, -1520, -8602, -11836, -12357, -11868, -10448, -7949, -5126, -2687, -529, 1600, 3522, 5037, 6274, 7390, 8339, 9080, 9699, 10255, 10721, 11108, 11464, 11774, 11999, 12167, 12320, 12436, 12490, 12516, 12541, 12541, 12497, 12433, 12360, 12258, 12131, 12005, 11883, 11749, 11613, 11491, 11376, 11251, 11126, 11016, 10911, 10801, 10696, 10604, 10516, 10425, 10339, 10259, 10177, 10091, 10003, 9912, 9816, 9715, 9603, 9475, 9336, 9199, 9061, 8907, 8743, 8585, 8437, 8283, 8117, 7952, 7801, 7666, 7545, 7431, 7324, 7235, 7175, 7141, 7116, 7088, 7066, 7058, 7065, 7077, 7086, 7082, 7065, 7045, 7030, 7014, 6984, 6937, 6875, 6801, 6723, 6647, 6571, 6488, 6396, 6300, 6202, 6105, 6009, 5915, 5819, 5719, 5619, 5525, 5438, 5360, 5293, 5234, 5180, 5130, 5088, 5052, 5022, 5002, 4991, 4981, 4970, 4954, 4934, 4905, 4870, 4828, 4778, 4719, 4651, 4575, 4493, 4406, 4318, 4230, 4143, 4060, 3982, 3909, 3841, 3781, 3728, 3680, 3637, 3597, 3556, 3511, 3464, 3417, 3369, 3321, 3276, 3234, 3194, 3156, 3127, 3103, 3080, 3063, 3053, 3043, 3028, 3014, 3000, 2978, 2947, 2916, 2882, 2835, 2781, 2734, @@ -1528,7 +1528,7 @@ const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_32kHz_fx = 0; const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_HOA3_HRIR_coeff_Q_32kHz_fx = 14; -const Word16 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {15421, 12931, 8921, 4541, 608, -2485, -4920, -7227, -9366, -10462, -9896, -7880, -4370, 1052, 6753, 8281, 3038, -4749, -7105, -1236, 7189, 10815, 8191, 3045, -1515, -5320, -8832, -11522, -12924, -13496, -13788, -13759, -13272, -12554, -11842, -11100, -10265, -9431, -8661, -7910, -7161, -6452, -5769, -5069, -4377, -3735, -3120, -2500, -1905, -1361, -838, -312, 191, 656, 1104, 1535, 1927, 2280, 2617, 2934, 3219, 3483, 3744, 3994, 4221, 4433, 4646, 4851, 5040, 5223, 5411, 5595, 5773, 5953, 6139, 6324, 6509, 6694, 6880, 7068, 7257, 7441, 7608, 7763, 7918, 8066, 8193, 8299, 8400, 8499, 8583, 8640, 8675, 8700, 8720, 8735, 8739, 8729, 8713, 8712, 8731, 8758, 8785, 8815, 8859, 8924, 9010, 9109, 9211, 9310, 9414, 9532, 9663, 9798, 9929, 10052, 10163, 10268, 10374, 10481, 10584, 10679, 10765, 10846, 10923, 10999, 11073, 11143, 11204, 11258, 11307, 11355, 11404, 11458, 11517, 11579, 11644, 11713, 11787, 11870, 11965, 12073, 12193, 12321, 12455, 12594, 12735, 12874, 13009, 13138, 13257, 13364, 13457, 13536, 13600, 13651, 13692, 13722, 13743, 13752 }, @@ -1626,7 +1626,7 @@ const Word16 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNE -356, -385, -439, -509, -610, -756, -939, -1124, -1272, -1363, -1399, -1400, -1382, -1345, -1276, -1165, -1017, -848, -676, -511, -356, -203, -46, 119, 291, 463, 636, 811, 992, 1173, 1348, 1507, 1645, 1759, 1851, 1927, 1992, 2052, 2111, 2173, 2246, 2333, 2438, 2564, 2713, 2885, 3071, 3264, 3457, 3638, 3796, 3922, 4016, 4078, 4111, 4116, 4100, 4069, 4028, 3981, 3932, 3888, 3855, 3837 } } }; -const Word16 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160]={ +const Word16 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME32k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { {-2902, -7944, -11187, -12480, -12217, -11054, -9614, -7901, -5294, -1637, 2273, 5718, 8473, 9308, 5915, -1402, -7249, -5770, 1906, 7832, 5964, -1678, -8773, -12015, -12542, -12061, -10647, -8155, -5340, -2909, -760, 1360, 3273, 4779, 6008, 7116, 8058, 8791, 9404, 9953, 10412, 10793, 11143, 11447, 11666, 11828, 11974, 12083, 12129, 12147, 12164, 12155, 12102, 12029, 11946, 11835, 11698, 11562, 11430, 11287, 11141, 11010, 10885, 10751, 10617, 10498, 10385, 10266, 10153, 10052, 9957, 9858, 9764, 9676, 9586, 9492, 9395, 9295, 9190, 9080, 8958, 8819, 8670, 8522, 8373, 8208, 8032, 7863, 7703, 7537, 7360, 7183, 7021, 6876, 6744, 6620, 6503, 6404, 6334, 6290, 6255, 6218, 6185, 6167, 6163, 6164, 6162, 6146, 6117, 6085, 6057, 6027, 5984, 5923, 5845, 5757, 5663, 5572, 5481, 5384, 5278, 5168, 5056, 4946, 4838, 4732, 4623, 4511, 4399, 4291, 4191, 4097, 4012, 3932, 3855, 3778, 3704, 3633, 3565, 3500, 3436, 3367, 3288, 3198, 3095, 2978, 2844, 2694, 2528, 2348, 2152, 1943, 1726, 1501, 1273, 1043, 813, 582, 349, 116 }, @@ -1738,7 +1738,7 @@ const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_16kHz_fx = 0; const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const Word16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word16 CRendBin_HOA3_HRIR_coeff_Q_16kHz_fx = 14; -const Word16 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { 14619, 12130, 8121, 3741, -192, -3284, -5718, -8022, -10157, -11244, -10668, -8642, -5124, 302, 6004, 7539, 2311, -5460, -7805, -1932, 6501, 10142, 7532, 2396, -2154, -5944, -9441, -12114, -13496, -14045, -14317, -14268, -13761, -13021, -12288, -11522, -10660, -9795, -8992, -8205, -7417, -6669, -5947, -5208, -4476, -3795, -3140, -2479, -1839, -1248, -671, -87, 481, 1016, 1540, 2051, 2527, 2967, 3395, 3809, 4198, 4576, 4966, 5364, 5762, 6174, 6620, 7091, 7581, 8099, 8646, 9206, 9766, 10318, 10844, 11320, 11729, 12057, 12286, 12401 }, { 14619, 12130, 8121, 3741, -192, -3284, -5718, -8022, -10157, -11244, -10668, -8642, -5124, 302, 6004, 7539, 2311, -5460, -7805, -1932, 6501, 10142, 7532, 2396, -2154, -5944, -9441, -12114, -13496, -14045, -14317, -14268, -13761, -13021, -12288, -11522, -10660, -9795, -8992, -8205, -7417, -6669, -5947, -5208, -4476, -3795, -3140, -2479, -1839, -1248, -671, -87, 481, 1016, 1540, 2051, 2527, 2967, 3395, 3809, 4198, 4576, 4966, 5364, 5762, 6174, 6620, 7091, 7581, 8099, 8646, 9206, 9766, 10318, 10844, 11320, 11729, 12057, 12286, 12401 } @@ -1804,7 +1804,7 @@ const Word16 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNE { -236, -224, -207, -192, -219, -329, -440, -318, 65, 162, -648, -1887, -1929, 58, 2439, 2535, -65, -2697, -2706, -469, 1474, 1571, 480, -462, -774, -658, -259, 365, 996, 1387, 1504, 1455, 1316, 1155, 1063, 1050, 1004, 821, 496, 82, -371, -804, -1151, -1380, -1504, -1542, -1516, -1461, -1413, -1386, -1379, -1398, -1445, -1505, -1558, -1592, -1600, -1582, -1549, -1520, -1505, -1510, -1541, -1602, -1686, -1775, -1861, -1944, -2017, -2074, -2114, -2140, -2149, -2133, -2098, -2060, -2029, -1999, -1965, -1939 } } }; -const Word16 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80]={ +const Word16 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][L_FRAME16k/MAX_PARAM_SPATIAL_SUBFRAMES]={ { { -2917, -7989, -11262, -12586, -12353, -11219, -9807, -8120, -5539, -1908, 1972, 5385, 8105, 8905, 5482, -1858, -7731, -6287, 1351, 7243, 5347, -2325, -9454, -12730, -13289, -12836, -11452, -8991, -6207, -3809, -1696, 389, 2268, 3740, 4935, 6011, 6921, 7622, 8201, 8715, 9136, 9475, 9782, 10042, 10215, 10331, 10433, 10499, 10503, 10481, 10459, 10410, 10316, 10199, 10069, 9907, 9716, 9526, 9338, 9138, 8938, 8756, 8583, 8399, 8215, 8038, 7851, 7635, 7392, 7117, 6788, 6391, 5922, 5376, 4741, 4020, 3222, 2357, 1436, 482 }, { -2917, -7989, -11262, -12586, -12353, -11219, -9807, -8120, -5539, -1908, 1972, 5385, 8105, 8905, 5482, -1858, -7731, -6287, 1351, 7243, 5347, -2325, -9454, -12730, -13289, -12836, -11452, -8991, -6207, -3809, -1696, 389, 2268, 3740, 4935, 6011, 6921, 7622, 8201, 8715, 9136, 9475, 9782, 10042, 10215, 10331, 10433, 10499, 10503, 10481, 10459, 10410, 10316, 10199, 10069, 9907, 9716, 9526, 9338, 9138, 8938, 8756, 8583, 8399, 8215, 8038, 7851, 7635, 7392, 7117, 6788, 6391, 5922, 5376, 4741, 4020, 3222, 2357, 1436, 482 } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index e761a8f15c50acc3ea2cc5847a479dbe47c792b5..c3e1c0b7019e88fae247c3e1f1b886c3a5acc70d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1231,6 +1231,7 @@ typedef struct TDREND_HRFILT_FiltSet_struct #ifdef USE_TDREND_16BIT_ROM Word16 latency_s_Q_fx; #endif + } TDREND_HRFILT_FiltSet_t; /* Distance attenuation */ @@ -1387,11 +1388,13 @@ typedef struct ivas_hrtfs_structure Word32 latency_s_fx; Word16 init_from_rom; Word16 gain_lfe_fx; // Q14 + #ifdef FIX_CREND_SIMPLIFY_CODE -} HRTFS_DATA, *HRTFS_HANDLE, HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; // VE: all instance of HRTFS_DATAand *HRTFS_HANDLE should be renamed to HRTFS_CREND_DATA and *HRTFS_CREND_HANDLE +} HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; #else } HRTFS_DATA, *HRTFS_HANDLE; #endif + /* Main Crend structure */ typedef struct ivas_crend_state_t { @@ -1418,11 +1421,15 @@ typedef struct ivas_binaural_crend_wrapper_struct { Word32 binaural_latency_ns; CREND_HANDLE hCrend[MAX_HEAD_ROT_POSES]; +#ifdef FIX_CREND_SIMPLIFY_CODE + HRTFS_CREND_HANDLE hHrtfCrend; +#else HRTFS_HANDLE hHrtfCrend; +#endif Word16 *p_io_qfactor; Word16 io_qfactor; -} CREND_WRAPPER, *CREND_WRAPPER_HANDLE; +} CREND_WRAPPER, *CREND_WRAPPER_HANDLE; /* Fastconv binaural data structure */ typedef struct ivas_binaural_rendering_struct @@ -1450,6 +1457,7 @@ typedef struct ivas_binaural_rendering_struct } BINAURAL_RENDERER, *BINAURAL_RENDERER_HANDLE; + /*------------------------------------------------------------------------------------------* * HRTF structures - hrtfs from binary files *------------------------------------------------------------------------------------------*/ @@ -1464,6 +1472,7 @@ typedef struct ivas_hrtfs_crend_structure } HRTFS_CREND, *HRTFS_CREND_HANDLE; #endif + /* Fastconv binaural data structure */ #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct ivas_hrtf_fastconv_struct @@ -1523,7 +1532,6 @@ typedef struct ivas_hrtfs_fastconv_struct } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; - #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct ivas_hrtf_statistics_struct #else @@ -1536,7 +1544,8 @@ typedef struct ivas_hrtfs_statistics_struct Word32 *average_energy_l_dyn; Word32 *average_energy_r_dyn; Word32 *inter_aural_coherence_dyn; - int16_t fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ + Word16 fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ + } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 65cd20af3b54bad4a76ae1137932feaf512549dc..7289ced5cd4cf772e97bb030868c14059418d0fe 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -191,15 +191,15 @@ ivas_error IVAS_REND_GetDelay_fx( ); /*! r: error code */ -ivas_error IVAS_REND_GetHrtfHandle( +ivas_error IVAS_REND_GetHrtfTdHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS rendder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ); /*! r: error code */ ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS render handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ); ivas_error IVAS_REND_GetHrtfFastConvHandle( diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 68ad09d679f0f4aa7f67cd57fb965c27858df7fe..d08542df8b96b8832a89454fe16a1477a350d3e8 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -198,10 +198,14 @@ typedef struct typedef struct hrtf_handles { +#ifdef FIX_CREND_SIMPLIFY_CODE + IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend; +#else IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; +#endif IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; - IVAS_DEC_HRTF_HANDLE hHrtfTD; + IVAS_DEC_HRTF_TD_HANDLE hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; } hrtf_handles; @@ -1406,12 +1410,12 @@ static ivas_error initIsmMasaRendering( } #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputIsm->crendWrapper ); + ivas_rend_closeCrend_fx( &inputIsm->crendWrapper ); #else - ivas_rend_closeCrend( &inputIsm->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputIsm->crendWrapper, num_poses ); #endif - ivas_reverb_close( &inputIsm->hReverb ); + ivas_reverb_close_fx( &inputIsm->hReverb ); IF( NE_32( ( error = ivas_omasa_ana_open( &inputIsm->hOMasa, inSampleRate, inputIsm->total_num_objects ) ), IVAS_ERR_OK ) ) { @@ -1441,7 +1445,6 @@ static ivas_error setRendInputActiveIsm( Word16 num_poses; #endif - IF( EQ_32( getAudioConfigType( inConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ) { ivas_format = MC_FORMAT; @@ -1450,6 +1453,7 @@ static ivas_error setRendInputActiveIsm( { ivas_format = ISM_FORMAT; } + move16(); inputIsm = (input_ism *) input; rendCtx = inputIsm->base.ctx; @@ -1464,7 +1468,6 @@ static ivas_error setRendInputActiveIsm( move16(); } #endif - IF( !isIoConfigPairSupported( inConfig, outConfig ) ) { return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; @@ -1625,9 +1628,9 @@ static ivas_error setRendInputActiveIsm( ELSE IF( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { #ifdef FIX_CREND_SIMPLIFY_CODE - IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, num_poses ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, num_poses ) ), IVAS_ERR_OK ) ) #endif { return error; @@ -1656,7 +1659,6 @@ static void clearInputIsm( } #endif - rendCtx = inputIsm->base.ctx; freeInputBaseBufferData_fx( &inputIsm->base.inputBuffer.data_fx ); @@ -1665,12 +1667,12 @@ static void clearInputIsm( /* Free input's internal handles */ #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputIsm->crendWrapper ); + ivas_rend_closeCrend_fx( &inputIsm->crendWrapper ); #else - ivas_rend_closeCrend( &inputIsm->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputIsm->crendWrapper, num_poses ); #endif - ivas_reverb_close( &inputIsm->hReverb ); + ivas_reverb_close_fx( &inputIsm->hReverb ); IF( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { @@ -2481,6 +2483,7 @@ static ivas_error initMcBinauralRendering( move16(); } #endif + /* Allocate TD binaural renderer for custom loudspeaker layouts (regardless of headrotation) or planar MC layouts with headrotation, CREND for the rest */ useTDRend = FALSE; @@ -2525,17 +2528,18 @@ static ivas_error initMcBinauralRendering( IF( useTDRend ) { #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputMc->crendWrapper ); + ivas_rend_closeCrend_fx( &inputMc->crendWrapper ); #else - ivas_rend_closeCrend( &inputMc->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputMc->crendWrapper, num_poses ); #endif } + test(); test(); test(); IF( !reconfigureFlag || ( !useTDRend && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && inputMc->hReverb != NULL ) ) { - ivas_reverb_close( &inputMc->hReverb ); + ivas_reverb_close_fx( &inputMc->hReverb ); } test(); @@ -2644,11 +2648,11 @@ static ivas_error initMcBinauralRendering( { /* open CREND */ #ifdef FIX_CREND_SIMPLIFY_CODE - IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, - outSampleRate, 1, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, + outSampleRate, 1, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, num_poses ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, num_poses ) ), IVAS_ERR_OK ) ) #endif { return error; @@ -2719,12 +2723,12 @@ static ivas_error initMcMasaRendering( } #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputMc->crendWrapper ); + ivas_rend_closeCrend_fx( &inputMc->crendWrapper ); #else - ivas_rend_closeCrend( &inputMc->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputMc->crendWrapper, num_poses ); #endif - ivas_reverb_close( &inputMc->hReverb ); + ivas_reverb_close_fx( &inputMc->hReverb ); IF( inputMc->efapInWrapper.hEfap != NULL ) { @@ -2803,6 +2807,7 @@ static lfe_routing defaultLfeRouting( return routing; } + static ivas_error setRendInputActiveMc( void *input, const AUDIO_CONFIG inConfig, @@ -2880,8 +2885,11 @@ static ivas_error setRendInputActiveMc( IF( EQ_32( getAudioConfigType( outConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) { - +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( NE_32( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -2933,12 +2941,12 @@ static void clearInputMc( } #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputMc->crendWrapper ); + ivas_rend_closeCrend_fx( &inputMc->crendWrapper ); #else - ivas_rend_closeCrend( &inputMc->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputMc->crendWrapper, num_poses ); #endif - ivas_reverb_close( &inputMc->hReverb ); + ivas_reverb_close_fx( &inputMc->hReverb ); IF( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { @@ -3063,6 +3071,7 @@ static ivas_error updateSbaPanGains( #ifndef FIX_CREND_SIMPLIFY_CODE Word16 num_poses; #endif + /* Reset to all zeros - some functions below only write non-zero elements. */ setZeroPanMatrix_fx( inputSba->hoaDecMtx_fx ); @@ -3133,9 +3142,9 @@ static ivas_error updateSbaPanGains( else { #ifdef FIX_CREND_SIMPLIFY_CODE - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, num_poses ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, num_poses ) ), IVAS_ERR_OK ) ) #endif { return error; @@ -3152,9 +3161,9 @@ static ivas_error updateSbaPanGains( return error; } #ifdef FIX_CREND_SIMPLIFY_CODE - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, num_poses ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_openCrend_fx( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, num_poses ) ), IVAS_ERR_OK ) ) #endif { return error; @@ -3197,10 +3206,11 @@ static ivas_error initSbaMasaRendering( move16(); } #endif + #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputSba->crendWrapper ); + ivas_rend_closeCrend_fx( &inputSba->crendWrapper ); #else - ivas_rend_closeCrend( &inputSba->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputSba->crendWrapper, num_poses ); #endif IF( NE_32( ( error = ivas_dirac_ana_open_fx( &inputSba->hDirAC, inSampleRate ) ), IVAS_ERR_OK ) ) @@ -3259,7 +3269,12 @@ static ivas_error setRendInputActiveSba( return error; } } + +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( NE_32( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -3291,9 +3306,9 @@ static void clearInputSba( initRendInputBase_fx( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); #ifdef FIX_CREND_SIMPLIFY_CODE - ivas_rend_closeCrend( &inputSba->crendWrapper ); + ivas_rend_closeCrend_fx( &inputSba->crendWrapper ); #else - ivas_rend_closeCrend( &inputSba->crendWrapper, num_poses ); + ivas_rend_closeCrend_fx( &inputSba->crendWrapper, num_poses ); #endif IF( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) @@ -3572,15 +3587,24 @@ ivas_error IVAS_REND_Open( hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; +#ifdef FIX_CREND_SIMPLIFY_CODE + hIvasRend->hHrtfs.hHrtfCrend = NULL; +#else hIvasRend->hHrtfs.hSetOfHRTF = NULL; +#endif hIvasRend->hHrtfs.hHrtfStatistics = NULL; + IF( asHrtfBinary ) { IF( NE_32( ( error = ivas_HRTF_binary_open_fx( &( hIvasRend->hHrtfs.hHrtfTD ) ) ), IVAS_ERR_OK ) ) { return error; } +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( NE_32( ( error = ivas_HRTF_CRend_binary_open_fx( &( hIvasRend->hHrtfs.hHrtfCrend ) ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_HRTF_CRend_binary_open_fx( &( hIvasRend->hHrtfs.hSetOfHRTF ) ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -3592,7 +3616,7 @@ ivas_error IVAS_REND_Open( { return error; } - IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_HRTF_statistics_binary_open_fx( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ), IVAS_ERR_OK ) ) { return error; } @@ -3600,7 +3624,7 @@ ivas_error IVAS_REND_Open( IF( EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { - IF( NE_32( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_HRTF_statistics_init_fx( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ), IVAS_ERR_OK ) ) { return error; } @@ -4270,12 +4294,13 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return error; } - test(); - test(); - IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) { +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -4933,7 +4958,7 @@ ivas_error IVAS_REND_InitConfig( IF( rendererConfigEnabled ) { - IF( NE_32( ( error = ivas_render_config_open( &( hIvasRend->hRendererConfig ) ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_render_config_open_fx( &( hIvasRend->hRendererConfig ) ) ), IVAS_ERR_OK ) ) { return error; } @@ -5094,7 +5119,7 @@ Word16 IVAS_REND_FeedRenderConfig( if ( pMasaInput->hMasaExtRend->hDiracDecBin[0] != NULL && pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb != NULL ) { ivas_binaural_reverb_close_fx( &pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb ); - IF( NE_32( ( error = ivas_binaural_reverb_init( &pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, pMasaInput->hMasaExtRend->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL, NULL ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_binaural_reverb_init_fx( &pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, pMasaInput->hMasaExtRend->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL, NULL ) ), IVAS_ERR_OK ) ) { return error; } @@ -5102,7 +5127,7 @@ Word16 IVAS_REND_FeedRenderConfig( if ( pMasaInput->hMasaExtRend->hReverb != NULL ) { ivas_binaural_reverb_close_fx( &pMasaInput->hMasaExtRend->hReverb ); - IF( NE_32( ( error = ivas_binaural_reverb_init( &pMasaInput->hMasaExtRend->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, pMasaInput->hMasaExtRend->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL, NULL ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_binaural_reverb_init_fx( &pMasaInput->hMasaExtRend->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, pMasaInput->hMasaExtRend->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL, NULL ) ), IVAS_ERR_OK ) ) { return error; } @@ -5225,7 +5250,11 @@ ivas_error IVAS_REND_SetHeadRotation( { IF( NE_32( hIvasRend->inputsMc[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -5319,7 +5348,11 @@ ivas_error IVAS_REND_DisableHeadRotation( { IF( NE_32( hIvasRend->inputsMc[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { +#ifdef FIX_CREND_SIMPLIFY_CODE + IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ), IVAS_ERR_OK ) ) +#endif { return error; @@ -6257,8 +6290,10 @@ static ivas_error renderIsmToBinauralRoom( } *ismInput->crendWrapper->p_io_qfactor = *exp; + move16(); + /* render 7_1_4 with BRIRs */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( ismInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, ismInput->base.inputBuffer.config.numSamplesPerChannel, *ismInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( ismInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, ismInput->base.inputBuffer.config.numSamplesPerChannel, *ismInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -6995,13 +7030,15 @@ static ivas_error renderMcToBinaural( { copyBufferTo2dArray_fx( mcInput->base.inputBuffer, tmpRendBuffer_fx ); } - // Porting Crend_process function + CREND_HANDLE hCrend; hCrend = mcInput->crendWrapper->hCrend[0]; *mcInput->crendWrapper->p_io_qfactor = exp; + move16(); + /* call CREND */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer_fx, p_tmpRendBuffer_fx, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer_fx, p_tmpRendBuffer_fx, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -7117,13 +7154,15 @@ static ivas_error renderMcToBinauralRoom( { copyBufferTo2dArray_fx( mcInput->base.inputBuffer, tmpRendBuffer ); } - // Porting Crend_process function + CREND_HANDLE hCrend; hCrend = mcInput->crendWrapper->hCrend[0]; *mcInput->crendWrapper->p_io_qfactor = exp; + move16(); + /* call CREND */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -7229,14 +7268,17 @@ static ivas_error renderMcCustomLsToBinauralRoom( { renderBufferChannel_fx( *tmpBufPtr, i, mcInput->panGains_fx[i], tmpMcBuffer ); } + copyBufferTo2dArray_fx( tmpMcBuffer, tmpCrendBuffer ); CREND_HANDLE hCrend; hCrend = mcInput->crendWrapper->hCrend[0]; *mcInput->crendWrapper->p_io_qfactor = exp; + move16(); + /* call CREND */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( mcInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -7475,8 +7517,10 @@ static ivas_error renderMcToSplitBinaural( copyBufferTo2dArray_fx( tmpRotBuffer, tmpRendBuffer ); *mcInput->crendWrapper->p_io_qfactor = exp; + move16(); + /* call CREND (rotation already performed) */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, pos_idx ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, pos_idx ) ), IVAS_ERR_OK ) ) { return error; } @@ -7745,8 +7789,10 @@ static ivas_error renderSbaToMultiBinaural( assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL ); *sbaInput->crendWrapper->p_io_qfactor = *pq_fact; + move16(); + /* call CREND */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, pos_idx ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, pos_idx ) ), IVAS_ERR_OK ) ) { return error; } @@ -7925,8 +7971,10 @@ static ivas_error renderSbaToBinaural( hCrend = sbaInput->crendWrapper->hCrend[0]; *sbaInput->crendWrapper->p_io_qfactor = *outAudio.pq_fact; + move16(); + /* call CREND */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, output_fx, output_fx, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, output_fx, output_fx, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -8035,11 +8083,14 @@ static ivas_error renderSbaToBinauralRoom( { renderBufferChannel_fx( *tmpBufPtr, i, sbaInput->hoaDecMtx_fx[i], tmpMcBuffer ); } + copyBufferTo2dArray_fx( tmpMcBuffer, tmpCrendBuffer ); *sbaInput->crendWrapper->p_io_qfactor = *outAudio.pq_fact; + move16(); + /* call CREND */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( sbaInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) { return error; } @@ -9249,6 +9300,9 @@ void IVAS_REND_Close( FOR( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { clearInputSba( &hIvasRend->inputsSba[i] ); +#ifdef FIX_CREND_SIMPLIFY_CODE + hIvasRend->hHrtfs.hHrtfFastConv = NULL; +#endif } FOR( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { @@ -9256,7 +9310,7 @@ void IVAS_REND_Close( } /* clear Config. Renderer */ - ivas_render_config_close( &( hIvasRend->hRendererConfig ) ); + ivas_render_config_close_fx( &( hIvasRend->hRendererConfig ) ); ivas_limiter_close_fx( &hIvasRend->hLimiter ); @@ -9274,14 +9328,18 @@ void IVAS_REND_Close( ivas_combined_orientation_close_fx( &hIvasRend->hCombinedOrientationData ); /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( &hIvasRend->hHrtfs.hHrtfFastConv ); + ivas_binaural_hrtf_close_fx( &hIvasRend->hHrtfs.hHrtfFastConv ); /* Parametric binauralizer HRTF filters */ ivas_HRTF_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfTD ) ); +#ifdef FIX_CREND_SIMPLIFY_CODE + ivas_HRTF_CRend_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfCrend ) ); +#else ivas_HRTF_CRend_binary_close_fx( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); +#endif ivas_HRTF_fastconv_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfParambin ) ); - ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); + ivas_HRTF_statistics_close_fx( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); free( hIvasRend ); *phIvasRend = NULL; @@ -9421,14 +9479,14 @@ void IVAS_REND_cldfbSynthesis_wrapper( /*---------------------------------------------------------------------* - * IVAS_REND_GetHrtfHandle( ) + * IVAS_REND_GetHrtfTdHandle( ) * * *---------------------------------------------------------------------*/ -ivas_error IVAS_REND_GetHrtfHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ +ivas_error IVAS_REND_GetHrtfTdHandle( + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ) { if ( hIvasRend == NULL || hIvasRend->hHrtfs.hHrtfTD == NULL ) @@ -9450,15 +9508,24 @@ ivas_error IVAS_REND_GetHrtfHandle( ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ) { +#ifdef FIX_CREND_SIMPLIFY_CODE + test(); + IF( hIvasRend == NULL || hIvasRend->hHrtfs.hHrtfCrend == NULL ) +#else if ( hIvasRend == NULL || hIvasRend->hHrtfs.hSetOfHRTF == NULL ) +#endif { return IVAS_ERR_WRONG_PARAMS; } - *hSetOfHRTF = &hIvasRend->hHrtfs.hSetOfHRTF; +#ifdef FIX_CREND_SIMPLIFY_CODE + *hHrtfCrend = &hIvasRend->hHrtfs.hHrtfCrend; +#else + *hHrtfCrend = &hIvasRend->hHrtfs.hSetOfHRTF; +#endif return IVAS_ERR_OK; } @@ -10105,7 +10172,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( IF( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { - IF( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx, hDiracDecBin->earlyPartEneCorrection_fx ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_binaural_reverb_init_fx( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx, hDiracDecBin->earlyPartEneCorrection_fx ) ), IVAS_ERR_OK ) ) { return error; } @@ -10365,7 +10432,7 @@ static void freeMasaExtRenderer( { if ( hMasaExtRend->hDiracDecBin[i] != NULL ) { - ivas_dirac_dec_close_binaural_data( &hMasaExtRend->hDiracDecBin[i] ); + ivas_dirac_dec_close_binaural_data_fx( &hMasaExtRend->hDiracDecBin[i] ); } } diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index fcf337630969aacd2bfdbc23d6cd54bc9717b2a5..b885b285703e28f8a360db0f82f8c36e947d6881 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -565,8 +565,8 @@ static void LoadBSplineBinaryITD( --------------------------------------------------------------------*/ static ivas_error TDREND_LoadBSplineBinary( - IVAS_DEC_HRTF_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ - FILE *f_hrtf /* i : HR filter data file handle */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ + FILE *f_hrtf /* i : HR filter data file handle */ ) { ModelParams_t *model; @@ -858,8 +858,8 @@ static ivas_error TDREND_LoadBSplineBinary( --------------------------------------------------------------------*/ static ivas_error LoadBSplineBinary( - IVAS_DEC_HRTF_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ - FILE *f_hrtf /* i : HR filter data file handle */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ + FILE *f_hrtf /* i : HR filter data file handle */ ) { ModelParams_t *model; @@ -1156,7 +1156,7 @@ static ivas_error load_reverb_from_binary( if ( hrtf_header.frequency != sampleRate ) { free( hrtf_data ); - return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE; + return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" ); } } #endif @@ -1251,7 +1251,7 @@ static ivas_error TDREND_MIX_LoadHRTF( #ifdef FIX_989_TD_REND_ROM const Word32 sampleRate, /* i : sample rate */ #endif - IVAS_DEC_HRTF_HANDLE HrFiltSet_p /* o : Loaded HR filter set */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p /* o : Loaded HR filter set */ ) { int16_t tmp; @@ -1351,7 +1351,7 @@ static ivas_error TDREND_MIX_LoadHRTF( if ( hrtf_header.frequency != sampleRate ) { free( hrtf_data ); - return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE; + return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" ); } } #endif @@ -1397,7 +1397,7 @@ static ivas_error TDREND_MIX_LoadHRTF( *---------------------------------------------------------------------*/ ivas_error load_TDrend_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: TD rend. HRTF handle */ const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) @@ -1420,7 +1420,7 @@ ivas_error load_TDrend_HRTF_binary( *---------------------------------------------------------------------*/ ivas_error load_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: HRTF handle */ const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ) { @@ -1508,7 +1508,7 @@ static void HRTF_energy_sections_precalc( *---------------------------------------------------------------------*/ void destroy_td_hrtf( - IVAS_DEC_HRTF_HANDLE *hHrtf /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE *hHrtf /* i/o: TD rend. HRTF handle */ ) { int16_t i; @@ -1635,8 +1635,8 @@ void destroy_td_hrtf( *---------------------------------------------------------------------*/ static ivas_error create_Crend_HRTF_from_rawdata( - HRTFS_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ - char *hrtf_data /* i : pointer to binary file */ + HRTFS_CREND_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ + char *hrtf_data /* i : pointer to binary file */ ) { Word16 i, j, k, l; @@ -2914,7 +2914,7 @@ ivas_error load_fastconv_HRTF_from_binary( if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */ { free( hrtf_data ); - return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE; + return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" ); } #else if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) ) @@ -3108,7 +3108,7 @@ ivas_error load_parambin_HRTF_from_binary( if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */ { free( hrtf_data ); - return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE; + return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" ); } #endif @@ -3233,7 +3233,7 @@ ivas_error load_Crend_HRTF_from_binary( if ( hrtf_header.frequency != sampleRate ) { free( hrtf_data ); - return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE; + return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" ); } if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -3531,7 +3531,7 @@ void destroy_hrtf_statistics( } } - ivas_HRTF_statistics_close( hHrtfStatistics ); + ivas_HRTF_statistics_close_fx( hHrtfStatistics ); #ifdef FIX_CREND_SIMPLIFY_CODE return; @@ -3549,7 +3549,7 @@ void destroy_fastconv_hrtf( ) { /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( hHrtfFastConv ); + ivas_binaural_hrtf_close_fx( hHrtfFastConv ); /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close_fx( hHrtfFastConv ); diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 5277260217895e9efa6d07fc8b10b9234fa14f40..6d3f50b40b4c86a5fe6d0c10dc854b4c1d2ec148 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -62,8 +62,22 @@ typedef enum HRTF_READER_RENDERER_BINAURAL_MIXER_CONV, HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM, HRTF_READER_RENDERER_BINAURAL_REVERB_ALL + } HRTF_READER_RENDERER_TYPE; +#ifdef FIX_CREND_SIMPLIFY_CODE +typedef enum +{ + BINAURAL_INPUT_AUDIO_CONFIG_INVALID, + BINAURAL_INPUT_AUDIO_CONFIG_COMBINED, /* 5_1, 5_1_2, 5_1_4, 7_1, 7_1_4 */ + BINAURAL_INPUT_AUDIO_CONFIG_HOA3, /* HOA3 */ + BINAURAL_INPUT_AUDIO_CONFIG_HOA2, /* HOA2 */ + BINAURAL_INPUT_AUDIO_CONFIG_FOA, /* FOA */ + BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED /* Not used */ + +} BINAURAL_INPUT_AUDIO_CONFIG; +#endif + #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct ivas_hrtfs_header_t { @@ -71,8 +85,10 @@ typedef struct ivas_hrtfs_header_t Word32 input_cfg; Word32 frequency; UWord32 data_size; + } ivas_hrtfs_header_t; #endif + /*---------------------------------------------------------------------* * hrtfFileReader_open() * @@ -105,7 +121,7 @@ ivas_error load_TDrend_HRTF_binary( #else ivas_error load_HRTF_binary( #endif - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: TD rend. HRTF handle */ #ifdef FIX_989_TD_REND_ROM const Word32 sampleRate, /* i : sample rate */ #endif @@ -227,7 +243,7 @@ void destroy_parambin_hrtf( *---------------------------------------------------------------------*/ void destroy_td_hrtf( - IVAS_DEC_HRTF_HANDLE *hHRTF /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE *hHRTF /* i/o: TD rend. HRTF handle */ ); #endif /* IVAS_HRTF_FILE_READER_H */