diff --git a/Workspace_msvc/encoder.vcxproj b/Workspace_msvc/encoder.vcxproj
index bcfe92a4db2218e2e04ae78a7cf7ea35cdc24349..9578e488dcee1c036524b8520471e228f6cb409f 100644
--- a/Workspace_msvc/encoder.vcxproj
+++ b/Workspace_msvc/encoder.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
encoder
@@ -27,12 +23,6 @@
false
MultiByte
-
- Application
- v141
- false
- MultiByte
-
Application
v141
@@ -46,10 +36,6 @@
-
-
-
-
@@ -65,13 +51,6 @@
false
IVAS_cod
-
- ..\
- .\Debug_$(ProjectName)\
- false
- false
- IVAS_cod
-
..\
.\Release_$(ProjectName)\
@@ -126,63 +105,6 @@
-
-
-
-
-
-
- $(IntDir)$(ProjectName).tlb
-
-
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions)
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
-
-
-
-
- $(IntDir)$(ProjectName).pdb
- Level4
- true
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0c0c
-
-
-
-
- $(OutDir)$(TargetName).exe
- true
-
-
- false
- true
- $(IntDir)$(ProjectName).pdb
- Console
-
-
- false
-
-
- MachineX86
-
-
-
-
-
-
diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj
index 0769491d34fd06efcaf5b6fda6b57166e5f72b86..8a1559090269fbef0fc2610f72898c6d055213bb 100644
--- a/Workspace_msvc/lib_com.vcxproj
+++ b/Workspace_msvc/lib_com.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
{39EC200D-7795-4FF8-B214-B24EDA5526AE}
@@ -26,12 +22,6 @@
false
MultiByte
-
- StaticLibrary
- v141
- false
- MultiByte
-
StaticLibrary
v141
@@ -45,10 +35,6 @@
-
-
-
-
@@ -62,11 +48,6 @@
.\Debug_$(ProjectName)\
libivascom
-
- .\Debug_$(ProjectName)\
- .\Debug_$(ProjectName)\
- libivascom
-
.\Release_$(ProjectName)\
.\Release_$(ProjectName)\
@@ -102,40 +83,6 @@
true
-
-
-
-
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)
-
-
- EnableFastChecks
- MultiThreadedDebug
-
-
-
-
- $(IntDir)$(ProjectName).pdb
- Level4
- true
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0c0c
-
-
- WS2_32.lib; %(AdditionalDependencies)
- $(OutDir)$(TargetName).lib
- true
-
-
diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj
index 7a2fcecef1353bc4e7bf229c4e584957bb3e89b9..4f3b1aa297341e81d0dbb2cedc16927960a67e26 100644
--- a/Workspace_msvc/lib_debug.vcxproj
+++ b/Workspace_msvc/lib_debug.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
{54509728-928B-44D9-A118-A6F92F08B34F}
@@ -25,11 +21,6 @@
v141
MultiByte
-
- StaticLibrary
- v141
- MultiByte
-
StaticLibrary
v141
@@ -42,9 +33,6 @@
-
-
-
@@ -57,11 +45,6 @@
.\Debug_$(ProjectName)\
libivasdebug
-
- .\Debug_$(ProjectName)\
- .\Debug_$(ProjectName)\
- libivasdebug
-
.\Release_$(ProjectName)\
.\Release_$(ProjectName)\
@@ -73,7 +56,7 @@
Disabled
- ..\lib_util;..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories)
+ ..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories)
_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)
false
@@ -90,31 +73,6 @@
$(OutDir)$(TargetName).lib
-
-
-
-
-
-
- Disabled
- ..\lib_util;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)
- false
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
- $(IntDir)$(ProjectName).pdb
- Level4
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- $(OutDir)$(TargetName).lib
-
-
@@ -124,7 +82,7 @@
AnySuitable
false
false
- ..\lib_util;..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories)
+ ..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories)
_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)
true
diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj
index ff41d4f9c4589b68431da01ff0a2505cc5aa515e..5ed2cd88a901cfff235b9de947d5cf9ac916b25d 100644
--- a/Workspace_msvc/lib_dec.vcxproj
+++ b/Workspace_msvc/lib_dec.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
lib_dec
@@ -26,12 +22,6 @@
false
MultiByte
-
- StaticLibrary
- v141
- false
- MultiByte
-
StaticLibrary
@@ -46,10 +36,6 @@
-
-
-
-
@@ -65,13 +51,6 @@
false
libivasdec
-
- .\Debug_$(ProjectName)\
- .\Debug_$(ProjectName)\
- false
- false
- libivasdec
-
.\Release_$(ProjectName)\
.\Release_$(ProjectName)\
@@ -114,46 +93,6 @@
true
-
-
-
-
-
-
- .\Debug\$(ProjectName).tlb
-
-
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
-
-
-
-
- $(IntDir)$(ProjectName).pdb
- Level4
- true
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0c0c
-
-
- WS2_32.lib; %(AdditionalDependencies)
- $(OutDir)$(TargetName).lib
- true
-
-
diff --git a/Workspace_msvc/lib_dec.vcxproj.filters b/Workspace_msvc/lib_dec.vcxproj.filters
index 82f949db7889bd6c187294d75159e533348974b6..b916d743c959dfdc028a67cc88001e74892c5246 100644
--- a/Workspace_msvc/lib_dec.vcxproj.filters
+++ b/Workspace_msvc/lib_dec.vcxproj.filters
@@ -1,576 +1,579 @@
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
- dec_ivas_c
+ decoder_ivas_c
+
+
+ decoder_ivas_c
- dec_ivas_c
+ decoder_ivas_c
- dec_ivas_c
+ decoder_ivas_c
- dec_ivas_c
+ decoder_ivas_c
- dec_ivas_c
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
- dec_ivas_c
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
- dec_ivas_c
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
+
+
+ decoder_ivas_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
-
-
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_evs_c
+ decoder_evs_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
+
+
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
+
+
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
+ decoder_all_c
- dec_all_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_evs_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
- dec_ivas_c
-
-
-
- dec_ivas_c
+ decoder_all_c
-
- dec_h
-
-
- dec_h
-
- dec_h
+ decoder_h
- dec_h
+ decoder_h
+
+
+ decoder_h
+
+
+ decoder_h
- dec_h
+ decoder_h
- dec_h
-
-
- dec_h
+ decoder_h
- dec_h
+ decoder_h
-
- dec_h
+
+ decoder_h
- dec_h
+ decoder_h
+
+
+ decoder_h
- dec_h
+ decoder_h
- dec_h
+ decoder_h
+
+
+ decoder_h
-
-
- {9d223c16-7845-4b37-b6fe-30de409ab87b}
+
+ {f63b6db2-97ec-4d8d-be9c-e798ac8bb645}
-
- {0df7c383-e6a6-4d1c-a261-eea34adef2fc}
+
+ {0853864e-7de7-411d-975b-5045652f22c3}
-
- {71a041e7-3b8b-4642-ab14-2b6a79aeb0a8}
+
+ {e29aae34-aeeb-45dd-a986-61b39890c5bb}
-
- {e4a97be1-bcf8-43d3-b941-594f39f2d41b}
+
+ {c33b80b3-67ce-466b-91c0-4adfc9efcb5c}
-
+
\ No newline at end of file
diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj
index c38a0e1e1a3bbbea206ef648e2c5682cc84f04fc..4ff380f542c3890f42eb032016956f1726463682 100644
--- a/Workspace_msvc/lib_enc.vcxproj
+++ b/Workspace_msvc/lib_enc.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
lib_enc
@@ -27,12 +23,6 @@
false
MultiByte
-
- StaticLibrary
- v141
- false
- MultiByte
-
StaticLibrary
v141
@@ -46,10 +36,6 @@
-
-
-
-
@@ -65,13 +51,6 @@
false
libivasenc
-
- .\Debug_$(ProjectName)\
- .\Debug_$(ProjectName)\
- false
- false
- libivasenc
-
.\Release_$(ProjectName)\
.\Release_$(ProjectName)\
@@ -117,50 +96,6 @@
-
-
-
-
-
-
- $(IntDir)$(ProjectName).tlb
-
-
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
-
-
-
-
- $(IntDir)$(ProjectName).pdb
- Level4
- true
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0c0c
-
-
- WS2_32.lib; %(AdditionalDependencies)
- $(OutDir)$(TargetName).lib
- true
-
-
-
-
-
-
diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj
index 852cb8f14bc40454a9cb9881ce16996d5991d428..9cd48bcd8a2edc9ac9e13dcd97d0bfd1b835104e 100644
--- a/Workspace_msvc/lib_rend.vcxproj
+++ b/Workspace_msvc/lib_rend.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
lib_rend
@@ -26,12 +22,6 @@
false
MultiByte
-
- StaticLibrary
- v141
- false
- MultiByte
-
StaticLibrary
@@ -46,10 +36,6 @@
-
-
-
-
@@ -65,13 +51,6 @@
false
libivasrend
-
- .\Debug_$(ProjectName)\
- .\Debug_$(ProjectName)\
- false
- false
- libivasrend
-
.\Release_$(ProjectName)\
.\Release_$(ProjectName)\
@@ -114,46 +93,6 @@
true
-
-
-
-
-
-
- .\Debug\$(ProjectName).tlb
-
-
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lc3plus;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
-
-
-
-
- $(IntDir)$(ProjectName).pdb
- Level4
- true
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0c0c
-
-
- WS2_32.lib; %(AdditionalDependencies)
- $(OutDir)$(TargetName).lib
- true
-
-
@@ -256,9 +195,16 @@
+
+
+
+
+
+
+
diff --git a/Workspace_msvc/lib_rend.vcxproj.filters b/Workspace_msvc/lib_rend.vcxproj.filters
new file mode 100644
index 0000000000000000000000000000000000000000..7bcbdd91e415fca1c6c4b279b32767c47eda9660
--- /dev/null
+++ b/Workspace_msvc/lib_rend.vcxproj.filters
@@ -0,0 +1,215 @@
+
+
+
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+ rend_c
+
+
+
+
+
+ rend_c
+
+
+ rend_c
+
+
+
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+ rend_h
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {54449ece-ef29-44b5-9512-ed8f555851a8}
+
+
+ {672b0eb6-cce8-425c-8bf2-aba4b45639bb}
+
+
+
\ No newline at end of file
diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj
index 4938d0b2ce6c6a4f4e466c342953db032c2063c0..687e9795a0396b5fdd696f8ba85026b750199dc1 100644
--- a/Workspace_msvc/lib_util.vcxproj
+++ b/Workspace_msvc/lib_util.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
{2FA8F384-0775-F3B7-F8C3-85209222FC70}
@@ -25,11 +21,6 @@
v141
MultiByte
-
- StaticLibrary
- v141
- MultiByte
-
StaticLibrary
v141
@@ -42,9 +33,6 @@
-
-
-
@@ -58,12 +46,6 @@
.\Debug_$(ProjectName)\
libivasutil
-
- true
- .\Debug_$(ProjectName)\
- .\Debug_$(ProjectName)\
- libivasutil
-
false
.\Release_$(ProjectName)\
@@ -90,27 +72,6 @@
$(OutDir)$(TargetName).lib
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;$(Macros);ZLIB_WINAPI;%(PreprocessorDefinitions)
- false
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
- $(IntDir)$(ProjectName).pdb
- Level4
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- $(OutDir)$(TargetName).lib
-
-
MaxSpeed
diff --git a/Workspace_msvc/renderer.vcxproj b/Workspace_msvc/renderer.vcxproj
index eee6eed340c3d05398a8f668cde3c5748399d4fc..56c9601e2f261491faaf3d97cb695183873f52e0 100644
--- a/Workspace_msvc/renderer.vcxproj
+++ b/Workspace_msvc/renderer.vcxproj
@@ -9,10 +9,6 @@
Release
Win32
-
- Unittests
- Win32
-
renderer
@@ -27,12 +23,6 @@
false
MultiByte
-
- Application
- v141
- false
- MultiByte
-
Application
v141
@@ -46,10 +36,6 @@
-
-
-
-
@@ -65,13 +51,6 @@
false
IVAS_rend
-
- ..\
- .\Debug_$(ProjectName)\
- false
- false
- IVAS_rend
-
..\
.\Release_$(ProjectName)\
@@ -86,7 +65,7 @@
Disabled
- ..\lib_com;..\lib_dec;..\lib_enc;..\lib_debug;..\lib_util;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
+ ..\lib_com;..\lib_debug;..\lib_util;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
_CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions)
EnableFastChecks
@@ -118,56 +97,6 @@
MachineX86
-
-
-
-
-
-
- $(IntDir)$(ProjectName).tlb
-
-
-
-
- Disabled
- ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
- _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions)
-
-
- EnableFastChecks
- MultiThreadedDebug
- false
-
-
-
-
- $(IntDir)$(ProjectName).pdb
- Level4
- true
- OldStyle
- Default
- %(DisableSpecificWarnings)
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0c0c
-
-
-
-
- $(OutDir)$(TargetName).exe
- true
-
-
- true
- $(IntDir)$(ProjectName).pdb
- Console
- false
-
-
- MachineX86
-
-
$(IntDir)$(ProjectName).tlb
@@ -180,7 +109,7 @@
Neither
false
false
- ..\lib_com;..\lib_dec;..\lib_enc;..\lib_debug;..\lib_util;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
+ ..\lib_com;..\lib_debug;..\lib_util;..\lib_rend;..\lc3plus;%(AdditionalIncludeDirectories)
_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)
true
diff --git a/apps/decoder.c b/apps/decoder.c
index d3cab998f36a765a0b6d93985078e4737be4006a..b46b6db31ca4a1ba6199484c88b56e3db7bda34d 100644
--- a/apps/decoder.c
+++ b/apps/decoder.c
@@ -30,41 +30,36 @@
*******************************************************************************************************/
-#include
-#include
-#include
-#include
-#include "options.h"
#include "lib_dec.h"
+#include
#include "cmdl_tools.h"
#include "audio_file_writer.h"
#include "bitstream_reader.h"
-#include "masa_file_writer.h"
+#include "evs_rtp_payload.h"
#include "ism_file_writer.h"
-#include "ls_custom_file_reader.h"
+#include "jbm_file_writer.h"
#include "hrtf_file_reader.h"
+#include "ls_custom_file_reader.h"
+#include "masa_file_writer.h"
+#include "render_config_reader.h"
#include "rotation_file_reader.h"
-#include "vector3_pair_file_reader.h"
-#include "jbm_file_writer.h"
-#include "evs_rtp_payload.h"
+#ifdef SPLIT_REND_WITH_HEAD_ROT
+#include "split_render_file_read_write.h"
+#endif
#ifdef VARIABLE_SPEED_DECODING
#include "tsm_scale_file_reader.h"
#endif
+#include "vector3_pair_file_reader.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "wmc_auto.h"
-#include "render_config_reader.h"
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-#include "split_render_file_read_write.h"
-#endif
-#include "hrtf_file_reader.h"
#define WMC_TOOL_SKIP
/*------------------------------------------------------------------------------------------*
- * Local constants, enums, structures
+ * Local constants
*------------------------------------------------------------------------------------------*/
#if !defined( DEBUGGING ) && !defined( WMOPS )
@@ -74,22 +69,16 @@ static
#define MIN_NUM_BITS_ACTIVE_FRAME 56
#define NUM_BITS_SID_IVAS_5K2 104
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-#define NUM_FRAMES_PER_SEC 50
-#define MAX_FRAME_SIZE ( 48000 / NUM_FRAMES_PER_SEC )
-#else
-#define MAX_FRAME_SIZE ( 48000 / 50 )
-#endif
-#define MAX_NUM_OUTPUT_CHANNELS 16
#ifdef SBA_AND_OBJECTS
-#define MAX_OUTPUT_PCM_BUFFER_SIZE ( ( MAX_NUM_OUTPUT_CHANNELS + IVAS_MAX_NUM_OBJECTS ) * MAX_FRAME_SIZE )
+#define MAX_OUTPUT_PCM_BUFFER_SIZE ( ( IVAS_MAX_OUTPUT_CHANNELS + IVAS_MAX_NUM_OBJECTS ) * IVAS_MAX_FRAME_SIZE )
#else
-#define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE )
+#define MAX_OUTPUT_PCM_BUFFER_SIZE ( IVAS_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE )
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define MAX_SPLIT_REND_BITRATE ( 768000 ) /* TODO tmu: unify with SPLIT_REND_MAX_BRATE ? */
-#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
+#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
#endif
+
#define IVAS_PUBLIC_ORIENT_TRK_NONE ( 0 )
#define IVAS_PUBLIC_ORIENT_TRK_REF ( 1 )
#define IVAS_PUBLIC_ORIENT_TRK_AVG ( 2 )
@@ -101,13 +90,18 @@ static
#endif
#define JBM_FRONTEND_FETCH_FRAMESIZE_MS 20
+
+/*------------------------------------------------------------------------------------------*
+ * Local structure for storing cmdln arguments
+ *------------------------------------------------------------------------------------------*/
+
typedef struct
{
char *inputBitstreamFilename;
char *outputWavFilename;
IVAS_DEC_MODE decMode;
int32_t output_Fs;
- IVAS_DEC_AUDIO_CONFIG outputFormat;
+ AUDIO_CONFIG outputConfig;
bool quietModeEnabled;
bool delayCompensationEnabled;
bool voipMode;
@@ -123,12 +117,10 @@ typedef struct
char *jbmTraceFilename;
#endif
char *jbmOffsetFilename;
- char *FEPatterFileName;
+ char *FEPatternFileName;
float FER;
bool hrtfReaderEnabled;
char *hrtfFileName;
- bool hrtfCRendReaderEnabled;
- char *hrtfCRendFileName;
IVAS_DEC_INPUT_FORMAT inputFormat;
bool customLsOutputEnabled;
char *customLsSetupFilename;
@@ -149,6 +141,7 @@ typedef struct
#endif
#ifdef DEBUG_JBM_CMD_OPTION
bool noBadFrameDelay;
+ uint16_t frontendFetchSizeMs;
#endif
#ifdef VARIABLE_SPEED_DECODING
bool variableSpeedMode;
@@ -156,11 +149,7 @@ typedef struct
char *tsmScaleFileName;
uint16_t tsmScale;
#endif
-#ifdef DEBUG_JBM_CMD_OPTION
- uint16_t frontendFetchSizeMs;
#endif
-#endif
-
uint16_t acousticEnvironmentId;
uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
@@ -172,6 +161,7 @@ typedef struct
*------------------------------------------------------------------------------------------*/
static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
+
static void usage_dec( void );
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader,
@@ -180,6 +170,7 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF
#endif
IVAS_DEC_HANDLE hIvasDec,
int16_t *pcmBuf );
+
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
@@ -288,7 +279,7 @@ int main(
if ( arg.hrtfReaderEnabled )
{
/* sanity check */
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
arg.hrtfReaderEnabled = false;
fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" );
@@ -310,9 +301,9 @@ int main(
if ( arg.enableHeadRotation )
{
/* sanity check */
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB
#ifdef SPLIT_REND_WITH_HEAD_ROT
- && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM
+ && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM
#endif
)
{
@@ -334,7 +325,7 @@ int main(
if ( arg.enableReferenceRotation )
{
/* sanity check */
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" );
goto cleanup;
@@ -361,7 +352,7 @@ int main(
if ( arg.enableReferenceVectorTracking )
{
/* sanity check */
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" );
goto cleanup;
@@ -414,9 +405,9 @@ int main(
if ( arg.renderConfigEnabled )
{
/* sanity check */
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB
#ifdef SPLIT_REND_WITH_HEAD_ROT
- && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM
+ && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM
#endif
)
{
@@ -434,13 +425,15 @@ int main(
/*------------------------------------------------------------------------------------------*
* Configure the decoder
*------------------------------------------------------------------------------------------*/
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED || arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM )
+ if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
arg.enableHeadRotation = true;
}
#endif
- if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
+
+ if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
@@ -545,9 +538,9 @@ int main(
* Open Error pattern file for simulation
*-----------------------------------------------------------------*/
- if ( arg.FEPatterFileName != NULL )
+ if ( arg.FEPatternFileName != NULL )
{
- if ( ( FEC_pattern = fopen( arg.FEPatterFileName, "rb" ) ) == NULL )
+ if ( ( FEC_pattern = fopen( arg.FEPatternFileName, "rb" ) ) == NULL )
{
fprintf( stderr, "Error: Missing or incorrect FEC filename specification\n\n" );
usage_dec();
@@ -563,20 +556,20 @@ int main(
* Print information about FEC
*-----------------------------------------------------------------*/
- if ( !arg.voipMode && ( arg.FEPatterFileName != NULL || arg.FER > 0 ) )
+ if ( !arg.voipMode && ( arg.FEPatternFileName != NULL || arg.FER > 0 ) )
{
- if ( arg.FEPatterFileName != NULL )
+ if ( arg.FEPatternFileName != NULL )
{
- fprintf( stdout, "FEC: %s\n", arg.FEPatterFileName );
+ fprintf( stdout, "FEC: %s\n", arg.FEPatternFileName );
}
else
{
fprintf( stdout, "FEC: %.2f %%\n", arg.FER );
}
}
-#else /* DEBUGGING */
+#else
IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode );
-#endif /* DEBUGGING */
+#endif
/*-------------------------------------------------------------------*
* Load renderer configuration from file
@@ -588,15 +581,14 @@ int main(
/* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB &&
- arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED &&
- arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM )
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
+ arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
- exit( -1 );
+ goto cleanup;
}
#else
- if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
+ if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" );
goto cleanup;
@@ -614,13 +606,14 @@ int main(
fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
goto cleanup;
}
+
if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to get directivity for objects: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
goto cleanup;
}
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
+ if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
{
@@ -637,6 +630,7 @@ int main(
}
renderConfig.room_acoustics.override = true;
}
+
if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -674,7 +668,11 @@ int main(
{
IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
- IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
+ if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
{
@@ -682,29 +680,42 @@ int main(
goto cleanup;
}
-
IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
- IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
+ if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
{
- fprintf( stderr, "\nError in loading HRTF binary file %s for CRend \n\n", arg.hrtfCRendFileName );
+ fprintf( stderr, "\nError in loading HRTF binary file %s for CRend \n\n", arg.hrtfFileName );
goto cleanup;
}
+
IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL;
- IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv );
+ if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK )
{
- fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfCRendFileName );
+ fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfFileName );
goto cleanup;
}
+
IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL;
- IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin );
+ if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK )
{
- fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfCRendFileName );
+ fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName );
goto cleanup;
}
}
@@ -721,16 +732,12 @@ int main(
#ifdef VARIABLE_SPEED_DECODING
else if ( arg.variableSpeedMode )
{
- error = decodeVariableSpeed( arg, hBsReader, headRotReader,
- externalOrientationFileReader,
- refRotReader, referenceVectorReader, hIvasDec );
+ error = decodeVariableSpeed( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec );
}
#endif
else
{
- error = decodeG192( arg, hBsReader, headRotReader,
- externalOrientationFileReader,
- refRotReader, referenceVectorReader,
+ error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader,
#ifdef SPLIT_REND_WITH_HEAD_ROT
splitRendBitsBuf,
#endif
@@ -786,6 +793,7 @@ cleanup:
IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
destroy_SetOfHRTF( hSetOfHRTF );
}
+
IVAS_DEC_Close( &hIvasDec );
CustomLsReader_close( &hLsCustomReader );
hrtfFileReader_close( &hrtfReader );
@@ -827,10 +835,10 @@ cleanup:
* Translate command-line argument to output configuration
*---------------------------------------------------------------------*/
-static IVAS_DEC_AUDIO_CONFIG cmdline2config(
+static AUDIO_CONFIG cmdline2config(
char *argv )
{
- IVAS_DEC_AUDIO_CONFIG output_config;
+ AUDIO_CONFIG output_config;
char argv_to_upper[FILENAME_MAX];
@@ -840,73 +848,73 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config(
if ( strcmp( argv_to_upper, "EXT" ) == 0 ) /* external renderer */
{
- output_config = IVAS_DEC_OUTPUT_EXT;
+ output_config = AUDIO_CONFIG_EXTERNAL;
}
else if ( strcmp( argv_to_upper, "MONO" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_MONO;
+ output_config = AUDIO_CONFIG_MONO;
}
else if ( strcmp( argv_to_upper, "STEREO" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_STEREO;
+ output_config = AUDIO_CONFIG_STEREO;
}
else if ( strcmp( argv_to_upper, "5_1" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_5_1;
+ output_config = AUDIO_CONFIG_5_1;
}
else if ( strcmp( argv_to_upper, "7_1" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_7_1;
+ output_config = AUDIO_CONFIG_7_1;
}
else if ( strcmp( argv_to_upper, "5_1_2" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_5_1_2;
+ output_config = AUDIO_CONFIG_5_1_2;
}
else if ( strcmp( argv_to_upper, "5_1_4" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_5_1_4;
+ output_config = AUDIO_CONFIG_5_1_4;
}
else if ( strcmp( argv_to_upper, "7_1_4" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_7_1_4;
+ output_config = AUDIO_CONFIG_7_1_4;
}
else if ( strcmp( argv_to_upper, "FOA" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_FOA;
+ output_config = AUDIO_CONFIG_FOA;
}
else if ( strcmp( argv_to_upper, "HOA2" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_HOA2;
+ output_config = AUDIO_CONFIG_HOA2;
}
else if ( strcmp( argv_to_upper, "HOA3" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_HOA3;
+ output_config = AUDIO_CONFIG_HOA3;
}
else if ( strcmp( argv_to_upper, "BINAURAL" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_BINAURAL;
+ output_config = AUDIO_CONFIG_BINAURAL;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CODED" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED;
+ output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
}
else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_PCM" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM;
+ output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
}
#endif
else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_IR" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR;
+ output_config = AUDIO_CONFIG_BINAURAL_ROOM_IR;
}
else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_REVERB" ) == 0 )
{
- output_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB;
+ output_config = AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
}
else
{
- output_config = IVAS_DEC_OUTPUT_LS_CUSTOM;
+ output_config = AUDIO_CONFIG_LS_CUSTOM;
}
return output_config;
@@ -936,7 +944,7 @@ static bool parseCmdlIVAS_dec(
#endif
#endif
arg->output_Fs = 48000;
- arg->outputFormat = IVAS_DEC_OUTPUT_MONO;
+ arg->outputConfig = AUDIO_CONFIG_MONO;
arg->decMode = IVAS_DEC_MODE_IVAS;
arg->quietModeEnabled = false;
arg->delayCompensationEnabled = true;
@@ -959,14 +967,11 @@ static bool parseCmdlIVAS_dec(
arg->jbmOffsetFilename = NULL;
arg->FER = 0.f;
- arg->FEPatterFileName = NULL;
+ arg->FEPatternFileName = NULL;
arg->hrtfReaderEnabled = false;
arg->hrtfFileName = NULL;
- arg->hrtfCRendReaderEnabled = false;
- arg->hrtfCRendFileName = NULL;
-
arg->customLsOutputEnabled = false;
arg->customLsSetupFilename = NULL;
@@ -1095,7 +1100,7 @@ static bool parseCmdlIVAS_dec(
ftmp = 0.0f;
if ( sscanf( argv[i + 1], "%f", &ftmp ) != 1 )
{
- arg->FEPatterFileName = argv[i + 1];
+ arg->FEPatternFileName = argv[i + 1];
}
else
{
@@ -1378,10 +1383,10 @@ static bool parseCmdlIVAS_dec(
}
i += tmp;
}
+
/*-----------------------------------------------------------------*
* Option not recognized
*-----------------------------------------------------------------*/
-
else
{
fprintf( stderr, "Error: Unknown option %s or wrong number of parameters!\n\n", argv[i] );
@@ -1398,14 +1403,14 @@ static bool parseCmdlIVAS_dec(
if ( i < argc - 3 )
{
- arg->outputFormat = cmdline2config( argv[i] );
- if ( arg->outputFormat == IVAS_DEC_OUTPUT_LS_CUSTOM )
+ arg->outputConfig = cmdline2config( argv[i] );
+ if ( arg->outputConfig == AUDIO_CONFIG_LS_CUSTOM )
{
arg->customLsOutputEnabled = true;
arg->customLsSetupFilename = argv[i];
}
i++;
- if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputFormat != IVAS_DEC_OUTPUT_STEREO ) )
+ if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != AUDIO_CONFIG_STEREO ) )
{
fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" );
usage_dec();
@@ -1414,11 +1419,11 @@ static bool parseCmdlIVAS_dec(
}
else
{
- arg->outputFormat = IVAS_DEC_OUTPUT_MONO;
+ arg->outputConfig = AUDIO_CONFIG_MONO;
arg->decMode = IVAS_DEC_MODE_EVS;
if ( ( arg->Opt_non_diegetic_pan ) )
{
- arg->outputFormat = IVAS_DEC_OUTPUT_STEREO;
+ arg->outputConfig = AUDIO_CONFIG_STEREO;
}
}
@@ -1618,8 +1623,8 @@ static ivas_error initOnFirstGoodFrame(
return error;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) ||
- ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) )
+ if ( ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ||
+ ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
{
pFullDelayNumSamples[0] = 0;
}
@@ -1646,32 +1651,42 @@ static ivas_error initOnFirstGoodFrame(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED )
+ if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
int16_t delayNumSamples_temp[3];
int32_t delayTimeScale_temp;
- IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp );
- error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp );
- if ( error != IVAS_ERR_OK )
+
+ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
+ return error;
+ }
+
+ if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", arg.outputWavFilename );
- exit( -1 );
+ return error;
}
+
*ppAfWriter = NULL;
}
else
{
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM )
+ if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
int16_t delayNumSamples_temp[3];
int32_t delayTimeScale_temp;
- IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp );
- assert( arg.outputMdFilename != NULL );
- error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp );
- if ( error != IVAS_ERR_OK )
+
+ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
+ return error;
+ }
+
+ if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", arg.outputWavFilename );
- exit( -1 );
+ return error;
}
}
#endif
@@ -1729,7 +1744,7 @@ static ivas_error initOnFirstGoodFrame(
free( zeroBuf );
/* Open other output files if EXT output config - now details about ISM or MASA are known */
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
if ( ( error = IVAS_DEC_GetFormat( hIvasDec, pBsFormat ) ) != IVAS_ERR_OK )
{
@@ -1963,6 +1978,7 @@ static ivas_error decodeG192(
goto cleanup;
}
}
+
/* Reference rotation */
if ( arg.enableReferenceRotation )
{
@@ -2077,26 +2093,13 @@ static ivas_error decodeG192(
/* Once good frame decoded, catch up */
if ( decodedGoodFrame )
{
- error = initOnFirstGoodFrame(
- hIvasDec,
- arg,
- numInitialBadFrames,
- nOutSamples,
- delayNumSamples_orig,
- &delayNumSamples,
- &delayTimeScale,
- &bsFormat,
- &afWriter,
- &masaWriter,
- ismWriters,
- &nOutChannels,
- &numObj
+ if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, nOutSamples, delayNumSamples_orig,
+ &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj
#ifdef SPLIT_REND_WITH_HEAD_ROT
- ,
- &hSplitRendFileReadWrite
+ ,
+ &hSplitRendFileReadWrite
#endif
- );
- if ( error != IVAS_ERR_OK )
+ ) ) != IVAS_ERR_OK )
{
goto cleanup;
}
@@ -2111,7 +2114,7 @@ static ivas_error decodeG192(
if ( decodedGoodFrame )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) )
+ if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
{
if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
splitRendBits.codec, splitRendBits.pose_correction ) != IVAS_ERR_OK )
@@ -2122,7 +2125,7 @@ static ivas_error decodeG192(
}
else
{
- if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) )
+ if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
splitRendBits.codec, splitRendBits.pose_correction ) != IVAS_ERR_OK )
@@ -2151,7 +2154,7 @@ static ivas_error decodeG192(
}
/* Write MASA/ISM metadata to external file(s) */
- if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
#ifdef MASA_AND_OBJECTS
if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM
@@ -2260,7 +2263,7 @@ static ivas_error decodeG192(
}
/* Print output metadata file name(s) */
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
if ( bsFormat == IVAS_DEC_BS_OBJ )
{
@@ -2325,6 +2328,7 @@ cleanup:
*
* Print bitstream info of a VoIP G.192 or RTPDUMP bitstream.
*---------------------------------------------------------------------*/
+
static ivas_error printBitstreamInfoVoip(
DecArguments arg,
BS_READER_HANDLE hBsReader,
@@ -2745,7 +2749,7 @@ static ivas_error decodeVoIP(
}
/* Write ISM metadata to external file(s) */
- if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
int16_t i;
@@ -3186,7 +3190,7 @@ static ivas_error decodeVariableSpeed(
}
/* Write ISm metadata to external file(s) */
- if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
#ifdef MASA_AND_OBJECTS
if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM )
@@ -3370,7 +3374,7 @@ static ivas_error decodeVariableSpeed(
}
/* Write ISm metadata to external file(s) */
- if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
#ifdef MASA_AND_OBJECTS
if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM )
@@ -3452,7 +3456,7 @@ static ivas_error decodeVariableSpeed(
}
/* Print output metadata file name(s) */
- if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
+ if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
{
if ( bsFormat == IVAS_DEC_BS_OBJ )
{
diff --git a/apps/encoder.c b/apps/encoder.c
index 4fa2b9a75020312e0d2b1daf227700560f67d3cc..0ef304f4fbaec8369782cbc75222100673b7b543 100644
--- a/apps/encoder.c
+++ b/apps/encoder.c
@@ -30,25 +30,24 @@
*******************************************************************************************************/
-#include
-#include
-#include
#include "lib_enc.h"
+#include
#include "cmdl_tools.h"
#include "audio_file_reader.h"
#include "bitstream_writer.h"
+#include "ism_file_reader.h"
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
-#include "ism_file_reader.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "wmc_auto.h"
+
#define WMC_TOOL_SKIP
/*------------------------------------------------------------------------------------------*
- * Local constants, enums, structures
+ * Local constants, enums
*------------------------------------------------------------------------------------------*/
#if !defined( DEBUGGING ) && !defined( WMOPS )
@@ -110,7 +109,11 @@ typedef union _EncInputFormatConfig
} EncInputFormatConfig;
-/* Struct for storing cmdln arguments */
+
+/*------------------------------------------------------------------------------------------*
+ * Local structure for storing cmdln arguments
+ *------------------------------------------------------------------------------------------*/
+
typedef struct
{
char *inputWavFilename;
diff --git a/apps/renderer.c b/apps/renderer.c
index 4933849a387a6912a3ba7431de911bd7db0af2e6..37bf0ea3d5c28d1b4878fc3b54ac903d03566a47 100644
--- a/apps/renderer.c
+++ b/apps/renderer.c
@@ -31,32 +31,33 @@
*******************************************************************************************************/
#include "lib_rend.h"
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-#include "split_render_file_read_write.h"
-#include "split_rend_bfi_file_reader.h"
-#endif
#include
-#include
#include
-#include
-#include
#include
#include "audio_file_reader.h"
#include "audio_file_writer.h"
#include "cmdl_tools.h"
#include "cmdln_parser.h"
-#include "rotation_file_reader.h"
-#include "vector3_pair_file_reader.h"
#include "hrtf_file_reader.h"
#include "ism_file_reader.h"
#include "ls_custom_file_reader.h"
#include "masa_file_reader.h"
#include "masa_file_writer.h"
-#include "prot.h"
#include "render_config_reader.h"
+#include "rotation_file_reader.h"
+#ifdef SPLIT_REND_WITH_HEAD_ROT
+#include "split_render_file_read_write.h"
+#include "split_rend_bfi_file_reader.h"
+#endif
+#include "vector3_pair_file_reader.h"
+#ifdef DEBUGGING
+#include "debug.h"
+#endif
#include "wmc_auto.h"
+#define WMC_TOOL_SKIP
+
/*------------------------------------------------------------------------------------------*
* Local constants
*------------------------------------------------------------------------------------------*/
@@ -66,9 +67,12 @@
#define RENDERER_MAX_METADATA_LINE_LENGTH 1024
#ifdef SPLIT_REND_WITH_HEAD_ROT
-#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) SPLIT_REND_MAX_BRATE / FRAMES_PER_SEC ) + 7 ) >> 3 ) + SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
+#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) SPLIT_REND_MAX_BRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) + SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
#endif
+#define IVAS_MAX16B_FLT 32767.0f
+#define IVAS_MIN16B_FLT ( -32768.0f )
+
#if !defined( DEBUGGING ) && !defined( WMOPS )
static
#endif
@@ -80,6 +84,11 @@ static
#define SEP_FOLDER '/'
#endif
+#ifndef _WIN32
+#define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
+#define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
+#endif
+
/*------------------------------------------------------------------------------------------*
* Local structures
@@ -106,7 +115,7 @@ typedef struct
} LfeRoutingConfig;
typedef struct
{
- IVAS_REND_AudioConfig audioConfig;
+ AUDIO_CONFIG audioConfig;
int32_t inputChannelIndex;
float gain_dB;
} RendererInput;
@@ -136,7 +145,7 @@ typedef struct
typedef struct
{
- IVAS_REND_AudioConfig audioConfig;
+ AUDIO_CONFIG audioConfig;
IVAS_CUSTOM_LS_DATA outSetupCustom;
} OutputConfig;
@@ -375,7 +384,7 @@ static const CmdLnParser_Option cliOptions[] = {
static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_Option );
-static IVAS_REND_AudioConfig ambisonicsOrderToEnum( const int16_t order );
+static AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order );
static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs );
@@ -390,6 +399,7 @@ static void IsmPositionProvider_getNextFrame( IsmPositionProvider *positionProvi
static void IsmPositionProvider_close( IsmPositionProvider *positionProvider );
static LfeRoutingConfig *LfeRoutingConfig_open( void );
+
static void LfeRoutingConfig_close( LfeRoutingConfig *lfeRoutingCfg );
static void readFromShorthandMetadata( IsmPositionProvider *positionProvider, ObjectPositionBuffer *objectMetadataBuffer, const uint32_t objIdx );
@@ -414,13 +424,13 @@ static ivas_error parseLfePanMtxFile( const char *lfeRoutingMatrixFilePath, IVAS
static void printSupportedAudioConfigs( void );
-static IVAS_REND_AudioConfig parseAudioConfig( const char *configString );
+static AUDIO_CONFIG parseAudioConfig( const char *configString );
static void convertInputBuffer( const int16_t *intBuffer, const int16_t numIntSamplesPerChannel, const int16_t numFloatSamplesPerChannel, const int16_t numChannels, float *floatBuffer
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const int16_t cldfb_in,
- HANDLE_CLDFB_FILTER_BANK *cldfbAna
+ IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbAna
#endif
);
@@ -428,7 +438,7 @@ static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamp
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const int16_t cldfb_in,
- HANDLE_CLDFB_FILTER_BANK *cldfbSyn
+ IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbSyn
#endif
);
@@ -615,7 +625,7 @@ static void setupWithSingleFormatInput(
else if ( args.inConfig.numBinBuses != 0 )
{
*hhSplitRendFileReadWrite = NULL;
- if ( args.inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( args.inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
ivas_error error;
error = split_rend_reader_open( hhSplitRendFileReadWrite, args.inMetadataFilePaths[0] );
@@ -637,62 +647,7 @@ static float dBToLin(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
-static int16_t rend_openCldfb(
- HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS],
- HANDLE_CLDFB_FILTER_BANK cldfbSyn[MAX_INPUT_CHANNELS],
- const int16_t num_in_chs,
- const int16_t num_out_chs,
- const int32_t output_Fs )
-{
- int16_t n;
-
- for ( n = 0; n < num_in_chs; n++ )
- {
- if ( openCldfb( &( cldfbAna[n] ), CLDFB_ANALYSIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) != IVAS_ERR_OK )
- {
- return -1;
- }
- }
- for ( ; n < MAX_INPUT_CHANNELS; n++ )
- {
- cldfbAna[n] = NULL;
- }
-
- for ( n = 0; n < num_out_chs; n++ )
- {
- if ( openCldfb( &( cldfbSyn[n] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) != IVAS_ERR_OK )
- {
- return -1;
- }
- }
- for ( ; n < MAX_INPUT_CHANNELS; n++ )
- {
- cldfbSyn[n] = NULL;
- }
- return 0;
-}
-
-static void rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], HANDLE_CLDFB_FILTER_BANK cldfbSyn[MAX_INPUT_CHANNELS] )
-{
- int16_t n;
- for ( n = 0; n < MAX_INPUT_CHANNELS; n++ )
- {
- if ( cldfbAna[n] != NULL )
- {
- deleteCldfb( &( cldfbAna[n] ) );
- cldfbAna[n] = NULL;
- }
-
- if ( cldfbSyn[n] != NULL )
- {
- deleteCldfb( &( cldfbSyn[n] ) );
- cldfbSyn[n] = NULL;
- }
- }
- return;
-}
-
-static int16_t get_cldfb_in_flag( IVAS_REND_AudioConfig audioConfig, IVAS_RENDER_CONFIG_DATA *renderConfig )
+static int16_t get_cldfb_in_flag( AUDIO_CONFIG audioConfig, IVAS_RENDER_CONFIG_DATA *renderConfig )
{
int16_t cldfb_in;
cldfb_in = 0;
@@ -701,7 +656,7 @@ static int16_t get_cldfb_in_flag( IVAS_REND_AudioConfig audioConfig, IVAS_RENDER
#ifdef DEBUGGING
cldfb_in = 1;
#endif
- if ( audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
+ if ( audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
cldfb_in = 1;
}
@@ -715,7 +670,7 @@ static int16_t is_split_post_rend_mode( CmdlnArgs *args )
int16_t flag;
flag = 0;
if ( ( args->inConfig.numBinBuses > 0 ) &&
- ( ( args->inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( args->inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) )
+ ( ( args->inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( args->inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) )
{
flag = 1;
}
@@ -727,8 +682,8 @@ static int16_t is_split_pre_rend_mode( CmdlnArgs *args )
{
int16_t flag;
flag = 0;
- if ( ( args->outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
- ( args->outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ if ( ( args->outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
+ ( args->outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
flag = 1;
}
@@ -752,8 +707,8 @@ int main(
RotFileReader *externalOrientationFileReader = NULL;
RotFileReader *referenceRotReader = NULL;
#ifdef SPLIT_REND_WITH_HEAD_ROT
- HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS];
- HANDLE_CLDFB_FILTER_BANK cldfbSyn[MAX_INPUT_CHANNELS];
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS];
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS];
int16_t cldfb_in, CLDFBframeSize_smpls;
SplitRendBFIFileReader *splitRendBFIReader = NULL;
#endif
@@ -818,14 +773,14 @@ int main(
CmdlnArgs args = parseCmdlnArgs( argc, argv );
- if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_MONO ) ||
- ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == IVAS_REND_AUDIO_CONFIG_OBJECT && args.inConfig.numAudioObjects == 1 ) ) )
+ if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == AUDIO_CONFIG_MONO ) ||
+ ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == AUDIO_CONFIG_OBA && args.inConfig.numAudioObjects == 1 ) ) )
{
fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires mono or ISM1 input\n" );
exit( -1 );
}
- if ( args.nonDiegeticPan && args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_STEREO )
+ if ( args.nonDiegeticPan && args.outConfig.audioConfig != AUDIO_CONFIG_STEREO )
{
fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" );
exit( -1 );
@@ -905,12 +860,7 @@ int main(
if ( args.sceneDescriptionInput )
{
/* With scene description input, inputFilePath is the path to the scene description file. Parse it. */
- parseSceneDescriptionFile( args.inputFilePath,
- audioFilePath,
- &args.inConfig,
- positionProvider,
- masaReaders,
- lfeRoutingConfigs );
+ parseSceneDescriptionFile( args.inputFilePath, audioFilePath, &args.inConfig, positionProvider, masaReaders, lfeRoutingConfigs );
}
else
{
@@ -924,7 +874,7 @@ int main(
}
/* Check that there is allowed configuration for MASA format output */
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 )
{
if ( args.inConfig.numMasaBuses == 0 )
{
@@ -943,7 +893,7 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*if split renderer is running in post renderer mode*/
- if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
+ if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
{
error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath );
if ( error != IVAS_ERR_OK )
@@ -1053,13 +1003,13 @@ int main(
/* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) )
+ if ( ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) )
{
fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split pre-rendering mode is enabled. Exiting. \n" );
exit( -1 );
}
#else
- if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
+ if ( ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
{
fprintf( stderr, "\nExternal Renderer Config is only supported for binaural output configurations. Exiting. \n" );
exit( -1 );
@@ -1083,7 +1033,7 @@ int main(
exit( -1 );
}
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
{
@@ -1098,7 +1048,7 @@ int main(
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
exit( -1 );
}
- renderConfig.room_acoustics.override = TRUE;
+ renderConfig.room_acoustics.override = 1;
}
if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK )
@@ -1125,7 +1075,7 @@ int main(
}
/* Set up output custom layout configuration */
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK )
{
@@ -1134,7 +1084,7 @@ int main(
}
/* Set up MASA writer for MASA output */
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 )
{
MasaFileWriter_open( args.outputFilePath, true, &masaWriter ); /* No delay for audio in renderer, so calling metadata writer in delayCompensated mode, i.e., no delay applied to meta */
if ( masaWriter == NULL )
@@ -1177,7 +1127,7 @@ int main(
exit( -1 );
}
- if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( args.inConfig.multiChannelBuses[i].audioConfig == AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK )
{
@@ -1244,7 +1194,7 @@ int main(
for ( i = 0; i < args.inConfig.numAudioObjects; ++i )
{
- if ( ( error = IVAS_REND_AddInput( hIvasRend, IVAS_REND_AUDIO_CONFIG_OBJECT, &ismIds[i] ) ) != IVAS_ERR_OK )
+ if ( ( error = IVAS_REND_AddInput( hIvasRend, AUDIO_CONFIG_OBA, &ismIds[i] ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
@@ -1257,7 +1207,7 @@ int main(
}
/* With MASA output, all objects are handled at once, so add only one input having all objects in it */
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 )
{
break;
}
@@ -1341,10 +1291,10 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( cldfb_in )
{
- rend_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate );
+ IVAS_REND_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate );
}
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp );
error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp );
@@ -1357,7 +1307,7 @@ int main(
}
else
{
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp );
error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp );
@@ -1643,7 +1593,7 @@ int main(
for ( i = 0; i < args.inConfig.numAudioObjects; ++i )
{
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 )
{
if ( i == 0 )
{
@@ -1835,7 +1785,7 @@ int main(
/* Write MASA metadata for MASA outputs */
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 )
{
IVAS_REND_AudioConfigType inputType1;
IVAS_REND_AudioConfigType inputType2;
@@ -1935,9 +1885,9 @@ int main(
}
#endif
- if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
+ if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
{
- fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) );
+ fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / IVAS_NUM_FRAMES_PER_SEC / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) );
}
if ( !args.quietModeEnabled && args.delayCompensationEnabled )
@@ -1978,7 +1928,7 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( cldfb_in )
{
- rend_closeCldfb( cldfbAna, cldfbSyn );
+ IVAS_REND_closeCldfb( cldfbAna, cldfbSyn );
}
if ( hSplitRendFileReadWrite != NULL )
@@ -2019,20 +1969,20 @@ int main(
* Local functions
*------------------------------------------------------------------------------------------*/
-static IVAS_REND_AudioConfig ambisonicsOrderToEnum(
+static AUDIO_CONFIG ambisonicsOrderToEnum(
const int16_t order )
{
switch ( order )
{
case 1:
- return IVAS_REND_AUDIO_CONFIG_FOA;
+ return AUDIO_CONFIG_FOA;
case 2:
- return IVAS_REND_AUDIO_CONFIG_HOA2;
+ return AUDIO_CONFIG_HOA2;
case 3:
- return IVAS_REND_AUDIO_CONFIG_HOA3;
+ return AUDIO_CONFIG_HOA3;
}
- return IVAS_REND_AUDIO_CONFIG_UNKNOWN;
+ return AUDIO_CONFIG_INVALID;
}
static const CmdLnParser_Option *findOptionById(
@@ -2077,47 +2027,47 @@ static bool parseInConfig(
return true;
}
- /* Check for single-format inputs. The given string should map to a member of IVAS_REND_AudioConfig enum. */
- IVAS_REND_AudioConfig audioConfig = parseAudioConfig( inFormatStr );
+ /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */
+ AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr );
switch ( audioConfig )
{
- case IVAS_REND_AUDIO_CONFIG_MONO:
- case IVAS_REND_AUDIO_CONFIG_STEREO:
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1_4:
inConfig->numMultiChannelBuses = 1;
inConfig->multiChannelBuses[0].audioConfig = audioConfig;
inConfig->multiChannelBuses[0].inputChannelIndex = 0;
inConfig->multiChannelBuses[0].gain_dB = 0.0f;
break;
- case IVAS_REND_AUDIO_CONFIG_FOA:
- case IVAS_REND_AUDIO_CONFIG_HOA2:
- case IVAS_REND_AUDIO_CONFIG_HOA3:
+ case AUDIO_CONFIG_FOA:
+ case AUDIO_CONFIG_HOA2:
+ case AUDIO_CONFIG_HOA3:
inConfig->numAmbisonicsBuses = 1;
inConfig->ambisonicsBuses[0].audioConfig = audioConfig;
inConfig->ambisonicsBuses[0].inputChannelIndex = 0;
inConfig->ambisonicsBuses[0].gain_dB = 0.0f;
break;
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
inConfig->numBinBuses = 1;
inConfig->binBuses[0].audioConfig = audioConfig;
inConfig->binBuses[0].inputChannelIndex = 0;
inConfig->binBuses[0].gain_dB = 0.0f;
break;
#endif
- case IVAS_REND_AUDIO_CONFIG_MASA1:
- case IVAS_REND_AUDIO_CONFIG_MASA2:
+ case AUDIO_CONFIG_MASA1:
+ case AUDIO_CONFIG_MASA2:
inConfig->numMasaBuses = 1;
inConfig->masaBuses[0].audioConfig = audioConfig;
inConfig->masaBuses[0].inputChannelIndex = 0;
inConfig->masaBuses[0].gain_dB = 0.0f;
break;
- case IVAS_REND_AUDIO_CONFIG_OBJECT:
+ case AUDIO_CONFIG_OBA:
/* If input format is objects, parse the characters after "ISM" to get number of objects */
{
char *ptr = NULL;
@@ -2141,8 +2091,8 @@ static bool parseInConfig(
}
}
break;
- case IVAS_REND_AUDIO_CONFIG_UNKNOWN:
- /* This case will be reached if parsing string to IVAS_REND_AudioConfig enum fails.
+ case AUDIO_CONFIG_INVALID:
+ /* This case will be reached if parsing string to AUDIO_CONFIG enum fails.
* Try to use the given string as a path to a custom loudspeaker layout file. */
{
ivas_error error = parseCustomLayoutFile( inFormatStr, &inConfig->inSetupCustom );
@@ -2160,14 +2110,14 @@ static bool parseInConfig(
return false;
}
inConfig->numMultiChannelBuses = 1;
- inConfig->multiChannelBuses[0].audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM;
+ inConfig->multiChannelBuses[0].audioConfig = AUDIO_CONFIG_LS_CUSTOM;
inConfig->multiChannelBuses[0].inputChannelIndex = 0;
inConfig->multiChannelBuses[0].gain_dB = 0.0f;
}
break;
default:
{
- /* Default case covers formats that are defined in the IVAS_REND_AudioConfig enum,
+ /* Default case covers formats that are defined in the AUDIO_CONFIG enum,
* but cannot be used at input, e.g. BINAURAL */
const CmdLnParser_Option *listOption = findOptionById( CmdLnOptionId_listFormats );
fprintf( stderr, "Unsupported input format: %s. To list valid formats, use option --%s.\n", inFormatStr, listOption->match );
@@ -2187,9 +2137,9 @@ static bool parseOutConfig(
outConfig->audioConfig = parseAudioConfig( outputFormatStr );
/* If the string provided is not recognized as a valid output config,
* it's expected to be a path to a custom loudspeaker layout description file. */
- if ( outConfig->audioConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( outConfig->audioConfig == AUDIO_CONFIG_INVALID )
{
- outConfig->audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM;
+ outConfig->audioConfig = AUDIO_CONFIG_LS_CUSTOM;
if ( ( error = parseCustomLayoutFile( outputFormatStr, &outConfig->outSetupCustom ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error while parsing output format option\n" );
@@ -2266,7 +2216,7 @@ static bool parseOrientationTracking(
return true;
}
-static IVAS_REND_AudioConfig parseAudioConfig(
+static AUDIO_CONFIG parseAudioConfig(
const char *configString )
{
#ifndef SPLIT_REND_WITH_HEAD_ROT
@@ -2283,43 +2233,43 @@ static IVAS_REND_AudioConfig parseAudioConfig(
if ( ( strcmp( charBuf, "MONO" ) == 0 ) || ( strcmp( charBuf, "HOA0" ) == 0 ) || ( strcmp( charBuf, "SBA0" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_MONO;
+ return AUDIO_CONFIG_MONO;
}
if ( ( strcmp( charBuf, "STEREO" ) == 0 ) || ( strcmp( charBuf, "CICP2" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_STEREO;
+ return AUDIO_CONFIG_STEREO;
}
if ( ( strcmp( charBuf, "FOA" ) == 0 ) || ( strcmp( charBuf, "SBA1" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_FOA;
+ return AUDIO_CONFIG_FOA;
}
if ( ( strcmp( charBuf, "HOA2" ) == 0 ) || ( strcmp( charBuf, "SBA2" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_HOA2;
+ return AUDIO_CONFIG_HOA2;
}
if ( ( strcmp( charBuf, "HOA3" ) == 0 ) || ( strcmp( charBuf, "SBA3" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_HOA3;
+ return AUDIO_CONFIG_HOA3;
}
if ( ( strcmp( charBuf, "5_1" ) == 0 ) || ( strcmp( charBuf, "CICP6" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_5_1;
+ return AUDIO_CONFIG_5_1;
}
if ( ( strcmp( charBuf, "7_1" ) == 0 ) || ( strcmp( charBuf, "CICP12" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_7_1;
+ return AUDIO_CONFIG_7_1;
}
if ( ( strcmp( charBuf, "5_1_2" ) == 0 ) || ( strcmp( charBuf, "CICP14" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_5_1_2;
+ return AUDIO_CONFIG_5_1_2;
}
if ( ( strcmp( charBuf, "5_1_4" ) == 0 ) || ( strcmp( charBuf, "CICP16" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_5_1_4;
+ return AUDIO_CONFIG_5_1_4;
}
if ( ( strcmp( charBuf, "7_1_4" ) == 0 ) || ( strcmp( charBuf, "CICP19" ) == 0 ) )
{
- return IVAS_REND_AUDIO_CONFIG_7_1_4;
+ return AUDIO_CONFIG_7_1_4;
}
if ( strncmp( charBuf, "ISM", 3 ) == 0 )
{
@@ -2331,7 +2281,7 @@ static IVAS_REND_AudioConfig parseAudioConfig(
case '2':
case '3':
case '4':
- return IVAS_REND_AUDIO_CONFIG_OBJECT;
+ return AUDIO_CONFIG_OBA;
}
}
if ( strncmp( charBuf, "MASA", 4 ) == 0 )
@@ -2341,36 +2291,36 @@ static IVAS_REND_AudioConfig parseAudioConfig(
case '1':
fprintf( stderr, "1TC MASA support is not functional and is pending on DirAC renderer refactoring.\n" );
exit( EXIT_FAILURE );
- /*return IVAS_REND_AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings
+ /*return AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings
case '2':
- return IVAS_REND_AUDIO_CONFIG_MASA2;
+ return AUDIO_CONFIG_MASA2;
default:
- return IVAS_REND_AUDIO_CONFIG_UNKNOWN;
+ return AUDIO_CONFIG_INVALID;
}
}
if ( strcmp( charBuf, "BINAURAL" ) == 0 )
{
- return IVAS_REND_AUDIO_CONFIG_BINAURAL;
+ return AUDIO_CONFIG_BINAURAL;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( strcmp( charBuf, "BINAURAL_SPLIT_PCM" ) == 0 )
{
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
+ return AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
}
if ( strcmp( charBuf, "BINAURAL_SPLIT_CODED" ) == 0 )
{
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
+ return AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
}
#endif
if ( strcmp( charBuf, "BINAURAL_ROOM_IR" ) == 0 )
{
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR;
+ return AUDIO_CONFIG_BINAURAL_ROOM_IR;
}
if ( strcmp( charBuf, "BINAURAL_ROOM_REVERB" ) == 0 )
{
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
+ return AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
}
- return IVAS_REND_AUDIO_CONFIG_UNKNOWN;
+ return AUDIO_CONFIG_INVALID;
}
static bool parseLfePositionConfig(
@@ -2458,7 +2408,7 @@ static bool checkRequiredArgs(
fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort );
missingRequiredArg = true;
}
- if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( args.outConfig.audioConfig == AUDIO_CONFIG_INVALID )
{
tmpOption = findOptionById( CmdLnOptionId_outputFormat );
fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort );
@@ -2489,7 +2439,7 @@ static CmdlnArgs defaultArgs(
args.inConfig.numMultiChannelBuses = 0;
args.inConfig.numMasaBuses = 0;
- args.outConfig.audioConfig = IVAS_REND_AUDIO_CONFIG_UNKNOWN;
+ args.outConfig.audioConfig = AUDIO_CONFIG_INVALID;
args.outConfig.outSetupCustom.num_spk = 0;
args.outConfig.outSetupCustom.num_lfe = 0;
@@ -3264,9 +3214,9 @@ static void parseMc(
--inConfig->multiChannelBuses[idx].inputChannelIndex; /* Convert from 1-indexing */
readNextMetadataChunk( line, "\n" );
- IVAS_REND_AudioConfig cfg = parseAudioConfig( line );
+ AUDIO_CONFIG cfg = parseAudioConfig( line );
/* Try to use the given string as a path to a custom loudspeaker layout file. */
- if ( cfg == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( cfg == AUDIO_CONFIG_INVALID )
{
ivas_error error = parseCustomLayoutFile( line, &inConfig->inSetupCustom );
@@ -3276,7 +3226,7 @@ static void parseMc(
exit( -1 );
}
inConfig->numMultiChannelBuses = 1;
- inConfig->multiChannelBuses[idx].audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM;
+ inConfig->multiChannelBuses[idx].audioConfig = AUDIO_CONFIG_LS_CUSTOM;
inConfig->multiChannelBuses[idx].inputChannelIndex = 0;
inConfig->multiChannelBuses[idx].gain_dB = 0.0f;
}
@@ -3382,12 +3332,20 @@ static ivas_error parseCustomLayoutFile(
}
pLsSetupCustom->num_spk = hLsCustomData.num_spk;
- mvr2r( hLsCustomData.azimuth, pLsSetupCustom->azimuth, hLsCustomData.num_spk );
- mvr2r( hLsCustomData.elevation, pLsSetupCustom->elevation, hLsCustomData.num_spk );
+
+ for ( int16_t i = 0; i < hLsCustomData.num_spk; i++ )
+ {
+ pLsSetupCustom->azimuth[i] = hLsCustomData.azimuth[i];
+ pLsSetupCustom->elevation[i] = hLsCustomData.elevation[i];
+ }
/* Loudspeaker LFE */
pLsSetupCustom->num_lfe = hLsCustomData.num_lfe;
- mvs2s( hLsCustomData.lfe_idx, pLsSetupCustom->lfe_idx, hLsCustomData.num_lfe );
+
+ for ( int16_t i = 0; i < hLsCustomData.num_lfe; i++ )
+ {
+ pLsSetupCustom->lfe_idx[i] = hLsCustomData.lfe_idx[i];
+ }
CustomLsReader_close( &hLsCustomReader );
@@ -3594,7 +3552,7 @@ static ivas_error parseLfePanMtxFile(
const char *lfeRoutingMatrixFilePath,
IVAS_REND_LfePanMtx *lfePanMtx )
{
- int16_t lfe_in, ch_out;
+ int16_t i, lfe_in, ch_out;
const char *tok;
char line[200]; /* > (10 chars * IVAS_MAX_OUTPUT_CHANNELS) i.e. "-999, " */
FILE *mtxFile;
@@ -3615,7 +3573,10 @@ static ivas_error parseLfePanMtxFile(
any subsequent issue in file reading will gracefully exit the function */
for ( lfe_in = 0; lfe_in < IVAS_MAX_INPUT_LFE_CHANNELS; lfe_in++ )
{
- set_zero( ( *lfePanMtx )[lfe_in], IVAS_MAX_OUTPUT_CHANNELS );
+ for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ )
+ {
+ ( *lfePanMtx )[lfe_in][i] = 0.0f;
+ }
}
for ( lfe_in = 0; lfe_in < IVAS_MAX_INPUT_LFE_CHANNELS; lfe_in++ )
@@ -3674,7 +3635,7 @@ static void convertInputBuffer(
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const int16_t cldfb_in,
- HANDLE_CLDFB_FILTER_BANK *cldfbAna
+ IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbAna
#endif
)
{
@@ -3685,11 +3646,13 @@ static void convertInputBuffer(
if ( cldfb_in )
{
int16_t slotIdx, numCldfbBands, numFloatPcmSamples;
- float fIn[MAX_OUTPUT_CHANNELS][L_FRAME48k];
+ float fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
+
numFloatPcmSamples = numFloatSamplesPerChannel >> 1;
- numCldfbBands = numFloatPcmSamples / CLDFB_NO_COL_MAX;
+ numCldfbBands = numFloatPcmSamples / IVAS_CLDFB_NO_COL_MAX;
+
/* CLDFB Analysis*/
- assert( numIntSamplesPerChannel <= MAX_OUTPUT_CHANNELS * L_FRAME48k );
+ assert( numIntSamplesPerChannel <= IVAS_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE );
for ( smpl = 0; smpl < numFloatPcmSamples; ++smpl )
{
for ( chnl = 0; chnl < numChannels; ++chnl )
@@ -3706,15 +3669,15 @@ static void convertInputBuffer(
++i;
}
}
+
for ( chnl = 0; chnl < numChannels; ++chnl )
{
- for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; slotIdx++ )
+ for ( slotIdx = 0; slotIdx < IVAS_CLDFB_NO_COL_MAX; slotIdx++ )
{
- cldfbAnalysis_ts( &fIn[chnl][numCldfbBands * slotIdx],
- &floatBuffer[( chnl * numFloatSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands )],
- &floatBuffer[numCldfbBands + ( chnl * numFloatSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands )],
- numCldfbBands,
- cldfbAna[chnl] );
+ IVAS_REND_cldfbAnalysis_ts_wrapper( &fIn[chnl][numCldfbBands * slotIdx],
+ &floatBuffer[( chnl * numFloatSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands )],
+ &floatBuffer[numCldfbBands + ( chnl * numFloatSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands )],
+ numCldfbBands, cldfbAna[chnl] );
}
}
}
@@ -3759,7 +3722,7 @@ static void convertOutputBuffer(
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
const int16_t cldfb_in,
- HANDLE_CLDFB_FILTER_BANK *cldfbSyn
+ IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbSyn
#endif
)
{
@@ -3772,15 +3735,17 @@ static void convertOutputBuffer(
if ( cldfb_in )
{
int16_t slotIdx, numCldfbBands, numPcmSamples, b;
- float fIn[MAX_OUTPUT_CHANNELS][L_FRAME48k];
- float re[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
- float im[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
+ float fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
+ float re[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
+ float im[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
+
numPcmSamples = numSamplesPerChannel >> 1;
- numCldfbBands = numPcmSamples / CLDFB_NO_COL_MAX;
+ numCldfbBands = numPcmSamples / IVAS_CLDFB_NO_COL_MAX;
+
/* CLDFB Synthesis*/
for ( chnl = 0; chnl < numChannels; ++chnl )
{
- for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; slotIdx++ )
+ for ( slotIdx = 0; slotIdx < IVAS_CLDFB_NO_COL_MAX; slotIdx++ )
{
for ( b = 0; b < numCldfbBands; b++ )
{
@@ -3793,16 +3758,16 @@ static void convertOutputBuffer(
/* Implement CLDFB synthesis */
for ( chnl = 0; chnl < numChannels; ++chnl )
{
- float *RealBuffer[CLDFB_NO_COL_MAX];
- float *ImagBuffer[CLDFB_NO_COL_MAX];
+ float *RealBuffer[IVAS_CLDFB_NO_COL_MAX];
+ float *ImagBuffer[IVAS_CLDFB_NO_COL_MAX];
- for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; slotIdx++ )
+ for ( slotIdx = 0; slotIdx < IVAS_CLDFB_NO_COL_MAX; slotIdx++ )
{
RealBuffer[slotIdx] = re[chnl][slotIdx];
ImagBuffer[slotIdx] = im[chnl][slotIdx];
}
- cldfbSynthesis( RealBuffer, ImagBuffer, &( fIn[chnl][0] ), numCldfbBands * CLDFB_NO_COL_MAX, cldfbSyn[chnl] );
+ IVAS_REND_cldfbSynthesis_wrapper( RealBuffer, ImagBuffer, &( fIn[chnl][0] ), numCldfbBands * IVAS_CLDFB_NO_COL_MAX, cldfbSyn[chnl] );
}
for ( smpl = 0; smpl < numPcmSamples; ++smpl )
{
@@ -3822,13 +3787,13 @@ static void convertOutputBuffer(
{
temp = floatBuffer[chnl * numSamplesPerChannel + smpl];
temp = (float) floor( temp + 0.5f );
- if ( temp > MAX16B_FLT )
+ if ( temp > IVAS_MAX16B_FLT )
{
- temp = MAX16B_FLT;
+ temp = IVAS_MAX16B_FLT;
}
- else if ( temp < MIN16B_FLT )
+ else if ( temp < IVAS_MIN16B_FLT )
{
- temp = MIN16B_FLT;
+ temp = IVAS_MIN16B_FLT;
}
intBuffer[i] = (int16_t) temp;
diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h
index 46cbe4d7fa4a7ab0d8c068eba760410d3fb9220e..634fc8f5503321a725fac4fafc99b1c8e6501e65 100644
--- a/lib_com/common_api_types.h
+++ b/lib_com/common_api_types.h
@@ -44,16 +44,57 @@
* Common API constants
*----------------------------------------------------------------------------------*/
+#define IVAS_NUM_FRAMES_PER_SEC 50
+#define IVAS_MAX_FRAME_SIZE ( 48000 / IVAS_NUM_FRAMES_PER_SEC )
+
#define IVAS_MAX_BITS_PER_FRAME ( 512000 / 50 )
#define IVAS_MAX_NUM_OBJECTS 4
+#define IVAS_MAX_INPUT_CHANNELS 16
#define IVAS_MAX_OUTPUT_CHANNELS 16
-#define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 )
+#define IVAS_CLDFB_NO_COL_MAX 16
+#define IVAS_CLDFB_NO_CHANNELS_MAX 60
#define IVAS_MAX_INPUT_LFE_CHANNELS 4
-#define RENDERER_HEAD_POSITIONS_PER_FRAME 4
+#define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4
+#define RENDERER_HEAD_POSITIONS_PER_FRAME 4 // ToDo: should it be harmonized with IVAS_MAX_PARAM_SPATIAL_SUBFRAMES?
#define QC_ABS_COEFF 6
+/*----------------------------------------------------------------------------------*
+ * Common API enum for output audio configurations
+ *----------------------------------------------------------------------------------*/
+
+typedef enum _IVAS_AUDIO_CONFIG
+{
+ AUDIO_CONFIG_INVALID,
+ AUDIO_CONFIG_MONO, /* mono output */
+ AUDIO_CONFIG_STEREO, /* stereo output */
+ AUDIO_CONFIG_5_1, /* 5.1 speakers layout CICP6 */
+ AUDIO_CONFIG_7_1, /* 7.1 speakers layout CICP12 */
+ AUDIO_CONFIG_5_1_2, /* 5.1+2 speakers layout CICP14 */
+ AUDIO_CONFIG_5_1_4, /* 5.1+4 speakers layout CICP16 */
+ AUDIO_CONFIG_7_1_4, /* 7.1+4 speakers layout CICP19 */
+ AUDIO_CONFIG_LS_CUSTOM, /* custom loudspeaker layout */
+ AUDIO_CONFIG_FOA, /* ambisonics, order 1 */
+ AUDIO_CONFIG_HOA2, /* ambisonics, order 2 */
+ AUDIO_CONFIG_HOA3, /* ambisonics, order 3 */
+ AUDIO_CONFIG_OBA, /* object based audio */
+ AUDIO_CONFIG_BINAURAL, /* binaural with HRIR */
+ AUDIO_CONFIG_BINAURAL_SPLIT_CODED, /* split binaural with CLDFB coded output */
+ AUDIO_CONFIG_BINAURAL_SPLIT_PCM, /* split binaural with PCM coded output */
+ AUDIO_CONFIG_BINAURAL_ROOM_IR, /* binaural with BRIR */
+ AUDIO_CONFIG_BINAURAL_ROOM_REVERB, /* binaural with HRIR + reverb */
+ AUDIO_CONFIG_ISM1, /* ISM1 */
+ AUDIO_CONFIG_ISM2, /* ISM2 */
+ AUDIO_CONFIG_ISM3, /* ISM3 */
+ AUDIO_CONFIG_ISM4, /* ISM4 */
+ AUDIO_CONFIG_MASA1, /* MASA1 */
+ AUDIO_CONFIG_MASA2, /* MASA2 */
+ AUDIO_CONFIG_EXTERNAL /* external renderer */
+
+} AUDIO_CONFIG;
+
+
/*----------------------------------------------------------------------------------*
* Common API structures
*----------------------------------------------------------------------------------*/
@@ -135,6 +176,7 @@ typedef struct ivas_split_rend_bits_t
IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
} ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS, *IVAS_SPLIT_REND_BITS_HANDLE;
#endif
+
typedef struct
{
float x, y, z;
@@ -157,6 +199,8 @@ 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;
+typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE;
+
#ifdef DEBUGGING
typedef enum
{
@@ -185,11 +229,13 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
float pAcoustic_dsr[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's Diffuse to Source Ratio per center frequency */
float acousticPreDelay; /* Time elapsed between input signal and late reverberation start, float, range [0.001..10] */
float inputPreDelay; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10] */
- int16_t use_er; /* ER activation flag */
- int32_t lowComplexity; /* Low complexity ER flag */
- IVAS_VECTOR3 dimensions; /* Room dimensions [m] */
- float AbsCoeff[QC_ABS_COEFF]; /* Absorption coeffs */
- IVAS_VECTOR3 ListenerOrigin; /* Listener origin */
+
+ /* early reflections */
+ int16_t use_er; /* ER activation flag */
+ int32_t lowComplexity; /* Low complexity ER flag */
+ IVAS_VECTOR3 dimensions; /* Room dimensions [m] */
+ float AbsCoeff[QC_ABS_COEFF]; /* Absorption coeffs */
+ IVAS_VECTOR3 ListenerOrigin; /* Listener origin */
} IVAS_ROOM_ACOUSTICS_CONFIG_DATA;
#ifdef SPLIT_REND_WITH_HEAD_ROT
diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h
index 42c1c40d4acc290a93f37b439022d324e263e735..02a342dfe0c9a178c8d50c4e8cd22221f5321add 100755
--- a/lib_com/ivas_cnst.h
+++ b/lib_com/ivas_cnst.h
@@ -89,49 +89,6 @@ typedef enum
#endif
-/*----------------------------------------------------------------------------------*
- * IVAS output audio configurations
- *----------------------------------------------------------------------------------*/
-
-typedef enum
-{
- AUDIO_CONFIG_INVALID,
- AUDIO_CONFIG_MONO, /* mono output */
- AUDIO_CONFIG_STEREO, /* stereo output */
- AUDIO_CONFIG_5_1, /* 5.1 speakers layout CICP6 */
- AUDIO_CONFIG_7_1, /* 7.1 speakers layout CICP12 */
- AUDIO_CONFIG_5_1_2, /* 5.1+2 speakers layout CICP14 */
- AUDIO_CONFIG_5_1_4, /* 5.1+4 speakers layout CICP16 */
- AUDIO_CONFIG_7_1_4, /* 7.1+4 speakers layout CICP19 */
- AUDIO_CONFIG_LS_CUSTOM, /* custom loudspeaker layout */
- AUDIO_CONFIG_FOA, /* ambisonics, order 1 */
- AUDIO_CONFIG_HOA2, /* ambisonics, order 2 */
- AUDIO_CONFIG_HOA3, /* ambisonics, order 3 */
- AUDIO_CONFIG_OBA, /* object based audio */
- AUDIO_CONFIG_BINAURAL, /* binaural with HRIR */
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- AUDIO_CONFIG_BINAURAL_SPLIT_CODED, /* split binaural with CLDFB coded output */
- AUDIO_CONFIG_BINAURAL_SPLIT_PCM, /* split binaural with PCM coded output */
-#endif
- AUDIO_CONFIG_BINAURAL_ROOM_IR, /* binaural with BRIR */
- AUDIO_CONFIG_BINAURAL_ROOM_REVERB, /* binaural with HRIR + reverb */
- AUDIO_CONFIG_ISM1, /* ISM1 */
- AUDIO_CONFIG_ISM2, /* ISM2 */
- AUDIO_CONFIG_ISM3, /* ISM3 */
- AUDIO_CONFIG_ISM4, /* ISM4 */
- AUDIO_CONFIG_MASA1, /* MASA1 */
- AUDIO_CONFIG_MASA2, /* MASA2 */
- AUDIO_CONFIG_EXTERNAL /* external renderer */
-
-} AUDIO_CONFIG;
-
-typedef enum
-{
- RENDER_TYPE_OVERRIDE_NONE,
- RENDER_TYPE_OVERRIDE_CREND,
- RENDER_TYPE_OVERRIDE_FASTCONV
-} ivas_renderTypeOverride;
-
/*----------------------------------------------------------------------------------*
* IVAS rendering configurations
*----------------------------------------------------------------------------------*/
@@ -176,6 +133,16 @@ typedef enum
#endif
} RENDERER_TYPE;
+#ifdef DEBUGGING
+typedef enum
+{
+ RENDER_TYPE_OVERRIDE_NONE,
+ RENDER_TYPE_OVERRIDE_CREND,
+ RENDER_TYPE_OVERRIDE_FASTCONV
+
+} ivas_renderTypeOverride;
+#endif
+
/*----------------------------------------------------------------------------------*
* IVAS general constants
*----------------------------------------------------------------------------------*/
@@ -1866,19 +1833,6 @@ typedef enum
#define QUANT_STRAT_0 0
#define QUANT_STRAT_2 2
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-/*----------------------------------------------------------------------------------*
- * Split rendering bitrate constants
- *----------------------------------------------------------------------------------*/
-
-#define SPLIT_REND_256k 256000
-#define SPLIT_REND_320k 320000
-#define SPLIT_REND_384k 384000
-#define SPLIT_REND_512k 512000
-#define SPLIT_REND_768k 768000
-#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k
-#define SPLIT_REND_ADDITIONAL_BYTES_TO_READ ( 1 )
-#endif
/*----------------------------------------------------------------------------------*
* Limiter constants
@@ -1891,6 +1845,7 @@ typedef enum
/*----------------------------------------------------------------------------------*
* Early Reflection constants
*----------------------------------------------------------------------------------*/
+
#define ER_ABS_COEFF 6
#define ER_MAX_SOURCES 25
#define ER_REF_ORDER 1
diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c
index 8a28174f508fd8c7d118c8f6cfd9294369f958c8..54d0d5f8dabac2d0948abe985e577eaf77f53686 100644
--- a/lib_com/ivas_cov_smooth.c
+++ b/lib_com/ivas_cov_smooth.c
@@ -40,6 +40,10 @@
#include "wmc_auto.h"
#include "prot.h"
+/*-----------------------------------------------------------------------------------------*
+ * Local constants
+ *-----------------------------------------------------------------------------------------*/
+
#define BAND_SMOOTH_REST_START_IDX ( 2 )
/*-----------------------------------------------------------------------------------------*
@@ -48,24 +52,36 @@
* To calculate the update factor
*-----------------------------------------------------------------------------------------*/
-static float ivas_calculate_update_factor( float *p_bin_to_band, int16_t active_bins )
+static float ivas_calculate_update_factor(
+ float *p_bin_to_band,
+ int16_t active_bins )
{
float update_factor_temp = 0.0f;
int16_t k;
+
for ( k = 0; k < active_bins; k++ )
{
update_factor_temp += p_bin_to_band[k];
}
+
return update_factor_temp;
}
+
/*-----------------------------------------------------------------------------------------*
* Function ivas_calculate_smoothning_factor()
*
* To calculate the Smoothning factor
*-----------------------------------------------------------------------------------------*/
-static void ivas_calculate_smoothning_factor( float *Smoothing_factor, float update_factor, const int16_t min_pool_size, const float max_update_rate, const COV_SMOOTHING_TYPE smooth_mode, const int32_t ivas_total_brate, int16_t j )
+static void ivas_calculate_smoothning_factor(
+ float *Smoothing_factor,
+ float update_factor,
+ const int16_t min_pool_size,
+ const float max_update_rate,
+ const COV_SMOOTHING_TYPE smooth_mode,
+ const int32_t ivas_total_brate,
+ int16_t j )
{
float smooth_fact;
*Smoothing_factor = update_factor / min_pool_size;
@@ -81,12 +97,16 @@ static void ivas_calculate_smoothning_factor( float *Smoothing_factor, float upd
}
*Smoothing_factor *= ( j + 1 ) * smooth_fact;
}
+
if ( *Smoothing_factor > max_update_rate )
{
*Smoothing_factor = max_update_rate;
}
+
+ return;
}
+
/*-----------------------------------------------------------------------------------------*
* Function ivas_set_up_cov_smoothing()
*
@@ -124,6 +144,8 @@ static void ivas_set_up_cov_smoothing(
}
hCovState->prior_bank_idx = -1;
+
+ return;
}
diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c
index 3cfa185c177d2e5051cf099c7694687895b98abd..325637c9375b99fa5abd3cfe132c85de254edd43 100644
--- a/lib_com/ivas_fb_mixer.c
+++ b/lib_com/ivas_fb_mixer.c
@@ -594,6 +594,7 @@ void ivas_fb_mixer_get_windowed_fr(
*
* FB Mixer cross fading
*-----------------------------------------------------------------------------------------*/
+
void ivas_fb_mixer_cross_fading(
IVAS_FB_MIXER_HANDLE hFbMixer,
float **ppOut_pcm,
@@ -607,8 +608,8 @@ void ivas_fb_mixer_cross_fading(
if ( hFbMixer->first_frame[ch] == 0 )
{
- fade_start_offset = (int16_t) hFbMixer->cross_fade_start_offset;
- fade_end_offset = (int16_t) hFbMixer->cross_fade_end_offset;
+ fade_start_offset = hFbMixer->cross_fade_start_offset;
+ fade_end_offset = hFbMixer->cross_fade_end_offset;
for ( k = 0; k < fade_start_offset; k++ )
{
diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c
index bee378307b33a404592a5356a77a2fd4cb52ed0e..25415e56d6b5e3b9395efd2dc147ce7f897720d3 100644
--- a/lib_com/ivas_omasa_com.c
+++ b/lib_com/ivas_omasa_com.c
@@ -383,7 +383,7 @@ void ivas_combined_format_brate_sanity(
/*!r : number of bits for ISM ratio index */
int16_t bits_index_ism_ratio(
- const int16_t nchan_ism /* i : number of objects */
+ const int16_t nchan_ism /* i : number of objects */
)
{
int16_t bits_index;
diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h
index 02bdaa5d0b488da23d139a18740977cfda1e648f..b964b4ed8b05dd3977cf96687376e954e52d80cb 100755
--- a/lib_com/ivas_prot.h
+++ b/lib_com/ivas_prot.h
@@ -107,26 +107,10 @@ ivas_error mct_enc_reconfigure(
const uint16_t b_nchan_change /* i : flag indicating different channel count */
);
-ivas_error ivas_spar_md_enc_init
-(
- ivas_spar_md_enc_state_t *hMdEnc, /* o : MD encoder handle */
- const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */
- const int16_t sba_order /* i : Ambisonic (SBA) order */
-);
-
-int16_t ivas_spar_get_activeW_flag(
- ivas_enc_cov_handler_state_t *hCovEnc,
- float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
- float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
- const int16_t dtx_vad,
- const int16_t nchan_inp,
- const int16_t nchan_transport,
- int16_t *res_ind,
- const int16_t *dmx_order);
-
ivas_error ivas_sba_enc_reconfigure(
Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */
);
+
/*! r: maximum SBA metadata bit-budget */
int16_t ivas_sba_get_max_md_bits(
Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */
@@ -328,12 +312,6 @@ ivas_error ivas_dec(
#endif
);
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-ivas_error ivas_dec_init_split_rend(
- Decoder_Struct *st_ivas /* i : IVAS decoder structure */
-);
-#endif
-
ivas_error ivas_dec_setup(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */
@@ -872,11 +850,11 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
);
void ivas_jbm_dec_get_md_map_even_spacing(
- const int16_t len, /* i : length of the modfied frames in metadata slots */
- const int16_t subframe_len, /* i : default length of a subframe */
- const int16_t offset, /* i : current read offset into the md buffer */
- const int16_t buf_len, /* i : length of the metadata buffer */
- int16_t *map /* o : metadata index map */
+ const int16_t len, /* i : length of the modfied frames in metadata slots */
+ const int16_t subframe_len, /* i : default length of a subframe */
+ const int16_t offset, /* i : current read offset into the md buffer */
+ const int16_t buf_len, /* i : length of the metadata buffer */
+ int16_t *map /* o : metadata index map */
);
TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode(
@@ -1058,9 +1036,9 @@ ivas_error ivas_ism_metadata_dec(
ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */
const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */
int16_t *ism_extended_metadata_flag, /* i/o: Extended metadata active in renderer */
- int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */
+ int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */
#ifdef SBA_AND_OBJECTS
- , DEC_CORE_HANDLE st0
+ , DEC_CORE_HANDLE st0 /* i : core-coder handle */
#endif
);
@@ -2547,7 +2525,7 @@ void IGFDecApplyStereo(
const int16_t *coreMsMask,
const int16_t restrict_hopsize,
const int16_t bfi, /* i : frame loss == 1, frame good == 0 */
- const int16_t bfi_apply_damping /* i : decoder element mode */
+ const int16_t bfi_apply_damping /* i : decoder element mode */
);
void IGFEncStereoEncoder(
@@ -2736,7 +2714,7 @@ void sns_avq_dec(
void sns_avq_dec_stereo(
int16_t *indexl, /* i : Quantization indices (left channel) */
int16_t *indexr, /* i : Quantization indices (right channe) */
- const int16_t L_frame,
+ const int16_t L_frame, /* i : frame length */
float *SNS_Ql, /* o : Quantized SNS vectors (left channel) */
float *SNS_Qr /* o : Quantized SNS vectors (right channe) */
);
@@ -3529,7 +3507,7 @@ void ivas_dirac_param_est_enc(
float **pp_fr_imag,
const int16_t input_frame,
const IVAS_FORMAT ivas_format ,
- const int16_t hodirac_flag,
+ const int16_t hodirac_flag,
const int16_t nchan_fb_in,
int16_t *mono_frame_count,
int16_t *dirac_mono_flag
@@ -3635,6 +3613,7 @@ void ivas_sba_getTCs(
const int16_t input_frame /* i : frame length */
);
+/*! r: SBA DirAC stereo flag */
int16_t ivas_sba_remapTCs(
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
float *sba_data[], /* i/o: SBA signals */
@@ -3918,18 +3897,18 @@ void ivas_mc_paramupmix_dec_read_BS(
);
void ivas_mc_paramupmix_dec_digest_tc(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
- const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */
- const int16_t nSamplesForRendering /* i : number of samples provided */
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
+ const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */
+ const int16_t nSamplesForRendering /* i : number of samples provided */
);
void ivas_mc_paramupmix_dec_render(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
- const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */
- uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */
- uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */
- float *input_f[], /* i: core-coder transport channels */
- float *output_f[] /* i/o: synthesized core-coder transport channels */
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
+ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */
+ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */
+ uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */
+ float *input_f[], /* i : core-coder transport channels */
+ float *output_f[] /* i/o: synthesized core-coder transport channels */
);
void ivas_param_mc_metadata_open(
@@ -4269,7 +4248,7 @@ void ivas_spar_config(
const int16_t sid_format /* i : IVAS format indicator from SID frame */
);
-void ivas_sba_upmixer_renderer(
+ivas_error ivas_sba_upmixer_renderer(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
float *output[], /* i/o: transport/output audio channels */
@@ -4341,6 +4320,13 @@ void ivas_spar_agc_dec_close(
ivas_agc_dec_state_t **hAgcDec /* i/o: AGC decoder handle */
);
+ivas_error ivas_spar_md_enc_init
+(
+ ivas_spar_md_enc_state_t *hMdEnc, /* o : MD encoder handle */
+ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */
+ const int16_t sba_order /* i : Ambisonic (SBA) order */
+);
+
void ivas_agc_dec_process(
ivas_agc_dec_state_t *hAgcDec, /* i/o: AGC decoder handle */
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
@@ -4539,17 +4525,17 @@ void ivas_spar_md_enc_close(
);
ivas_error ivas_spar_md_enc_process(
- ivas_spar_md_enc_state_t *hMdEnc, /* i/o: SPAR MD encoder handle */
- const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */
+ ivas_spar_md_enc_state_t *hMdEnc, /* i/o: SPAR MD encoder handle */
+ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */
float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
- BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */
+ BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */
const int16_t dtx_vad,
const int16_t nchan_inp,
- const int16_t sba_order, /* i : Ambisonic (SBA) order */
+ const int16_t sba_order, /* i : Ambisonic (SBA) order */
float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH], /* i : prior mixer_matrix */
- const int16_t dyn_active_w_flag, /* i : flag to indicate dynamic active W */
- const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA */
+ const int16_t dyn_active_w_flag, /* i : flag to indicate dynamic active W */
+ const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA */
);
void ivas_compute_spar_params(
@@ -4621,20 +4607,21 @@ int16_t ivas_get_spar_dec_md_num_subframes(
);
ivas_error ivas_spar_md_dec_matrix_open(
- ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */
- const int16_t num_channels, /* i : number of internal channels */
- const int16_t num_md_sub_frames );
+ ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */
+ const int16_t num_channels, /* i : number of internal channels */
+ const int16_t num_md_sub_frames
+);
void ivas_spar_md_dec_matrix_close(
- ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */
- const int16_t num_channels ); /* i : number of internal channels */
-
+ ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */
+ const int16_t num_channels /* i : number of internal channels */
+);
ivas_error ivas_spar_md_dec_open(
ivas_spar_md_dec_state_t **hMdDec_out, /* i/o: SPAR MD decoder handle */
const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */
const int16_t num_channels, /* i : number of internal channels */
- const int16_t sba_order, /* i : SBA order */
+ const int16_t sba_order, /* i : SBA order */
const int16_t sid_format, /* i : SID format */
const int32_t last_active_ivas_total_brate /* i : IVAS last active bitrate */
);
@@ -4736,8 +4723,8 @@ void ivas_enc_cov_handler_process(
int16_t *res_ind,
const int16_t *remix_order,
int16_t *dyn_active_w_flag,
- const int16_t nchan_transport,
- const int16_t is_sba
+ const int16_t nchan_transport,
+ const int16_t is_sba
);
ivas_error ivas_spar_covar_smooth_enc_open(
@@ -4746,7 +4733,7 @@ ivas_error ivas_spar_covar_smooth_enc_open(
ivas_filterbank_t *pFb, /* i/o: FB handle */
const int16_t nchan_inp, /* i : number of input channels */
const COV_SMOOTHING_TYPE smooth_mode, /* i : Smooth covariance for SPAR or MC */
- const int32_t ivas_total_brate /* i : IVAS total bitrate */
+ const int32_t ivas_total_brate /* i : IVAS total bitrate */
);
void ivas_spar_covar_smooth_enc_close(
@@ -5378,19 +5365,19 @@ void ivas_binRenderer_close(
);
void ivas_binaural_hrtf_close(
- HRTFS_FASTCONV_HANDLE *hHrtfFastConv /* i/o: decoder binaural hrtf handle */
+ HRTFS_FASTCONV_HANDLE *hHrtfFastConv /* i/o: decoder binaural hrtf handle */
);
-ivas_error ivas_init_binaural_hrtf(
- HRTFS_FASTCONV *HrtfFastConv /* i/o: FASTCONV HRTF structure */
+void ivas_init_binaural_hrtf(
+ HRTFS_FASTCONV *HrtfFastConv /* i/o: FASTCONV HRTF structure */
);
ivas_error ivas_allocate_binaural_hrtf(
- HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */
- AUDIO_CONFIG input_config, /* i : input audio configuration */
- BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */
- RENDERER_TYPE renderer_type, /* i : renderer type */
- int16_t allocate_init_flag /* i : Memory allocation flag */
+ HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */
+ const AUDIO_CONFIG input_config, /* i : input audio configuration */
+ const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */
+ const RENDERER_TYPE renderer_type, /* i : renderer type */
+ const int16_t allocate_init_flag /* i : Memory allocation flag */
);
void ivas_binaural_cldfb(
@@ -5415,7 +5402,7 @@ void ivas_binRenderer(
#endif
COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */
int16_t subframe_idx, /* i : subframe index */
- const int16_t numTimeSlots, /* i: : number of time slots to process */
+ const int16_t numTimeSlots, /* i : number of time slots to process */
#ifdef SPLIT_REND_WITH_HEAD_ROT
float Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */
float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */
@@ -5861,52 +5848,49 @@ void ivas_osba_enc(
const int16_t input_frame, /* i : Input frame size */
const int16_t nchan_ism, /* i : Number of objects for parameter analysis */
const ISM_MODE ism_mode, /* i : ISM mode */
- const int16_t sba_analysis_order /* i : SBA order evaluated in DirAC/SPAR encoder */
-#ifdef SBA_AND_OBJECTS
- , const int32_t input_Fs /* i : input sampling rate */
-#endif
+ const int16_t sba_analysis_order, /* i : SBA order evaluated in DirAC/SPAR encoder */
+ const int32_t input_Fs /* i : input sampling rate */
);
-#ifdef SBA_AND_OBJECTS
ivas_error ivas_masa_ism_data_open(
- Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */
+ Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */
);
+
ivas_error ivas_sba_ism_separate_object_renderer_open(
- Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
+ Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
);
ivas_error ivas_osba_dirac_td_binaural(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
- float *output[], /* o : output synthesis signal */
+ float *output[], /* o : output synthesis signal */
#else
- float output[][L_FRAME48k], /* o : output synthesis signal */
+ float output[][L_FRAME48k], /* o : output synthesis signal */
#endif
- const int16_t output_frame /* i : output frame length per channel */
+ const int16_t output_frame /* i : output frame length per channel */
);
ivas_error ivas_osba_ism_metadata_dec(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
- const int32_t ism_total_brate, /* i : ISM total bitrate */
- int16_t *nchan_ism, /* o : number of ISM separated channels */
- int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
+ const int32_t ism_total_brate, /* i : ISM total bitrate */
+ int16_t *nchan_ism, /* o : number of ISM separated channels */
+ int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */
);
-void ivas_osba_render(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
+ivas_error ivas_osba_render(
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
- float *output_f[], /* i/o: core-coder transport channels/object output */
+ float *output_f[], /* i/o: core-coder transport channels/object output */
#else
- float output_f[][L_FRAME48k], /* i/o: core-coder transport channels/object output */
+ float output_f[][L_FRAME48k], /* i/o: core-coder transport channels/object output */
#endif
- const int16_t output_frame /* i : output frame length per channel */
+ const int16_t output_frame /* i : output frame length per channel */
);
void ivas_masa_ism_data_close(
- MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */
+ MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */
);
#endif
-#endif
#ifdef MASA_AND_OBJECTS
@@ -5927,13 +5911,9 @@ ivas_error ivas_omasa_enc_config(
);
ivas_error ivas_omasa_dec_config(
-#ifdef MASA_AND_OBJECTS
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */
int16_t *data /* o : flushed PCM samples */
-#else
- Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
-#endif
);
void ivas_omasa_set_config(
@@ -6143,11 +6123,6 @@ void ivas_omasa_separate_object_render_jbm(
);
#endif
-#ifndef FIX__657_REMOVE_EDITING
-void ivas_omasa_set_edited_objects(
- Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
-);
-#endif
void ivas_omasa_encode_masa_to_total(
float masa_to_total_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS],
BSTR_ENC_HANDLE hMetaData,
@@ -6264,14 +6239,14 @@ void ivas_fb_mixer_get_in_out_mapping(
);
void ivas_fb_mixer_cross_fading(
- IVAS_FB_MIXER_HANDLE hFbMixer,
- float **ppOut_pcm,
- float *pMdft_out_old,
- float *pMdft_out_new,
- const int16_t ch,
- const int16_t frame_len,
- const int16_t cf_offset
- );
+ IVAS_FB_MIXER_HANDLE hFbMixer,
+ float **ppOut_pcm,
+ float *pMdft_out_old,
+ float *pMdft_out_new,
+ const int16_t ch,
+ const int16_t frame_len,
+ const int16_t cf_offset
+);
/*! r: number of spectral bands */
int16_t ivas_get_num_bands_from_bw_idx(
diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c
index 5f15fda6e4dcce14d1be5b58461618518d68b3a8..c1e524d8af426139b3783a98c688b906f9e714f9 100644
--- a/lib_com/ivas_rom_com.c
+++ b/lib_com/ivas_rom_com.c
@@ -5668,11 +5668,17 @@ const int16_t ivas_num_active_bands[FB - WB + 1] =
IVAS_16K_12BANDS_ACTIVE_BANDS, IVAS_FB_BANDS_12, IVAS_FB_BANDS_12
};
+/*------------------------------------------------------------------------------------------*
+ * SNS MSVQ codebooks and means
+ *------------------------------------------------------------------------------------------*/
+
const int16_t ivas_sns_cdbks_tcx20_levels[SNS_MSVQ_NSTAGES_TCX20] = { 128, 64, 32, 32 };
+
const int16_t ivas_sns_cdbks_tcx20_bits[SNS_MSVQ_NSTAGES_TCX20] = { 7, 6, 5, 5 };
/* pre-rounded codebook vectors for singed Q4.12 represantation */
-const float ivas_sns_cdbk_tcx20_stage1[ 128 * 16 ] = {
+const float ivas_sns_cdbk_tcx20_stage1[ 128 * 16 ] =
+{
-1.8305664f, -2.0878906f, -0.9638672f, 2.8059082f, 2.668213f, 1.1638184f, 1.390625f, 1.217041f, 1.3850098f, 0.44555664f, -0.47045898f, -0.5307617f, -0.810791f, -1.1647949f, -1.4560547f, -1.7612305f,
-2.5979004f, -3.3308105f, -1.8554688f, -0.3605957f, 1.6828613f, 2.5871582f, 0.98168945f, 0.22436523f, -0.13110352f, 0.16699219f, 1.5004883f, 0.3293457f, 0.33569336f, 1.1591797f, 0.1796875f, -0.8718262f,
1.982666f, 2.2011719f, 1.1525879f, 0.8093262f, 0.86499023f, 1.1618652f, 1.2888184f, 1.3618164f, 1.0827637f, 0.83251953f, 0.12011719f, -0.7182617f, -2.1948242f, -3.0500488f, -3.3571777f, -3.53833f,
@@ -5802,7 +5808,9 @@ const float ivas_sns_cdbk_tcx20_stage1[ 128 * 16 ] = {
1.7553711f, 2.8996582f, 1.9260254f, 0.40551758f, -0.0234375f, 0.44506836f, 0.31152344f, 0.1809082f, -0.47607422f, -0.4807129f, -1.204834f, -1.3293457f, -1.2412109f, -1.0134277f, -0.89501953f, -1.2602539f,
0.2253418f, 2.2539062f, 2.265625f, 0.57128906f, -0.7661133f, -0.6245117f, 0.21313477f, 1.2248535f, 0.8737793f, -0.12524414f, -0.9609375f, -2.416504f, -1.1223145f, -0.70532227f, -0.31469727f, -0.592041f,
};
-const float ivas_sns_cdbk_tcx20_stage2[ 64 * 16 ] = {
+
+const float ivas_sns_cdbk_tcx20_stage2[ 64 * 16 ] =
+{
-1.1569824f, -0.4765625f, 0.008056641f, 0.47802734f, 0.38330078f, -0.075683594f, -0.3737793f, -0.29516602f, -0.1352539f, 0.012939453f, 0.22241211f, 0.375f, 0.31689453f, 0.20874023f, 0.2541504f, 0.25439453f,
-0.40600586f, -0.22070312f, -0.04272461f, 0.15893555f, -0.25195312f, -0.6623535f, -0.27172852f, 0.28735352f, 0.35742188f, 0.20166016f, 0.052246094f, -0.3647461f, -0.4506836f, 0.1862793f, 0.66796875f, 0.7585449f,
0.02734375f, -0.2097168f, -0.39819336f, -0.54296875f, -0.46850586f, -0.25146484f, -0.26953125f, -0.07495117f, 0.375f, 0.9343262f, 0.91625977f, 0.4267578f, 0.026123047f, -0.15576172f, -0.11425781f, -0.22021484f,
@@ -5868,7 +5876,9 @@ const float ivas_sns_cdbk_tcx20_stage2[ 64 * 16 ] = {
0.3227539f, -1.0678711f, -1.1435547f, 0.068603516f, 0.7546387f, 0.38745117f, 0.09008789f, -0.0007324219f, -0.12792969f, 0.076416016f, 0.24853516f, 0.28735352f, 0.076660156f, -0.041748047f, -0.01977539f, 0.08911133f,
0.6101074f, -0.22070312f, -0.5324707f, -0.119384766f, 0.10473633f, 0.16333008f, -0.15112305f, -0.34472656f, -0.39746094f, -0.43652344f, -0.23876953f, 0.0017089844f, 0.056152344f, 0.22973633f, 0.50024414f, 0.7751465f,
};
-const float ivas_sns_cdbk_tcx20_stage3[ 32 * 16 ] = {
+
+const float ivas_sns_cdbk_tcx20_stage3[ 32 * 16 ] =
+{
-0.12109375f, -0.32348633f, -0.25976562f, 0.21435547f, 0.4814453f, 0.14819336f, -0.22363281f, -0.31030273f, -0.13256836f, 0.10107422f, 0.33276367f, 0.32495117f, 0.16577148f, -0.079833984f, -0.16210938f, -0.15527344f,
0.088378906f, -0.0146484375f, -0.13378906f, -0.29003906f, 0.873291f, -0.3125f, -0.19384766f, 0.19311523f, -0.09863281f, 0.052734375f, -0.13110352f, -0.021972656f, -0.07861328f, -0.01977539f, -0.07373047f, 0.1616211f,
-0.115722656f, 0.28100586f, 0.2697754f, -0.10522461f, -0.107910156f, -0.2866211f, -0.36694336f, -0.33862305f, -0.15844727f, 0.01928711f, 0.17382812f, 0.21118164f, 0.2697754f, 0.17260742f, 0.07299805f, 0.009033203f,
@@ -5902,7 +5912,9 @@ const float ivas_sns_cdbk_tcx20_stage3[ 32 * 16 ] = {
0.17895508f, -0.31396484f, -0.033203125f, -0.02734375f, -0.0637207f, -0.11791992f, -0.03466797f, 0.0061035156f, 0.07324219f, 0.072753906f, 0.14916992f, 0.13671875f, 0.12524414f, 0.017333984f, -0.08178711f, -0.08618164f,
0.13330078f, -0.15893555f, -0.22045898f, -0.032226562f, -0.07739258f, -0.25463867f, -0.32299805f, -0.2614746f, 0.039794922f, 0.18554688f, 0.1262207f, -0.04321289f, -0.010498047f, 0.13330078f, 0.31860352f, 0.44506836f,
};
-const float ivas_sns_cdbk_tcx20_stage4[ 32 * 16 ] = {
+
+const float ivas_sns_cdbk_tcx20_stage4[ 32 * 16 ] =
+{
-0.0056152344f, -0.03955078f, 0.071777344f, 0.26879883f, 0.44140625f, -0.08203125f, -0.20092773f, -0.009277344f, 0.05810547f, -0.06347656f, -0.07910156f, -0.05126953f, -0.07006836f, -0.068847656f, -0.07885742f, -0.09082031f,
-0.011962891f, -0.060302734f, 0.011962891f, 0.049804688f, -0.044677734f, 0.037841797f, 0.099121094f, 0.06274414f, 0.022216797f, -0.09057617f, 0.00390625f, 0.38452148f, 0.1027832f, -0.5292969f, -0.3269043f, 0.28881836f,
-0.3557129f, 0.3815918f, 0.10839844f, 0.08203125f, 0.03149414f, -0.0024414062f, -0.0036621094f, -0.02758789f, -0.03125f, -0.096191406f, -0.09326172f, -0.103515625f, -0.07006836f, 0.008056641f, 0.06616211f, 0.10644531f,
@@ -5940,9 +5952,11 @@ const float ivas_sns_cdbk_tcx20_stage4[ 32 * 16 ] = {
const float *const ivas_sns_cdbks_tcx20[SNS_MSVQ_NSTAGES_TCX20] = { ivas_sns_cdbk_tcx20_stage1, ivas_sns_cdbk_tcx20_stage2, ivas_sns_cdbk_tcx20_stage3, ivas_sns_cdbk_tcx20_stage4 };
const int16_t ivas_sns_cdbks_tcx10_levels[SNS_MSVQ_NSTAGES_TCX10] = { 128, 32, 8 };
+
const int16_t ivas_sns_cdbks_tcx10_bits[SNS_MSVQ_NSTAGES_TCX10] = { 7, 5, 3 };
-const float ivas_sns_cdbk_tcx10_stage1[ 128 * 16 ] = {
+const float ivas_sns_cdbk_tcx10_stage1[ 128 * 16 ] =
+{
1.0144043f, 1.1826172f, 0.3269043f, -0.6411133f, -1.2163086f, -1.1411133f, -1.1525879f, -0.8898926f, -0.19604492f, 0.7402344f, 1.1782227f, 1.0830078f, 0.78222656f, 0.26953125f, -0.33203125f, -1.0080566f,
-0.38916016f, -0.31347656f, -1.1826172f, -2.036621f, -2.086914f, -1.8569336f, -1.637207f, -1.3156738f, -0.4182129f, 0.50634766f, 1.2770996f, 1.3771973f, 1.8566895f, 2.3503418f, 2.3015137f, 1.5678711f,
0.43652344f, 1.8859863f, 2.8059082f, 2.2385254f, 1.5480957f, 0.14331055f, 0.07299805f, -1.1218262f, -1.1103516f, -0.7336426f, -0.4194336f, -0.89624023f, -1.0429688f, -0.79785156f, -1.204834f, -1.8046875f,
@@ -6072,7 +6086,9 @@ const float ivas_sns_cdbk_tcx10_stage1[ 128 * 16 ] = {
3.256836f, 3.5593262f, 2.2746582f, 1.1318359f, 0.3149414f, -0.02368164f, 0.27172852f, -0.19335938f, -0.48779297f, -0.9663086f, -0.9187012f, -1.0222168f, -1.512207f, -1.6816406f, -1.8964844f, -2.1069336f,
-0.057617188f, -0.45092773f, -0.9638672f, -0.72143555f, 0.20703125f, 1.4692383f, 1.921875f, 1.6833496f, 1.3933105f, 0.6699219f, 0.17333984f, -0.43798828f, -0.9772949f, -1.1477051f, -1.3552246f, -1.4057617f,
};
-const float ivas_sns_cdbk_tcx10_stage2[ 32 * 16 ] = {
+
+const float ivas_sns_cdbk_tcx10_stage2[ 32 * 16 ] =
+{
0.30615234f, 0.48828125f, -0.02709961f, -0.47680664f, -0.5300293f, -0.25463867f, -0.13305664f, -0.14941406f, -0.14819336f, 0.08666992f, 0.28833008f, 0.27514648f, 0.099365234f, -0.017578125f, 0.033203125f, 0.15893555f,
0.40942383f, -0.044189453f, -0.088378906f, 0.38720703f, 0.5151367f, 0.42236328f, 0.34960938f, 0.2680664f, 0.037597656f, -0.19970703f, -0.31054688f, -0.32617188f, -0.38452148f, -0.38085938f, -0.38598633f, -0.2692871f,
-0.16040039f, -0.37548828f, -0.41479492f, -0.1237793f, 0.25708008f, 0.29589844f, 0.045410156f, -0.04345703f, -0.11450195f, -0.2019043f, 0.032470703f, 0.5847168f, 1.074707f, 0.3178711f, -0.43847656f, -0.73535156f,
@@ -6106,7 +6122,9 @@ const float ivas_sns_cdbk_tcx10_stage2[ 32 * 16 ] = {
-0.78149414f, 0.05517578f, 0.09863281f, -0.35083008f, -0.29174805f, 0.1352539f, 0.10620117f, -0.3515625f, -0.27514648f, 0.15917969f, 0.34326172f, 0.2626953f, 0.39916992f, 0.42089844f, 0.20947266f, -0.1394043f,
-0.20361328f, -0.21557617f, -0.16308594f, -0.041748047f, -0.111083984f, -0.057617188f, 0.0390625f, 0.013183594f, 0.17358398f, 0.74902344f, 0.9448242f, 0.4477539f, -0.09423828f, -0.32739258f, -0.50634766f, -0.6467285f,
};
-const float ivas_sns_cdbk_tcx10_stage3[ 8 * 16 ] = {
+
+const float ivas_sns_cdbk_tcx10_stage3[ 8 * 16 ] =
+{
0.15209961f, -0.12768555f, 0.09375f, -0.083496094f, -0.25390625f, 0.12524414f, 0.2993164f, -0.09863281f, -0.34814453f, -0.2434082f, -0.11254883f, -0.060058594f, 0.032470703f, 0.15527344f, 0.23413086f, 0.2355957f,
-0.16235352f, -0.111083984f, -0.3173828f, -0.25634766f, 0.13842773f, 0.29858398f, 0.10498047f, 0.11743164f, 0.26611328f, 0.05444336f, -0.1459961f, -0.19238281f, 0.041748047f, 0.2097168f, 0.07421875f, -0.12011719f,
-0.05078125f, 0.14770508f, -0.1003418f, -0.32104492f, -0.17504883f, -0.18652344f, -0.27148438f, -0.07788086f, 0.0036621094f, -0.04296875f, 0.10131836f, 0.34985352f, 0.3083496f, 0.10107422f, 0.0769043f, 0.13696289f,
@@ -6124,7 +6142,8 @@ const int16_t ivas_sns_cdbks_side_tcx20_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 5 };
const int16_t ivas_sns_cdbks_side_tcx10_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 8 };
const int16_t ivas_sns_cdbks_side_tcx10_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 3 };
-const float ivas_sns_cdbks_side_tcx20_stage1[ 32 * 16 ] = {
+const float ivas_sns_cdbks_side_tcx20_stage1[ 32 * 16 ] =
+{
-0.11376953f, -0.06591797f, 0.041992188f, 0.044677734f, 0.17871094f, -0.02758789f, -0.32592773f, -0.21069336f, -0.049072266f, 0.0126953125f, 0.012939453f, 0.015136719f, 0.08203125f, 0.12670898f, 0.12695312f, 0.15112305f,
-0.017089844f, 0.09326172f, 0.2355957f, 0.2241211f, 0.107421875f, 0.05029297f, 0.039794922f, -0.0073242188f, -0.048339844f, -0.0871582f, -0.08520508f, -0.12060547f, -0.111572266f, -0.10620117f, -0.08911133f, -0.078125f,
-0.26635742f, 0.27368164f, 0.4543457f, 0.1821289f, 0.6513672f, 0.18066406f, 0.14575195f, -0.008056641f, 0.2631836f, -0.045898438f, -0.52001953f, -0.1628418f, 0.038330078f, -0.31811523f, -0.4321289f, -0.43603516f,
@@ -6159,7 +6178,8 @@ const float ivas_sns_cdbks_side_tcx20_stage1[ 32 * 16 ] = {
-0.19580078f, -0.14624023f, -0.11303711f, -0.055908203f, -0.052001953f, -0.009033203f, 0.022949219f, -0.0068359375f, -0.032470703f, 0.0017089844f, 0.045410156f, 0.025146484f, 0.039794922f, 0.07543945f, 0.1574707f, 0.24267578f,
};
-const float ivas_sns_cdbks_side_tcx20_stage2[ 32 * 16 ] = {
+const float ivas_sns_cdbks_side_tcx20_stage2[ 32 * 16 ] =
+{
-0.013916016f, 0.0007324219f, 0.017089844f, 0.005859375f, 0.056152344f, -0.08178711f, -0.2927246f, 0.00390625f, 0.140625f, 0.03881836f, 0.010498047f, 0.038330078f, 0.042236328f, 0.020751953f, 0.005859375f, 0.0075683594f,
-0.07104492f, -0.10253906f, 0.038085938f, 0.091552734f, 0.118896484f, 0.13476562f, 0.05078125f, -0.111328125f, -0.13842773f, -0.20727539f, -0.25732422f, -0.15063477f, 0.032470703f, 0.08129883f, 0.17578125f, 0.31469727f,
0.0715332f, 0.029052734f, 0.01953125f, 0.008056641f, 0.0234375f, 0.020751953f, 0.032226562f, 0.021972656f, 0.03466797f, 0.017822266f, -0.037841797f, -0.14038086f, -0.21679688f, -0.11035156f, 0.057617188f, 0.16845703f,
@@ -6196,7 +6216,8 @@ const float ivas_sns_cdbks_side_tcx20_stage2[ 32 * 16 ] = {
const float *const ivas_sns_cdbks_side_tcx20[SNS_MSVQ_NSTAGES_SIDE] = { ivas_sns_cdbks_side_tcx20_stage1, ivas_sns_cdbks_side_tcx20_stage2 };
-const float ivas_sns_cdbks_side_tcx10_stage1[ 32 * 16 ] = {
+const float ivas_sns_cdbks_side_tcx10_stage1[ 32 * 16 ] =
+{
-0.23950195f, -0.203125f, -0.17822266f, -0.1315918f, -0.123291016f, -0.095947266f, -0.106933594f, -0.16552734f, -0.14941406f, -0.075683594f, 0.026367188f, 0.1015625f, 0.17041016f, 0.2770996f, 0.37890625f, 0.5148926f,
0.12890625f, 0.20825195f, 0.22924805f, 0.2998047f, 0.24267578f, 0.14477539f, 0.07861328f, 0.024658203f, -0.076171875f, -0.18432617f, -0.26660156f, -0.33251953f, -0.2758789f, -0.13964844f, -0.030517578f, -0.05126953f,
-0.14160156f, -0.13305664f, -0.111816406f, -0.037353516f, -0.038085938f, 0.051513672f, 0.07348633f, 0.0073242188f, 0.044921875f, -0.0234375f, -0.123291016f, -0.01171875f, 0.28100586f, 0.24194336f, 0.0703125f, -0.1496582f,
@@ -6229,9 +6250,11 @@ const float ivas_sns_cdbks_side_tcx10_stage1[ 32 * 16 ] = {
0.06982422f, 0.072265625f, 0.18261719f, 0.025390625f, -0.2475586f, -0.2861328f, -0.111572266f, -0.037109375f, 0.0036621094f, 0.031982422f, 0.043945312f, 0.057373047f, 0.078125f, 0.072021484f, 0.028564453f, 0.016357422f,
0.07836914f, 0.13549805f, 0.1743164f, 0.15478516f, 0.12573242f, -0.009521484f, -0.1508789f, -0.1965332f, -0.19604492f, -0.103027344f, -0.045898438f, -0.026123047f, 0.020263672f, 0.023925781f, 0.013183594f, 0.0014648438f,
0.25341797f, 0.22558594f, 0.2241211f, 0.17114258f, 0.18164062f, 0.16894531f, 0.16503906f, 0.20239258f, 0.17041016f, 0.025878906f, -0.16625977f, -0.24121094f, -0.31982422f, -0.4008789f, -0.38256836f, -0.27783203f,
-};
+}
+;
-const float ivas_sns_cdbks_side_tcx10_stage2[ 8 * 16 ] = {
+const float ivas_sns_cdbks_side_tcx10_stage2[ 8 * 16 ] =
+{
-0.13989258f, -0.024658203f, 0.12670898f, 0.027832031f, 0.06689453f, 0.12817383f, 0.07495117f, -0.01977539f, -0.05834961f, -0.07543945f, -0.06542969f, -0.0546875f, -0.04345703f, -0.0063476562f, 0.034179688f, 0.029541016f,
-0.06713867f, -0.11450195f, -0.09790039f, -0.091308594f, -0.12182617f, -0.010009766f, 0.10986328f, 0.115478516f, 0.060058594f, 0.038085938f, 0.020507812f, 0.017333984f, 0.024169922f, 0.028320312f, 0.038330078f, 0.05053711f,
0.05517578f, 0.030517578f, 0.0390625f, 0.05810547f, 0.021484375f, 0.032470703f, 0.040039062f, -0.0087890625f, -0.055908203f, -0.023925781f, 0.037109375f, 0.06347656f, 0.02709961f, -0.07373047f, -0.1274414f, -0.115234375f,
@@ -6244,7 +6267,8 @@ const float ivas_sns_cdbks_side_tcx10_stage2[ 8 * 16 ] = {
const float *const ivas_sns_cdbks_side_tcx10[SNS_MSVQ_NSTAGES_SIDE] = { ivas_sns_cdbks_side_tcx10_stage1, ivas_sns_cdbks_side_tcx10_stage2 };
-const int16_t sns_1st_cdbk[2][2][8 * 32] = {
+const int16_t sns_1st_cdbk[2][2][8 * 32] =
+{
{ /* split 1 */
{ /* TCX 20 */
-10900, -11064, -10637, -10471, -9051, -6381, -4688, -2438,
@@ -6386,7 +6410,9 @@ const int16_t sns_1st_cdbk[2][2][8 * 32] = {
}
}
};
-const int16_t sns_1st_means_16k[2][16] = {
+
+const int16_t sns_1st_means_16k[2][16] =
+{
{ /* TCX 20 */
14210, 19017, 14362, 9309, 5385, 2674, 1055, -211, -1407, -3059, -4393, -8597, -11180, -11756, -12131, -13281,
},
@@ -6394,7 +6420,9 @@ const int16_t sns_1st_means_16k[2][16] = {
12018, 15915, 11089, 6015, 847, -705, -539, -1548, -893, -2163, -1806, -4189, -7017, -8670, -8874, -9480,
}
};
-const int16_t sns_1st_means_25k6[2][16] = {
+
+const int16_t sns_1st_means_25k6[2][16] =
+{
{ /* TCX 20 */
14973, 20323, 16461, 9554, 4017, 3103, 1602, 1694, -221, -1401, -6817, -10071, -11503, -11805, -13158, -16749,
},
@@ -6402,7 +6430,9 @@ const int16_t sns_1st_means_25k6[2][16] = {
15560, 19489, 14623, 5595, 2084, 1699, 775, -1312, -2195, -6101, -9078, -9465, -7825, -6603, -7281, -9960,
}
};
-const int16_t sns_1st_means_32k[2][16] = {
+
+const int16_t sns_1st_means_32k[2][16] =
+{
{ /* TCX 20 */
15041, 20603, 16969, 10289, 4973, 4283, 3003, 3316, 1684, -259, -6614, -9535, -10363, -11834, -16625, -24930,
},
@@ -6411,100 +6441,105 @@ const int16_t sns_1st_means_32k[2][16] = {
}
};
-ACPL_QUANT_TABLE alpha_quant_table[] =
-{
- { /* Alfa Fine */
- 33, /* nquant */
- 16, /* offset */
- { -2.000000e+000f, -1.809375e+000f, -1.637500e+000f, -1.484375e+000f, -1.350000e+000f, -1.234375e+000f, -1.137500e+000f, -1.059375e+000f, -1.000000e+000f, -9.406250e-001f,
- -8.625000e-001f, -7.656250e-001f, -6.500000e-001f, -5.156250e-001f, -3.625000e-001f, -1.906250e-001f, +0.000000e+000f, +1.906250e-001f, +3.625000e-001f, +5.156250e-001f,
- +6.500000e-001f, +7.656250e-001f, +8.625000e-001f, +9.406250e-001f, +1.000000e+000f, +1.059375e+000f, +1.137500e+000f, +1.234375e+000f, +1.350000e+000f, +1.484375e+000f,
- +1.637500e+000f, +1.809375e+000f, +2.000000e+000f } /* data */
- }, /* End Alfa Fine */
- { /* Alfa Coarse */
- 17, /* nquant */
- 8, /* offset */
- { -2.000000e+000f, -1.637500e+000f, -1.350000e+000f, -1.137500e+000f, -1.000000e+000f, -8.625000e-001f, -6.500000e-001f, -3.625000e-001f, +0.000000e+000f, +3.625000e-001f,
- +6.500000e-001f, +8.625000e-001f, +1.000000e+000f, +1.137500e+000f, +1.350000e+000f, +1.637500e+000f, +2.000000e+000f } /* data */
- } /* End Alfa Coarse */
-};
-
-ACPL_QUANT_TABLE beta_quant_table[2][9] =
-{
- {
- { /* Beta Fine #1 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +2.375000e-001f, +5.500000e-001f, +9.375000e-001f, +1.400000e+000f, +1.937500e+000f, +2.550000e+000f, +3.237500e+000f, +4.000000e+000f } /* data */
- }, /* End Beta Fine #1 */
- { /* Beta Fine #2 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +2.035449e-001f, +4.713672e-001f, +8.034668e-001f, +1.199844e+000f, +1.660498e+000f, +2.185430e+000f, +2.774639e+000f, +3.428125e+000f } /* data */
- }, /* End Beta Fine #2 */
- { /* Beta Fine #3 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +1.729297e-001f, +4.004688e-001f, +6.826172e-001f, +1.019375e+000f, +1.410742e+000f, +1.856719e+000f, +2.357305e+000f, +2.912500e+000f } /* data */
- }, /* End Beta Fine #3 */
- { /* Beta Fine #4 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +1.456543e-001f, +3.373047e-001f, +5.749512e-001f, +8.585938e-001f, +1.188232e+000f, +1.563867e+000f, +1.985498e+000f, +2.453125e+000f } /* data */
- }, /* End Beta Fine #4 */
- { /* Beta Fine #5 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +1.217188e-001f, +2.818750e-001f, +4.804688e-001f, +7.175000e-001f, +9.929688e-001f, +1.306875e+000f, +1.659219e+000f, +2.050000e+000f } /* data */
- }, /* End Beta Fine #5 */
- { /* Beta Fine #6 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +1.011230e-001f, +2.341797e-001f, +3.991699e-001f, +5.960938e-001f, +8.249512e-001f, +1.085742e+000f, +1.378467e+000f, +1.703125e+000f } /* data */
- }, /* End Beta Fine #6 */
- { /* Beta Fine #7 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +8.386719e-002f, +1.942188e-001f, +3.310547e-001f, +4.943750e-001f, +6.841797e-001f, +9.004688e-001f, +1.143242e+000f, +1.412500e+000f } /* data */
- }, /* End Beta Fine #7 */
- { /* Beta Fine #8 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +6.995117e-002f, +1.619922e-001f, +2.761230e-001f, +4.123438e-001f, +5.706543e-001f, +7.510547e-001f, +9.535449e-001f, +1.178125e+000f } /* data */
- }, /* End Beta Fine #8 */
- { /* Beta Fine #9 */
- 9, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +5.937500e-002f, +1.375000e-001f, +2.343750e-001f, +3.500000e-001f, +4.843750e-001f, +6.375000e-001f, +8.093750e-001f, +1.000000e+000f } /* data */
- } /* End Beta Fine #9 */
- },
- {
- { /* Beta Coarse #1 */
- 5, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +5.500000e-001f, +1.400000e+000f, +2.550000e+000f, +4.000000e+000f } /* data */
- }, /* End Beta Coarse #1 */
- { /* Beta Coarse #2 */
- 5, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +4.004688e-001f, +1.019375e+000f, +1.856719e+000f, +2.912500e+000f } /* data */
- }, /* End Beta Coarse #2 */
- { /* Beta Coarse #3 */
- 5, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +2.818750e-001f, +7.175000e-001f, +1.306875e+000f, +2.050000e+000f } /* data */
- }, /* End Beta Coarse #3 */
- { /* Beta Coarse #4 */
- 5, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +1.942188e-001f, +4.943750e-001f, +9.004688e-001f, +1.412500e+000f } /* data */
- }, /* End Beta Coarse #4 */
- { /* Beta Coarse #5 */
- 5, /* nquant */
- 0, /* offset */
- { +0.000000e+000f, +1.375000e-001f, +3.500000e-001f, +6.375000e-001f, +1.000000e+000f } /* data */
- } /* End Beta Coarse #5 */
- }
+
+/*------------------------------------------------------------------------------------------*
+ * MC ParamUpMix tables
+ *------------------------------------------------------------------------------------------*/
+
+const ACPL_QUANT_TABLE ivas_param_upmx_alpha_quant_table[] =
+{
+ { /* Alfa Fine */
+ 33, /* nquant */
+ 16, /* offset */
+ { -2.000000e+000f, -1.809375e+000f, -1.637500e+000f, -1.484375e+000f, -1.350000e+000f, -1.234375e+000f, -1.137500e+000f, -1.059375e+000f, -1.000000e+000f, -9.406250e-001f,
+ -8.625000e-001f, -7.656250e-001f, -6.500000e-001f, -5.156250e-001f, -3.625000e-001f, -1.906250e-001f, +0.000000e+000f, +1.906250e-001f, +3.625000e-001f, +5.156250e-001f,
+ +6.500000e-001f, +7.656250e-001f, +8.625000e-001f, +9.406250e-001f, +1.000000e+000f, +1.059375e+000f, +1.137500e+000f, +1.234375e+000f, +1.350000e+000f, +1.484375e+000f,
+ +1.637500e+000f, +1.809375e+000f, +2.000000e+000f } /* data */
+ },
+ { /* Alfa Coarse */
+ 17, /* nquant */
+ 8, /* offset */
+ { -2.000000e+000f, -1.637500e+000f, -1.350000e+000f, -1.137500e+000f, -1.000000e+000f, -8.625000e-001f, -6.500000e-001f, -3.625000e-001f, +0.000000e+000f, +3.625000e-001f,
+ +6.500000e-001f, +8.625000e-001f, +1.000000e+000f, +1.137500e+000f, +1.350000e+000f, +1.637500e+000f, +2.000000e+000f } /* data */
+ }
+};
+
+const ACPL_QUANT_TABLE ivas_param_upmx_beta_quant_table[2][9] =
+{
+ {
+ { /* Beta Fine #1 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +2.375000e-001f, +5.500000e-001f, +9.375000e-001f, +1.400000e+000f, +1.937500e+000f, +2.550000e+000f, +3.237500e+000f, +4.000000e+000f } /* data */
+ },
+ { /* Beta Fine #2 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +2.035449e-001f, +4.713672e-001f, +8.034668e-001f, +1.199844e+000f, +1.660498e+000f, +2.185430e+000f, +2.774639e+000f, +3.428125e+000f } /* data */
+ },
+ { /* Beta Fine #3 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +1.729297e-001f, +4.004688e-001f, +6.826172e-001f, +1.019375e+000f, +1.410742e+000f, +1.856719e+000f, +2.357305e+000f, +2.912500e+000f } /* data */
+ },
+ { /* Beta Fine #4 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +1.456543e-001f, +3.373047e-001f, +5.749512e-001f, +8.585938e-001f, +1.188232e+000f, +1.563867e+000f, +1.985498e+000f, +2.453125e+000f } /* data */
+ },
+ { /* Beta Fine #5 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +1.217188e-001f, +2.818750e-001f, +4.804688e-001f, +7.175000e-001f, +9.929688e-001f, +1.306875e+000f, +1.659219e+000f, +2.050000e+000f } /* data */
+ },
+ { /* Beta Fine #6 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +1.011230e-001f, +2.341797e-001f, +3.991699e-001f, +5.960938e-001f, +8.249512e-001f, +1.085742e+000f, +1.378467e+000f, +1.703125e+000f } /* data */
+ },
+ { /* Beta Fine #7 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +8.386719e-002f, +1.942188e-001f, +3.310547e-001f, +4.943750e-001f, +6.841797e-001f, +9.004688e-001f, +1.143242e+000f, +1.412500e+000f } /* data */
+ },
+ { /* Beta Fine #8 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +6.995117e-002f, +1.619922e-001f, +2.761230e-001f, +4.123438e-001f, +5.706543e-001f, +7.510547e-001f, +9.535449e-001f, +1.178125e+000f } /* data */
+ },
+ { /* Beta Fine #9 */
+ 9, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +5.937500e-002f, +1.375000e-001f, +2.343750e-001f, +3.500000e-001f, +4.843750e-001f, +6.375000e-001f, +8.093750e-001f, +1.000000e+000f } /* data */
+ }
+ },
+ {
+ { /* Beta Coarse #1 */
+ 5, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +5.500000e-001f, +1.400000e+000f, +2.550000e+000f, +4.000000e+000f } /* data */
+ },
+ { /* Beta Coarse #2 */
+ 5, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +4.004688e-001f, +1.019375e+000f, +1.856719e+000f, +2.912500e+000f } /* data */
+ },
+ { /* Beta Coarse #3 */
+ 5, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +2.818750e-001f, +7.175000e-001f, +1.306875e+000f, +2.050000e+000f } /* data */
+ },
+ { /* Beta Coarse #4 */
+ 5, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +1.942188e-001f, +4.943750e-001f, +9.004688e-001f, +1.412500e+000f } /* data */
+ },
+ { /* Beta Coarse #5 */
+ 5, /* nquant */
+ 0, /* offset */
+ { +0.000000e+000f, +1.375000e-001f, +3.500000e-001f, +6.375000e-001f, +1.000000e+000f } /* data */
+ }
+ }
};
/* clang-format on */
diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h
index a74f378b3bcba9b5334bcd1e833bd497da758ccd..ce43aa3c5c7c1b1e29b1d22f69318126b1d5a2ff 100644
--- a/lib_com/ivas_rom_com.h
+++ b/lib_com/ivas_rom_com.h
@@ -430,6 +430,7 @@ extern const int16_t ivas_num_active_bands[FB - WB + 1];
/*------------------------------------------------------------------------------------------*
* SNS MSVQ codebooks and means
*------------------------------------------------------------------------------------------*/
+
extern const int16_t ivas_sns_cdbks_tcx20_levels[];
extern const int16_t ivas_sns_cdbks_tcx20_bits[];
@@ -447,13 +448,18 @@ extern const int16_t ivas_sns_cdbks_side_tcx10_bits[];
extern const float *const ivas_sns_cdbks_side_tcx20[];
extern const float *const ivas_sns_cdbks_side_tcx10[];
-extern ACPL_QUANT_TABLE alpha_quant_table[];
-extern ACPL_QUANT_TABLE beta_quant_table[2][9];
-
/* means and codebooks for the split VQ in the 2-stage SNS VQ */
extern const int16_t sns_1st_cdbk[2][2][8 * 32];
extern const int16_t sns_1st_means_16k[2][16];
extern const int16_t sns_1st_means_25k6[2][16];
extern const int16_t sns_1st_means_32k[2][16];
+
+/*------------------------------------------------------------------------------------------*
+ * SNS MSVQ codebooks and means
+ *------------------------------------------------------------------------------------------*/
+
+extern const ACPL_QUANT_TABLE ivas_param_upmx_alpha_quant_table[];
+extern const ACPL_QUANT_TABLE ivas_param_upmx_beta_quant_table[2][9];
+
/* IVAS_ROM_COM_H */
#endif
diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c
index 97586786c8193d3495d746e2470660cea6196d6a..195a51432aabbceae5249c567bdf909d749ee8d0 100644
--- a/lib_com/ivas_spar_com.c
+++ b/lib_com/ivas_spar_com.c
@@ -520,6 +520,7 @@ static void ivas_get_pred_coeffs(
float dm_f_local, dm_w, dm_y, DM_F[IVAS_MAX_NUM_BANDS];
float num_f, den_f, passive_g;
float activew_quad_thresh, g_th_sq;
+
if ( dyn_active_w_flag == 1 )
{
activew_quad_thresh = 1.0f;
@@ -530,7 +531,6 @@ static void ivas_get_pred_coeffs(
}
g_th_sq = activew_quad_thresh * activew_quad_thresh;
-
set_zero( dm_alpha, IVAS_MAX_NUM_BANDS );
for ( i = 1; i < in_chans; i++ )
@@ -604,7 +604,6 @@ static void ivas_get_pred_coeffs(
passive_g = activew_quad_thresh;
}
-
if ( passive_g < activew_quad_thresh )
{
/*linear activeW*/
@@ -1542,19 +1541,11 @@ void ivas_compute_spar_params(
float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS];
int16_t b, i, ndm;
- ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w,
- active_w_vlbr,
- dtx_vad, from_dirac,
- dyn_active_w_flag,
- hSparMd->res_ind );
+ ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w, active_w_vlbr, dtx_vad, from_dirac, dyn_active_w_flag, hSparMd->res_ind );
ivas_create_fullr_dmx_mat( pred_coeffs_re, dm_fv_re, mixer_mat, num_ch, start_band, end_band, active_w, hSparCfg );
- ivas_get_Wscaling_factor( cov_real, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch,
- hSparCfg->num_dmx_chans_per_band, bands_bw, active_w,
- active_w_vlbr,
- pWscale,
- dyn_active_w_flag );
+ ivas_get_Wscaling_factor( cov_real, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch, hSparCfg->num_dmx_chans_per_band, bands_bw, active_w, active_w_vlbr, pWscale, dyn_active_w_flag );
for ( b = start_band; b < end_band; b++ )
{
@@ -1896,12 +1887,8 @@ void ivas_get_spar_md_from_dirac(
#endif
active_w = ( dyn_active_w_flag == 1 ) || ( hSpar_md_cfg->active_w == 1 );
- ivas_compute_spar_params( pCov_real, dm_fv_re, i_ts, ppMixer_mat, start_band, end_band, dtx_vad,
- num_ch, 1,
- active_w,
- active_w_vlbr,
- hSpar_md_cfg, hSpar_md, Wscale, 1,
- dyn_active_w_flag );
+
+ ivas_compute_spar_params( pCov_real, dm_fv_re, i_ts, ppMixer_mat, start_band, end_band, dtx_vad, num_ch, 1, active_w, active_w_vlbr, hSpar_md_cfg, hSpar_md, Wscale, 1, dyn_active_w_flag );
if ( mixer_mat != NULL )
{
diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h
index 232feae691158649a4f632e46532a622646f1962..a9a7516c899a90007506167f210102245b8b82cf 100644
--- a/lib_com/ivas_stat_com.h
+++ b/lib_com/ivas_stat_com.h
@@ -231,6 +231,7 @@ typedef struct ivas_spar_md_t
float ref_pow_slow[IVAS_MAX_NUM_BANDS];
int16_t res_ind;
int16_t prior_dyn_active_w_flag;
+
} ivas_spar_md_t;
typedef struct ivas_spar_md_prev_t
diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c
index f77a0a093321a6bf09405e8e7127931451bd8551..a2c817da15cbf1db45791ce326e2d2a7660db491 100644
--- a/lib_com/ivas_stereo_td_bit_alloc.c
+++ b/lib_com/ivas_stereo_td_bit_alloc.c
@@ -76,7 +76,7 @@
void tdm_bit_alloc(
#ifdef MASA_AND_OBJECTS
const int16_t ivas_format, /* i : IVAS format */
- const int16_t ism_mode, /* i: ISM mode in combined format */
+ const int16_t ism_mode, /* i : ISM mode in combined format */
#endif
const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */
const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */
diff --git a/lib_com/ivas_transient_det.c b/lib_com/ivas_transient_det.c
index 1e8f53c7ca5a1d17b7d49501169deaf7634914a6..aac25f50c990b2b93934316d2492cd8845c683a4 100644
--- a/lib_com/ivas_transient_det.c
+++ b/lib_com/ivas_transient_det.c
@@ -211,11 +211,12 @@ void ivas_transient_det_close(
*
* Transient detection process call
*-----------------------------------------------------------------------------------------*/
+
void ivas_transient_det_process(
- ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle */
- float *pIn_pcm, /* i : input audio channels */
- const int16_t frame_len, /* i : frame length in samples */
- int16_t transient_det[2] /* o: transient det outputs */
+ ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle */
+ float *pIn_pcm, /* i : input audio channels */
+ const int16_t frame_len, /* i : frame length in samples */
+ int16_t transient_det[2] /* o : transient det outputs */
)
{
float in_duck_gain[L_FRAME48k];
diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c
index 5a2b3b0d23ea3f1c00ede9657e5fc032bea89b87..70d1e655c03f224e1349a54f36a77c349fe97267 100644
--- a/lib_com/lsf_tools.c
+++ b/lib_com/lsf_tools.c
@@ -2444,7 +2444,7 @@ void dctT2_N_apply_matrix(
const float *input, /* i : input in fdcng or DCT(fdcng) domain */
float *output, /* o : output in DCT(fdcng) or fdcng ordomain */
const int16_t dct_dim, /* i : dct processing dim possibly truncated */
- int16_t fdcngvq_dim, /* i : fdcng domain length */
+ const int16_t fdcngvq_dim, /* i : fdcng domain length */
const float *matrix, /* i : IDCT matrix */
const int16_t matrix_row_dim, /* i : */
const DCTTYPE dcttype /* i : matrix operation type */
diff --git a/lib_com/options.h b/lib_com/options.h
index 43d94c665961a5662edf2a22c289c91c828a4d60..9769123af1eb563957e5d23250703a781305f4f7 100644
--- a/lib_com/options.h
+++ b/lib_com/options.h
@@ -170,10 +170,9 @@
#define FIX_264_AUDIO_CHANNELS_TO_HEAP /* VA: issue 243: Move audio channels memory from stack to heap */
#define FIX_691_OSBA_CRASH /* FhG: Fix for issue 691: Crash for OSBA Stereo out */
-
-
#define FIX_694_OMASA_EXTREME /* Nokia: fix for crash in OMASA on extreme sample */
+
/* ################## End BE DEVELOPMENT switches ######################### */
/* #################### Start NON-BE CR switches ########################## */
diff --git a/lib_com/prot.h b/lib_com/prot.h
index 96103248868aab79708ebf53c19ac147a58a4302..263f4cfe0eac3cda878ba55930f9f5f3e897a7f4 100644
--- a/lib_com/prot.h
+++ b/lib_com/prot.h
@@ -1864,9 +1864,9 @@ void apply_envelope_enc(
/*! r: Leading_sign_index, index, size, k_val */
PvqEntry mpvq_encode_vec(
- const int16_t *vec_in, /* i : Signed pulse train */
- const int16_t dim_in, /* i : Dimension */
- int16_t k_val_local /* i/o : Num unit pulses */
+ const int16_t *vec_in, /* i : Signed pulse train */
+ const int16_t dim_in, /* i : Dimension */
+ int16_t k_val_local /* i/o: Num unit pulses */
);
/*! r: Size, dim, k_val */
@@ -3977,7 +3977,7 @@ void set_impulse(
float exc[], /* o : adaptive codebook excitation */
float y1[], /* o : filtered adaptive codebook excitation */
int16_t *imp_shape, /* o : adaptive codebook index */
- int16_t *imp_pos, /* o : position of the glotal impulse center index */
+ int16_t *imp_pos, /* o : position of the glottal impulse center index */
float *gain_trans /* o : transition gain */
);
@@ -4936,7 +4936,7 @@ void FEC_encode(
int16_t FEC_pos_dec(
Decoder_State *st, /* i/o: decoder state structure */
- int16_t *last_pulse_pos, /* o : Last glotal pulse position in the lost ACB */
+ int16_t *last_pulse_pos, /* o : Last glottal pulse position in the lost ACB */
float *enr_q, /* o : Decoded energy */
const int16_t nBits_es_Pred /* i : number of bits for Es_pred Q */
);
@@ -7991,7 +7991,7 @@ void writeTCXparam(
const int16_t nbits_header,
const int16_t nbits_start,
const int16_t nbits_lpc,
- const int16_t *no_param_tns, /* i : number of TNS parameters per subframe */
+ const int16_t *no_param_tns, /* i : number of TNS parameters per subframe */
int16_t p_param[2], /* i/o: pointer to parameters from previous bs writing */
const int16_t target_bitsTCX10[2],
const int16_t pre_past_flag );
@@ -8142,7 +8142,7 @@ void dctT2_N_apply_matrix(
const float *input, /* i : input in fdcng or DCT(fdcng) domain */
float *output, /* o : output in DCT(fdcng) or fdcng ordomain */
const int16_t dct_dim, /* i : dct processing dim possibly truncated */
- int16_t fdcngvq_dim, /* i : fdcng domain length */
+ const int16_t fdcngvq_dim, /* i : fdcng domain length */
const float *matrix, /* i : IDCT matrix */
const int16_t matrix_row_dim, /* i : */
const DCTTYPE dcttype /* i : matrix operation type */
@@ -8161,12 +8161,12 @@ void extend_dctN_input(
/*! r: (p_max , best candidate sofar ) */
int16_t msvq_stage1_dct_search(
- const float *u, /* i : target */
- const int16_t N, /* i : target length and IDCT synthesis length */
+ const float *u, /* i : target */
+ const int16_t N, /* i : target length and IDCT synthesis length */
const int16_t maxC_st1, /* i : number of final stage 1 candidates to provide */
- const DCTTYPE dcttype, /* e.g. DCT_T2_16_XX, DCT_T2_24_XX; */
+ const DCTTYPE dcttype, /* e.g. DCT_T2_16_XX, DCT_T2_24_XX; */
const int16_t max_dct_trunc, /* i : maximum of truncation lenghts */
- float *invTrfMatrix, /* i : IDCT synthesis matrix for dim N */
+ float *invTrfMatrix, /* i : IDCT synthesis matrix for dim N */
const float *midQ_truncQ, /* i : midQ vector */
const float *dct_invScaleF, /* i : global inv scale factors */
const float *dct_scaleF, /* i : global scale factors */
diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h
index 79976efa88ab63a6d3eb8948712e899a1e5e1f12..90203dc4700abd848353e13423f3ab42c2386895 100644
--- a/lib_com/stat_com.h
+++ b/lib_com/stat_com.h
@@ -461,7 +461,7 @@ typedef int16_t ( *TDecodeValue )( struct Decoder_State *st, int16_t index, int1
*/
typedef float ( *TLinearPredictionFilter )( const int16_t order, const float parCoeff[], float *state, float x );
-/** Structure that defines mapping between a parameter and a bistream. */
+/** Structure that defines mapping between a parameter and a bitstream. */
typedef struct ParamBitMap
{
/** Number of bits in a bitstream required for the parameter.
@@ -516,7 +516,7 @@ typedef struct ParamBitMap
struct ParamsBitMap const *pSubParamBitMap;
} ParamBitMap;
-/** Structure that defines mapping between parameters and a bistream. */
+/** Structure that defines mapping between parameters and a bitstream. */
typedef struct ParamsBitMap
{
/** Number of parameters in params. */
@@ -573,7 +573,7 @@ typedef struct
} FrameSizeParams;
-typedef struct
+typedef struct cldfb_filter_bank_struct
{
int16_t no_channels;
int16_t no_col;
diff --git a/lib_dec/FEC_adapt_codebook.c b/lib_dec/FEC_adapt_codebook.c
index 961dfc6a5d19fa38401eb9c7bb396546b267329d..1200e2651cf52f30ff9fb82be8440dc076e960c5 100644
--- a/lib_dec/FEC_adapt_codebook.c
+++ b/lib_dec/FEC_adapt_codebook.c
@@ -399,12 +399,12 @@ void FEC_SinOnset(
}
int16_t FEC_enhACB(
- const int16_t L_frame, /* i : frame length */
- const int16_t last_L_frame, /* i : frame length of last frame */
- float *exc_io, /* i/o : adaptive codebook memory */
- const int16_t new_pit, /* i : decoded first frame pitch */
- const int16_t puls_pos, /* i : decoder position of the last glottal pulses decoded in the previous frame */
- const float bfi_pitch /* i : pitch used for concealment */
+ const int16_t L_frame, /* i : frame length */
+ const int16_t last_L_frame, /* i : frame length of last frame */
+ float *exc_io, /* i/o: adaptive codebook memory */
+ const int16_t new_pit, /* i : decoded first frame pitch */
+ const int16_t puls_pos, /* i : decoder position of the last glottal pulses decoded in the previous frame */
+ const float bfi_pitch /* i : pitch used for concealment */
)
{
int16_t Tc, P0, sign, pit_search;
diff --git a/lib_dec/FEC_clas_estim.c b/lib_dec/FEC_clas_estim.c
index 4acd3dab9cef32fa47fafd57184f9edc2e52877a..8d54129a7c2d5945f07951153d958c86c21f1cb5 100644
--- a/lib_dec/FEC_clas_estim.c
+++ b/lib_dec/FEC_clas_estim.c
@@ -735,7 +735,7 @@ static void FEC_classificationMusic(
int16_t FEC_pos_dec(
Decoder_State *st, /* i/o: decoder state structure */
- int16_t *last_pulse_pos, /* o : last glotal pulse position in the lost ACB */
+ int16_t *last_pulse_pos, /* o : last glottal pulse position in the lost ACB */
float *enr_q, /* o : decoded energy */
const int16_t nBits_es_Pred /* i : number of bits for Es_pred Q */
diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c
index ee8b838e94fbb293e987c1b73a3e834f2bed9aba..3966eae0cfa397d9bcb8c4fc2f0c7aab4f26a2cd 100644
--- a/lib_dec/ivas_binRenderer_internal.c
+++ b/lib_dec/ivas_binRenderer_internal.c
@@ -487,11 +487,12 @@ static ivas_error ivas_binRenderer_convModuleOpen(
* initialize memory for HrtfFastConv structure elements
*-------------------------------------------------------------------------*/
-ivas_error ivas_init_binaural_hrtf(
+void ivas_init_binaural_hrtf(
HRTFS_FASTCONV *HrtfFastConv /* i/o: FASTCONV HRTF structure */
)
{
int16_t i;
+
HrtfFastConv->leftHRIRReal_HOA3 = NULL;
HrtfFastConv->leftHRIRImag_HOA3 = NULL;
HrtfFastConv->rightHRIRReal_HOA3 = NULL;
@@ -530,29 +531,36 @@ ivas_error ivas_init_binaural_hrtf(
HrtfFastConv->fastconvReverberationEneCorrections[i] = 0x00;
}
- return IVAS_ERR_OK;
+ return;
}
+
/*-------------------------------------------------------------------------*
* ivas_alloc_pppMem()
*
* Allocate memory for tripple pointer elements
*-------------------------------------------------------------------------*/
-static ivas_error ivas_alloc_pppMem( float ****pppMem, int32_t dim1, int32_t dim2, int32_t dim3, int16_t allocate_init_flag )
+static ivas_error ivas_alloc_pppMem(
+ float ****pppMem,
+ const int16_t dim1,
+ const int16_t dim2,
+ const int16_t dim3,
+ const int16_t allocate_init_flag )
{
- int32_t i, j;
+ int16_t i, j;
float ***localMem = NULL;
if ( ( localMem = (float ***) malloc( dim1 * sizeof( float ** ) ) ) == NULL )
{
- return IVAS_ERR_FAILED_ALLOC;
+ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" );
}
+
for ( i = 0; i < dim1; i++ )
{
if ( ( localMem[i] = (float **) malloc( dim2 * sizeof( float * ) ) ) == NULL )
{
- return IVAS_ERR_FAILED_ALLOC;
+ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" );
}
if ( allocate_init_flag == 0 )
{
@@ -560,7 +568,7 @@ static ivas_error ivas_alloc_pppMem( float ****pppMem, int32_t dim1, int32_t dim
{
if ( ( localMem[i][j] = (float *) malloc( dim3 * sizeof( float ) ) ) == NULL )
{
- return IVAS_ERR_FAILED_ALLOC;
+ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF memory" );
}
}
}
@@ -571,6 +579,7 @@ static ivas_error ivas_alloc_pppMem( float ****pppMem, int32_t dim1, int32_t dim
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------*
* ivas_allocate_binaural_hrtf()
*
@@ -578,11 +587,11 @@ static ivas_error ivas_alloc_pppMem( float ****pppMem, int32_t dim1, int32_t dim
*-------------------------------------------------------------------------*/
ivas_error ivas_allocate_binaural_hrtf(
- HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */
- AUDIO_CONFIG input_config, /* i : input audio configuration */
- BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */
- RENDERER_TYPE renderer_type, /* i : renderer type */
- int16_t allocate_init_flag /* i : Memory allocation flag */
+ HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */
+ const AUDIO_CONFIG input_config, /* i : input audio configuration */
+ const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */
+ const RENDERER_TYPE renderer_type, /* i : renderer type */
+ const int16_t allocate_init_flag /* i : Memory allocation flag */
)
{
if ( input_config == AUDIO_CONFIG_HOA3 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 )
@@ -611,6 +620,7 @@ ivas_error ivas_allocate_binaural_hrtf(
}
}
}
+
if ( input_config == AUDIO_CONFIG_HOA2 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 )
{
if ( ( HrtfFastConv->leftHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA2 != NULL ) )
@@ -637,6 +647,7 @@ ivas_error ivas_allocate_binaural_hrtf(
}
}
}
+
if ( input_config == AUDIO_CONFIG_FOA || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_FOA )
{
if ( ( HrtfFastConv->leftHRIRReal_FOA != NULL ) && ( HrtfFastConv->leftHRIRImag_FOA != NULL ) && ( HrtfFastConv->rightHRIRReal_FOA != NULL ) && ( HrtfFastConv->rightHRIRImag_FOA != NULL ) )
@@ -663,6 +674,7 @@ ivas_error ivas_allocate_binaural_hrtf(
}
}
}
+
if ( renderer_type == RENDERER_BINAURAL_FASTCONV || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
{
if ( ( HrtfFastConv->leftHRIRReal != NULL ) && ( HrtfFastConv->leftHRIRImag != NULL ) && ( HrtfFastConv->rightHRIRReal != NULL ) && ( HrtfFastConv->rightHRIRImag != NULL ) )
@@ -690,6 +702,7 @@ ivas_error ivas_allocate_binaural_hrtf(
}
}
}
+
if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
{
if ( ( HrtfFastConv->leftBRIRReal != NULL ) && ( HrtfFastConv->leftBRIRImag != NULL ) && ( HrtfFastConv->rightBRIRReal != NULL ) && ( HrtfFastConv->rightBRIRImag != NULL ) )
@@ -716,9 +729,11 @@ ivas_error ivas_allocate_binaural_hrtf(
}
}
}
+
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------*
* ivas_binaural_HRTF_open()
*
@@ -726,12 +741,14 @@ ivas_error ivas_allocate_binaural_hrtf(
*-------------------------------------------------------------------------*/
static ivas_error ivas_binaural_hrtf_open(
- HRTFS_FASTCONV_HANDLE *hHrtfFastConv, /* i : fastconv HRTF handle */
- AUDIO_CONFIG input_config, /* i : output configuration */
- RENDERER_TYPE renderer_type /* i : renderer type */
+ HRTFS_FASTCONV_HANDLE *hHrtfFastConv, /* i : fastconv HRTF handle */
+ const AUDIO_CONFIG input_config, /* i : output configuration */
+ const RENDERER_TYPE renderer_type /* i : renderer type */
)
{
int16_t i, j;
+ ivas_error error;
+
if ( hHrtfFastConv != NULL && *hHrtfFastConv != NULL )
{
/* Tables already loaded from file */
@@ -749,6 +766,7 @@ static ivas_error ivas_binaural_hrtf_open(
ivas_init_binaural_hrtf( HrtfFastConv );
+
if ( input_config == AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV )
{
HrtfFastConv->FASTCONV_HRIR_latency_s = FASTCONV_HRIR_latency_s;
@@ -769,8 +787,13 @@ static ivas_error ivas_binaural_hrtf_open(
{
HrtfFastConv->FASTCONV_BRIR_latency_s = FASTCONV_BRIR_latency_s;
}
+
HrtfFastConv->allocate_init_flag = 1;
- ivas_allocate_binaural_hrtf( HrtfFastConv, input_config, BINAURAL_INPUT_AUDIO_CONFIG_INVALID, renderer_type, HrtfFastConv->allocate_init_flag );
+
+ if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, input_config, BINAURAL_INPUT_AUDIO_CONFIG_INVALID, renderer_type, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
for ( i = 0; i < BINAURAL_CONVBANDS; i++ )
{
if ( renderer_type == RENDERER_BINAURAL_FASTCONV )
@@ -961,15 +984,14 @@ static void ivas_binaural_obtain_DMX(
ivas_error ivas_rend_openCldfbRend(
CLDFB_REND_WRAPPER *pCldfbRend,
- const IVAS_REND_AudioConfig inConfig,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig,
const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
const int32_t output_Fs )
{
BINAURAL_RENDERER_HANDLE hBinRenderer;
int16_t convBand;
ivas_error error;
- AUDIO_CONFIG in_config, out_config;
error = IVAS_ERR_OK;
@@ -994,8 +1016,6 @@ ivas_error ivas_rend_openCldfbRend(
convBand = hBinRenderer->max_band;
hBinRenderer->timeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; /* Corresponds to 5 msec sound to motion latency */
- in_config = getIvasAudioConfigFromRendAudioConfig( inConfig );
- out_config = getIvasAudioConfigFromRendAudioConfig( outConfig );
if ( convBand > BINAURAL_CONVBANDS )
{
@@ -1006,10 +1026,10 @@ ivas_error ivas_rend_openCldfbRend(
hBinRenderer->conv_band = convBand;
}
hBinRenderer->hInputSetup->is_loudspeaker_setup = 0;
- hBinRenderer->hInputSetup->output_config = in_config;
+ hBinRenderer->hInputSetup->output_config = inConfig;
getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE );
- if ( ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
hBinRenderer->numPoses = pMultiBinPoseData->num_poses + 1;
@@ -1026,7 +1046,7 @@ ivas_error ivas_rend_openCldfbRend(
/* Allocate memories and buffers needed for convolutional module */
- if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, in_config,
+ if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, inConfig,
pCldfbRend->hHrtfFastConv, hBinRenderer->numPoses ) ) != IVAS_ERR_OK )
{
return error;
@@ -1124,18 +1144,17 @@ ivas_error ivas_binRenderer_open(
}
/* Load HRTF tables */
- ivas_binaural_hrtf_open( &st_ivas->hHrtfFastConv, st_ivas->hIntSetup.output_config, st_ivas->renderer_type );
+ if ( ( error = ivas_binaural_hrtf_open( &st_ivas->hHrtfFastConv, st_ivas->hIntSetup.output_config, st_ivas->renderer_type ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && ( st_ivas->hIntSetup.is_loudspeaker_setup == 0 ) )
{
IVAS_OUTPUT_SETUP out_setup;
- /* Allocate memories and buffers needed for convolutional module in CICP19 */
- if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer,
- st_ivas->renderer_type,
- 1,
- AUDIO_CONFIG_7_1_4,
- st_ivas->hHrtfFastConv
+ /* Allocate memories and buffers needed for convolutional module in CCP19 */
+ if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
hBinRenderer->numPoses
@@ -1161,11 +1180,7 @@ ivas_error ivas_binRenderer_open(
else
{
/* Allocate memories and buffers needed for convolutional module */
- if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer,
- st_ivas->renderer_type,
- st_ivas->hIntSetup.is_loudspeaker_setup,
- st_ivas->hIntSetup.output_config,
- st_ivas->hHrtfFastConv
+ if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hHrtfFastConv
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
hBinRenderer->numPoses
@@ -1211,12 +1226,7 @@ ivas_error ivas_binRenderer_open(
/* Allocate memories needed for reverb module */
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
- if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ),
- hBinRenderer->conv_band,
- hBinRenderer->timeSlots,
- &( st_ivas->hRenderConfig->roomAcoustics ),
- st_ivas->hIntSetup.output_config,
- st_ivas->hDecoderConfig->output_Fs,
+ if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs,
RENDERER_BINAURAL_FASTCONV,
st_ivas->hHrtfFastConv,
st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
@@ -1278,7 +1288,7 @@ static void ivas_binRenderer_convModuleClose(
BINAURAL_RENDERER_HANDLE *hBinRenderer /* i/o: fastconv binaural renderer handle */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
- int16_t num_poses
+ const int16_t num_poses
#endif
)
{
@@ -1389,25 +1399,6 @@ static void ivas_binRenderer_convModuleClose(
return;
}
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-/*-------------------------------------------------------------------------
- * ivas_rend_openCldfbRend()
- *
- * Close CLDFB based fastconv binaural renderer memories
- *------------------------------------------------------------------------*/
-void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend )
-{
- if ( pCldfbRend->hCldfbRend->hInputSetup != NULL )
- {
- free( pCldfbRend->hCldfbRend->hInputSetup );
- pCldfbRend->hCldfbRend->hInputSetup = NULL;
- }
- ivas_binRenderer_close( &pCldfbRend->hCldfbRend );
-
- ivas_HRTF_fastconv_binary_close( &pCldfbRend->hHrtfFastConv );
- return;
-}
-#endif
/*-------------------------------------------------------------------------
* ivas_binRenderer_close()
@@ -1450,9 +1441,14 @@ void ivas_binRenderer_close(
*
* Free fastconv binaural renderer hrtf memories
*------------------------------------------------------------------------*/
-static void ivas_free_pppHrtfMem( float ****ppppHRIR, int16_t dim, int16_t alloc_init )
+
+static void ivas_free_pppHrtfMem(
+ float ****ppppHRIR,
+ const int16_t dim,
+ const int16_t alloc_init )
{
int16_t i, j;
+
if ( *ppppHRIR != NULL )
{
for ( i = 0; i < BINAURAL_CONVBANDS; i++ )
@@ -1471,7 +1467,11 @@ static void ivas_free_pppHrtfMem( float ****ppppHRIR, int16_t dim, int16_t alloc
free( *ppppHRIR );
*ppppHRIR = NULL;
}
+
+ return;
}
+
+
/*-------------------------------------------------------------------------
* ivas_binaural_hrtf_close()
*
@@ -1483,11 +1483,14 @@ void ivas_binaural_hrtf_close(
)
{
int16_t allocate_init_flag;
+
if ( hHrtfFastConv == NULL || *hHrtfFastConv == NULL )
{
return;
}
+
allocate_init_flag = ( *hHrtfFastConv )->allocate_init_flag;
+
ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag );
ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag );
ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag );
@@ -1512,8 +1515,11 @@ void ivas_binaural_hrtf_close(
ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag );
ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag );
ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag );
+
+ return;
}
+
/*-------------------------------------------------------------------------*
* ivas_binaural_add_LFE()
*
@@ -1523,8 +1529,8 @@ void ivas_binaural_hrtf_close(
void ivas_binaural_add_LFE(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
int16_t output_frame, /* i : length of input frame */
- float *input_f[], /* i : transport channels */
- float *output_f[] /* o : synthesized core-coder transport channels/DirAC output */
+ float *input_f[], /* i : transport channels */
+ float *output_f[] /* o : synthesized core-coder transport channels/DirAC output */
)
{
int16_t render_lfe, idx_lfe;
diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c
index eb8e13c65a4cf9b17857ff1a1a92815fb991ea03..bd9c41cee27e806de9721062daf55318b25e6e82 100644
--- a/lib_dec/ivas_dec.c
+++ b/lib_dec/ivas_dec.c
@@ -450,7 +450,7 @@ ivas_error ivas_dec(
}
#ifdef DEBUG_LBR_SBA
/* SCE Decoder Output */
- for ( int t = 0; t < 960; t++ )
+ for ( int16_t t = 0; t < 960; t++ )
{
for ( int c = 0; c < st_ivas->nchan_transport; c++ )
{
@@ -553,7 +553,10 @@ ivas_error ivas_dec(
}
else if ( !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 )
{
- ivas_sba_upmixer_renderer( st_ivas, output, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
+ if ( ( error = ivas_sba_upmixer_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
+ {
+ return error;
+ }
}
}
#ifdef MASA_AND_OBJECTS
@@ -759,9 +762,9 @@ ivas_error ivas_dec(
if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
{
int16_t nchan = st_ivas->nchan_transport + st_ivas->nchan_ism;
- for ( int t = 0; t < output_frame; t++ )
+ for ( int16_t t = 0; t < output_frame; t++ )
{
- for ( int c = 0; c < nchan; c++ )
+ for ( int16_t c = 0; c < nchan; c++ )
{
int16_t val = (int16_t) ( output[c][t] + 0.5f );
dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/TC_dec_core_out.raw" );
@@ -771,8 +774,8 @@ ivas_error ivas_dec(
#endif
if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
{
- num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate,
- st_ivas->last_active_ivas_total_brate );
+ num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate );
+
ivas_sba_mix_matrix_determiner( st_ivas->hSpar, &output[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
}
else if ( st_ivas->renderer_type != RENDERER_DISABLE )
@@ -829,11 +832,17 @@ ivas_error ivas_dec(
}
else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS )
{
- ivas_osba_render( st_ivas, output, output_frame );
+ if ( ( error = ivas_osba_render( st_ivas, output, output_frame ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
}
else if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL && !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 )
{
- ivas_sba_upmixer_renderer( st_ivas, output, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
+ if ( ( error = ivas_sba_upmixer_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
}
else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/
{
@@ -845,7 +854,10 @@ ivas_error ivas_dec(
}
}
- ivas_sba_upmixer_renderer( st_ivas, &output[sba_ch_idx], output_frame );
+ if ( ( error = ivas_sba_upmixer_renderer( st_ivas, &output[sba_ch_idx], output_frame ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
if ( st_ivas->ism_mode == ISM_MODE_NONE )
{
diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c
index dc62b1470ff50a2c6854aaddb7699e93fc0df747..aeb0f89cca4bccc3b0ed898783b6667c6f107595 100644
--- a/lib_dec/ivas_init_dec.c
+++ b/lib_dec/ivas_init_dec.c
@@ -214,7 +214,8 @@ static ivas_error ivas_dec_reconfig_split_rend(
*
* IVAS decoder split rend init
*-------------------------------------------------------------------*/
-ivas_error ivas_dec_init_split_rend(
+
+static ivas_error ivas_dec_init_split_rend(
Decoder_Struct *st_ivas /* i : IVAS decoder structure */
)
{
@@ -444,7 +445,6 @@ ivas_error ivas_dec_setup(
st_ivas->sba_order = 3;
}
-
/* set Ambisonic (SBA) order used for analysis and coding */
st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order );
@@ -473,6 +473,7 @@ ivas_error ivas_dec_setup(
st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1;
}
#endif
+
if ( ivas_total_brate >= IVAS_256k )
{
st_ivas->ism_mode = ISM_SBA_MODE_DISC;
@@ -756,6 +757,7 @@ static ivas_error ivas_read_format(
#ifdef SBA_AND_OBJECTS
/* read Ambisonic (SBA) planar flag */
st_ivas->sba_planar = st_ivas->bit_stream[( *num_bits_read ) + 1];
+
/* read Ambisonic (SBA) order */
st_ivas->sba_order = st_ivas->bit_stream[( *num_bits_read ) + 2 + SBA_PLANAR_BITS];
st_ivas->sba_order += 2 * st_ivas->bit_stream[( *num_bits_read ) + 1 + SBA_PLANAR_BITS];
@@ -2087,6 +2089,7 @@ ivas_error ivas_init_decoder(
return error;
}
}
+
#ifdef SBA_AND_OBJECTS
if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
{
@@ -2188,9 +2191,9 @@ ivas_error ivas_init_decoder(
* Allocate and initialize limiter struct
*-----------------------------------------------------------------*/
- if ( ( st_ivas->hLimiter = ivas_limiter_open( hDecoderConfig->nchan_out, output_Fs ) ) == NULL )
+ if ( ( error = ivas_limiter_open( &st_ivas->hLimiter, hDecoderConfig->nchan_out, output_Fs ) ) != IVAS_ERR_OK )
{
- return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to open limiter handle" );
+ return error;
}
/*-----------------------------------------------------------------*
@@ -2719,6 +2722,7 @@ void ivas_destroy_dec(
ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF );
/* Fastconv HRTF memories */
ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv );
+
/* Fastconv HRTF filters */
ivas_HRTF_fastconv_binary_close( &st_ivas->hHrtfFastConv );
@@ -2802,6 +2806,7 @@ void ivas_init_dec_get_num_cldfb_instances(
{
*numCldfbAnalyses = st_ivas->nchan_transport + 1;
}
+
#ifdef SBA_AND_OBJECTS
if ( ivas_format == SBA_ISM_FORMAT )
{
diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c
index 7e87bf56a5c09bc73274088ce49fb2cf91d06494..4ad262493fbd165def82c6f3d63aaa9b90c1a2f8 100644
--- a/lib_dec/ivas_ism_dec.c
+++ b/lib_dec/ivas_ism_dec.c
@@ -41,12 +41,12 @@
#include "wmc_auto.h"
/*-------------------------------------------------------------------------*
- * ivas_ism_bitrate_switching()
+ * ivas_ism_bitrate_switching_dec()
*
*
*-------------------------------------------------------------------------*/
-static ivas_error ivas_ism_bitrate_switching(
+static ivas_error ivas_ism_bitrate_switching_dec(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
const int16_t nchan_transport_old, /* i : last number of transport channels */
const ISM_MODE last_ism_mode, /* i : last ISM mode */
@@ -466,7 +466,7 @@ ivas_error ivas_ism_dec_config(
{
if ( ( st_ivas->ism_mode != last_ism_mode ) || ( st_ivas->hDecoderConfig->ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) )
{
- if ( ( error = ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -489,7 +489,7 @@ ivas_error ivas_ism_dec_config(
/* ISM mode switching */
if ( st_ivas->ism_mode != last_ism_mode )
{
- if ( ( error = ivas_ism_bitrate_switching( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK )
{
return error;
}
diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c
index 108a9428f14bd7c80c92e69889853ab7695d1170..e21566dd244d51dc6953fc3eec0e42ff748ca1e8 100755
--- a/lib_dec/ivas_ism_metadata_dec.c
+++ b/lib_dec/ivas_ism_metadata_dec.c
@@ -152,7 +152,7 @@ ivas_error ivas_ism_metadata_dec(
int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */
#ifdef SBA_AND_OBJECTS
,
- DEC_CORE_HANDLE st0
+ DEC_CORE_HANDLE st0 /* i : core-coder handle */
#endif
)
{
@@ -773,7 +773,7 @@ ivas_error ivas_ism_metadata_dec_create(
/*-------------------------------------------------------------------------
* decode_angle_indices()
*
- * Decoding of an angle
+ * Decoding of a position/orientation angle
*-------------------------------------------------------------------------*/
static void decode_angle_indices(
diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c
index 14cafaf6a20b2143b96b1a256b6f49b3bd9e5ca4..cec88e4e6cdd8badee094dcd224937e1d23905ca 100644
--- a/lib_dec/ivas_masa_dec.c
+++ b/lib_dec/ivas_masa_dec.c
@@ -2354,14 +2354,14 @@ static void read_ism_ratio_index(
static void decode_ism_ratios(
- uint16_t *bit_stream, /* i : bitstream */
- int16_t *next_bit_pos, /* i/o: position in bitstream */
- float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i: masa_to_total energy ratios */
- float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* o : ISM ratios */
- const int16_t n_ism, /* i : number of objects */
- const int16_t nbands, /* i : number of subbands */
- const int16_t numSf, /* i : number of subframes */
- const int16_t idx_separated_object /* i: index of separated object */
+ uint16_t *bit_stream, /* i : bitstream */
+ int16_t *next_bit_pos, /* i/o: position in bitstream */
+ float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : masa_to_total energy ratios */
+ float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* o : ISM ratios */
+ const int16_t n_ism, /* i : number of objects */
+ const int16_t nbands, /* i : number of subbands */
+ const int16_t numSf, /* i : number of subframes */
+ const int16_t idx_separated_object /* i : index of separated object */
)
{
int16_t sf, band;
diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c
index d9be291edbf1cff21379a1622e3fe7ca51ad9624..35d48f2c63526ef50e926404b5d7fc4701fc828d 100644
--- a/lib_dec/ivas_mc_paramupmix_dec.c
+++ b/lib_dec/ivas_mc_paramupmix_dec.c
@@ -74,7 +74,7 @@ static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], f
static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], float pcm_in[][L_FRAME48k], float **pp_out_pcm, const int16_t output_frame );
#endif
-static int huff_read( Decoder_State *st, const int16_t ( *ht )[2] );
+static int16_t huff_read( Decoder_State *st, const int16_t ( *ht )[2] );
static void huffman_decode( Decoder_State *st, const int16_t nv, const int16_t ivStart, PAR_TYPE parType, QUANT_TYPE quant_type, const int16_t bNoDt, int32_t *vq );
@@ -484,10 +484,16 @@ void ivas_mc_paramupmix_dec(
}
+/*-------------------------------------------------------------------------
+ * ivas_mc_paramupmix_dec_digest_tc()
+ *
+ *
+ *------------------------------------------------------------------------*/
+
void ivas_mc_paramupmix_dec_digest_tc(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
- const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */
- const int16_t nSamplesForRendering /* i : number of samples provided */
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
+ const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */
+ const int16_t nSamplesForRendering /* i : number of samples provided */
)
{
MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix;
@@ -507,12 +513,18 @@ void ivas_mc_paramupmix_dec_digest_tc(
}
+/*-------------------------------------------------------------------------
+ * ivas_mc_paramupmix_dec_render()
+ *
+ *
+ *------------------------------------------------------------------------*/
+
void ivas_mc_paramupmix_dec_render(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */
uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */
uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */
- float *input_f[], /* i: core-coder transport channels */
+ float *input_f[], /* i : core-coder transport channels */
float *output_f[] /* i/o: synthesized core-coder transport channels */
)
{
@@ -1290,7 +1302,7 @@ static void paramupmix_td_decorr_process(
}
-static int huff_read(
+static int16_t huff_read(
Decoder_State *st,
const int16_t ( *ht )[2] )
{
@@ -1324,10 +1336,10 @@ static void huffman_decode(
switch ( parType )
{
case ALPHA:
- nquant = alpha_quant_table[quant_type].nquant;
+ nquant = ivas_param_upmx_alpha_quant_table[quant_type].nquant;
break;
case BETA:
- nquant = beta_quant_table[quant_type][0].nquant;
+ nquant = ivas_param_upmx_beta_quant_table[quant_type][0].nquant;
break;
default:
assert( 0 );
@@ -1410,7 +1422,7 @@ static void dequant_alpha(
float *v )
{
int16_t iv;
- ACPL_QUANT_TABLE *quant_table = &alpha_quant_table[quant_type];
+ const ACPL_QUANT_TABLE *quant_table = &ivas_param_upmx_alpha_quant_table[quant_type];
for ( iv = 0; iv < ivStart; iv++ )
{
@@ -1435,7 +1447,7 @@ static void dequant_beta(
float *beta )
{
int16_t iv;
- ACPL_QUANT_TABLE *quant_table;
+ const ACPL_QUANT_TABLE *quant_table;
for ( iv = 0; iv < ivStart; iv++ )
{
@@ -1444,7 +1456,7 @@ static void dequant_beta(
for ( iv = ivStart; iv < nv; iv++ )
{
- quant_table = &beta_quant_table[quant_type][ivas_param_upmx_mx_qmap[quant_type][aq[iv]]];
+ quant_table = &ivas_param_upmx_beta_quant_table[quant_type][ivas_param_upmx_mx_qmap[quant_type][aq[iv]]];
beta[iv] = quant_table->data[bq[iv]];
}
diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c
index f823f2563e2053d5ec3de251a175e24c1c821f5e..b6c40ad1f07750e5cf46adb5c3accdace21c2370 100755
--- a/lib_dec/ivas_mono_dmx_renderer.c
+++ b/lib_dec/ivas_mono_dmx_renderer.c
@@ -104,6 +104,7 @@ void ivas_mono_downmix_render_passive(
numInputChannels = st_ivas->nchan_ism;
}
#endif
+
#ifdef MASA_AND_OBJECTS
if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
{
diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c
index c324de82568aba44b7c766c0a922532f9e58b80e..3cd5005121a85a5b4e453f693ebff6f6fa2a2936 100755
--- a/lib_dec/ivas_osba_dec.c
+++ b/lib_dec/ivas_osba_dec.c
@@ -181,7 +181,10 @@ ivas_error ivas_osba_dirac_td_binaural(
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
{
- ivas_sba_upmixer_renderer( st_ivas, &output[channel_offset], output_frame );
+ if ( ( error = ivas_sba_upmixer_renderer( st_ivas, &output[channel_offset], output_frame ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
}
else
{
@@ -190,9 +193,9 @@ ivas_error ivas_osba_dirac_td_binaural(
#ifdef DEBUG_OSBA
{
- for ( int t = 0; t < output_frame; t++ )
+ for ( int16_t t = 0; t < output_frame; t++ )
{
- for ( int c = 0; c < BINAURAL_CHANNELS; c++ )
+ for ( int16_t c = 0; c < BINAURAL_CHANNELS; c++ )
{
int16_t val = (int16_t) ( output[channel_offset + c][t] + 0.5f );
dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/sba_fast_conv_out.raw" );
@@ -242,14 +245,12 @@ ivas_error ivas_osba_dirac_td_binaural(
}
#ifdef DEBUG_OSBA
+ for ( int16_t t = 0; t < output_frame; t++ )
{
- for ( int t = 0; t < output_frame; t++ )
+ for ( int16_t c = 0; c < BINAURAL_CHANNELS; c++ )
{
- for ( int c = 0; c < BINAURAL_CHANNELS; c++ )
- {
- int16_t val = (int16_t) ( p_sepobj[c][t] + 0.5f );
- dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/ism_td_bin_out.raw" );
- }
+ int16_t val = (int16_t) ( p_sepobj[c][t] + 0.5f );
+ dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/ism_td_bin_out.raw" );
}
}
#endif
@@ -300,7 +301,7 @@ ivas_error ivas_osba_ism_metadata_dec(
* Object + SBA rendering process.
*-------------------------------------------------------------------------*/
-void ivas_osba_render(
+ivas_error ivas_osba_render(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
float *output_f[], /* i/o: core-coder transport channels/object output */
@@ -313,6 +314,7 @@ void ivas_osba_render(
float tmp_ism_out[MAX_OUTPUT_CHANNELS][L_FRAME48k];
float *p_tmp_ism_out[MAX_OUTPUT_CHANNELS];
int16_t n, nchan_out, nchan_ism, sba_ch_idx;
+ ivas_error error;
nchan_out = st_ivas->hDecoderConfig->nchan_out;
nchan_ism = st_ivas->nchan_ism;
@@ -348,7 +350,10 @@ void ivas_osba_render(
}
}
- ivas_sba_upmixer_renderer( st_ivas, &output_f[sba_ch_idx], output_frame );
+ if ( ( error = ivas_sba_upmixer_renderer( st_ivas, &output_f[sba_ch_idx], output_frame ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
{
@@ -359,6 +364,6 @@ void ivas_osba_render(
}
}
- return;
+ return IVAS_ERR_OK;
}
#endif
diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c
index 3d989ddedc17149b7092452d3e988074287b396d..8920dc52ce2d560cf23bea886c1758083591cbcb 100644
--- a/lib_dec/ivas_qmetadata_dec.c
+++ b/lib_dec/ivas_qmetadata_dec.c
@@ -120,10 +120,10 @@ static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, con
/*! r: number of bits read */
int16_t ivas_qmetadata_dec_decode(
- IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: hQMetaData handle */
- uint16_t *bitstream, /* i : bitstream */
- int16_t *index, /* i/o: bitstream position */
- const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */
+ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: hQMetaData handle */
+ uint16_t *bitstream, /* i : bitstream */
+ int16_t *index, /* i/o: bitstream position */
+ const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */
)
{
int16_t d, b, m;
@@ -3674,7 +3674,7 @@ static int16_t decode_fixed_rate_composed_index_coherence(
/*-------------------------------------------------------------------*
* read_coherence_data_hr_512()
*
- *
+ * Read coherence data at HR
*-------------------------------------------------------------------*/
/*! r: number of bits read */
diff --git a/lib_dec/ivas_range_uni_dec.c b/lib_dec/ivas_range_uni_dec.c
index db0fbddeabd1d3f83ef2df5908f290383289bac9..6fbbaa5636d4a0c6f38be7afcf589afff04f2640 100644
--- a/lib_dec/ivas_range_uni_dec.c
+++ b/lib_dec/ivas_range_uni_dec.c
@@ -138,7 +138,7 @@ uint16_t rc_uni_dec_read_symbol_fastS(
{
rc_st_dec->bit_error_detected = 1;
- /* for valid bistreams, always low < range, therefore setting low = range */
+ /* for valid bitstreams, always low < range, therefore setting low = range */
/* will always reach the bitstream error condition branch on the next call */
rc_st_dec->rc_range = 0xFFFFFFFF;
rc_st_dec->rc_low = rc_st_dec->rc_range;
@@ -248,7 +248,7 @@ uint16_t rc_uni_dec_read_bit(
{
rc_st_dec->bit_error_detected = 1;
- /* for valid bistreams, always low < range, therefore setting low = range */
+ /* for valid bitstreams, always low < range, therefore setting low = range */
/* will always reach the bitstream error condition branch on the next call */
rc_st_dec->rc_range = 0xFFFFFFFF;
rc_st_dec->rc_low = rc_st_dec->rc_range;
@@ -303,7 +303,7 @@ uint16_t rc_uni_dec_read_bit_prob_fast(
{
rc_st_dec->bit_error_detected = 1;
- /* for valid bistreams, always low < range, therefore setting low = range */
+ /* for valid bitstreams, always low < range, therefore setting low = range */
/* will always reach the bitstream error condition branch on the next call */
rc_st_dec->rc_range = 0xFFFFFFFF;
rc_st_dec->rc_low = rc_st_dec->rc_range;
@@ -376,7 +376,7 @@ uint16_t rc_uni_dec_read_bits(
{
rc_st_dec->bit_error_detected = 1;
- /* for valid bistreams, always low < range, therefore setting low = range */
+ /* for valid bitstreams, always low < range, therefore setting low = range */
/* will always reach the bitstream error condition branch on the next call */
rc_st_dec->rc_range = 0xFFFFFFFF;
rc_st_dec->rc_low = rc_st_dec->rc_range;
@@ -482,7 +482,7 @@ static int16_t rc_uni_dec_read(
{
rc_st_dec->bit_error_detected = 1;
- /* for valid bistreams, always low < range, therefore setting low = range */
+ /* for valid bitstreams, always low < range, therefore setting low = range */
/* will always reach the bitstream error condition branch on the next call */
rc_st_dec->rc_range = 0xFFFFFFFF;
rc_st_dec->rc_low = rc_st_dec->rc_range;
diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c
index ff1d93b5bade393df147cd3863ec41905f11b5d3..e55d37657c42527e0f69b73954c1089700e3d716 100644
--- a/lib_dec/ivas_sba_dirac_stereo_dec.c
+++ b/lib_dec/ivas_sba_dirac_stereo_dec.c
@@ -495,14 +495,14 @@ static void ivas_sba_dirac_stereo_compute_hb_gain(
*-------------------------------------------------------------------*/
static void ivas_sba_dirac_stereo_upmix_hb(
- float hb_stereo_synth[CPE_CHANNELS][L_FRAME48k], /* i/o: stereo HB synthesis signal */
- float hb_synth[L_FRAME48k], /* i : HB signal */
- float hb_gain[NB_DIV], /* i : side gains for HB signal */
- const int16_t output_frame, /* i : output frame length per channel */
- const int16_t mcmasa, /* i : McMASA flag */
- const int16_t sba_mono_flag, /* i : flag for mono output */
- const int16_t bwidth, /* i : bandwidth of signal */
- const STEREO_DFT_DEC_DATA_HANDLE hStereoDft /* i : Stereo DFT handle for mixing matrix */
+ float hb_stereo_synth[CPE_CHANNELS][L_FRAME48k], /* i/o: stereo HB synthesis signal */
+ float hb_synth[L_FRAME48k], /* i : HB signal */
+ float hb_gain[NB_DIV], /* i : side gains for HB signal */
+ const int16_t output_frame, /* i : output frame length per channel */
+ const int16_t mcmasa, /* i : McMASA flag */
+ const int16_t sba_mono_flag, /* i : flag for mono output */
+ const int16_t bwidth, /* i : bandwidth of signal */
+ const STEREO_DFT_DEC_DATA_HANDLE hStereoDft /* i : Stereo DFT handle for mixing matrix */
)
{
int16_t i;
@@ -597,7 +597,6 @@ static void ivas_sba_dirac_stereo_upmix_hb(
}
}
-
return;
}
diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c
index 21489ccee7bac657153d36d2c2174ad5f7444e1a..4cb9eb339d882a5bc6e598ee5d058c854fdc8392 100644
--- a/lib_dec/ivas_sba_rendering_internal.c
+++ b/lib_dec/ivas_sba_rendering_internal.c
@@ -219,6 +219,7 @@ void ivas_mc2sba(
* Get TCs from Ambisonics signal in ACN
*-------------------------------------------------------------------*/
+/*! r: SBA DirAC stereo flag */
int16_t ivas_sba_remapTCs(
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
float *sba_data[], /* i/o: SBA signals */
@@ -391,7 +392,7 @@ void ivas_ism2sba_sf(
* SBA upmix & rendering
*-------------------------------------------------------------------*/
-void ivas_sba_upmixer_renderer(
+ivas_error ivas_sba_upmixer_renderer(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
float *output[], /* i/o: transport/output audio channels */
@@ -405,6 +406,7 @@ void ivas_sba_upmixer_renderer(
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
int16_t sba_ch_idx;
#endif
+ ivas_error error;
push_wmops( "ivas_sba_upmixer_renderer" );
@@ -426,6 +428,7 @@ void ivas_sba_upmixer_renderer(
output_config = ( st_ivas->ivas_format == SBA_ISM_FORMAT ? st_ivas->hOutSetup.output_config : st_ivas->hDecoderConfig->output_config );
#endif
+
#ifdef SBA_AND_OBJECTS
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
sba_ch_idx = 0;
@@ -446,18 +449,17 @@ void ivas_sba_upmixer_renderer(
}
#ifdef SBA_AND_OBJECTS
- ivas_sba_linear_renderer( output_f, output_frame, st_ivas->hIntSetup.nchan_out_woLFE,
-#ifdef SBA_AND_OBJECTS
- st_ivas->nchan_ism,
-#endif
- output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx );
+ if ( ( error = ivas_sba_linear_renderer( output_f, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->nchan_ism, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ) ) != IVAS_ERR_OK )
+ {
+ return error;
+ }
#else
ivas_sba_linear_renderer( output_f, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx );
#endif
}
pop_wmops();
- return;
+ return IVAS_ERR_OK;
}
@@ -638,7 +640,7 @@ void ivas_sba_mix_matrix_determiner(
const int16_t bfi, /* i : BFI flag */
const int16_t nchan_remapped, /* i : num channels after remapping of TCs */
const int16_t output_frame, /* i : output frame length */
- const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */
+ const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix*/
)
{
int16_t i, ch;
diff --git a/lib_dec/ivas_sns_dec.c b/lib_dec/ivas_sns_dec.c
index b475ae0a061abe525dbe004ba2ab868550106a4f..99fe5eb523dc1932cbe55d4cb2a3d27437e76ab8 100644
--- a/lib_dec/ivas_sns_dec.c
+++ b/lib_dec/ivas_sns_dec.c
@@ -178,11 +178,11 @@ void sns_avq_dec(
*-------------------------------------------------------------------*/
void sns_avq_dec_stereo(
- int16_t *indexl, /* i : Quantization indices (left channel) */
- int16_t *indexr, /* i : Quantization indices (right channe) */
- const int16_t L_frame,
- float *SNS_Ql, /* o : Quantized SNS vectors (left channel) */
- float *SNS_Qr /* o : Quantized SNS vectors (right channe) */
+ int16_t *indexl, /* i : Quantization indices (left channel) */
+ int16_t *indexr, /* i : Quantization indices (right channe) */
+ const int16_t L_frame, /* i : frame length */
+ float *SNS_Ql, /* o : Quantized SNS vectors (left channel) */
+ float *SNS_Qr /* o : Quantized SNS vectors (right channe) */
)
{
int16_t i, stereo_mode;
@@ -228,6 +228,13 @@ void sns_avq_dec_stereo(
return;
}
+
+/*-------------------------------------------------------------------
+ * dequantize_sns()
+ *
+ * Dequantize SNS
+ *-------------------------------------------------------------------*/
+
void dequantize_sns(
int16_t indices[CPE_CHANNELS][NPRM_LPC_NEW],
float snsQ_out[CPE_CHANNELS][NB_DIV][M],
@@ -289,4 +296,6 @@ void dequantize_sns(
}
}
}
+
+ return;
}
diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c
old mode 100644
new mode 100755
index 5cc14dcab2555732b5218c7942d8b4ca5b2d98ac..5ff94a0f15590ec2f54c81760f079ee3f45eae40
--- a/lib_dec/ivas_spar_decoder.c
+++ b/lib_dec/ivas_spar_decoder.c
@@ -176,6 +176,7 @@ ivas_error ivas_spar_dec_open(
}
hSpar->i_subframe = 0;
hSpar->AGC_flag = 0;
+
/*-----------------------------------------------------------------*
* Configuration - set SPAR high-level parameters
*-----------------------------------------------------------------*/
diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c
index 032de95e09c323393c9cdee4a79c2a777b1e790c..80851af85b4f5f7489ebfab2a0fde5ac33bd6579 100644
--- a/lib_dec/ivas_spar_md_dec.c
+++ b/lib_dec/ivas_spar_md_dec.c
@@ -262,7 +262,7 @@ ivas_error ivas_spar_md_dec_matrix_open(
int16_t ivas_get_spar_dec_md_num_subframes(
const int16_t sba_order, /* i : Ambisonic (SBA) order */
const int32_t ivas_total_brate, /* i : IVAS total bitrate */
- const int32_t ivas_last_active_brate /* i : IVAS last active bitrate */
+ const int32_t ivas_last_active_brate /* i : IVAS last active bitrate */
)
{
int16_t num_subframes;
@@ -312,9 +312,7 @@ ivas_error ivas_spar_md_dec_open(
return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD decoder" );
}
- num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, hDecoderConfig->ivas_total_brate,
- last_active_ivas_total_brate /* i : IVAS last active bitrate */
- );
+ num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, hDecoderConfig->ivas_total_brate, last_active_ivas_total_brate );
if ( ( error = ivas_spar_md_dec_matrix_open( hMdDec, num_channels, num_md_sub_frames ) ) != IVAS_ERR_OK )
{
@@ -336,6 +334,7 @@ ivas_error ivas_spar_md_dec_open(
{
hMdDec->table_idx = ivas_get_spar_table_idx( hDecoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL );
}
+
if ( ( error = ivas_spar_md_dec_init( hMdDec, hDecoderConfig, num_channels, sba_order ) ) != IVAS_ERR_OK )
{
return error;
@@ -821,12 +820,7 @@ void ivas_spar_md_dec_process(
}
}
- ivas_get_spar_matrices( hMdDec, num_bands_out, num_md_sub_frames, bw, dtx_vad, nB,
- num_md_chs,
- active_w_vlbr,
- dyn_active_w_flag
-
- );
+ ivas_get_spar_matrices( hMdDec, num_bands_out, num_md_sub_frames, bw, dtx_vad, nB, num_md_chs, active_w_vlbr, dyn_active_w_flag );
#ifdef DEBUG_SPAR_DIRAC_WRITE_OUT_PRED_PARS
{
@@ -843,6 +837,7 @@ void ivas_spar_md_dec_process(
{
nB = nB << 1;
}
+
for ( b = nB; b < num_bands_out; b++ )
{
hMdDec->valid_bands[b] = 1;
@@ -854,14 +849,17 @@ void ivas_spar_md_dec_process(
return;
}
+
+
/*-----------------------------------------------------------------------------------------*
* Function ivas_spar_chk_zero_coefs()
*
* Check for zeroed SPAR coefficients
*-----------------------------------------------------------------------------------------*/
+
int16_t ivas_spar_chk_zero_coefs(
- Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
- const int16_t sba_order /* i : Ambisonic (SBA) order */
+ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
+ const int16_t sba_order /* i : Ambisonic (SBA) order */
)
{
int16_t j, k, b, i_ts;
@@ -911,6 +909,7 @@ int16_t ivas_spar_chk_zero_coefs(
return mono;
}
+
/*-----------------------------------------------------------------------------------------*
* Function ivas_spar_smooth_md_dtx()
*
@@ -1162,9 +1161,10 @@ static void ivas_get_spar_matrices(
{
num_bands = num_bands >> 1;
}
- active_w = ( dyn_active_w_flag == 1 ) || ( hMdDec->spar_md_cfg.active_w == 1 );
+ active_w = ( dyn_active_w_flag == 1 ) || ( hMdDec->spar_md_cfg.active_w == 1 );
active_w_dm_fac = ( dtx_vad == 0 ) ? IVAS_ACTIVEW_DM_F_SCALE_DTX : ( ( active_w_vlbr ) ? IVAS_ACTIVEW_DM_F_SCALE_VLBR : IVAS_ACTIVEW_DM_F_SCALE );
+
for ( i_ts = 0; i_ts < n_ts; i_ts++ )
{
for ( i = 0; i < numch_out; i++ )
@@ -1653,8 +1653,7 @@ static void ivas_spar_dec_parse_md_bs(
if ( no_ec == 0 )
{
- ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff,
- strat, ivas_total_brate );
+ ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, strat, ivas_total_brate );
}
else
{
@@ -1857,9 +1856,11 @@ static void ivas_decode_arith_bs(
}
ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF );
+
return;
}
+
/*-----------------------------------------------------------------------------------------*
* Function ivas_fill_band_coeffs_idx()
*
@@ -1942,6 +1943,7 @@ static void ivas_decode_huffman_bs(
drct_dim = ndec * ( ndm - 1 );
decd_dim = ndec;
pred_offset = 0;
+
if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag )
{
if ( i >= SPAR_DIRAC_SPLIT_START_BAND )
@@ -2325,6 +2327,7 @@ static void ivas_parse_parameter_bitstream_dtx(
{
zero_pad_bits -= 1;
}
+
for ( j = 0; j < zero_pad_bits; j++ )
{
get_next_indice( st0, 1 );
diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h
index a83668d9ab93d4d877ab01b296809dc210e919d3..d19fa843f190d9defd3a0c4447fc1dccfe5f119a 100755
--- a/lib_dec/ivas_stat_dec.h
+++ b/lib_dec/ivas_stat_dec.h
@@ -40,6 +40,8 @@
#include "stat_dec.h"
#include "ivas_stat_com.h"
#include "ivas_stat_rend.h"
+
+
/*----------------------------------------------------------------------------------*
* DFT Stereo decoder structure
*----------------------------------------------------------------------------------*/
@@ -290,6 +292,7 @@ typedef struct stereo_mdct_dec_data_structure
STEREO_MDCT_BAND_PARAMETERS stbParamsTCX20; /* stereo frequency band parameters for TCX20 */
STEREO_MDCT_BAND_PARAMETERS stbParamsTCX10; /* stereo frequency band parameters for TCX10 */
STEREO_MDCT_BAND_PARAMETERS stbParamsTCX20afterACELP; /* stereo frequency band parameters for transition frame */
+
/* only intraframe */
int16_t mdct_stereo_mode[2]; /* mdct stereo mode: LR, MS, band-wise MS */
int16_t global_ild[2]; /* Quantized ILD for the whole spectrum */
@@ -395,6 +398,7 @@ typedef struct
} ISM_DTX_DATA_DEC;
+
/*----------------------------------------------------------------------------------*
* DirAC decoder structures
*----------------------------------------------------------------------------------*/
@@ -411,7 +415,6 @@ typedef struct param_ism_rendering
} PARAM_ISM_RENDERING_DATA, *PARAM_ISM_RENDERING_HANDLE;
-/* ===== DirAC main structure ===== */
typedef struct ivas_dirac_dec_data_structure
{
DIRAC_CONFIG_DATA_HANDLE hConfig;
@@ -440,7 +443,6 @@ typedef struct ivas_dirac_dec_data_structure
typedef struct dirac_output_synthesis_cov_state_structure
{
-
/* only pointer to local buffers */
float *direct_power_factor;
float *diffuse_power_factor;
@@ -469,6 +471,7 @@ typedef struct dirac_output_synthesis_cov_state_structure
/*----------------------------------------------------------------------------------*
* ParamMC structures
*----------------------------------------------------------------------------------*/
+
typedef struct ivas_param_mc_diff_proto_info_structure
{
int16_t num_protos_diff;
@@ -479,10 +482,9 @@ typedef struct ivas_param_mc_diff_proto_info_structure
} PARAM_MC_DIFF_PROTO_INFO;
-/* ===== Parametric MC main structure ===== */
+
typedef struct ivas_param_mc_dec_data_structure
{
-
int16_t slot_size;
float *Cldfb_RealBuffer_tc;
float *Cldfb_ImagBuffer_tc;
@@ -527,11 +529,11 @@ typedef struct ivas_param_mc_dec_data_structure
} PARAM_MC_DEC_DATA, *PARAM_MC_DEC_HANDLE;
+
/*----------------------------------------------------------------------------------*
* MC Param-Upmix Mode structures
*----------------------------------------------------------------------------------*/
-/* ===== MC Param-Upmix Mode main structure ===== */
typedef struct ivas_mc_paramupmix_dec_data_structure
{
int16_t num_freq_bands;
@@ -551,6 +553,7 @@ typedef struct ivas_mc_paramupmix_dec_data_structure
} MC_PARAMUPMIX_DEC_DATA, *MC_PARAMUPMIX_DEC_HANDLE;
+
/*------------------------------------------------------------------------------------------*
* SPAR decoder structures
*------------------------------------------------------------------------------------------*/
@@ -610,6 +613,7 @@ typedef struct ivas_agc_dec_state_t
} ivas_agc_dec_state_t;
+
/* PCA structure */
typedef struct
{
@@ -623,6 +627,7 @@ typedef struct
} PCA_DEC_STATE;
+
/* main SPAR decoder structure */
typedef struct ivas_spar_dec_lib_t
{
@@ -736,6 +741,7 @@ typedef struct mct_dec_block_data_struct
} MCT_DEC_BLOCK_DATA, *MCT_DEC_BLOCK_DATA_HANDLE;
+
typedef struct mct_dec_data_structure
{
int16_t nchan_out_woLFE; /* number of active channels within multi-channel configuration */
@@ -746,6 +752,7 @@ typedef struct mct_dec_data_structure
int16_t chBitRatios[MCT_MAX_CHANNELS];
int16_t lowE_ch[MCT_MAX_CHANNELS]; /* note: pointer to local parameter */
uint16_t mc_global_ild[MCT_MAX_CHANNELS]; /* note: pointer to local parameter */
+
} MCT_DEC_DATA, *MCT_DEC_HANDLE;
@@ -786,7 +793,6 @@ typedef struct renderer_struct
} ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE;
-
#ifndef SPLIT_REND_WITH_HEAD_ROT
/* Fastconv binaural data structure */
typedef struct ivas_binaural_rendering_struct
@@ -813,7 +819,6 @@ typedef struct ivas_binaural_rendering_struct
} BINAURAL_RENDERER, *BINAURAL_RENDERER_HANDLE;
#endif
-
/*----------------------------------------------------------------------------------*
* MASA decoder structures
*----------------------------------------------------------------------------------*/
@@ -975,6 +980,7 @@ typedef struct jbm_metadata_structure
int16_t slot_md_buffer_length;
int16_t sf_to_slot_map[MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME * MASA_JBM_RINGBUFFER_FRAMES];
+
} JBM_METADATA, *JBM_METADATA_HANDLE;
@@ -1082,7 +1088,6 @@ typedef struct Decoder_Struct
MASA_ISM_DATA_HANDLE hMasaIsmData;
#endif
-
#ifdef MASA_AND_OBJECTS
int16_t flag_omasa_brate;
#endif
diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c
index 76ee5cb650312a93b8d46a68456888bf87ef51ce..060fb130742907e8aff745deb6afdb1db8122caf 100644
--- a/lib_dec/ivas_vbap.c
+++ b/lib_dec/ivas_vbap.c
@@ -1956,9 +1956,9 @@ static int16_t determine_non_crossing_planes(
*-------------------------------------------------------------------------*/
static void reorder_triplets(
- VBAP_VS_TRIPLET *triplets, /* i/o : VS triplets to be reordered */
- const int16_t *target_order, /* i : Target order for VS triplets */
- const int16_t num_triplets /* i : Number of VS triplets */
+ VBAP_VS_TRIPLET *triplets, /* i/o: VS triplets to be reordered */
+ const int16_t *target_order, /* i : Target order for VS triplets */
+ const int16_t num_triplets /* i : Number of VS triplets */
)
{
VBAP_VS_TRIPLET tempTriplets[VBAP_MAX_NUM_TRIPLETS];
diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c
index 58f47788088974716d9cb7bed89393a4bac2bc5b..8f4efe998928e7af3d0922c3a81faa3c56c81ff5 100644
--- a/lib_dec/lib_dec.c
+++ b/lib_dec/lib_dec.c
@@ -97,7 +97,7 @@ struct IVAS_DEC
/*---------------------------------------------------------------------*
- * Local functions
+ * Local function declarations
*---------------------------------------------------------------------*/
static void IVAS_DEC_Close_VoIP( IVAS_DEC_VOIP *hVoIP );
@@ -107,14 +107,8 @@ static void store_JbmData( IVAS_DEC_VOIP *hVoIP, JB4_DATAUNIT_HANDLE dataUnit, c
static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSamples, float *floatBuf, int16_t *pcmBuf );
static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled );
static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig );
-static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas );
-static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( IVAS_DEC_HANDLE hIvasDec );
static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts );
-static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels, uint8_t *nOutChannels, uint16_t *nSamplesRendered, int16_t *data );
-static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples );
-static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *pcmBuf );
-static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const uint16_t nSamplesForRendering, uint16_t *nSamplesRendered, uint16_t *nSamplesAvailableNext, int16_t *pcmBuf );
-static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, int16_t *nSamplesBuffered );
+
/*---------------------------------------------------------------------*
* IVAS_DEC_Open()
@@ -180,6 +174,7 @@ ivas_error IVAS_DEC_Open(
/* initialize Decoder Config. handle */
init_decoder_config( hIvasDec->st_ivas->hDecoderConfig );
+
/* initialize pointers to handles to NULL */
ivas_initialize_handles_dec( st_ivas );
@@ -289,185 +284,6 @@ void IVAS_DEC_Close(
return;
}
-#ifdef SPLIT_REND_WITH_HEAD_ROT
-/*---------------------------------------------------------------------*
- * mapAudioConfig2DecAudioConfig()
- *
- *
- *---------------------------------------------------------------------*/
-
-static IVAS_DEC_AUDIO_CONFIG mapAudioConfig2DecAudioConfig(
- const AUDIO_CONFIG audio_config )
-{
- IVAS_DEC_AUDIO_CONFIG dec_audio_config;
-
- if ( audio_config == AUDIO_CONFIG_EXTERNAL ) /* external renderer */
- {
- dec_audio_config = IVAS_DEC_OUTPUT_EXT;
- }
- else if ( audio_config == AUDIO_CONFIG_MONO )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_MONO;
- }
- else if ( audio_config == AUDIO_CONFIG_STEREO )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_STEREO;
- }
- else if ( audio_config == AUDIO_CONFIG_5_1 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_5_1;
- }
- else if ( audio_config == AUDIO_CONFIG_7_1 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_7_1;
- }
- else if ( audio_config == AUDIO_CONFIG_5_1_2 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_5_1_2;
- }
- else if ( audio_config == AUDIO_CONFIG_5_1_4 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_5_1_4;
- }
- else if ( audio_config == AUDIO_CONFIG_7_1_4 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_7_1_4;
- }
- else if ( audio_config == AUDIO_CONFIG_LS_CUSTOM )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_LS_CUSTOM;
- }
- else if ( audio_config == AUDIO_CONFIG_FOA )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_FOA;
- }
- else if ( audio_config == AUDIO_CONFIG_HOA2 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_HOA2;
- }
- else if ( audio_config == AUDIO_CONFIG_HOA3 )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_HOA3;
- }
- else if ( audio_config == AUDIO_CONFIG_BINAURAL )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_BINAURAL;
- }
- else if ( audio_config == AUDIO_CONFIG_BINAURAL_ROOM_IR )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR;
- }
- else if ( audio_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB;
- }
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- else if ( audio_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED;
- }
- else if ( audio_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
- {
- dec_audio_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM;
- }
-#endif
- else
- {
- dec_audio_config = IVAS_DEC_OUTPUT_UNKNOWN;
- }
-
- return dec_audio_config;
-}
-#endif
-
-/*---------------------------------------------------------------------*
- * mapOutputFormat()
- *
- *
- *---------------------------------------------------------------------*/
-
-static AUDIO_CONFIG mapOutputFormat(
- const IVAS_DEC_AUDIO_CONFIG outputFormat )
-{
- AUDIO_CONFIG output_config;
-
- if ( outputFormat == IVAS_DEC_OUTPUT_EXT ) /* external renderer */
- {
- output_config = AUDIO_CONFIG_EXTERNAL;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_MONO )
- {
- output_config = AUDIO_CONFIG_MONO;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_STEREO )
- {
- output_config = AUDIO_CONFIG_STEREO;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_5_1 )
- {
- output_config = AUDIO_CONFIG_5_1;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_7_1 )
- {
- output_config = AUDIO_CONFIG_7_1;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_5_1_2 )
- {
- output_config = AUDIO_CONFIG_5_1_2;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_5_1_4 )
- {
- output_config = AUDIO_CONFIG_5_1_4;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_7_1_4 )
- {
- output_config = AUDIO_CONFIG_7_1_4;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_LS_CUSTOM )
- {
- output_config = AUDIO_CONFIG_LS_CUSTOM;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_FOA )
- {
- output_config = AUDIO_CONFIG_FOA;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_HOA2 )
- {
- output_config = AUDIO_CONFIG_HOA2;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_HOA3 )
- {
- output_config = AUDIO_CONFIG_HOA3;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL )
- {
- output_config = AUDIO_CONFIG_BINAURAL;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR )
- {
- output_config = AUDIO_CONFIG_BINAURAL_ROOM_IR;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
- {
- output_config = AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
- }
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- else if ( outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED )
- {
- output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
- }
- else if ( outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM )
- {
- output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
- }
-#endif
- else
- {
- output_config = AUDIO_CONFIG_INVALID;
- }
-
- return output_config;
-}
/*---------------------------------------------------------------------*
@@ -519,7 +335,7 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat(
ivas_error IVAS_DEC_Configure(
IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
const uint32_t sampleRate, /* i : output sampling frequency */
- const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */
+ const AUDIO_CONFIG outputConfig, /* i : output configuration */
const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */
const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */
const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */
@@ -546,8 +362,8 @@ ivas_error IVAS_DEC_Configure(
return IVAS_ERR_WRONG_PARAMS;
}
- if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputFormat == IVAS_DEC_OUTPUT_MONO && Opt_non_diegetic_pan == 0 ) ||
- ( outputFormat == IVAS_DEC_OUTPUT_STEREO && Opt_non_diegetic_pan == 1 ) ) )
+ if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == AUDIO_CONFIG_MONO && Opt_non_diegetic_pan == 0 ) ||
+ ( outputConfig == AUDIO_CONFIG_STEREO && Opt_non_diegetic_pan == 1 ) ) )
{
return IVAS_ERR_WRONG_MODE;
}
@@ -556,7 +372,7 @@ ivas_error IVAS_DEC_Configure(
hDecoderConfig = st_ivas->hDecoderConfig;
- hDecoderConfig->output_config = mapOutputFormat( outputFormat );
+ hDecoderConfig->output_config = outputConfig;
if ( hDecoderConfig->output_config == AUDIO_CONFIG_INVALID )
{
return IVAS_ERR_WRONG_PARAMS;
@@ -570,7 +386,7 @@ ivas_error IVAS_DEC_Configure(
hDecoderConfig->nchan_out = 1;
}
- if ( outputFormat != IVAS_DEC_OUTPUT_EXT && outputFormat != IVAS_DEC_OUTPUT_LS_CUSTOM )
+ if ( outputConfig != AUDIO_CONFIG_EXTERNAL && outputConfig != AUDIO_CONFIG_LS_CUSTOM )
{
hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config );
}
@@ -872,16 +688,16 @@ ivas_error IVAS_DEC_GetSamples(
/*---------------------------------------------------------------------*
* IVAS_DEC_Setup( )
*
- * Main function to decode to PCM data of the transport channels
+ *
*---------------------------------------------------------------------*/
static ivas_error IVAS_DEC_Setup(
- IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
- uint16_t *nTcBufferGranularity, /* o : granularity of the TC Buffer */
- uint8_t *nTransportChannels, /* o : number of decoded transport PCM channels */
- uint8_t *nOutChannels, /* o : number of decoded out channels (PCM or CLDFB) */
- uint16_t *nSamplesRendered, /* o : number of samples flushed from the last frame */
- int16_t *data /* o : flushed samples */
+ IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
+ uint16_t *nTcBufferGranularity, /* o : granularity of the TC Buffer */
+ uint8_t *nTransportChannels, /* o : number of decoded transport PCM channels */
+ uint8_t *nOutChannels, /* o : number of decoded out channels (PCM or CLDFB) */
+ uint16_t *nSamplesRendered, /* o : number of samples flushed from the last frame */
+ int16_t *data /* o : flushed samples */
)
{
ivas_error error;
@@ -940,7 +756,7 @@ static ivas_error IVAS_DEC_Setup(
* Main function to decode to PCM data of the transport channels
*---------------------------------------------------------------------*/
-ivas_error IVAS_DEC_GetTcSamples(
+static ivas_error IVAS_DEC_GetTcSamples(
IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
float *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 */
int16_t *nOutSamples /* o : number of samples per channel written to output buffer */
@@ -992,7 +808,7 @@ ivas_error IVAS_DEC_GetTcSamples(
* Main function to decode to PCM data of the transport channels
*---------------------------------------------------------------------*/
-ivas_error IVAS_DEC_RendererFeedTcSamples(
+static ivas_error IVAS_DEC_RendererFeedTcSamples(
IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
const int16_t nSamplesForRendering, /* i : number of TC samples wanted from the renderer */
int16_t *nSamplesResidual, /* o : number of samples not fitting into the renderer grid and buffer for the next call */
@@ -1024,10 +840,10 @@ ivas_error IVAS_DEC_RendererFeedTcSamples(
/*---------------------------------------------------------------------*
* IVAS_DEC_GetRenderedSamples( )
*
- * Main function to decode to PCM data of the transport channels
+ * Main function to render the transport channels to PCM output datat
*---------------------------------------------------------------------*/
-ivas_error IVAS_DEC_GetRenderedSamples(
+static ivas_error IVAS_DEC_GetRenderedSamples(
IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
const uint16_t nSamplesForRendering, /* i : number of TC samples wanted from the renderer */
uint16_t *nSamplesRendered, /* o : number of samples rendered */
@@ -1057,9 +873,16 @@ ivas_error IVAS_DEC_GetRenderedSamples(
return error;
}
-ivas_error IVAS_DEC_GetBufferedNumberOfSamples(
- IVAS_DEC_HANDLE hIvasDec, /* i/o : IVAS decoder handle */
- int16_t *nSamplesBuffered /* o : number of samples still buffered */
+
+/*---------------------------------------------------------------------*
+ * IVAS_DEC_GetBufferedNumberOfSamples( )
+ *
+ * Returns the number of objects available in the decoded bitstream
+ *---------------------------------------------------------------------*/
+
+static ivas_error IVAS_DEC_GetBufferedNumberOfSamples(
+ IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
+ int16_t *nSamplesBuffered /* o : number of samples still buffered */
)
{
ivas_error error;
@@ -1276,6 +1099,7 @@ ivas_error IVAS_DEC_GetMasaMetadata(
return IVAS_ERR_OK;
}
+
/*---------------------------------------------------------------------*
* IVAS_DEC_FeedHeadTrackData( )
*
@@ -1288,7 +1112,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
IVAS_VECTOR3 *Pos /* i : listener position */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
- IVAS_SPLIT_REND_ROT_AXIS rot_axis
+ const IVAS_SPLIT_REND_ROT_AXIS rot_axis
#endif
)
{
@@ -1338,6 +1162,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
return IVAS_ERR_OK;
}
+
/*---------------------------------------------------------------------*
* IVAS_DEC_FeedRefRotData( )
*
@@ -1366,6 +1191,7 @@ ivas_error IVAS_DEC_FeedRefRotData(
return IVAS_ERR_OK;
}
+
/*---------------------------------------------------------------------*
* IVAS_DEC_FeedRefVectorData( )
*
@@ -1388,9 +1214,11 @@ ivas_error IVAS_DEC_FeedRefVectorData(
}
pOtr = hIvasDec->st_ivas->hHeadTrackData->OrientationTracker;
+
return ivas_orient_trk_SetReferenceVector( pOtr, listenerPos, refPos );
}
+
/*---------------------------------------------------------------------*
* IVAS_DEC_FeedExternalOrientationData( )
*
@@ -1435,6 +1263,7 @@ ivas_error IVAS_DEC_FeedExternalOrientationData(
return IVAS_ERR_OK;
}
+
/*---------------------------------------------------------------------*
* IVAS_DEC_FeedCustomLsData( )
*
@@ -3188,6 +3017,13 @@ ivas_error IVAS_DEC_GetSbaDebugParams(
#endif /* DEBUGGING */
+
+/*---------------------------------------------------------------------*
+ * input_format_API_to_internal()
+ *
+ *
+ *---------------------------------------------------------------------*/
+
static ivas_error input_format_API_to_internal(
IVAS_DEC_INPUT_FORMAT input_format,
int16_t *bitstream_format_internal,
@@ -3268,7 +3104,7 @@ static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig(
*
*---------------------------------------------------------------------*/
-ivas_error IVAS_DEC_VoIP_reconfigure(
+static ivas_error IVAS_DEC_VoIP_reconfigure(
IVAS_DEC_HANDLE hIvasDec,
const uint16_t nTransportChannels,
const uint16_t l_ts )
@@ -3393,11 +3229,11 @@ ivas_error IVAS_DEC_VoIP_reconfigure(
*
*---------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetCldfbSamples(
- IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
- float *out_real, /* o: buffer for decoded PCM real output in CLDFB domain */
- float *out_imag, /* o: buffer for decoded PCM imag output in CLDFB domain */
- IVAS_DEC_AUDIO_CONFIG *audio_config,
- int16_t *nOutSamples /* o : number of samples per channel written to output buffer */
+ IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
+ float *out_real, /* o : buffer for decoded PCM real output in CLDFB domain */
+ float *out_imag, /* o : buffer for decoded PCM imag output in CLDFB domain */
+ AUDIO_CONFIG *audio_config, /* o : audio configuration */
+ int16_t *nOutSamples /* o : number of samples per channel written to output buffer */
)
{
Decoder_Struct *st_ivas;
@@ -3415,7 +3251,7 @@ ivas_error IVAS_DEC_GetCldfbSamples(
num_samples = 0;
if ( st_ivas->splitBinRend.hCldfbDataOut != NULL )
{
- *audio_config = mapAudioConfig2DecAudioConfig( st_ivas->splitBinRend.hCldfbDataOut->config );
+ *audio_config = st_ivas->splitBinRend.hCldfbDataOut->config;
if ( st_ivas->splitBinRend.hCldfbDataOut->config != AUDIO_CONFIG_INVALID )
{
num_chs = audioCfg2channels( st_ivas->splitBinRend.hCldfbDataOut->config );
@@ -3437,7 +3273,7 @@ ivas_error IVAS_DEC_GetCldfbSamples(
}
else
{
- *audio_config = IVAS_DEC_OUTPUT_UNKNOWN;
+ *audio_config = AUDIO_CONFIG_INVALID;
}
*nOutSamples = num_samples;
return error;
diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h
index ffaaee1fd87b4bd909ed863680c1abe0020f3173..3d61e99e81894688dd9242a85303927eed168833 100644
--- a/lib_dec/lib_dec.h
+++ b/lib_dec/lib_dec.h
@@ -40,31 +40,6 @@
* Decoder enums
*---------------------------------------------------------------------*/
-/* output formats generated by the decoder */
-typedef enum _IVAS_DEC_OUTPUT_CONFIG
-{
- IVAS_DEC_OUTPUT_MONO = 0x0001,
- IVAS_DEC_OUTPUT_STEREO,
- IVAS_DEC_OUTPUT_5_1,
- IVAS_DEC_OUTPUT_7_1,
- IVAS_DEC_OUTPUT_5_1_2,
- IVAS_DEC_OUTPUT_5_1_4,
- IVAS_DEC_OUTPUT_7_1_4,
- IVAS_DEC_OUTPUT_LS_CUSTOM,
- IVAS_DEC_OUTPUT_FOA,
- IVAS_DEC_OUTPUT_HOA2,
- IVAS_DEC_OUTPUT_HOA3,
- IVAS_DEC_OUTPUT_BINAURAL,
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED,
- IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM,
-#endif
- IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR,
- IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB,
- IVAS_DEC_OUTPUT_EXT,
- IVAS_DEC_OUTPUT_UNKNOWN = 0xffff
-} IVAS_DEC_AUDIO_CONFIG;
-
/* mode the decoder is operating in */
typedef enum _IVAS_DEC_MODE
{
@@ -150,7 +125,7 @@ ivas_error IVAS_DEC_Open(
ivas_error IVAS_DEC_Configure(
IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
const uint32_t sampleRate, /* i : output sampling frequency */
- const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */
+ const AUDIO_CONFIG outputConfig, /* i : audio configuration */
const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */
const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */
const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */
@@ -184,18 +159,18 @@ ivas_error IVAS_DEC_GetSamples(
int16_t *nOutSamples /* o : number of samples per channel written to output buffer */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
- IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits /* o : bitstream output for split rendering mode*/
+ IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits /* o : bitstream output for split rendering mode */
#endif
);
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*! r: decoder error code */
ivas_error IVAS_DEC_GetCldfbSamples(
- IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
- float *out_real, /* o: buffer for decoded PCM real output in CLDFB domain */
- float *out_imag, /* o: buffer for decoded PCM imag output in CLDFB domain */
- IVAS_DEC_AUDIO_CONFIG *audio_config,
- int16_t *nOutSamples /* o : number of samples per channel written to output buffer */
+ IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
+ float *out_real, /* o : buffer for decoded PCM real output in CLDFB domain */
+ float *out_imag, /* o : buffer for decoded PCM imag output in CLDFB domain */
+ AUDIO_CONFIG *audio_config, /* o : audio configuration */
+ int16_t *nOutSamples /* o : number of samples per channel written to output buffer */
);
#endif
@@ -221,7 +196,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
IVAS_VECTOR3 *Pos /* i : listener position */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
- IVAS_SPLIT_REND_ROT_AXIS rot_axis /*i : external control for rotation axis for split rendering*/
+ IVAS_SPLIT_REND_ROT_AXIS rot_axis /*i : external control for rotation axis for split rendering */
#endif
);
diff --git a/lib_enc/enc_prm.c b/lib_enc/enc_prm.c
index 758d672d0b71fd6b9747c0fd580fb0a56c3764ee..61bfbf2f0feef1024e848d5c305613782eefb4e6 100644
--- a/lib_enc/enc_prm.c
+++ b/lib_enc/enc_prm.c
@@ -329,7 +329,7 @@ void writeTCXparam(
const int16_t nbits_header,
const int16_t nbits_start,
const int16_t nbits_lpc,
- const int16_t *no_param_tns, /* i : number of TNS parameters per subframe */
+ const int16_t *no_param_tns, /* i : number of TNS parameters per subframe */
int16_t p_param[2], /* i/o: pointer to parameters from previous bs writing */
const int16_t target_bitsTCX10[2],
const int16_t pre_past_flag )
diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c
index 7179a14a8f4723f8770ea1766f06075c15c0d0cc..915d1653138aa14747daa20fa21e6574b912ced0 100644
--- a/lib_enc/ivas_dirac_enc.c
+++ b/lib_enc/ivas_dirac_enc.c
@@ -275,6 +275,7 @@ void ivas_dirac_enc_close(
return;
}
+
/*-------------------------------------------------------------------------
* ivas_dirac_enc()
*
@@ -304,9 +305,7 @@ void ivas_dirac_enc(
int16_t i, j, b, i_ts;
push_wmops( "ivas_dirac_enc" );
- ivas_dirac_param_est_enc( hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, ivas_format, hodirac_flag, hodirac_flag ? HOA2_CHANNELS : FOA_CHANNELS,
- &( hDirAC->mono_frame_count ),
- &( hQMetaData->dirac_mono_flag ) );
+ ivas_dirac_param_est_enc( hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, ivas_format, hodirac_flag, hodirac_flag ? HOA2_CHANNELS : FOA_CHANNELS, &( hDirAC->mono_frame_count ), &( hQMetaData->dirac_mono_flag ) );
if ( hQMetaData->q_direction->cfg.nbands > 0 )
{
@@ -409,6 +408,7 @@ void ivas_dirac_enc(
return;
}
+
/*-------------------------------------------------------------------------
* ivas_dirac_get_mono_flag()
*
@@ -521,6 +521,7 @@ static int16_t ivas_dirac_get_mono_flag(
}
}
+
/*-------------------------------------------------------------------------
* computeReferencePower_enc()
*
@@ -543,7 +544,6 @@ void computeReferencePower_enc(
{
int16_t brange[2];
int16_t ch_idx, i, j;
-
float reference_power_W[DIRAC_MAX_NBANDS];
if ( dirac_mono_flag != NULL )
@@ -576,6 +576,7 @@ void computeReferencePower_enc(
}
v_multc( reference_power, 0.5f, reference_power, num_freq_bands );
+
if ( ivas_format == SBA_FORMAT && ref_power_w == 1 )
{
for ( i = 0; i < num_freq_bands; i++ )
@@ -587,6 +588,7 @@ void computeReferencePower_enc(
return;
}
+
/*-------------------------------------------------------------------------
* ivas_dirac_param_est_enc()
*
@@ -627,9 +629,7 @@ void ivas_dirac_param_est_enc(
float norm_tmp;
int16_t mrange[2];
int16_t num_blocks;
-
float reference_power[CLDFB_NO_COL_MAX][DIRAC_NO_FB_BANDS_MAX];
-
float azi_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 };
float ele_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 };
float diff_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 };
@@ -704,7 +704,6 @@ void ivas_dirac_param_est_enc(
assert( pp_fr_real );
assert( pp_fr_imag );
#endif
-
for ( i = 0; i < nchan_fb_in; i++ )
{
mvr2r( &pp_fr_real[i][ts * l_ts], Cldfb_RealBuffer[i], l_ts );
diff --git a/lib_enc/ivas_enc_cov_handler.c b/lib_enc/ivas_enc_cov_handler.c
index 6dbbb202d551a9e718d54fa336a9d56bc4322c48..3ecb96c31fabdaf1f66254c81bf049a2c138a699 100644
--- a/lib_enc/ivas_enc_cov_handler.c
+++ b/lib_enc/ivas_enc_cov_handler.c
@@ -151,7 +151,8 @@ void ivas_spar_covar_enc_close(
*
*
*-----------------------------------------------------------------------------------------*/
-int16_t ivas_spar_get_activeW_flag(
+
+static int16_t ivas_spar_get_activeW_flag(
ivas_enc_cov_handler_state_t *hCovEnc,
float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
@@ -195,7 +196,6 @@ int16_t ivas_spar_get_activeW_flag(
{
hCovEnc->bb_var_lt[ch] = bb_var[ch];
}
- // hCovEnc->prior_var_flag = 0;
}
else
{
@@ -257,6 +257,7 @@ int16_t ivas_spar_get_activeW_flag(
return activeW_flag;
}
+
/*-----------------------------------------------------------------------------------------*
* Function ivas_enc_cov_handler_process()
*
@@ -303,8 +304,7 @@ void ivas_enc_cov_handler_process(
*res_ind = 0;
if ( nchan_transport > 1 && nchan_transport <= ( FOA_CHANNELS - 1 ) )
{
- *dyn_active_w_flag = ivas_spar_get_activeW_flag( hCovEnc, cov_real, cov_real, dtx_vad, num_ch, nchan_transport, res_ind,
- remix_order );
+ *dyn_active_w_flag = ivas_spar_get_activeW_flag( hCovEnc, cov_real, cov_real, dtx_vad, num_ch, nchan_transport, res_ind, remix_order );
}
else
{
diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c
index 9ee8effec32422cf3e3ffb49a15226f93d5c705f..ac67be6585a3de266e3e53a55d3027fbfedc9ac6 100755
--- a/lib_enc/ivas_ism_metadata_enc.c
+++ b/lib_enc/ivas_ism_metadata_enc.c
@@ -660,7 +660,7 @@ ivas_error ivas_ism_metadata_enc(
/* But send the flag with 1 bit */
push_next_indice( hBstr, hParamIsm->flag_noisy_speech, 1 );
- /* Loop over multiwave to write the object indices into bistream */
+ /* Loop over multiwave to write the object indices into bitstream */
for ( ch = 0; ch < MAX_PARAM_ISM_WAVE; ch++ )
{
for ( nbands = 0; nbands < hParamIsm->nbands; nbands++ )
@@ -672,7 +672,7 @@ ivas_error ivas_ism_metadata_enc(
}
}
- /* Loop over bands to write the power ratio's indices into bistream */
+ /* Loop over bands to write the power ratio's indices into bitstream */
for ( nbands = 0; nbands < hParamIsm->nbands; nbands++ )
{
for ( nblocks = 0; nblocks < hParamIsm->nblocks[nbands]; nblocks++ )
diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c
index f107dba99729483513887e7e9dead4cb13017865..24e7d119b17d0f522aa1de04f379f772ed5a0cff 100644
--- a/lib_enc/ivas_mc_paramupmix_enc.c
+++ b/lib_enc/ivas_mc_paramupmix_enc.c
@@ -556,8 +556,8 @@ static void quantize_alpha(
int16_t nq;
const float *data;
- nq = alpha_quant_table[quant_type].nquant;
- data = alpha_quant_table[quant_type].data;
+ nq = ivas_param_upmx_alpha_quant_table[quant_type].nquant;
+ data = ivas_param_upmx_alpha_quant_table[quant_type].data;
quantize_pars( nv, alpha, nq, data, aq, adeq );
@@ -577,7 +577,7 @@ static void quantize_beta(
float *bdeq )
{
int16_t iv, iq, iq0, iq1;
- ACPL_QUANT_TABLE *tables = beta_quant_table[quant_type];
+ const ACPL_QUANT_TABLE *tables = ivas_param_upmx_beta_quant_table[quant_type];
ACPL_QUANT_TABLE quant_table;
for ( iv = 0; iv < nv; iv++ )
@@ -612,7 +612,7 @@ static void quantize_beta(
}
}
- *pnq = beta_quant_table[quant_type][0].nquant;
+ *pnq = ivas_param_upmx_beta_quant_table[quant_type][0].nquant;
return;
}
diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c
index d1e7791b210209b5b737dad023a6f9e219d59c9e..84668daccaad4155753e18ecfc28948dd56df9ad 100644
--- a/lib_enc/ivas_qmetadata_enc.c
+++ b/lib_enc/ivas_qmetadata_enc.c
@@ -6150,11 +6150,11 @@ static int16_t find_optimal_GR_orders(
static int16_t write_stream_dct_coeffs_omasa(
- int16_t *q_idx, /* i: array of indexes to be written */
- const int16_t len_stream, /* i: array length */
- BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream */
- const int16_t first_line, /* i: is first line of the matrix? 1/0*/
- const int16_t low_bitrate_mode /* i: is low bitrate mode? if yes, limit the number of bits written */
+ int16_t *q_idx, /* i : array of indexes to be written */
+ const int16_t len_stream, /* i : array length */
+ BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream */
+ const int16_t first_line, /* i : is first line of the matrix? 1/0 */
+ const int16_t low_bitrate_mode /* i : is low bitrate mode? if yes, limit the number of bits written */
)
{
int16_t nb_bits = 0, bits_pos;
@@ -6174,6 +6174,7 @@ static int16_t write_stream_dct_coeffs_omasa(
{
max_bits = 1000;
}
+
/* write DCT 0 component */
/* write sign only if not the very first DCT coeff */
if ( first_line == 0 )
@@ -6196,7 +6197,6 @@ static int16_t write_stream_dct_coeffs_omasa(
nb_bits += BITS_MASA2TOTTAL_DCT0;
}
-
if ( q_idx[0] != 0 )
{
i_min = 1;
@@ -6261,6 +6261,7 @@ static int16_t write_stream_dct_coeffs_omasa(
}
}
}
+
if ( update_needed == 1 )
{
/* re-calculate */
diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c
index bfb744a626181a8beac6e2efb54f5afaf7b96a37..1d6f434ce447841fa52497ee348c9050b9a9943b 100644
--- a/lib_enc/ivas_spar_encoder.c
+++ b/lib_enc/ivas_spar_encoder.c
@@ -170,6 +170,7 @@ ivas_error ivas_spar_enc_open(
return error;
}
}
+
/* PCA handle */
hSpar->hPCA = NULL;
if ( hEncoderConfig->Opt_PCA_ON )
@@ -316,7 +317,6 @@ void ivas_spar_enc_close(
( *hSpar ) = NULL;
}
-
return;
}
@@ -447,11 +447,7 @@ static ivas_error ivas_spar_cov_md_process(
}
ivas_enc_cov_handler_process( hSpar->hCovEnc, ppIn_FR_real, ppIn_FR_imag, cov_real, cov_dtx_real, hSpar->hFbMixer->pFb, 0, hSpar->hFbMixer->pFb->filterbank_num_bands, nchan_inp, dtx_vad, transient_det, hSpar->hMdEnc->HOA_md_ind,
- &hSpar->hMdEnc->spar_md.res_ind,
- remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order],
- dyn_active_w_flag, nchan_transport, 1
-
- );
+ &hSpar->hMdEnc->spar_md.res_ind, remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order], dyn_active_w_flag, nchan_transport, 1 );
if ( nchan_transport > 1 && nchan_transport <= ( FOA_CHANNELS - 1 ) )
{
@@ -476,9 +472,7 @@ static ivas_error ivas_spar_cov_md_process(
if ( hSpar->hMdEnc->spar_hoa_md_flag == 0 )
{
- ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, hSpar->hFbMixer->prior_mixer,
- *dyn_active_w_flag,
- hQMetaData->dirac_mono_flag );
+ ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, hSpar->hFbMixer->prior_mixer, *dyn_active_w_flag, hQMetaData->dirac_mono_flag );
}
if ( hSpar->hMdEnc->spar_hoa_dirac2spar_md_flag )
@@ -526,9 +520,7 @@ static ivas_error ivas_spar_cov_md_process(
if ( hSpar->hMdEnc->spar_hoa_md_flag )
{
- ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, hSpar->hFbMixer->prior_mixer,
- *dyn_active_w_flag,
- hQMetaData->dirac_mono_flag );
+ ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, hSpar->hFbMixer->prior_mixer, *dyn_active_w_flag, hQMetaData->dirac_mono_flag );
}
return error;
@@ -694,9 +686,7 @@ static ivas_error ivas_spar_enc_process(
* Covariance and MD processing
*-----------------------------------------------------------------------------------------*/
- if ( ( error = ivas_spar_cov_md_process( hEncoderConfig, st_ivas->hSpar, st_ivas->hQMetaData, hMetaData, nchan_inp, sba_order, ppIn_FR_real, ppIn_FR_imag, transient_det, dtx_vad,
- nchan_transport,
- &dyn_active_w_flag ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_spar_cov_md_process( hEncoderConfig, st_ivas->hSpar, st_ivas->hQMetaData, hMetaData, nchan_inp, sba_order, ppIn_FR_real, ppIn_FR_imag, transient_det, dtx_vad, nchan_transport, &dyn_active_w_flag ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -855,7 +845,7 @@ static ivas_error ivas_spar_enc_process(
for ( i = 1; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++ )
{
- int idx = hSpar->hFbMixer->fb_cfg->remix_order[i];
+ int16_t idx = hSpar->hFbMixer->fb_cfg->remix_order[i];
/* delayed, reorderd and accumulated with (negative) prediction from W */
v_add( wyzx_del_buf[idx], p_pcm_tmp[i], p_pcm_tmp[i], num_del_samples );
@@ -881,9 +871,9 @@ static ivas_error ivas_spar_enc_process(
}
#ifdef DEBUG_LBR_SBA
- for ( int t = 0; t < 960; t++ )
+ for ( int16_t t = 0; t < 960; t++ )
{
- for ( int c = 0; c < hSpar->hFbMixer->fb_cfg->num_out_chans; c++ )
+ for ( int16_t c = 0; c < hSpar->hFbMixer->fb_cfg->num_out_chans; c++ )
{
float val = p_pcm_tmp[c][t]; // / MAX16B_FLT;
dbgwrite( &val, sizeof( float ), 1, 1, "int_enc_dmx.raw" );
@@ -972,10 +962,5 @@ static ivas_error ivas_spar_enc_process(
pop_wmops();
- /* ToDo: Commented for now */
- /*total_md_bits = hMetaData->nb_bits_tot - start_nb_bits;
- total_sba_bits = ivas_sba_get_max_md_bits( st_ivas );
- assert( total_md_bits <= total_sba_bits );*/
-
return error;
}
diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c
index f32644a286557dca8b2d5669ef56557864855b98..94ae5e0b1b391a509d54c5f351a8472f94d1381b 100644
--- a/lib_enc/ivas_spar_md_enc.c
+++ b/lib_enc/ivas_spar_md_enc.c
@@ -475,7 +475,7 @@ ivas_error ivas_spar_md_enc_process(
BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */
const int16_t dtx_vad,
const int16_t nchan_inp,
- const int16_t sba_order, /* i : Ambisonic (SBA) order */
+ const int16_t sba_order, /* i : Ambisonic (SBA) order */
float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH], /* i : prior mixer_matrix */
const int16_t dyn_active_w_flag, /* i : flag to indicate dynamic active W */
const int16_t dirac_mono_flag /* i : flag to indicate mono only mode in SBA */
@@ -592,11 +592,7 @@ ivas_error ivas_spar_md_enc_process(
}
}
- ivas_compute_spar_params( cov_real, dm_fv_re, 0, hMdEnc->mixer_mat, 0, nB, dtx_vad, num_ch,
- bands_bw, active_w,
- active_w_vlbr,
- &hMdEnc->spar_md_cfg, &hMdEnc->spar_md, Wscale, 0,
- dyn_active_w_flag );
+ ivas_compute_spar_params( cov_real, dm_fv_re, 0, hMdEnc->mixer_mat, 0, nB, dtx_vad, num_ch, bands_bw, active_w, active_w_vlbr, &hMdEnc->spar_md_cfg, &hMdEnc->spar_md, Wscale, 0, dyn_active_w_flag );
if ( dirac_mono_flag )
{
@@ -1800,6 +1796,7 @@ static void ivas_write_parameter_bitstream_dtx(
{
zero_pad_bits -= 1;
}
+
while ( zero_pad_bits > 0 )
{
j = min( zero_pad_bits, 16 );
diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h
index 89874ac92c3ddd901c7af937fab4a0acb2e80d32..023cc550f777e72723412258ae64ca4b4ad49e04 100644
--- a/lib_enc/ivas_stat_enc.h
+++ b/lib_enc/ivas_stat_enc.h
@@ -653,6 +653,7 @@ typedef struct ivas_enc_cov_handler_state_t
int16_t prior_dtx_present;
float bb_var_lt[FOA_CHANNELS];
int16_t prior_var_flag;
+
} ivas_enc_cov_handler_state_t;
diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c
index e2b1c09a340aec032cbe232169cd8468228cf18c..2ffc13d75d779e73ccc37561d3a4444c33e39672 100644
--- a/lib_enc/ivas_stereo_dmx_evs.c
+++ b/lib_enc/ivas_stereo_dmx_evs.c
@@ -175,7 +175,7 @@ void estimate_itd_wnd_fft(
static void calc_poc(
STEREO_DMX_EVS_POC_HANDLE hPOC, /* i/o: phase only correlation structure */
- STEREO_DMX_EVS_PHA_HANDLE hPHA, /* i/o : correlation filter structure */
+ STEREO_DMX_EVS_PHA_HANDLE hPHA, /* i/o: correlation filter structure */
const float wnd[], /* i : window coef */
const float rfft_coef[], /* i : RFFT coef */
const float specLr[], /* i : Lch real-part spectra */
diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c
index 3bb6d623fb8026193e44b82682dd5d03896ed604..38a445c76ba1f1e7fa635b052927fe527cca07d1 100644
--- a/lib_enc/lib_enc.c
+++ b/lib_enc/lib_enc.c
@@ -76,7 +76,7 @@ static int16_t getInputBufferSize( const Encoder_Struct *st_ivas );
static ivas_error doCommonConfigureChecks( IVAS_ENC_HANDLE hIvasEnc );
static ivas_error doCommonSetterChecks( IVAS_ENC_HANDLE hIvasEnc );
static ivas_error sanitizeBandwidth( const IVAS_ENC_HANDLE hIvasEnc );
-static ivas_error sanitizeBitrateISM( const ENCODER_CONFIG_HANDLE hEncoderConfig, const IVAS_ENC_HANDLE hIvasEnc );
+static ivas_error sanitizeBitrateISM( const ENCODER_CONFIG_HANDLE hEncoderConfig, const bool extMetadataApi );
static void init_encoder_config( ENCODER_CONFIG_HANDLE hEncoderConfig );
static void resetIsmMetadataProvidedFlags( IVAS_ENC_HANDLE hIvasEnc );
static ivas_error bandwidthApiToInternal( const IVAS_ENC_BANDWIDTH maxBandwidth, int16_t *internalMaxBandwidth );
@@ -884,7 +884,7 @@ static ivas_error configureEncoder(
}
else if ( hEncoderConfig->ivas_format == ISM_FORMAT )
{
- if ( ( error = sanitizeBitrateISM( hEncoderConfig, hIvasEnc ) ) != IVAS_ERR_OK )
+ if ( ( error = sanitizeBitrateISM( hEncoderConfig, hIvasEnc->extMetadataApi ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1906,7 +1906,7 @@ static ivas_error setBitrate(
if ( hEncoderConfig->ivas_format == ISM_FORMAT )
{
- if ( ( error = sanitizeBitrateISM( hEncoderConfig, hIvasEnc ) ) != IVAS_ERR_OK )
+ if ( ( error = sanitizeBitrateISM( hEncoderConfig, hIvasEnc->extMetadataApi ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -2147,7 +2147,7 @@ static ivas_error sanitizeBandwidth(
static ivas_error sanitizeBitrateISM(
const ENCODER_CONFIG_HANDLE hEncoderConfig,
- const IVAS_ENC_HANDLE hIvasEnc )
+ const bool extMetadataApi )
{
if ( hEncoderConfig->ivas_total_brate > IVAS_128k && hEncoderConfig->nchan_inp == 1 )
{
@@ -2179,7 +2179,7 @@ static ivas_error sanitizeBitrateISM(
return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 4 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate );
}
- if ( hIvasEnc->extMetadataApi )
+ if ( extMetadataApi )
{
hEncoderConfig->ism_extended_metadata_flag = ( hEncoderConfig->ivas_total_brate >= ISM_EXTENDED_METADATA_BRATE );
}
diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c
index 4a11f1b61f1d60360db9540f603d63b03c5b9b97..c035ef5ac4e1948a6cd385e5f4d3fd21cc49b985 100644
--- a/lib_enc/pre_proc.c
+++ b/lib_enc/pre_proc.c
@@ -381,7 +381,7 @@ void pre_proc(
}
else if ( st->rf_mode && st->core_brate != FRAME_NO_DATA && st->core_brate != SID_2k40 )
{
- /* the RF config is for (n- fec_offset)th frame that will be packed along with the n-th frame bistream */
+ /* the RF config is for (n- fec_offset)th frame that will be packed along with the n-th frame bitstream */
st->rf_mode = 1;
st->codec_mode = MODE2;
diff --git a/lib_enc/set_impulse.c b/lib_enc/set_impulse.c
index 4cafeea9e8a253a5b53ee88df65a4e91b0e5796d..2c8a7fdd080353a7880fb30d7ffd018b2f5f70dc 100644
--- a/lib_enc/set_impulse.c
+++ b/lib_enc/set_impulse.c
@@ -61,10 +61,10 @@ static void convolve_tc2( const float g[], const float h[], float y[], const int
/*---------------------------------------------------------------------------------------*
* Function set_impulse() for TC *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
- * Builds glottal codebook contribution based on glotal impulses positions finding. *
+ * Builds glottal codebook contribution based on glottal impulses positions finding. *
* *
- * Returns a position of the glotal impulse center and *
- * a number of the glotal impulse shape. *
+ * Returns a position of the glottal impulse center and *
+ * a number of the glottal impulse shape. *
* *
* |----| |----| xn *
* imp_pos-> || | imp_shape-> | g1 | | *
@@ -89,7 +89,7 @@ void set_impulse(
float exc[], /* o : adaptive codebook excitation */
float y1[], /* o : filtered adaptive codebook excitation */
int16_t *imp_shape, /* o : adaptive codebook index */
- int16_t *imp_pos, /* o : position of the glotal impulse center index */
+ int16_t *imp_pos, /* o : position of the glottal impulse center index */
float *gain_trans /* o : transition gain */
)
{
diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c
index 697520709f10c08f65fc9c870249e57e01f25bfe..8a48e0e2b82a2fb4f17758d5557a9b160c62ed60 100644
--- a/lib_rend/ivas_crend.c
+++ b/lib_rend/ivas_crend.c
@@ -53,7 +53,7 @@
* Initialize hHrtf handle
*------------------------------------------------------------------------*/
-static ivas_error ivas_hrtf_init(
+ivas_error ivas_hrtf_init(
HRTFS_DATA *hHrtf /* i/o: HRTF handle */
)
{
@@ -155,8 +155,8 @@ static ivas_error ivas_hrtf_close(
static ivas_error ivas_rend_initCrend(
CREND_WRAPPER *pCrend,
- const AUDIO_CONFIG inIvasConfig,
- const AUDIO_CONFIG outIvasConfig,
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig,
HRTFS_CREND_HANDLE hSetOfHRTF,
const int32_t output_Fs )
{
@@ -165,11 +165,6 @@ static ivas_error ivas_rend_initCrend(
IVAS_REND_AudioConfigType inConfigType;
HRTFS_HANDLE hHrtf;
ivas_error error;
- IVAS_REND_AudioConfig inConfig;
- IVAS_REND_AudioConfig outConfig;
-
- inConfig = getRendAudioConfigFromIvasAudioConfig( inIvasConfig );
- outConfig = getRendAudioConfigFromIvasAudioConfig( outIvasConfig );
inConfigType = getAudioConfigType( inConfig );
hHrtf = pCrend->hHrtfCrend;
@@ -180,9 +175,9 @@ static ivas_error ivas_rend_initCrend(
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported input config in Crend" );
}
- if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB
+ if ( outConfig != AUDIO_CONFIG_BINAURAL && outConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && outConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB
#ifdef SPLIT_REND_WITH_HEAD_ROT
- && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM
+ && outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM
#endif
)
{
@@ -197,7 +192,6 @@ static ivas_error ivas_rend_initCrend(
}
}
-
if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK )
{
return error;
@@ -218,7 +212,7 @@ static ivas_error ivas_rend_initCrend(
if ( output_Fs == 48000 )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s;
hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_48kHz;
@@ -233,7 +227,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[j];
hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[j];
@@ -251,7 +245,7 @@ static ivas_error ivas_rend_initCrend(
}
else if ( output_Fs == 32000 )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s;
hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_32kHz;
@@ -266,7 +260,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[j];
hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[j];
@@ -284,7 +278,7 @@ static ivas_error ivas_rend_initCrend(
}
else if ( output_Fs == 16000 )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s;
hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_16kHz;
@@ -299,7 +293,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[j];
hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[j];
@@ -322,23 +316,23 @@ static ivas_error ivas_rend_initCrend(
for ( i = 0; i < hHrtf->max_num_ir; i++ )
{
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 )
+ if ( inConfig == AUDIO_CONFIG_5_1 )
{
tmp = channelIndex_CICP6[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1 )
+ else if ( inConfig == AUDIO_CONFIG_7_1 )
{
tmp = channelIndex_CICP12[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 )
+ else if ( inConfig == AUDIO_CONFIG_5_1_2 )
{
tmp = channelIndex_CICP14[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 )
+ else if ( inConfig == AUDIO_CONFIG_5_1_4 )
{
tmp = channelIndex_CICP16[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1_4 )
+ else if ( inConfig == AUDIO_CONFIG_7_1_4 )
{
tmp = channelIndex_CICP19[i];
}
@@ -349,7 +343,7 @@ static ivas_error ivas_rend_initCrend(
if ( output_Fs == 48000 )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp];
}
@@ -360,7 +354,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_48kHz[tmp][j];
hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[tmp][j];
@@ -378,7 +372,7 @@ static ivas_error ivas_rend_initCrend(
}
else if ( output_Fs == 32000 )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp];
}
@@ -389,7 +383,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_32kHz[tmp][j];
hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[tmp][j];
@@ -407,7 +401,7 @@ static ivas_error ivas_rend_initCrend(
}
else if ( output_Fs == 16000 )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp];
}
@@ -418,7 +412,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_16kHz[tmp][j];
hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[tmp][j];
@@ -442,7 +436,7 @@ static ivas_error ivas_rend_initCrend(
}
else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS )
{
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 )
+ if ( inConfig == AUDIO_CONFIG_HOA3 )
{
if ( output_Fs == 48000 )
{
@@ -529,7 +523,7 @@ static ivas_error ivas_rend_initCrend(
return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" );
}
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_HOA2 )
+ else if ( inConfig == AUDIO_CONFIG_HOA2 )
{
if ( output_Fs == 48000 )
{
@@ -616,7 +610,7 @@ static ivas_error ivas_rend_initCrend(
return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" );
}
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_FOA )
+ else if ( inConfig == AUDIO_CONFIG_FOA )
{
if ( output_Fs == 48000 )
{
@@ -720,7 +714,7 @@ static ivas_error ivas_rend_initCrend(
hHrtf->max_num_ir -= 1; /* subtract LFE */
hHrtf->gain_lfe = GAIN_LFE;
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s;
hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations;
@@ -735,7 +729,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations_diffuse[j];
hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max_diffuse[j];
@@ -753,23 +747,23 @@ static ivas_error ivas_rend_initCrend(
for ( i = 0; i < hHrtf->max_num_ir; i++ )
{
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 )
+ if ( inConfig == AUDIO_CONFIG_5_1 )
{
tmp = channelIndex_CICP6[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1 )
+ else if ( inConfig == AUDIO_CONFIG_7_1 )
{
tmp = channelIndex_CICP12[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 )
+ else if ( inConfig == AUDIO_CONFIG_5_1_2 )
{
tmp = channelIndex_CICP14[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 )
+ else if ( inConfig == AUDIO_CONFIG_5_1_4 )
{
tmp = channelIndex_CICP16[i];
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1_4 )
+ else if ( inConfig == AUDIO_CONFIG_7_1_4 )
{
tmp = channelIndex_CICP19[i];
}
@@ -778,7 +772,7 @@ static ivas_error ivas_rend_initCrend(
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" );
}
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[tmp];
}
@@ -789,7 +783,7 @@ static ivas_error ivas_rend_initCrend(
for ( j = 0; j < BINAURAL_CHANNELS; j++ )
{
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j];
hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j];
@@ -808,7 +802,7 @@ static ivas_error ivas_rend_initCrend(
}
else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS )
{
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 )
+ if ( inConfig == AUDIO_CONFIG_HOA3 )
{
hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s;
hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations;
@@ -834,7 +828,7 @@ static ivas_error ivas_rend_initCrend(
hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_im[j];
}
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_HOA2 )
+ else if ( inConfig == AUDIO_CONFIG_HOA2 )
{
hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s;
hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations;
@@ -860,7 +854,7 @@ static ivas_error ivas_rend_initCrend(
hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_im[j];
}
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_FOA )
+ else if ( inConfig == AUDIO_CONFIG_FOA )
{
hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s;
hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations;
@@ -898,6 +892,7 @@ static ivas_error ivas_rend_initCrend(
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------
* ivas_shoebox_data_init()
*
@@ -927,6 +922,7 @@ static ivas_error ivas_shoebox_data_init(
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------
* ivas_shoebox_output_init()
*
@@ -953,13 +949,14 @@ static ivas_error ivas_shoebox_output_init(
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------
* ivas_shoebox_config_init()
*
* Initialize shoebox_config_t handle
*------------------------------------------------------------------------*/
-static ivas_error ivas_shoebox_config_init(
+static ivas_error ivas_shoebox_config_init_params(
shoebox_config_t *hShoeboxConfig /* i/o: shoebox_config_t handle */
)
{
@@ -986,6 +983,7 @@ static ivas_error ivas_shoebox_config_init(
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------
* ivas_shoebox_obj_init()
*
@@ -1030,18 +1028,19 @@ static ivas_error ivas_shoebox_obj_init(
hShoeboxObj->soundspeed = 0.0f;
hShoeboxObj->air_coeff = 0.0f;
- ivas_shoebox_config_init( &hShoeboxObj->cal );
+ ivas_shoebox_config_init_params( &hShoeboxObj->cal );
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------
- * ivas_er_init()
+ * ivas_er_init_handle()
*
* Initialize early reflections handle
*------------------------------------------------------------------------*/
-static ivas_error ivas_er_init(
+static ivas_error ivas_er_init_handle(
er_struct_t *reflections /* i/o: early reflections handle */
)
{
@@ -1052,7 +1051,7 @@ static ivas_error ivas_er_init(
return IVAS_ERR_WRONG_PARAMS;
}
- reflections->mode = AUDIO_CONFIG_INVALID;
+ reflections->audio_config = AUDIO_CONFIG_INVALID;
reflections->use_er = 0;
reflections->is_ready = 0;
reflections->circ_len = 0;
@@ -1085,6 +1084,7 @@ static ivas_error ivas_er_init(
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------------
* ivas_rend_initCrendWrapper()
*
@@ -1170,29 +1170,21 @@ ivas_error ivas_rend_initCrendWrapper(
ivas_error ivas_rend_openMultiBinCrend(
CREND_WRAPPER_HANDLE *pCrend,
- const IVAS_REND_AudioConfig inConfig,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig,
const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
const int32_t output_Fs )
{
ivas_error error;
- error = IVAS_ERR_OK;
- error = ivas_rend_openCrend( pCrend,
- getIvasAudioConfigFromRendAudioConfig( inConfig ),
- getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL /*hRendCfg*/,
- NULL,
- output_Fs
+
+ error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
pMultiBinPoseData->num_poses
#endif
);
- if ( error != IVAS_ERR_OK )
- {
- return error;
- }
+
return error;
}
#endif
@@ -1337,7 +1329,7 @@ ivas_error ivas_rend_openCrend(
{
return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Early Reflections" );
}
- ivas_er_init( hCrend->reflections );
+ ivas_er_init_handle( hCrend->reflections );
hCrend->reflections->use_er = hRendCfg->roomAcoustics.use_er;
hCrend->reflections->lowComplexity = hRendCfg->roomAcoustics.lowComplexity;
@@ -1346,10 +1338,10 @@ ivas_error ivas_rend_openCrend(
hCrend->reflections->max_frame_size = (int16_t) ( output_Fs / FRAMES_PER_SEC );
/* Init Shoebox */
- shoebox_config_init( &hCrend->reflections->shoebox_lib.cal, hRendCfg );
+ ivas_shoebox_config_init( &hCrend->reflections->shoebox_lib.cal, hRendCfg );
/* Init and compute Reflections */
- if ( ( error = er_init( hCrend->reflections, inConfig ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_er_init( hCrend->reflections, inConfig ) ) != IVAS_ERR_OK )
{
return error;
};
@@ -1372,6 +1364,7 @@ ivas_error ivas_rend_openCrend(
( *pCrend )->hCrend = hCrend;
#endif
}
+
return IVAS_ERR_OK;
}
@@ -1507,8 +1500,8 @@ void ivas_rend_closeCrend(
static ivas_error ivas_rend_crendConvolver(
const CREND_WRAPPER *pCrend,
- IVAS_REND_AudioConfig inConfig,
- IVAS_REND_AudioConfig outConfig,
+ AUDIO_CONFIG inConfig,
+ AUDIO_CONFIG outConfig,
float *pcm_in[],
float *pcm_out[],
const int32_t output_Fs,
@@ -1552,7 +1545,7 @@ static ivas_error ivas_rend_crendConvolver(
lfe_idx_in = -1;
if ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED )
{
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
lfe_idx_in = LFE_CHANNEL;
}
@@ -1698,11 +1691,8 @@ ivas_error ivas_rend_crendProcess(
int16_t nchan_out;
float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k];
float *p_pcm_tmp[BINAURAL_CHANNELS];
- AUDIO_CONFIG in_config;
IVAS_REND_AudioConfigType inConfigType;
ivas_error error;
- IVAS_REND_AudioConfig inRendConfig;
- IVAS_REND_AudioConfig outRendConfig;
CREND_HANDLE hCrend;
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -1728,14 +1718,9 @@ ivas_error ivas_rend_crendProcess(
push_wmops( "ivas_rend_crendProcess" );
- inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig );
- outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig );
-
- in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig );
-
- inConfigType = getAudioConfigType( inRendConfig );
+ inConfigType = getAudioConfigType( inConfig );
- if ( ( error = getAudioConfigNumChannels( outRendConfig, &nchan_out ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( outConfig, &nchan_out ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1755,11 +1740,7 @@ ivas_error ivas_rend_crendProcess(
{
if ( hCrend->reflections->use_er == 1 && hCrend->reflections->is_ready == 1 )
{
- if ( ( error = er_process( hCrend->reflections,
- subframe_len,
- subframe_idx,
- output,
- inRendConfig ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_er_process( hCrend->reflections, subframe_len, subframe_idx, output, inConfig ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1774,7 +1755,7 @@ ivas_error ivas_rend_crendProcess(
MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL
SBA SPAR -> BINAURAL or BINAURAL_ROOM
*/
- if ( in_config == AUDIO_CONFIG_FOA || in_config == AUDIO_CONFIG_HOA2 || in_config == AUDIO_CONFIG_HOA3 )
+ if ( inConfig == AUDIO_CONFIG_FOA || inConfig == AUDIO_CONFIG_HOA2 || inConfig == AUDIO_CONFIG_HOA3 )
{
rotateFrame_shd( hCombinedOrientationData, output, subframe_len, *hIntSetup, subframe_idx );
}
@@ -1785,9 +1766,9 @@ ivas_error ivas_rend_crendProcess(
}
}
- if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) )
+ if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED || inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS )
{
- if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, output, p_pcm_tmp, output_Fs, subframe_idx
+ if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, output, p_pcm_tmp, output_Fs, subframe_idx
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
pos_idx
@@ -1800,9 +1781,9 @@ ivas_error ivas_rend_crendProcess(
if ( hCrend->hReverb != NULL )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, in_config, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK )
#else
- if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, in_config, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, inConfig, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK )
#endif
{
return error;
@@ -1853,14 +1834,11 @@ ivas_error ivas_rend_crendProcessSubframe(
float *tc_local[MAX_TRANSPORT_CHANNELS];
float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k];
float *p_pcm_tmp[BINAURAL_CHANNELS];
- AUDIO_CONFIG in_config;
IVAS_REND_AudioConfigType inConfigType;
ivas_error error;
- IVAS_REND_AudioConfig inRendConfig;
- IVAS_REND_AudioConfig outRendConfig;
int8_t combinedOrientationEnabled;
-
CREND_HANDLE hCrend;
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
hCrend = pCrend->hCrend[0];
#else
@@ -1882,18 +1860,14 @@ ivas_error ivas_rend_crendProcessSubframe(
push_wmops( "ivas_rend_crendProcessSubframe" );
- inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig );
- outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig );
-
- in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig );
- inConfigType = getAudioConfigType( inRendConfig );
+ inConfigType = getAudioConfigType( inConfig );
- if ( ( error = getAudioConfigNumChannels( outRendConfig, &nchan_out ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( outConfig, &nchan_out ) ) != IVAS_ERR_OK )
{
return error;
}
- if ( ( error = getAudioConfigNumChannels( inRendConfig, &nchan_in ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1914,6 +1888,7 @@ ivas_error ivas_rend_crendProcessSubframe(
slots_to_render = min( hTcBuffer->num_slots - hTcBuffer->slots_rendered, n_samples_to_render / slot_size );
first_sf = hTcBuffer->subframes_rendered;
last_sf = first_sf;
+
while ( slots_to_render > 0 )
{
slots_to_render -= hTcBuffer->subframe_nbslots[last_sf];
@@ -1929,11 +1904,7 @@ ivas_error ivas_rend_crendProcessSubframe(
{
if ( hCrend->reflections->use_er == 1 && hCrend->reflections->is_ready == 1 )
{
- if ( ( error = er_process( hCrend->reflections,
- subframe_len,
- subframe_idx,
- output,
- inRendConfig ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_er_process( hCrend->reflections, subframe_len, subframe_idx, output, inConfig ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1946,27 +1917,23 @@ ivas_error ivas_rend_crendProcessSubframe(
MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL
SBA SPAR -> BINAURAL or BINAURAL_ROOM
*/
- if ( in_config == AUDIO_CONFIG_FOA || in_config == AUDIO_CONFIG_HOA2 || in_config == AUDIO_CONFIG_HOA3 )
+ if ( inConfig == AUDIO_CONFIG_FOA || inConfig == AUDIO_CONFIG_HOA2 || inConfig == AUDIO_CONFIG_HOA3 )
{
- rotateFrame_shd(
- hCombinedOrientationData,
- tc_local, subframe_len, *hIntSetup, 0 );
+ rotateFrame_shd( hCombinedOrientationData, tc_local, subframe_len, *hIntSetup, 0 );
}
/* Rotation in SD for MC -> BINAURAL_ROOM */
else if ( ( hIntSetup != NULL ) && hIntSetup->is_loudspeaker_setup )
{
- rotateFrame_sd(
- hCombinedOrientationData,
- tc_local, subframe_len, *hIntSetup, hEFAPdata, 0 );
+ rotateFrame_sd( hCombinedOrientationData, tc_local, subframe_len, *hIntSetup, hEFAPdata, 0 );
}
}
if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, tc_local, p_pcm_tmp, output_Fs, 0, 0 ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0, 0 ) ) != IVAS_ERR_OK )
#else
- if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, tc_local, p_pcm_tmp, output_Fs, 0 ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0 ) ) != IVAS_ERR_OK )
#endif
{
@@ -1975,7 +1942,7 @@ ivas_error ivas_rend_crendProcessSubframe(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( pCrend->hCrend[0]->hReverb != NULL )
{
- if ( ( error = ivas_reverb_process( pCrend->hCrend[0]->hReverb, in_config, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_reverb_process( pCrend->hCrend[0]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1983,7 +1950,7 @@ ivas_error ivas_rend_crendProcessSubframe(
#else
if ( pCrend->hCrend->hReverb != NULL )
{
- if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, in_config, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK )
{
return error;
}
diff --git a/lib_rend/ivas_dirac_ana.c b/lib_rend/ivas_dirac_ana.c
index 73812f6295d236644450978d444413871fce7caa..8e07698fbd1c3171d3d5994f614e72c66283439b 100644
--- a/lib_rend/ivas_dirac_ana.c
+++ b/lib_rend/ivas_dirac_ana.c
@@ -109,11 +109,17 @@ ivas_error ivas_dirac_ana_open(
/* intensity 3-dim */
for ( i = 0; i < DIRAC_NUM_DIMS; i++ )
{
- hDirAC->direction_vector_m[i] = (float **) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) );
+ if ( ( hDirAC->direction_vector_m[i] = (float **) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ) ) == NULL )
+ {
+ return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) );
+ }
for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ )
{
- hDirAC->direction_vector_m[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) );
+ if ( ( hDirAC->direction_vector_m[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) ) ) == NULL )
+ {
+ return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) );
+ }
set_zero( hDirAC->direction_vector_m[i][j], MASA_FREQUENCY_BANDS );
}
}
@@ -122,7 +128,10 @@ ivas_error ivas_dirac_ana_open(
{
for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ )
{
- hDirAC->buffer_intensity_real[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) );
+ if ( ( hDirAC->buffer_intensity_real[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) ) ) == NULL )
+ {
+ return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) );
+ }
set_zero( hDirAC->buffer_intensity_real[i][j], MASA_FREQUENCY_BANDS );
}
}
diff --git a/lib_rend/ivas_limiter.c b/lib_rend/ivas_limiter.c
index 106c4330341b0e42e8b30ab1db2470cd31d62740..0953e8a825dc3aecfe8a51b004da4a2400884199 100644
--- a/lib_rend/ivas_limiter.c
+++ b/lib_rend/ivas_limiter.c
@@ -101,9 +101,10 @@ static int16_t detect_strong_saturations(
*-------------------------------------------------------------------*/
/*! r : limiter struct handle */
-IVAS_LIMITER_HANDLE ivas_limiter_open(
- const int16_t max_num_channels, /* i : maximum number of I/O channels to be processed */
- const int32_t sampling_rate /* i : sampling rate for processing */
+ivas_error ivas_limiter_open(
+ IVAS_LIMITER_HANDLE *hLimiter_out, /* o : limiter struct handle */
+ const int16_t max_num_channels, /* i : maximum number of I/O channels to be processed */
+ const int32_t sampling_rate /* i : sampling rate for processing */
)
{
int16_t i;
@@ -111,17 +112,21 @@ IVAS_LIMITER_HANDLE ivas_limiter_open(
if ( max_num_channels <= 0 || sampling_rate <= 0 )
{
- return NULL;
+ return ( IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Wrong parameters for Limiter\n" ) );
}
if ( ( hLimiter = malloc( sizeof( IVAS_LIMITER ) ) ) == NULL )
{
- return NULL;
+ return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Limiter handle\n" ) );
}
hLimiter->max_num_channels = max_num_channels;
hLimiter->num_channels = max_num_channels;
- hLimiter->channel_ptrs = malloc( max_num_channels * sizeof( float * ) );
+
+ if ( ( hLimiter->channel_ptrs = malloc( max_num_channels * sizeof( float * ) ) ) == NULL )
+ {
+ return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Limiter handle\n" ) );
+ }
hLimiter->sampling_rate = sampling_rate;
hLimiter->gain = 1.f;
hLimiter->release_heuristic = 0.f;
@@ -136,7 +141,9 @@ IVAS_LIMITER_HANDLE ivas_limiter_open(
hLimiter->channel_ptrs[i] = NULL;
}
- return hLimiter;
+ *hLimiter_out = hLimiter;
+
+ return IVAS_ERR_OK;
}
diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c
index b90b02ed14ee5cfa2325f35ede25880b38f8b314..43a91b348977bc92aa89885d18fe416fdf829ec9 100644
--- a/lib_rend/ivas_mcmasa_ana.c
+++ b/lib_rend/ivas_mcmasa_ana.c
@@ -83,9 +83,9 @@ static void computeEvenLayout( const float *ls_azimuth, float *ls_azimuth_even,
*--------------------------------------------------------------------------*/
ivas_error ivas_mcmasa_ana_open(
- MCMASA_ANA_HANDLE *hMcMasaPtr, /* i/o: McMASA data handle pointer */
- const IVAS_REND_AudioConfig inConfig, /* i : Input config */
- int32_t input_Fs /* i : Sampling frequency */
+ MCMASA_ANA_HANDLE *hMcMasaPtr, /* i/o: McMASA data handle pointer */
+ const AUDIO_CONFIG inConfig, /* i : Input config */
+ int32_t input_Fs /* i : Sampling frequency */
)
{
int16_t i, j;
@@ -106,7 +106,7 @@ ivas_error ivas_mcmasa_ana_open(
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for McMasa\n" ) );
}
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 )
+ if ( inConfig == AUDIO_CONFIG_5_1 )
{
nchan_inp = 6;
mvr2r( ls_azimuth_CICP6, ls_azimuth, nchan_inp - 1 );
@@ -114,7 +114,7 @@ ivas_error ivas_mcmasa_ana_open(
hMcMasa->numHorizontalChannels = 5;
hMcMasa->isHorizontalSetup = 1;
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1 )
+ else if ( inConfig == AUDIO_CONFIG_7_1 )
{
nchan_inp = 8;
mvr2r( ls_azimuth_CICP12, ls_azimuth, nchan_inp - 1 );
@@ -122,7 +122,7 @@ ivas_error ivas_mcmasa_ana_open(
hMcMasa->numHorizontalChannels = 7;
hMcMasa->isHorizontalSetup = 1;
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 )
+ else if ( inConfig == AUDIO_CONFIG_5_1_2 )
{
nchan_inp = 8;
mvr2r( ls_azimuth_CICP14, ls_azimuth, nchan_inp - 1 );
@@ -130,7 +130,7 @@ ivas_error ivas_mcmasa_ana_open(
hMcMasa->numHorizontalChannels = 5;
hMcMasa->isHorizontalSetup = 0;
}
- else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 )
+ else if ( inConfig == AUDIO_CONFIG_5_1_4 )
{
nchan_inp = 10;
mvr2r( ls_azimuth_CICP16, ls_azimuth, nchan_inp - 1 );
diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c
index 7af15973cdd22da7260fe1c78ac93055f6f68d5a..abb9d568de05f5af74f3720e8b655b5ee7366afa 100644
--- a/lib_rend/ivas_objectRenderer.c
+++ b/lib_rend/ivas_objectRenderer.c
@@ -465,7 +465,7 @@ static void TDREND_Clear_Update_flags(
*---------------------------------------------------------------------*/
void TDREND_Update_object_positions(
- BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */
+ BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */
const int16_t num_src, /* i : number of sources to render */
const IVAS_FORMAT in_format, /* i : Format of input sources */
const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */
@@ -598,7 +598,7 @@ void TDREND_Update_listener_orientation(
ivas_error ivas_td_binaural_open_ext(
TDREND_WRAPPER *pTDRend,
- IVAS_REND_AudioConfig inConfig,
+ AUDIO_CONFIG inConfig,
RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */
LSSETUP_CUSTOM_STRUCT *customLsInput,
const int32_t outFs )
@@ -611,7 +611,7 @@ ivas_error ivas_td_binaural_open_ext(
float *directivity = NULL;
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_transport ) ) != IVAS_ERR_OK )
{
@@ -623,14 +623,13 @@ ivas_error ivas_td_binaural_open_ext(
nchan_transport = customLsInput->num_spk;
}
- transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig );
+ transport_config = inConfig;
ivas_format = ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? MC_FORMAT : ISM_FORMAT;
-#ifdef SPLIT_REND_WITH_HEAD_ROT
hTransSetup.ls_azimuth = NULL;
hTransSetup.ls_elevation = NULL;
-#endif
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+
+ if ( inConfig == AUDIO_CONFIG_LS_CUSTOM )
{
hTransSetup.ls_azimuth = customLsInput->ls_azimuth;
hTransSetup.ls_elevation = customLsInput->ls_elevation;
@@ -654,15 +653,15 @@ ivas_error ivas_td_binaural_open_ext(
*---------------------------------------------------------------------*/
ivas_error ivas_td_binaural_renderer_ext(
- const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */
- const IVAS_REND_AudioConfig inConfig, /* i : Input audio configuration */
- const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */
- const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */
- const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */
- const REVERB_HANDLE hReverb, /* i : Reverberator handle */
- const int16_t ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */
- const int16_t output_frame, /* i : output frame length */
- float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */
+ const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */
+ const AUDIO_CONFIG inConfig, /* i : Input audio configuration */
+ const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */
+ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */
+ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */
+ const REVERB_HANDLE hReverb, /* i : Reverberator handle */
+ const int16_t ism_md_subframe_update_ext, /* i : Metadata Delay in subframes to sync with audio delay */
+ const int16_t output_frame, /* i : output frame length */
+ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */
)
{
ISM_METADATA_FRAME hIsmMetaDataFrame;
@@ -691,8 +690,8 @@ ivas_error ivas_td_binaural_renderer_ext(
if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED )
{
ivas_format = MC_FORMAT;
- transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig );
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ transport_config = inConfig;
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = getAudioConfigNumChannels( inConfig, &num_src ) ) != IVAS_ERR_OK )
{
diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h
index 00f2c6b3437ebf5d026bb9a82220f1a15e504631..c519476b1352b739361261ec7653b3ce07d06e1b 100644
--- a/lib_rend/ivas_prot_rend.h
+++ b/lib_rend/ivas_prot_rend.h
@@ -47,20 +47,14 @@
*----------------------------------------------------------------------------------*/
IVAS_REND_AudioConfigType getAudioConfigType(
- const IVAS_REND_AudioConfig config
+ const AUDIO_CONFIG config
);
ivas_error getAudioConfigNumChannels(
- const IVAS_REND_AudioConfig config,
+ const AUDIO_CONFIG config,
int16_t *numChannels
);
-AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig(
- IVAS_REND_AudioConfig rendConfig );
-
-IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig(
- AUDIO_CONFIG config );
-
/*----------------------------------------------------------------------------------*
* output setup prototypes
@@ -88,8 +82,9 @@ int16_t ivas_get_nchan_buffers_dec(
* Limiter prototypes
*----------------------------------------------------------------------------------*/
-/*! r: limiter struct handle */
-IVAS_LIMITER_HANDLE ivas_limiter_open(
+
+ivas_error ivas_limiter_open(
+ IVAS_LIMITER_HANDLE *hLimiter_out, /* o : limiter struct handle */
const int16_t num_channels, /* i : number of I/O channels */
const int32_t sampling_rate /* i : sampling rate for processing */
);
@@ -158,7 +153,6 @@ ivas_error ivas_sba_get_hoa_dec_matrix(
const int16_t ambisonics_order /* i : Ambisonics order */
);
-
void ivas_dirac_dec_binaural_sba_gain(
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
float *output[], /* i/o: synthesized core-coder transport channels/DirAC output */
@@ -494,7 +488,7 @@ void ivas_dirac_dec_get_frequency_axis(
);
ivas_error ivas_spat_hSpatParamRendCom_config(
- SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out, /* i/o: IVAS decoder structure */
+ SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out,
const DIRAC_CONFIG_FLAG flag_config_inp, /* i/ : Flag determining if we open or reconfigure the DirAC decoder */
const int16_t dec_param_estim_flag,
const IVAS_FORMAT ivas_format,
@@ -595,12 +589,12 @@ ivas_error ivas_td_binaural_renderer_unwrap(
ivas_error ivas_td_binaural_renderer_ext(
const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */
- const IVAS_REND_AudioConfig inConfig, /* i : Input audio configuration */
+ const AUDIO_CONFIG inConfig, /* i : Input audio configuration */
const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */
- const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */
+ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData,/* i : Combined head and external orientations */
const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */
const REVERB_HANDLE hReverb, /* i : Reverberator handle */
- const int16_t ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */
+ const int16_t ism_md_subframe_update_ext, /* i : Metadata Delay in subframes to sync with audio delay */
const int16_t output_frame, /* i : output frame length */
float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */
);
@@ -619,7 +613,7 @@ ivas_error ivas_td_binaural_open_unwrap(
ivas_error ivas_td_binaural_open_ext(
TDREND_WRAPPER *pTDRend,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */
LSSETUP_CUSTOM_STRUCT *customLsInput,
const int32_t output_Fs
@@ -629,7 +623,6 @@ void ivas_td_binaural_close(
BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd /* i/o: TD binaural object renderer handle */
);
-
ivas_error TDREND_GetMix(
BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */
float *output[], /* i/o: ISM object synth / rendered output in 0,1 */
@@ -646,7 +639,7 @@ void TDREND_Update_listener_orientation(
);
void TDREND_Update_object_positions(
- BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */
+ BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */
const int16_t num_src, /* i : number of sources to render */
const IVAS_FORMAT in_format, /* i : Format of input sources */
const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */
@@ -860,6 +853,10 @@ void ivas_rend_closeCrend(
#endif
);
+ivas_error ivas_hrtf_init(
+ HRTFS_DATA *hHrtf /* i/o: HRTF handle */
+);
+
ivas_error ivas_rend_initCrendWrapper(
CREND_WRAPPER_HANDLE *pCrend
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -871,8 +868,8 @@ ivas_error ivas_rend_initCrendWrapper(
#ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_error ivas_rend_openMultiBinCrend(
CREND_WRAPPER_HANDLE *pCrend,
- const IVAS_REND_AudioConfig inConfig,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig,
const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
const int32_t output_Fs );
@@ -888,13 +885,13 @@ void ivas_rend_CldfbMultiBinRendProcess(
ivas_error ivas_rend_openCldfb(
HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS],
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const int32_t output_Fs );
ivas_error ivas_rend_openCldfbRend(
CLDFB_REND_WRAPPER *pCldfbRend,
- const IVAS_REND_AudioConfig inConfig,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig,
const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
const int32_t output_Fs );
@@ -923,7 +920,6 @@ IVAS_QUATERNION ivas_split_rend_get_sf_rot_data(
const IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME],
int16_t subframe_idx );
-void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend );
int32_t ivas_get_lcld_bitrate( const int32_t SplitRendBitRate, const IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode );
int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, const int16_t pcm_out );
int32_t ivas_get_lc3plus_bitrate( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode );
@@ -1027,7 +1023,7 @@ ivas_error ivas_reverb_open(
REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */
const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */
const HRTFS_HANDLE hHrtf, /* i : HRTF handle */
- const float *lr_energy_and_iac[], /* precomuputed lr energies and iac*/
+ const float *lr_energy_and_iac[], /* i : precomuputed lr energies and iac */
RENDER_CONFIG_DATA *pConfig, /* i : Reverb configuration */
const int32_t output_Fs /* i : output sampling rate */
);
@@ -1223,58 +1219,53 @@ void ivas_reverb_get_hrtf_set_properties(
* Shoebox Prototypes
*-----------------------------------------------------------------------------------*/
-void shoebox_config_init(
+void ivas_shoebox_config_init(
shoebox_config_t *cal,
RENDER_CONFIG_HANDLE pConfig
);
-void shoebox_get_config(
- const shoebox_obj_t *obj,
- shoebox_config_t *s
-);
-
-void shoebox_init(
+void ivas_shoebox_init(
shoebox_obj_t *obj,
shoebox_config_t *cal
);
-void shoebox_set_scene (
+void ivas_shoebox_set_scene (
shoebox_obj_t *obj,
shoebox_output_t *ER_PARAMS,
const float list_pos[3],
const float src_pos_data[],
- uint16_t isCartesian,
- uint16_t isRelative
+ const uint16_t isCartesian,
+ const uint16_t isRelative
);
/*---------------------------------------------------------------------------------*
- * Reflections compute and process Prototypes
+ * Early reflections prototypes
*-----------------------------------------------------------------------------------*/
-ivas_error er_init(
+ivas_error ivas_er_init(
er_struct_t *reflections,
- AUDIO_CONFIG inConfig
+ const AUDIO_CONFIG inConfig
);
-ivas_error er_set_reflections_mode(
+ivas_error ivas_er_set_reflections_mode(
er_struct_t *reflections,
- AUDIO_CONFIG mode
+ const AUDIO_CONFIG inConfig
);
-ivas_error er_compute_reflections(
+ivas_error ivas_er_compute_reflections(
er_struct_t *reflections
);
-ivas_error er_encoder_init(
+ivas_error ivas_er_encoder_init(
er_struct_t *reflections
);
-ivas_error er_process(
+ivas_error ivas_er_process(
er_struct_t *reflections,
- int16_t frame_size,
- int16_t subframe_idx,
+ const int16_t frame_size,
+ const int16_t subframe_idx,
float **io,
- IVAS_REND_AudioConfig inConfig
+ const AUDIO_CONFIG inConfig
);
@@ -1297,9 +1288,13 @@ void Euler2Quat(
IVAS_QUATERNION *quat /* o : quaternion describing the rotation */
);
-float deg2rad( float degrees );
+float deg2rad(
+ float degrees
+);
-float rad2deg( float radians );
+float rad2deg(
+ float radians
+);
void QuatToRotMat(
const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */
@@ -1308,10 +1303,10 @@ void QuatToRotMat(
#ifdef SPLIT_REND_WITH_HEAD_ROT
void Quat2EulerDegree(
- const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */
- float *yaw, /* o : yaw */
- float *pitch, /* o : pitch */
- float *roll /* o : roll */
+ const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */
+ float *yaw, /* o : yaw */
+ float *pitch, /* o : pitch */
+ float *roll /* o : roll */
);
#endif
@@ -1484,7 +1479,7 @@ ivas_error ivas_orient_trk_Process(
void ivas_set_split_rend_setup(
IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend,
IVAS_SPLIT_REND_CONFIG_DATA *hSplitBinConfig,
- COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */
+ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */
IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits );
void ivas_init_split_rend_handles(
@@ -1671,7 +1666,7 @@ void ivas_SplitRenderer_PostRenderer(
ivas_error ivas_mcmasa_ana_open(
MCMASA_ANA_HANDLE *hMcMasaPtr, /* i/o: McMASA data handle pointer */
- const IVAS_REND_AudioConfig inConfig, /* i : Input config */
+ const AUDIO_CONFIG inConfig, /* i : Input config */
int32_t input_Fs /* i : Sampling frequency */
);
@@ -1776,9 +1771,9 @@ void masaPrerendClose(
#ifdef SPLIT_REND_WITH_HEAD_ROT
void ivas_split_rend_choose_default_codec(
IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */
- int16_t isRenderingInTd, /* i : flag: is rendering done in TD? */
- int16_t pcm_out /*i : flag to indicate PCM output*/
- );
+ int16_t isRenderingInTd, /* i : flag: is rendering done in TD? */
+ int16_t pcm_out /*i : flag to indicate PCM output*/
+);
#endif
/* clang-format on */
diff --git a/lib_rend/ivas_reflections.c b/lib_rend/ivas_reflections.c
index f3c996ffd65bbc48fbed0c6c156b09ee33e0aced..bf3bbbb34cfd805294d9ee8d08163fc7c44a495c 100644
--- a/lib_rend/ivas_reflections.c
+++ b/lib_rend/ivas_reflections.c
@@ -31,9 +31,7 @@
*******************************************************************************************************/
#include "options.h"
-
-
-#include
+#include
#include
#include "prot.h"
#include "rom_dec.h"
@@ -48,30 +46,38 @@
#include "debug.h"
#endif
-uint16_t LC_mixing_5_1[5] = { 0, 1, 2, 0, 1 };
-uint16_t LC_mixing_7_1[7] = { 0, 1, 2, 3, 4, 3, 4 };
-uint16_t LC_mixing_5_1_2[7] = { 0, 1, 2, 3, 4, 0, 1 };
-uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 2, 3 };
-uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 2, 3 };
/*-----------------------------------------------------------------------------------------*
- * Function er_init
+ * Local constants/tabels
+ *-----------------------------------------------------------------------------------------*/
+
+static uint16_t LC_mixing_5_1[5] = { 0, 1, 2, 0, 1 };
+
+static uint16_t LC_mixing_7_1[7] = { 0, 1, 2, 3, 4, 3, 4 };
+
+static uint16_t LC_mixing_5_1_2[7] = { 0, 1, 2, 3, 4, 0, 1 };
+
+static uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 2, 3 };
+
+static uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 2, 3 };
+
+
+/*-----------------------------------------------------------------------------------------*
+ * Function ivas_er_init()
*
* Initializes the reflections data structure according to the requested input config.
*-----------------------------------------------------------------------------------------*/
-
-ivas_error er_init(
+ivas_error ivas_er_init(
er_struct_t *reflections,
- AUDIO_CONFIG mode )
+ const AUDIO_CONFIG inConfig )
{
ivas_error error;
- IVAS_REND_AudioConfig outRendConfig;
uint8_t i;
/* Set to defaults for shoebox */
reflections->is_ready = 0;
- reflections->mode = AUDIO_CONFIG_INVALID;
+ reflections->audio_config = AUDIO_CONFIG_INVALID;
reflections->is_cartesian = 0;
reflections->is_relative = 1;
reflections->shoebox_data.n_ref = ER_NUM_REF;
@@ -86,35 +92,33 @@ ivas_error er_init(
}
/* Init Shoebox */
- shoebox_init( &reflections->shoebox_lib, &reflections->shoebox_lib.cal );
+ ivas_shoebox_init( &reflections->shoebox_lib, &reflections->shoebox_lib.cal );
/* Set mode */
- if ( ( error = er_set_reflections_mode( reflections, mode ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_er_set_reflections_mode( reflections, inConfig ) ) != IVAS_ERR_OK )
{
return error;
}
/* Compute the static reflections (first frame) */
- if ( ( error = er_compute_reflections( reflections ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_er_compute_reflections( reflections ) ) != IVAS_ERR_OK )
{
return error;
}
- reflections->closest_ch_idx = (uint16_t *) malloc( reflections->n_total_reflections * sizeof( uint16_t ) );
- if ( !reflections->closest_ch_idx )
+ if ( ( reflections->closest_ch_idx = (uint16_t *) malloc( reflections->n_total_reflections * sizeof( uint16_t ) ) ) == NULL )
{
return IVAS_ERR_FAILED_ALLOC;
}
set_s( (int16_t *) reflections->closest_ch_idx, 0, reflections->n_total_reflections );
- outRendConfig = getRendAudioConfigFromIvasAudioConfig( reflections->mode );
- if ( ( error = getAudioConfigNumChannels( outRendConfig, &( reflections->nchan_out ) ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( reflections->audio_config, &( reflections->nchan_out ) ) ) != IVAS_ERR_OK )
{
return error;
}
/* Initialize Encoder */
- if ( ( error = er_encoder_init( reflections ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_er_encoder_init( reflections ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -124,29 +128,31 @@ ivas_error er_init(
return error;
}
+
+
/*-----------------------------------------------------------------------------------------*
- Function er_set_reflections_mode
+ Function ivas_er_set_reflections_mode()
Function sets the ER source positions based on the audio config
*-----------------------------------------------------------------------------------------*/
-ivas_error er_set_reflections_mode(
+ivas_error ivas_er_set_reflections_mode(
er_struct_t *reflections,
- AUDIO_CONFIG mode )
+ const AUDIO_CONFIG inConfig )
{
ivas_error error;
uint16_t ch;
error = IVAS_ERR_OK;
- if ( reflections->mode == mode )
+ if ( reflections->audio_config == inConfig )
{
return error;
}
reflections->is_ready = 0;
- reflections->mode = mode;
+ reflections->audio_config = inConfig;
- switch ( reflections->mode )
+ switch ( reflections->audio_config )
{
case AUDIO_CONFIG_MONO:
reflections->shoebox_data.n_sources = 1;
@@ -232,7 +238,7 @@ ivas_error er_set_reflections_mode(
reflections->use_er = 0;
break;
default:
- reflections->mode = AUDIO_CONFIG_INVALID;
+ reflections->audio_config = AUDIO_CONFIG_INVALID;
return IVAS_ERROR( IVAS_ERR_INVALID_ER_PARAM, "Unsupported reflections mode" );
}
@@ -241,12 +247,12 @@ ivas_error er_set_reflections_mode(
/*-----------------------------------------------------------------------------------------*
- Function er_encoder_init
+ Function ivas_er_encoder_init()
Function that initializes the er encoder
*-----------------------------------------------------------------------------------------*/
-ivas_error er_encoder_init(
+ivas_error ivas_er_encoder_init(
er_struct_t *reflections )
{
ivas_error error = IVAS_ERR_OK;
@@ -259,19 +265,18 @@ ivas_error er_encoder_init(
if ( !reflections )
{
- error = IVAS_ERR_FAILED_ALLOC;
- return error;
+ return IVAS_ERR_FAILED_ALLOC;
}
- if ( getAudioConfigType( getRendAudioConfigFromIvasAudioConfig( reflections->mode ) ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED )
+ if ( getAudioConfigType( reflections->audio_config ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED )
{
/* Compute MC-snap location (closest channel position to reflection direction) */
for ( i = 0; i < reflections->n_total_reflections; i++ )
{
/* Compute cartesian points for reflection (from degrees) */
- p_x = ER_RADIUS * ( (float) cos( deg2rad( reflections->shoebox_data.el_angle.data[i] ) ) * (float) cos( deg2rad( reflections->shoebox_data.az_angle.data[i] ) ) );
- p_y = ER_RADIUS * ( (float) cos( deg2rad( reflections->shoebox_data.el_angle.data[i] ) ) * (float) sin( deg2rad( reflections->shoebox_data.az_angle.data[i] ) ) );
- p_z = ER_RADIUS * ( (float) sin( deg2rad( reflections->shoebox_data.el_angle.data[i] ) ) );
+ p_x = ER_RADIUS * ( cosf( deg2rad( reflections->shoebox_data.el_angle.data[i] ) ) * cosf( deg2rad( reflections->shoebox_data.az_angle.data[i] ) ) );
+ p_y = ER_RADIUS * ( cosf( deg2rad( reflections->shoebox_data.el_angle.data[i] ) ) * sinf( deg2rad( reflections->shoebox_data.az_angle.data[i] ) ) );
+ p_z = ER_RADIUS * ( sinf( deg2rad( reflections->shoebox_data.el_angle.data[i] ) ) );
/* Calculate the euclidean distance to each point in the config ls setup */
for ( j = 0; j < reflections->nchan_out; j++ )
@@ -281,14 +286,14 @@ ivas_error er_encoder_init(
{
src_idx = ( j > LFE_CHANNEL ) ? j - 1 : j;
- p_x_src = reflections->source_positions[src_idx * 3 + 2] * ( (float) cos( reflections->source_positions[src_idx * 3 + 1] ) * (float) cos( reflections->source_positions[src_idx * 3] ) );
- p_y_src = reflections->source_positions[src_idx * 3 + 2] * ( (float) cos( reflections->source_positions[src_idx * 3 + 1] ) * (float) sin( reflections->source_positions[src_idx * 3] ) );
- p_z_src = reflections->source_positions[src_idx * 3 + 2] * (float) sin( reflections->source_positions[src_idx * 3 + 1] );
+ p_x_src = reflections->source_positions[src_idx * 3 + 2] * ( cosf( reflections->source_positions[src_idx * 3 + 1] ) * cosf( reflections->source_positions[src_idx * 3] ) );
+ p_y_src = reflections->source_positions[src_idx * 3 + 2] * ( cosf( reflections->source_positions[src_idx * 3 + 1] ) * sinf( reflections->source_positions[src_idx * 3] ) );
+ p_z_src = reflections->source_positions[src_idx * 3 + 2] * sinf( reflections->source_positions[src_idx * 3 + 1] );
tmp = ( p_x_src - p_x ) * ( p_x_src - p_x );
tmp += ( p_y_src - p_y ) * ( p_y_src - p_y );
tmp += ( p_z_src - p_z ) * ( p_z_src - p_z );
- dist = (float) sqrt( tmp );
+ dist = sqrtf( tmp );
/* Save index of closest channel */
if ( src_idx == 0 )
@@ -311,19 +316,18 @@ ivas_error er_encoder_init(
}
}
-
return error;
}
/*-----------------------------------------------------------------------------------------*
- Function er_compute_reflections
+ Function ivas_er_compute_reflections()
Function computes reflections using the shoebox library and sets up the circular buffers
structure for the early reflections process
*-----------------------------------------------------------------------------------------*/
-ivas_error er_compute_reflections(
+ivas_error ivas_er_compute_reflections(
er_struct_t *reflections )
{
ivas_error error = IVAS_ERR_OK;
@@ -333,15 +337,14 @@ ivas_error er_compute_reflections(
reflections->is_ready = 0;
/* Disabled case */
- if ( reflections->mode == AUDIO_CONFIG_INVALID )
+ if ( reflections->audio_config == AUDIO_CONFIG_INVALID )
{
return error;
}
/* Run shoebox with current reflection parameters */
- shoebox_set_scene( &( reflections->shoebox_lib ), &( reflections->shoebox_data ),
- reflections->shoebox_lib.cal.list_orig, reflections->source_positions,
- reflections->is_cartesian, reflections->is_relative );
+ ivas_shoebox_set_scene( &( reflections->shoebox_lib ), &( reflections->shoebox_data ), reflections->shoebox_lib.cal.list_orig,
+ reflections->source_positions, reflections->is_cartesian, reflections->is_relative );
/* Convert reflection times in seconds to samples and keep track of max */
circ_len = 0;
@@ -349,9 +352,9 @@ ivas_error er_compute_reflections(
{
for ( j = 0; j < reflections->shoebox_data.n_ref; j++ )
{
- tmp = reflections->shoebox_data.times.data[j + ( i * (int) reflections->shoebox_data.n_ref )];
- tmp = (float) round( tmp * reflections->output_Fs );
- reflections->shoebox_data.times.data[j + ( i * (int) reflections->shoebox_data.n_ref )] = tmp;
+ tmp = reflections->shoebox_data.times.data[j + ( i * reflections->shoebox_data.n_ref )];
+ tmp = roundf( tmp * reflections->output_Fs );
+ reflections->shoebox_data.times.data[j + ( i * reflections->shoebox_data.n_ref )] = tmp;
circ_len = ( (uint16_t) tmp > circ_len ) ? (uint16_t) tmp : circ_len;
}
}
@@ -376,27 +379,24 @@ ivas_error er_compute_reflections(
/* circ buffers exist but size is different */
reflections->circ_len = circ_len;
free( reflections->circ_buffers );
- reflections->circ_buffers = (float *) malloc(
- reflections->shoebox_data.n_sources * reflections->circ_len * sizeof( float ) );
- set_f( reflections->circ_buffers, 0.0f,
- reflections->shoebox_data.n_sources * reflections->circ_len );
+ if ( ( reflections->circ_buffers = (float *) malloc( reflections->shoebox_data.n_sources * reflections->circ_len * sizeof( float ) ) ) == NULL )
+ {
+ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Early Reflections buffers" );
+ }
+ set_f( reflections->circ_buffers, 0.0f, reflections->shoebox_data.n_sources * reflections->circ_len );
}
}
else
{
/* circ buffers do not exist */
reflections->circ_len = circ_len;
- reflections->circ_buffers = (float *) malloc(
- reflections->shoebox_data.n_sources * reflections->circ_len * sizeof( float ) );
- set_f( reflections->circ_buffers, 0.0f,
- reflections->shoebox_data.n_sources * reflections->circ_len );
+ if ( ( reflections->circ_buffers = (float *) malloc( reflections->shoebox_data.n_sources * reflections->circ_len * sizeof( float ) ) ) == NULL )
+ {
+ return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Early Reflections buffers" );
+ }
+ set_f( reflections->circ_buffers, 0.0f, reflections->shoebox_data.n_sources * reflections->circ_len );
}
- /* Check that circ buffers were allocated */
- if ( !reflections->circ_buffers )
- {
- return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Early Reflections buffers" );
- }
/* Initialize circular buffer insertion point */
reflections->circ_insert = reflections->circ_len - (uint16_t) reflections->max_frame_size;
@@ -413,20 +413,21 @@ ivas_error er_compute_reflections(
return error;
}
+
/*-----------------------------------------------------------------------------------------*
-Function er_process
+Function ivas_er_process()
Takes a buffer of N channels, returns a buffer of N*6 channels containing the early
reflections (one per wall). The process is a delay line architecture
*-----------------------------------------------------------------------------------------*/
-ivas_error er_process(
+ivas_error ivas_er_process(
er_struct_t *reflections,
- int16_t subframe_size,
- int16_t subframe_idx,
+ const int16_t subframe_size,
+ const int16_t subframe_idx,
float **io,
- IVAS_REND_AudioConfig inConfig )
+ const AUDIO_CONFIG inConfig )
{
ivas_error error = IVAS_ERR_OK;
uint16_t i, j, k, subframe_offset;
@@ -448,8 +449,7 @@ ivas_error er_process(
}
/* Ensure all reflection memory is allocated */
- if ( !reflections->circ_buffers ||
- !reflections->is_ready )
+ if ( !reflections->circ_buffers || !reflections->is_ready )
{
return IVAS_ERR_INIT_ERROR;
}
@@ -522,10 +522,10 @@ ivas_error er_process(
/* Determine start idx of reflection in circ buffer based on
current insert idx and reflection delay */
- samp_idx = (int) reflections->circ_insert - ref_delay;
+ samp_idx = (int16_t) reflections->circ_insert - ref_delay;
if ( samp_idx < 0 )
{
- samp_idx = (int) reflections->circ_len + samp_idx;
+ samp_idx = (int16_t) reflections->circ_len + samp_idx;
}
/* Pull reflection from circ buffer and apply gain */
diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c
index de595d922205debd485d10167603e5eb52bb9f74..7a9ad1156fcabab6e1b814746f06f394a7d35773 100644
--- a/lib_rend/ivas_rotation.c
+++ b/lib_rend/ivas_rotation.c
@@ -252,11 +252,13 @@ void Quat2EulerDegree(
}
#endif
+
/*-------------------------------------------------------------------------
* deg2rad()
*
* Converts degrees to normalized radians
*------------------------------------------------------------------------*/
+
float deg2rad(
float degrees )
{
@@ -272,11 +274,13 @@ float deg2rad(
return PI_OVER_180 * degrees;
}
+
/*-------------------------------------------------------------------------
* rad2deg()
*
* Converts normalized radians to degrees
*------------------------------------------------------------------------*/
+
float rad2deg(
float radians )
{
@@ -291,6 +295,7 @@ float rad2deg(
return _180_OVER_PI * radians;
}
+
/*-------------------------------------------------------------------------
* rotateAziEle()
*
diff --git a/lib_rend/ivas_shoebox.c b/lib_rend/ivas_shoebox.c
index 7b89339bf694bf32079142a8fc2c60775067b898..7c0f3c67d55004703bcf8da493b77971b84fd17b 100644
--- a/lib_rend/ivas_shoebox.c
+++ b/lib_rend/ivas_shoebox.c
@@ -31,9 +31,7 @@
*******************************************************************************************************/
#include "options.h"
-
-
-#include
+#include
#include
#include "ivas_prot_rend.h"
#include "ivas_stat_rend.h"
@@ -42,18 +40,18 @@
#include "wmc_auto.h"
/*-----------------------------------------------------------------------------------------*
- * Function shoebox_config_init
+ * Function ivas_shoebox_config_init
*
* Function transfer the parameters from the reverb config handle to the shoebox
* calibration data structure.
*-----------------------------------------------------------------------------------------*/
-void shoebox_config_init(
+void ivas_shoebox_config_init(
shoebox_config_t *cal,
RENDER_CONFIG_HANDLE hRenderConfig /* i : Renderer configuration handle */
)
{
- int32_t wall_idx;
+ int16_t wall_idx;
cal->room_L = hRenderConfig->roomAcoustics.dimensions.x;
cal->room_W = hRenderConfig->roomAcoustics.dimensions.y;
@@ -70,16 +68,19 @@ void shoebox_config_init(
cal->list_orig[0] = hRenderConfig->roomAcoustics.ListenerOrigin.x;
cal->list_orig[1] = hRenderConfig->roomAcoustics.ListenerOrigin.y;
cal->list_orig[2] = hRenderConfig->roomAcoustics.ListenerOrigin.z;
+
+ return;
}
+
/*-----------------------------------------------------------------------------------------*
- * Function shoebox_init
+ * Function ivas_shoebox_init()
*
* Function initializes the shoebox operating parameters by setting limits and defaults,
* also contains the calibration structure.
*-----------------------------------------------------------------------------------------*/
-void shoebox_init(
+void ivas_shoebox_init(
shoebox_obj_t *obj,
shoebox_config_t *cal )
{
@@ -115,10 +116,13 @@ void shoebox_init(
obj->min_wall_dist = ER_MIN_WALL_DIST;
obj->soundspeed = ER_SOUND_SPEED;
obj->air_coeff = ER_AIR_COEFF;
+
+ return;
}
+
/*-----------------------------------------------------------------------------------------*
- * Function shoebox_bound
+ * Function shoebox_bound()
*
* SHOEBOX_BOUND takes in CARTESIAN coordinates of either a receiver or
* source and checks if it is within the virtual room boundaries established
@@ -126,7 +130,6 @@ void shoebox_init(
* coordinates are established to collapse the object position.
*-----------------------------------------------------------------------------------------*/
-
static void shoebox_bound(
shoebox_obj_t *obj,
float *out_pos )
@@ -135,6 +138,7 @@ static void shoebox_bound(
int32_t i;
out_tmp = ( obj->cal.room_L / 2.0f ) - obj->min_wall_dist;
+
if ( ( out_pos[0] > out_tmp ) || ( out_pos[0] < ( ( ( -obj->cal.room_L ) / 2.0f ) + obj->min_wall_dist ) ) )
{
if ( out_pos[0] < 0.0f )
@@ -147,7 +151,9 @@ static void shoebox_bound(
}
out_pos[0] = out_tmp * ( (float) i );
}
+
out_tmp = ( obj->cal.room_W / 2.0f ) - obj->min_wall_dist;
+
if ( ( out_pos[1] > out_tmp ) || ( out_pos[1] < ( ( ( -obj->cal.room_W ) / 2.0f ) + obj->min_wall_dist ) ) )
{
if ( out_pos[1] < 0.0f )
@@ -160,7 +166,9 @@ static void shoebox_bound(
}
out_pos[1] = out_tmp * ( (float) i );
}
+
out_tmp = ( obj->cal.room_H / 2.0f ) - obj->min_wall_dist;
+
if ( ( out_pos[2] > out_tmp ) || ( out_pos[2] < ( ( ( -obj->cal.room_H ) / 2.0f ) + obj->min_wall_dist ) ) )
{
if ( out_pos[2] < 0.0f )
@@ -173,10 +181,13 @@ static void shoebox_bound(
}
out_pos[2] = out_tmp * ( (float) i );
}
+
+ return;
}
+
/*-----------------------------------------------------------------------------------------*
- * Function shoebox_get_coord
+ * Function shoebox_get_coord()
*
* Transform relative spherical coordinate to 3D cartesian point
*-----------------------------------------------------------------------------------------*/
@@ -227,10 +238,12 @@ static void shoebox_get_coord(
tmp_data[2] = src_pos_data[k + 2] - ( obj->cal.room_H / 2.0f );
}
}
+
for ( k = 0; k < tmp_size_idx_1; k++ )
{
obj->src_pos[( coord + k ) - 1] = tmp_data[k];
}
+
/* CENTER TO LISTENER */
if ( ( out_tmp + 1.0f ) > ( ( out_tmp + 1.0f ) + 2.0f ) )
{
@@ -240,19 +253,24 @@ static void shoebox_get_coord(
{
k = (int32_t) ( (float) ( out_tmp + 1.0f ) );
}
+
tmp_pos[0] = obj->src_pos[k - 1];
tmp_pos[1] = obj->src_pos[k];
tmp_pos[2] = obj->src_pos[k + 1];
+
if ( isRelative != 0.0f )
{
tmp_pos[0] += obj->list_pos[0];
tmp_pos[1] += obj->list_pos[1];
tmp_pos[2] += obj->list_pos[2];
}
+
+ return;
}
+
/*-----------------------------------------------------------------------------------------*
- * Function shoebox_get_euclidian_distance_internal
+ * Function shoebox_get_euclidian_distance_internal()
*
* Get 3D source distance from receiver
*-----------------------------------------------------------------------------------------*/
@@ -265,6 +283,7 @@ static float shoebox_get_euclidian_distance_internal(
float absxk, out_tmp, t;
absxk = fabsf( obj->list_pos[0] - tmp_pos[0] );
+
if ( absxk > ER_EUCLIDEAN_SCALE )
{
out_tmp = 1.0f;
@@ -275,7 +294,9 @@ static float shoebox_get_euclidian_distance_internal(
t = absxk / ER_EUCLIDEAN_SCALE;
out_tmp = t * t;
}
+
absxk = fabsf( obj->list_pos[1] - tmp_pos[1] );
+
if ( absxk > *scale )
{
t = *scale / absxk;
@@ -287,7 +308,9 @@ static float shoebox_get_euclidian_distance_internal(
t = absxk / *scale;
out_tmp += t * t;
}
+
absxk = fabsf( obj->list_pos[2] - tmp_pos[2] );
+
if ( absxk > *scale )
{
t = *scale / absxk;
@@ -299,24 +322,24 @@ static float shoebox_get_euclidian_distance_internal(
t = absxk / *scale;
out_tmp += t * t;
}
+
return out_tmp;
}
/*-----------------------------------------------------------------------------------------*
- * Function shoebox_set_scene
+ * Function ivas_shoebox_set_scene()
*
* Initial scene setup returning computed reflection (arrival times, DOA and gain).
*-----------------------------------------------------------------------------------------*/
-
-void shoebox_set_scene(
+void ivas_shoebox_set_scene(
shoebox_obj_t *obj,
shoebox_output_t *ER_PARAMS,
const float list_pos[3],
const float src_pos_data[],
- uint16_t isCartesian,
- uint16_t isRelative )
+ const uint16_t isCartesian,
+ const uint16_t isRelative )
{
float tmp_pos[3];
float out_tmp;
@@ -378,7 +401,6 @@ void shoebox_set_scene(
fcnOutput_data[n] = src_pos_data[k + n];
}
-
shoebox_get_coord( obj, fcnOutput_data, src_pos_data, tmp_pos, out_tmp, coord, loop_ub, k, isRelative );
shoebox_bound( obj, tmp_pos );
@@ -451,4 +473,6 @@ void shoebox_set_scene(
( ( 1.0f - obj->cal.abs_coeff[loop_ub] ) * ( out_tmp / path_dist ) ) - ( path_dist * obj->air_coeff );
}
}
+
+ return;
}
diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h
index 04293db0a62a1e1e5d9d06bb1e2f6c99d4e48b74..f7899271fde7fe42d8f7982c4a021c2396b16c3d 100644
--- a/lib_rend/ivas_stat_rend.h
+++ b/lib_rend/ivas_stat_rend.h
@@ -1025,8 +1025,7 @@ typedef struct ivas_reverb_state_t
* Shoebox structure
*----------------------------------------------------------------------------------*/
-/* This structure holds the original bitstream metadata */
-
+/* Structure to hold the original bitstream metadata */
typedef struct
{
float room_L;
@@ -1034,10 +1033,10 @@ typedef struct
float room_H;
float abs_coeff[ER_ABS_COEFF];
float list_orig[3];
-} shoebox_config_t;
-/* This structure holds the corrected( bounded ) source and listener positions */
+} shoebox_config_t;
+/* Structure to hold the corrected( bounded ) source and listener positions */
typedef struct
{
uint16_t isCartesian;
@@ -1063,6 +1062,7 @@ typedef struct shoebox_data_t
{
float data[150];
int32_t size[1];
+
} shoebox_data_t;
@@ -1074,17 +1074,17 @@ typedef struct
shoebox_data_t gains;
shoebox_data_t az_angle;
shoebox_data_t el_angle;
-} shoebox_output_t;
+} shoebox_output_t;
/*----------------------------------------------------------------------------------*
* Reflections structure
*----------------------------------------------------------------------------------*/
-/* This structure holds the original source positions */
+/* Structure to hold the original source positions */
typedef struct er_struct_t
{
- AUDIO_CONFIG mode;
+ AUDIO_CONFIG audio_config;
int16_t nchan_out;
uint16_t use_er;
uint32_t lowComplexity;
@@ -1104,6 +1104,7 @@ typedef struct er_struct_t
uint16_t *closest_ch_idx;
shoebox_output_t shoebox_data;
shoebox_obj_t shoebox_lib;
+
} er_struct_t;
diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c
index 8e17dfe0a37a2626e8172c26a2f51a5d139d6481..7949e0faa9a4c04a4992470f50321f4996a9b1fe 100644
--- a/lib_rend/lib_rend.c
+++ b/lib_rend/lib_rend.c
@@ -83,7 +83,7 @@ typedef float rotation_matrix[3][3];
typedef struct
{
EFAP_HANDLE hEfap;
- IVAS_REND_AudioConfig speakerConfig;
+ AUDIO_CONFIG speakerConfig;
const LSSETUP_CUSTOM_STRUCT *pCustomLsSetup; /* Pointer to main custom LS struct from renderer handle - doesn't need freeing */
} EFAP_WRAPPER;
@@ -97,7 +97,7 @@ typedef struct
typedef struct
{
const int32_t *pOutSampleRate;
- const IVAS_REND_AudioConfig *pOutConfig;
+ const AUDIO_CONFIG *pOutConfig;
const LSSETUP_CUSTOM_STRUCT *pCustomLsOut;
const EFAP_WRAPPER *pEfapOutWrapper;
const IVAS_REND_HeadRotData *pHeadRotData;
@@ -118,7 +118,7 @@ typedef struct
/* Common base for input structs */
typedef struct
{
- IVAS_REND_AudioConfig inConfig;
+ AUDIO_CONFIG inConfig;
IVAS_REND_InputId id;
IVAS_REND_AudioBuffer inputBuffer;
float gain; /* Linear, not in dB */
@@ -245,8 +245,8 @@ struct IVAS_REND
#endif
/* TODO @Philips - inputConfig should not be stored here, but read from e.g. input_mc->input_base.inConfig, please remove this */
- IVAS_REND_AudioConfig inputConfig;
- IVAS_REND_AudioConfig outputConfig;
+ AUDIO_CONFIG inputConfig;
+ AUDIO_CONFIG outputConfig;
EFAP_WRAPPER efapOutWrapper;
IVAS_LSSETUP_CUSTOM_STRUCT customLsOut;
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -526,141 +526,34 @@ static int32_t limitRendererOutput(
/*-------------------------------------------------------------------*
- * getIvasAudioConfigFromRendAudioConfig()
- *
- *
- *-------------------------------------------------------------------*/
-
-AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig(
- IVAS_REND_AudioConfig rendConfig )
-{
- switch ( rendConfig )
- {
- case IVAS_REND_AUDIO_CONFIG_MONO:
- return AUDIO_CONFIG_MONO;
- case IVAS_REND_AUDIO_CONFIG_STEREO:
- return AUDIO_CONFIG_STEREO;
- case IVAS_REND_AUDIO_CONFIG_5_1:
- return AUDIO_CONFIG_5_1;
- case IVAS_REND_AUDIO_CONFIG_7_1:
- return AUDIO_CONFIG_7_1;
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- return AUDIO_CONFIG_5_1_2;
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- return AUDIO_CONFIG_5_1_4;
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
- return AUDIO_CONFIG_7_1_4;
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
- return AUDIO_CONFIG_LS_CUSTOM;
- case IVAS_REND_AUDIO_CONFIG_FOA:
- return AUDIO_CONFIG_FOA;
- case IVAS_REND_AUDIO_CONFIG_HOA2:
- return AUDIO_CONFIG_HOA2;
- case IVAS_REND_AUDIO_CONFIG_HOA3:
- return AUDIO_CONFIG_HOA3;
- case IVAS_REND_AUDIO_CONFIG_OBJECT:
- return AUDIO_CONFIG_OBA;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
- return AUDIO_CONFIG_BINAURAL;
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- return AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
- return AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
-#endif
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- return AUDIO_CONFIG_BINAURAL_ROOM_IR;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
- return AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
- case IVAS_REND_AUDIO_CONFIG_MASA1:
- return AUDIO_CONFIG_MASA1;
- case IVAS_REND_AUDIO_CONFIG_MASA2:
- return AUDIO_CONFIG_MASA2;
- default:
- break;
- }
-
- return AUDIO_CONFIG_INVALID;
-}
-
-/*-------------------------------------------------------------------*
- * getRendAudioConfigFromIvasAudioConfig()
+ * validateOutputAudioConfig()
*
*
*-------------------------------------------------------------------*/
-IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig(
- AUDIO_CONFIG config )
+static ivas_error validateOutputAudioConfig(
+ const AUDIO_CONFIG outConfig )
{
- switch ( config )
+ switch ( outConfig )
{
case AUDIO_CONFIG_MONO:
- return IVAS_REND_AUDIO_CONFIG_MONO;
case AUDIO_CONFIG_STEREO:
- return IVAS_REND_AUDIO_CONFIG_STEREO;
- case AUDIO_CONFIG_BINAURAL:
- return IVAS_REND_AUDIO_CONFIG_BINAURAL;
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
- case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
-#endif
- case AUDIO_CONFIG_BINAURAL_ROOM_IR:
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR;
- case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
- return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
case AUDIO_CONFIG_5_1:
- return IVAS_REND_AUDIO_CONFIG_5_1;
case AUDIO_CONFIG_7_1:
- return IVAS_REND_AUDIO_CONFIG_7_1;
case AUDIO_CONFIG_5_1_2:
- return IVAS_REND_AUDIO_CONFIG_5_1_2;
case AUDIO_CONFIG_5_1_4:
- return IVAS_REND_AUDIO_CONFIG_5_1_4;
case AUDIO_CONFIG_7_1_4:
- return IVAS_REND_AUDIO_CONFIG_7_1_4;
+ case AUDIO_CONFIG_LS_CUSTOM:
case AUDIO_CONFIG_FOA:
- return IVAS_REND_AUDIO_CONFIG_FOA;
case AUDIO_CONFIG_HOA2:
- return IVAS_REND_AUDIO_CONFIG_HOA2;
case AUDIO_CONFIG_HOA3:
- return IVAS_REND_AUDIO_CONFIG_HOA3;
- default:
- break;
- }
- return IVAS_REND_AUDIO_CONFIG_UNKNOWN;
-}
-
-/*-------------------------------------------------------------------*
- * validateOutputAudioConfig()
- *
- *
- *-------------------------------------------------------------------*/
-
-static ivas_error validateOutputAudioConfig(
- IVAS_REND_AudioConfig outConfig )
-{
- switch ( outConfig )
- {
- case IVAS_REND_AUDIO_CONFIG_MONO:
- case IVAS_REND_AUDIO_CONFIG_STEREO:
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
- case IVAS_REND_AUDIO_CONFIG_FOA:
- case IVAS_REND_AUDIO_CONFIG_HOA2:
- case IVAS_REND_AUDIO_CONFIG_HOA3:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
-#endif
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ case AUDIO_CONFIG_BINAURAL:
+#ifdef SPLIT_REND_WITH_HEAD_ROT
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+#endif
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
return IVAS_ERR_OK;
default:
break;
@@ -677,10 +570,47 @@ static ivas_error validateOutputAudioConfig(
*-------------------------------------------------------------------*/
IVAS_REND_AudioConfigType getAudioConfigType(
- IVAS_REND_AudioConfig config )
+ const AUDIO_CONFIG config )
{
- /* By definition, config type is the second byte (from LSB) of IVAS_REND_AudioConfig enum. */
- return ( config & 0xFF00 ) >> 8;
+ IVAS_REND_AudioConfigType type;
+
+ switch ( config )
+ {
+ case AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_LS_CUSTOM:
+ type = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED;
+ break;
+ case AUDIO_CONFIG_FOA:
+ case AUDIO_CONFIG_HOA2:
+ case AUDIO_CONFIG_HOA3:
+ type = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS;
+ break;
+ case AUDIO_CONFIG_OBA:
+ type = IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED;
+ break;
+ case AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ type = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL;
+ break;
+ case AUDIO_CONFIG_MASA1:
+ case AUDIO_CONFIG_MASA2:
+ type = IVAS_REND_AUDIO_CONFIG_TYPE_MASA;
+ break;
+ default:
+ type = IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN;
+ break;
+ }
+
+ return type;
}
@@ -692,7 +622,7 @@ IVAS_REND_AudioConfigType getAudioConfigType(
static ivas_error validateOutputSampleRate(
const int32_t sampleRate,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
if ( getAudioConfigType( outConfig ) != IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
{
@@ -721,47 +651,47 @@ static ivas_error validateOutputSampleRate(
*-------------------------------------------------------------------*/
ivas_error getAudioConfigNumChannels(
- const IVAS_REND_AudioConfig config,
+ const AUDIO_CONFIG config,
int16_t *numChannels )
{
switch ( config )
{
- case IVAS_REND_AUDIO_CONFIG_MONO:
- case IVAS_REND_AUDIO_CONFIG_OBJECT:
- case IVAS_REND_AUDIO_CONFIG_MASA1:
+ case AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_OBA:
+ case AUDIO_CONFIG_MASA1:
*numChannels = 1;
break;
- case IVAS_REND_AUDIO_CONFIG_STEREO:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_BINAURAL:
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
#endif
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
- case IVAS_REND_AUDIO_CONFIG_MASA2:
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ case AUDIO_CONFIG_MASA2:
*numChannels = 2;
break;
- case IVAS_REND_AUDIO_CONFIG_FOA:
+ case AUDIO_CONFIG_FOA:
*numChannels = 4;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_5_1:
*numChannels = 6;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
*numChannels = 8;
break;
- case IVAS_REND_AUDIO_CONFIG_HOA2:
+ case AUDIO_CONFIG_HOA2:
*numChannels = 9;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_5_1_4:
*numChannels = 10;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_7_1_4:
*numChannels = 12;
break;
- case IVAS_REND_AUDIO_CONFIG_HOA3:
+ case AUDIO_CONFIG_HOA3:
*numChannels = 16;
break;
default:
@@ -781,10 +711,10 @@ static ivas_error initLimiter(
const int16_t numChannels,
const int32_t sampleRate )
{
+ ivas_error error;
+
/* If re-initializing with unchanged values, return early */
- if ( *phLimiter != NULL &&
- ( *phLimiter )->num_channels == numChannels &&
- ( *phLimiter )->sampling_rate == sampleRate )
+ if ( *phLimiter != NULL && ( *phLimiter )->num_channels == numChannels && ( *phLimiter )->sampling_rate == sampleRate )
{
return IVAS_ERR_OK;
}
@@ -795,9 +725,9 @@ static ivas_error initLimiter(
ivas_limiter_close( phLimiter );
}
- if ( ( *phLimiter = ivas_limiter_open( numChannels, sampleRate ) ) == NULL )
+ if ( ( error = ivas_limiter_open( phLimiter, numChannels, sampleRate ) ) != IVAS_ERR_OK )
{
- return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to open limiter handle" );
+ return error;
}
return IVAS_ERR_OK;
@@ -823,30 +753,30 @@ static LSSETUP_CUSTOM_STRUCT defaultCustomLs(
}
static ivas_error getSpeakerAzimuths(
- IVAS_REND_AudioConfig config,
+ AUDIO_CONFIG config,
const float **azimuths )
{
switch ( config )
{
- case IVAS_REND_AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_MONO:
*azimuths = ls_azimuth_CICP1;
break;
- case IVAS_REND_AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_STEREO:
*azimuths = ls_azimuth_CICP2;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_5_1:
*azimuths = ls_azimuth_CICP6;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_7_1:
*azimuths = ls_azimuth_CICP12;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_2:
*azimuths = ls_azimuth_CICP14;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_5_1_4:
*azimuths = ls_azimuth_CICP16;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_7_1_4:
*azimuths = ls_azimuth_CICP19;
break;
default:
@@ -857,30 +787,30 @@ static ivas_error getSpeakerAzimuths(
}
static ivas_error getSpeakerElevations(
- IVAS_REND_AudioConfig config,
+ AUDIO_CONFIG config,
const float **elevations )
{
switch ( config )
{
- case IVAS_REND_AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_MONO:
*elevations = ls_elevation_CICP1;
break;
- case IVAS_REND_AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_STEREO:
*elevations = ls_elevation_CICP2;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_5_1:
*elevations = ls_elevation_CICP6;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_7_1:
*elevations = ls_elevation_CICP12;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_2:
*elevations = ls_elevation_CICP14;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_5_1_4:
*elevations = ls_elevation_CICP16;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_7_1_4:
*elevations = ls_elevation_CICP19;
break;
default:
@@ -891,18 +821,18 @@ static ivas_error getSpeakerElevations(
}
static ivas_error getAmbisonicsOrder(
- IVAS_REND_AudioConfig config,
+ AUDIO_CONFIG config,
int16_t *order )
{
switch ( config )
{
- case IVAS_REND_AUDIO_CONFIG_FOA:
+ case AUDIO_CONFIG_FOA:
*order = 1;
break;
- case IVAS_REND_AUDIO_CONFIG_HOA2:
+ case AUDIO_CONFIG_HOA2:
*order = 2;
break;
- case IVAS_REND_AUDIO_CONFIG_HOA3:
+ case AUDIO_CONFIG_HOA3:
*order = 3;
break;
default:
@@ -917,13 +847,13 @@ static int16_t getNumLfeChannels(
{
switch ( inputMc->base.inConfig )
{
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1_4:
return 1;
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
+ case AUDIO_CONFIG_LS_CUSTOM:
return inputMc->customLsInput.num_lfe;
default:
break;
@@ -933,28 +863,28 @@ static int16_t getNumLfeChannels(
}
static ivas_error getNumNonLfeChannelsInSpeakerLayout(
- IVAS_REND_AudioConfig config,
+ AUDIO_CONFIG config,
int16_t *numNonLfeChannels )
{
switch ( config )
{
- case IVAS_REND_AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_MONO:
*numNonLfeChannels = 1;
break;
- case IVAS_REND_AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_STEREO:
*numNonLfeChannels = 2;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_5_1:
*numNonLfeChannels = 5;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_7_1:
*numNonLfeChannels = 7;
break;
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_5_1_4:
*numNonLfeChannels = 9;
break;
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_7_1_4:
*numNonLfeChannels = 11;
break;
default:
@@ -965,7 +895,7 @@ static ivas_error getNumNonLfeChannelsInSpeakerLayout(
}
static ivas_error getMcConfigValues(
- IVAS_REND_AudioConfig inConfig,
+ AUDIO_CONFIG inConfig,
LSSETUP_CUSTOM_STRUCT inCustomLs,
const float **azimuth,
const float **elevation,
@@ -978,7 +908,7 @@ static ivas_error getMcConfigValues(
*is_planar = 1;
switch ( inConfig )
{
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
+ case AUDIO_CONFIG_LS_CUSTOM:
*azimuth = (const float *) &inCustomLs.ls_azimuth;
*elevation = (const float *) &inCustomLs.ls_elevation;
if ( inCustomLs.num_lfe > 0 )
@@ -994,20 +924,20 @@ static ivas_error getMcConfigValues(
}
}
break;
- case IVAS_REND_AUDIO_CONFIG_MONO:
- case IVAS_REND_AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_STEREO:
getSpeakerAzimuths( inConfig, azimuth );
getSpeakerElevations( inConfig, elevation );
break;
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1_4:
getSpeakerAzimuths( inConfig, azimuth );
getSpeakerElevations( inConfig, elevation );
*lfe_idx = LFE_CHANNEL;
- *is_planar = ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ? 1 : 0;
+ *is_planar = ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ? 1 : 0;
break;
default:
assert( !"Invalid speaker config" );
@@ -1019,7 +949,7 @@ static ivas_error getMcConfigValues(
static ivas_error initEfap(
EFAP_WRAPPER *pEfapWrapper,
- IVAS_REND_AudioConfig outConfig,
+ AUDIO_CONFIG outConfig,
const LSSETUP_CUSTOM_STRUCT *pCustomLsOut )
{
ivas_error error;
@@ -1027,9 +957,9 @@ static ivas_error initEfap(
const float *elevations;
int16_t numNonLfeChannels;
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
- pEfapWrapper->speakerConfig = IVAS_REND_AUDIO_CONFIG_7_1_4;
+ pEfapWrapper->speakerConfig = AUDIO_CONFIG_7_1_4;
}
else
{
@@ -1050,7 +980,7 @@ static ivas_error initEfap(
return IVAS_ERR_OK;
}
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( outConfig == AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = efap_init_data( &pEfapWrapper->hEfap, pCustomLsOut->ls_azimuth, pCustomLsOut->ls_elevation, pCustomLsOut->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
{
@@ -1100,7 +1030,7 @@ static ivas_error getEfapGains(
efap_determine_gains( efapWrapper.hEfap, tmpPanGains, azi, ele, EFAP_MODE_EFAP );
/* Now copy to buffer that includes LFE channels */
- if ( efapWrapper.speakerConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( efapWrapper.speakerConfig == AUDIO_CONFIG_LS_CUSTOM )
{
numChannels = efapWrapper.pCustomLsSetup->num_spk + efapWrapper.pCustomLsSetup->num_lfe;
readPtr = tmpPanGains;
@@ -1217,6 +1147,7 @@ static void initRotGains(
rotation_gains rot_gains )
{
int16_t i;
+
/* Set gains to passthrough */
for ( i = 0; i < MAX_INPUT_CHANNELS; i++ )
{
@@ -1227,9 +1158,10 @@ static void initRotGains(
return;
}
+
static void initRendInputBase(
input_base *inputBase,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const IVAS_REND_InputId id,
const rendering_context rendCtx,
float *dataBuf,
@@ -1252,6 +1184,7 @@ static void initRendInputBase(
return;
}
+
static IVAS_REND_AudioObjectPosition defaultObjectPosition(
void )
{
@@ -1267,6 +1200,7 @@ static IVAS_REND_AudioObjectPosition defaultObjectPosition(
return pos;
}
+
static rendering_context getRendCtx(
IVAS_REND_HANDLE hIvasRend )
{
@@ -1290,6 +1224,7 @@ static rendering_context getRendCtx(
return ctx;
}
+
static TDREND_WRAPPER defaultTdRendWrapper(
void )
{
@@ -1302,6 +1237,7 @@ static TDREND_WRAPPER defaultTdRendWrapper(
return w;
}
+
static CREND_WRAPPER defaultCrendWrapper(
void )
{
@@ -1322,13 +1258,13 @@ static CREND_WRAPPER defaultCrendWrapper(
return w;
}
+
static bool isIoConfigPairSupported(
- IVAS_REND_AudioConfig inConfig,
- IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig )
{
/* Rendering mono or stereo to binaural is not supported */
- if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_MONO || inConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) &&
- getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
+ if ( ( inConfig == AUDIO_CONFIG_MONO || inConfig == AUDIO_CONFIG_STEREO ) && getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
{
return false;
}
@@ -1339,7 +1275,7 @@ static bool isIoConfigPairSupported(
static ivas_error initIsmMasaRendering(
input_ism *inputIsm,
- int32_t inSampleRate )
+ const int32_t inSampleRate )
{
ivas_error error;
@@ -1348,12 +1284,14 @@ static ivas_error initIsmMasaRendering(
ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd );
inputIsm->tdRendWrapper.hHrtfTD = NULL;
}
+
ivas_rend_closeCrend( &inputIsm->crendWrapper
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses
#endif
);
+
ivas_reverb_close( &inputIsm->hReverb );
if ( ( error = ivas_omasa_ana_open( &inputIsm->hOMasa, inSampleRate, inputIsm->total_num_objects ) ) != IVAS_ERR_OK )
@@ -1364,15 +1302,16 @@ static ivas_error initIsmMasaRendering(
return IVAS_ERR_OK;
}
+
static ivas_error setRendInputActiveIsm(
void *input,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const IVAS_REND_InputId id,
RENDER_CONFIG_DATA *hRendCfg )
{
ivas_error error;
rendering_context rendCtx;
- IVAS_REND_AudioConfig outConfig;
+ AUDIO_CONFIG outConfig;
input_ism *inputIsm;
#ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t i;
@@ -1391,8 +1330,7 @@ static ivas_error setRendInputActiveIsm(
{
return error;
}
- initRendInputBase( &inputIsm->base, inConfig, id, rendCtx,
- inputIsm->bufferData, MAX_BUFFER_LENGTH );
+ initRendInputBase( &inputIsm->base, inConfig, id, rendCtx, inputIsm->bufferData, MAX_BUFFER_LENGTH );
inputIsm->currentPos = defaultObjectPosition();
inputIsm->previousPos = defaultObjectPosition();
@@ -1400,24 +1338,26 @@ static ivas_error setRendInputActiveIsm(
inputIsm->hReverb = NULL;
inputIsm->tdRendWrapper = defaultTdRendWrapper();
initRotMatrix( inputIsm->rot_mat_prev );
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i )
{
inputIsm->splitTdRendWrappers[i] = defaultTdRendWrapper();
}
#endif
+
inputIsm->hOMasa = NULL;
error = IVAS_ERR_OK;
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#else
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
#endif
{
#ifndef SPLIT_REND_WITH_HEAD_ROT
- if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg,
- NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1428,7 +1368,7 @@ static ivas_error setRendInputActiveIsm(
}
#endif
}
- else if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ else if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 )
{
if ( ( error = initIsmMasaRendering( inputIsm, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
{
@@ -1442,9 +1382,9 @@ static ivas_error setRendInputActiveIsm(
{
return error;
}
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
- if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -1454,18 +1394,17 @@ static ivas_error setRendInputActiveIsm(
{
return error;
}
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
- {
- if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ {
+ if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
{
return error;
}
}
- else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR )
+ else if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR )
{
- if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg,
- NULL, *rendCtx.pOutSampleRate
+ if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses
@@ -1478,10 +1417,10 @@ static ivas_error setRendInputActiveIsm(
#endif /* SPLIT_REND_WITH_HEAD_ROT */
}
-
return IVAS_ERR_OK;
}
+
static void clearInputIsm(
input_ism *inputIsm )
{
@@ -1493,8 +1432,7 @@ static void clearInputIsm(
rendCtx = inputIsm->base.ctx;
freeInputBaseBufferData( &inputIsm->base.inputBuffer.data );
- initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx,
- NULL, 0 );
+ initRendInputBase( &inputIsm->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );
/* Free input's internal handles */
@@ -1525,6 +1463,7 @@ static void clearInputIsm(
return;
}
+
static void copyLsConversionMatrixToPanMatrix(
const LS_CONVERSION_MATRIX *lsConvMatrix,
pan_matrix panMatrix )
@@ -1549,6 +1488,7 @@ static void copyLsConversionMatrixToPanMatrix(
return;
}
+
static void setZeroPanMatrix(
pan_matrix panMatrix )
{
@@ -1562,6 +1502,7 @@ static void setZeroPanMatrix(
return;
}
+
/* Note: this only sets non-zero elements, call setZeroPanMatrix() to init first. */
static void fillIdentityPanMatrix(
pan_matrix panMatrix )
@@ -1576,6 +1517,7 @@ static void fillIdentityPanMatrix(
return;
}
+
static ivas_error initMcPanGainsWithIdentMatrix(
input_mc *inputMc )
{
@@ -1584,15 +1526,16 @@ static ivas_error initMcPanGainsWithIdentMatrix(
return IVAS_ERR_OK;
}
+
static ivas_error initMcPanGainsWithConversionMapping(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
AUDIO_CONFIG ivasConfigIn, ivasConfigOut;
int16_t i;
- ivasConfigIn = getIvasAudioConfigFromRendAudioConfig( inputMc->base.inConfig );
- ivasConfigOut = getIvasAudioConfigFromRendAudioConfig( outConfig );
+ ivasConfigIn = inputMc->base.inConfig;
+ ivasConfigOut = outConfig;
/* Find conversion mapping for current I/O config pair.
* Stay with default panning matrix if conversion_matrix is NULL */
@@ -1618,9 +1561,10 @@ static ivas_error initMcPanGainsWithConversionMapping(
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Missing multichannel conversion mapping" );
}
+
static ivas_error initMcPanGainsWithEfap(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
int16_t i;
int16_t numNonLfeInChannels;
@@ -1628,7 +1572,7 @@ static ivas_error initMcPanGainsWithEfap(
const float *spkAzi, *spkEle;
ivas_error error;
- if ( inputMc->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK )
{
@@ -1672,7 +1616,7 @@ static ivas_error initMcPanGainsWithEfap(
}
}
- if ( outConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inLfeChIdx >= 0 )
+ if ( outConfig != AUDIO_CONFIG_LS_CUSTOM && inLfeChIdx >= 0 )
{
inputMc->panGains[inLfeChIdx][LFE_CHANNEL] = 1;
}
@@ -1684,6 +1628,7 @@ static ivas_error initMcPanGainsWithEfap(
return IVAS_ERR_OK;
}
+
static ivas_error getRendInputNumChannels(
const void *rendInput,
int16_t *numInChannels )
@@ -1699,7 +1644,7 @@ static ivas_error getRendInputNumChannels(
pInputBase = (const input_base *) rendInput;
- if ( pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( pInputBase->inConfig == AUDIO_CONFIG_LS_CUSTOM )
{
pInputMc = (const input_mc *) rendInput;
*numInChannels = pInputMc->customLsInput.num_spk + pInputMc->customLsInput.num_lfe;
@@ -1715,6 +1660,7 @@ static ivas_error getRendInputNumChannels(
return IVAS_ERR_OK;
}
+
static ivas_error initMcPanGainsWithMonoOut(
input_mc *inputMc )
{
@@ -1730,7 +1676,7 @@ static ivas_error initMcPanGainsWithMonoOut(
return error;
}
- if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM )
{
for ( i = 0; i < numInChannels; ++i )
{
@@ -1739,7 +1685,7 @@ static ivas_error initMcPanGainsWithMonoOut(
inputMc->panGains[i][0] = 1.f;
}
}
- else if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_STEREO )
+ else if ( inputMc->base.inConfig == AUDIO_CONFIG_STEREO )
{
/* Special case for STEREO to MONO: Passive downmix (L+R)/2 */
inputMc->panGains[0][0] = 0.5;
@@ -1750,7 +1696,7 @@ static ivas_error initMcPanGainsWithMonoOut(
/* ls_conversion_cicpX_stereo contains gains for side speakers.
* These should be skipped with 5.1+X inputs. */
skipSideSpeakers = false;
- if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 )
+ if ( inputMc->base.inConfig == AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == AUDIO_CONFIG_5_1_4 )
{
skipSideSpeakers = true;
}
@@ -1769,6 +1715,7 @@ static ivas_error initMcPanGainsWithMonoOut(
return IVAS_ERR_OK;
}
+
static ivas_error initMcPanGainsWithStereoLookup(
input_mc *inputMc )
{
@@ -1780,7 +1727,7 @@ static ivas_error initMcPanGainsWithStereoLookup(
/* Special case - MONO input.
* Use gains for center CICP speaker and return early. */
- if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO )
+ if ( inputMc->base.inConfig == AUDIO_CONFIG_MONO )
{
inputMc->panGains[0][0] = ls_conversion_cicpX_stereo[2][0];
inputMc->panGains[0][1] = ls_conversion_cicpX_stereo[2][1];
@@ -1790,7 +1737,7 @@ static ivas_error initMcPanGainsWithStereoLookup(
/* ls_conversion_cicpX_stereo contains gains for side speakers.
* These should be skipped with 5.1+X inputs. */
skipSideSpeakers = false;
- if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 )
+ if ( inputMc->base.inConfig == AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == AUDIO_CONFIG_5_1_4 )
{
skipSideSpeakers = true;
}
@@ -1815,18 +1762,19 @@ static ivas_error initMcPanGainsWithStereoLookup(
return IVAS_ERR_OK;
}
+
/* Returns 1 (true) if configs A and B are equal, otherwise returns 0 (false).
* If both configs are custom LS layouts, layout details are compared to determine equality. */
static bool configsAreEqual(
- const IVAS_REND_AudioConfig configA,
+ const AUDIO_CONFIG configA,
const LSSETUP_CUSTOM_STRUCT customLsA,
- const IVAS_REND_AudioConfig configB,
+ const AUDIO_CONFIG configB,
const LSSETUP_CUSTOM_STRUCT customLsB )
{
int16_t i;
/* Both input and output are custom LS - compare structs */
- if ( configA == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && configB == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( configA == AUDIO_CONFIG_LS_CUSTOM && configB == AUDIO_CONFIG_LS_CUSTOM )
{
if ( customLsA.num_spk != customLsB.num_spk )
{
@@ -1867,9 +1815,10 @@ static bool configsAreEqual(
return configA == configB;
}
+
static ivas_error updateLfePanGainsForMcOut(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
int16_t i, numLfeIn, numOutChannels;
ivas_error error;
@@ -1883,7 +1832,7 @@ static ivas_error updateLfePanGainsForMcOut(
numLfeIn = getNumLfeChannels( inputMc );
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( outConfig == AUDIO_CONFIG_LS_CUSTOM )
{
numOutChannels = inputMc->base.ctx.pCustomLsOut->num_spk + inputMc->base.ctx.pCustomLsOut->num_lfe;
}
@@ -1916,9 +1865,10 @@ static ivas_error updateLfePanGainsForMcOut(
return error;
}
+
static ivas_error updateLfePanGainsForAmbiOut(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
int16_t i;
int16_t numLfeIn, outAmbiOrder;
@@ -1956,9 +1906,10 @@ static ivas_error updateLfePanGainsForAmbiOut(
return error;
}
+
static ivas_error updateMcPanGainsForMcOut(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
ivas_error error;
@@ -1978,11 +1929,11 @@ static ivas_error updateMcPanGainsForMcOut(
{
error = initMcPanGainsWithIdentMatrix( inputMc );
}
- else if ( outConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ||
- inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO ||
- inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ else if ( outConfig == AUDIO_CONFIG_LS_CUSTOM ||
+ inputMc->base.inConfig == AUDIO_CONFIG_MONO ||
+ inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM )
{
- if ( ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) )
+ if ( ( inputMc->base.inConfig == AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) )
{
inputMc->panGains[0][0] = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f;
inputMc->panGains[0][1] = 1.f - inputMc->panGains[0][0];
@@ -1993,11 +1944,11 @@ static ivas_error updateMcPanGainsForMcOut(
error = initMcPanGainsWithEfap( inputMc, outConfig );
}
}
- else if ( outConfig == IVAS_REND_AUDIO_CONFIG_MONO )
+ else if ( outConfig == AUDIO_CONFIG_MONO )
{
error = initMcPanGainsWithMonoOut( inputMc );
}
- else if ( outConfig == IVAS_REND_AUDIO_CONFIG_STEREO )
+ else if ( outConfig == AUDIO_CONFIG_STEREO )
{
error = initMcPanGainsWithStereoLookup( inputMc );
}
@@ -2018,9 +1969,10 @@ static ivas_error updateMcPanGainsForMcOut(
return error;
}
+
static ivas_error updateMcPanGainsForAmbiOut(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
int16_t ch_in, ch_out, lfeIdx;
int16_t numNonLfeInChannels, outAmbiOrder;
@@ -2032,7 +1984,7 @@ static ivas_error updateMcPanGainsForAmbiOut(
return error;
}
- if ( inputMc->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK )
{
@@ -2088,9 +2040,10 @@ static ivas_error updateMcPanGainsForAmbiOut(
return IVAS_ERR_OK;
}
+
static ivas_error updateMcPanGains(
input_mc *inputMc,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
int16_t i;
ivas_error error;
@@ -2110,16 +2063,16 @@ static ivas_error updateMcPanGains(
case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL:
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
#endif
break; /* Do nothing */
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
/* Prepare rendering to intermediate format */
- error = updateMcPanGainsForMcOut( inputMc, IVAS_REND_AUDIO_CONFIG_7_1_4 );
+ error = updateMcPanGainsForMcOut( inputMc, AUDIO_CONFIG_7_1_4 );
break;
default:
return IVAS_ERR_INVALID_OUTPUT_FORMAT;
@@ -2137,7 +2090,7 @@ static ivas_error updateMcPanGains(
}
/* Copy LFE routing to pan gains array */
- if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM )
{
for ( i = 0; i < inputMc->customLsInput.num_lfe; ++i )
{
@@ -2156,8 +2109,8 @@ static ivas_error updateMcPanGains(
static ivas_error initMcBinauralRendering(
input_mc *inputMc,
- const IVAS_REND_AudioConfig inConfig,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG inConfig,
+ const AUDIO_CONFIG outConfig,
RENDER_CONFIG_DATA *hRendCfg )
{
ivas_error error;
@@ -2206,16 +2159,16 @@ static ivas_error initMcBinauralRendering(
// initTDRend = false;
// #ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG
// if ( ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) &&
- // ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
+ // ( outConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( outConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
// #else
// if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM )
// #endif
// {
- // if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ // if ( inConfig == AUDIO_CONFIG_LS_CUSTOM )
// {
// initTDRend = true;
// }
- // else if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) &&
+ // else if ( ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) &&
// ( inputMc->base.ctx.pHeadRotData->headRotEnabled ) )
// {
// initTDRend = true;
@@ -2231,16 +2184,12 @@ static ivas_error initMcBinauralRendering(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
/* Open TD renderer wrappers */
for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
{
- if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i],
- inConfig,
- hRendCfg,
- &inputMc->customLsInput,
- outSampleRate ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -2251,9 +2200,9 @@ static ivas_error initMcBinauralRendering(
}
#endif
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
- if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), outConfig, NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -2261,11 +2210,10 @@ static ivas_error initMcBinauralRendering(
}
{
- if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg,
- NULL, outSampleRate
+ if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
- ( ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1
+ ( ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1
#endif
) ) != IVAS_ERR_OK )
{
@@ -2274,7 +2222,7 @@ static ivas_error initMcBinauralRendering(
}
/* Initialise the EFAP handle for rotation on input layout */
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled )
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled )
{
if ( ( error = initEfap( &inputMc->efapInWrapper, inConfig, NULL ) ) != IVAS_ERR_OK )
{
@@ -2283,8 +2231,7 @@ static ivas_error initMcBinauralRendering(
}
/* determine binaural delay ( used for aligning LFE to output signal ) */
- binauralDelayNs = max( ( inputMc->crendWrapper != NULL ) ? inputMc->crendWrapper->binaural_latency_ns : 0,
- inputMc->tdRendWrapper.binaural_latency_ns );
+ binauralDelayNs = max( ( inputMc->crendWrapper != NULL ) ? inputMc->crendWrapper->binaural_latency_ns : 0, inputMc->tdRendWrapper.binaural_latency_ns );
inputMc->binauralDelaySmp = (int16_t) roundf( (float) binauralDelayNs * *inputMc->base.ctx.pOutSampleRate / 1000000000.f );
if ( inputMc->binauralDelaySmp > MAX_BIN_DELAY_SAMPLES )
@@ -2295,10 +2242,11 @@ static ivas_error initMcBinauralRendering(
return IVAS_ERR_OK;
}
+
static ivas_error initMcMasaRendering(
input_mc *inputMc,
- const IVAS_REND_AudioConfig inConfig,
- int32_t inSampleRate )
+ const AUDIO_CONFIG inConfig,
+ const int32_t inSampleRate )
{
ivas_error error;
@@ -2307,13 +2255,16 @@ static ivas_error initMcMasaRendering(
ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd );
inputMc->tdRendWrapper.hHrtfTD = NULL;
}
+
ivas_rend_closeCrend( &inputMc->crendWrapper
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses
#endif
);
+
ivas_reverb_close( &inputMc->hReverb );
+
if ( inputMc->efapInWrapper.hEfap != NULL )
{
efap_free_data( &inputMc->efapInWrapper.hEfap );
@@ -2327,10 +2278,11 @@ static ivas_error initMcMasaRendering(
return IVAS_ERR_OK;
}
+
static lfe_routing defaultLfeRouting(
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const LSSETUP_CUSTOM_STRUCT customLsIn,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
const LSSETUP_CUSTOM_STRUCT customLsOut )
{
int16_t i;
@@ -2348,14 +2300,14 @@ static lfe_routing defaultLfeRouting(
switch ( inConfig )
{
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_7_1_4:
routing.numLfeChannels = 1;
break;
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
+ case AUDIO_CONFIG_LS_CUSTOM:
routing.numLfeChannels = customLsIn.num_lfe;
break;
default:
@@ -2364,14 +2316,14 @@ static lfe_routing defaultLfeRouting(
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_7_1_4:
routing.lfePanMtx[0][LFE_CHANNEL] = 1.0f;
break;
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
+ case AUDIO_CONFIG_LS_CUSTOM:
for ( i = 0; i < routing.numLfeChannels && i < customLsOut.num_lfe; ++i )
{
routing.lfePanMtx[i][customLsOut.lfe_idx[i]] = 1.0f;
@@ -2385,9 +2337,10 @@ static lfe_routing defaultLfeRouting(
return routing;
}
+
static ivas_error setRendInputActiveMc(
void *input,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const IVAS_REND_InputId id,
RENDER_CONFIG_DATA *hRendCfg )
{
@@ -2396,7 +2349,7 @@ static ivas_error setRendInputActiveMc(
#endif
ivas_error error;
rendering_context rendCtx;
- IVAS_REND_AudioConfig outConfig;
+ AUDIO_CONFIG outConfig;
input_mc *inputMc;
#ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t pos_idx;
@@ -2420,8 +2373,8 @@ static ivas_error setRendInputActiveMc(
{
return error;
}
- initRendInputBase( &inputMc->base, inConfig, id, rendCtx,
- inputMc->bufferData, MAX_BUFFER_LENGTH );
+ initRendInputBase( &inputMc->base, inConfig, id, rendCtx, inputMc->bufferData, MAX_BUFFER_LENGTH );
+
setZeroPanMatrix( inputMc->panGains );
inputMc->customLsInput = defaultCustomLs();
inputMc->tdRendWrapper = defaultTdRendWrapper();
@@ -2447,7 +2400,7 @@ static ivas_error setRendInputActiveMc(
if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
#else
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#endif
{
if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg ) ) != IVAS_ERR_OK )
@@ -2456,7 +2409,7 @@ static ivas_error setRendInputActiveMc(
}
}
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 )
{
if ( ( error = initMcMasaRendering( inputMc, inConfig, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
{
@@ -2472,6 +2425,7 @@ static ivas_error setRendInputActiveMc(
return IVAS_ERR_OK;
}
+
static void clearInputMc(
input_mc *inputMc )
{
@@ -2484,8 +2438,7 @@ static void clearInputMc(
freeMcLfeDelayBuffer( &inputMc->lfeDelayBuffer );
freeInputBaseBufferData( &inputMc->bufferData );
- initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx,
- NULL, 0 );
+ initRendInputBase( &inputMc->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );
/* Free input's internal handles */
if ( inputMc->efapInWrapper.hEfap != NULL )
@@ -2524,9 +2477,10 @@ static void clearInputMc(
return;
}
+
static ivas_error initSbaPanGainsForMcOut(
input_sba *inputSba,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
const LSSETUP_CUSTOM_STRUCT *outSetupCustom )
{
int16_t ambiOrderIn;
@@ -2548,20 +2502,20 @@ static ivas_error initSbaPanGainsForMcOut(
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_MONO:
+ case AUDIO_CONFIG_MONO:
hOutSetup.ls_azimuth = ls_azimuth_CICP1;
hOutSetup.ls_elevation = ls_elevation_CICP1;
- ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) );
+ ivas_output_init( &hOutSetup, outConfig );
break;
- case IVAS_REND_AUDIO_CONFIG_STEREO:
- case IVAS_REND_AUDIO_CONFIG_5_1:
- case IVAS_REND_AUDIO_CONFIG_7_1:
- case IVAS_REND_AUDIO_CONFIG_5_1_2:
- case IVAS_REND_AUDIO_CONFIG_5_1_4:
- case IVAS_REND_AUDIO_CONFIG_7_1_4:
- ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) );
+ case AUDIO_CONFIG_STEREO:
+ case AUDIO_CONFIG_5_1:
+ case AUDIO_CONFIG_7_1:
+ case AUDIO_CONFIG_5_1_2:
+ case AUDIO_CONFIG_5_1_4:
+ case AUDIO_CONFIG_7_1_4:
+ ivas_output_init( &hOutSetup, outConfig );
break;
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
+ case AUDIO_CONFIG_LS_CUSTOM:
ivas_ls_custom_setup( &hOutSetup, outSetupCustom );
break;
default:
@@ -2594,9 +2548,10 @@ static ivas_error initSbaPanGainsForMcOut(
return IVAS_ERR_OK;
}
+
static ivas_error initSbaPanGainsForSbaOut(
input_sba *inputSba,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
ivas_error error;
error = IVAS_ERR_OK;
@@ -2612,11 +2567,12 @@ static ivas_error initSbaPanGainsForSbaOut(
return error;
}
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error
updateSplitPostRendPanGains(
input_split_post_rend *inputSplitPostRend,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
RENDER_CONFIG_DATA *hRendCfg )
{
ivas_error error;
@@ -2642,13 +2598,14 @@ updateSplitPostRendPanGains(
}
#endif
+
static ivas_error updateSbaPanGains(
input_sba *inputSba,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
RENDER_CONFIG_DATA *hRendCfg )
{
ivas_error error;
- IVAS_REND_AudioConfig inConfig;
+ AUDIO_CONFIG inConfig;
rendering_context rendCtx;
/* Reset to all zeros - some functions below only write non-zero elements. */
@@ -2669,13 +2626,13 @@ static ivas_error updateSbaPanGains(
switch ( outConfig )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
{
if ( hRendCfg->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
{
- assert( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" );
+ assert( inConfig == AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" );
error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig,
&rendCtx.pSplitRendWrapper->multiBinPoseData,
*rendCtx.pOutSampleRate );
@@ -2699,13 +2656,11 @@ static ivas_error updateSbaPanGains(
break;
}
#endif
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( hRendCfg->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
{
- error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig,
- &rendCtx.pSplitRendWrapper->multiBinPoseData,
- *rendCtx.pOutSampleRate );
+ error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate );
if ( error != IVAS_ERR_OK )
{
return error;
@@ -2714,12 +2669,7 @@ static ivas_error updateSbaPanGains(
else
#endif
{
- error = ivas_rend_openCrend( &inputSba->crendWrapper,
- getIvasAudioConfigFromRendAudioConfig( inConfig ),
- getIvasAudioConfigFromRendAudioConfig( outConfig ),
- hRendCfg,
- NULL,
- *rendCtx.pOutSampleRate
+ error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses
@@ -2727,19 +2677,14 @@ static ivas_error updateSbaPanGains(
);
}
break;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
- if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_REND_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK )
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ if ( ( error = initSbaPanGainsForMcOut( inputSba, AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK )
{
return error;
}
- error = ivas_rend_openCrend( &inputSba->crendWrapper,
- AUDIO_CONFIG_7_1_4,
- getIvasAudioConfigFromRendAudioConfig( outConfig ),
- hRendCfg,
- NULL,
- *rendCtx.pOutSampleRate
+ error = ivas_rend_openCrend( &inputSba->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses
@@ -2765,16 +2710,17 @@ static ivas_error updateSbaPanGains(
return IVAS_ERR_OK;
}
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error setRendInputActiveSplitPostRend(
void *input,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const IVAS_REND_InputId id,
RENDER_CONFIG_DATA *hRendCfg )
{
ivas_error error;
rendering_context rendCtx;
- IVAS_REND_AudioConfig outConfig;
+ AUDIO_CONFIG outConfig;
input_split_post_rend *inputSplitPostRend;
inputSplitPostRend = (input_split_post_rend *) input;
@@ -2785,8 +2731,8 @@ static ivas_error setRendInputActiveSplitPostRend(
{
return error;
}
- initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx,
- inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH );
+
+ initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx, inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH );
if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg ) ) != IVAS_ERR_OK )
{
@@ -2796,6 +2742,7 @@ static ivas_error setRendInputActiveSplitPostRend(
}
#endif
+
static ivas_error initSbaMasaRendering(
input_sba *inputSba,
int32_t inSampleRate )
@@ -2817,15 +2764,16 @@ static ivas_error initSbaMasaRendering(
return IVAS_ERR_OK;
}
+
static ivas_error setRendInputActiveSba(
void *input,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const IVAS_REND_InputId id,
RENDER_CONFIG_DATA *hRendCfg )
{
ivas_error error;
rendering_context rendCtx;
- IVAS_REND_AudioConfig outConfig;
+ AUDIO_CONFIG outConfig;
input_sba *inputSba;
#ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t pos_idx;
@@ -2866,7 +2814,7 @@ static ivas_error setRendInputActiveSba(
initRotGains( inputSba->rot_gains_prev );
#endif /* SPLIT_REND_WITH_HEAD_ROT */
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 )
{
if ( ( error = initSbaMasaRendering( inputSba, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
{
@@ -2882,6 +2830,7 @@ static ivas_error setRendInputActiveSba(
return error;
}
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
static void clearInputSplitRend(
input_split_post_rend *inputSplitRend )
@@ -2891,16 +2840,19 @@ static void clearInputSplitRend(
rendCtx = inputSplitRend->base.ctx;
freeInputBaseBufferData( &inputSplitRend->bufferData );
- initRendInputBase( &inputSplitRend->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx,
- NULL, 0 );
+
+ initRendInputBase( &inputSplitRend->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );
+
if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL )
{
ivas_splitBinPostRendClose( &inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend );
}
+
if ( inputSplitRend->splitPostRendWrapper.hSplitBinLCLDDec != NULL )
{
ivas_splitBinLCLDDecClose( &inputSplitRend->splitPostRendWrapper.hSplitBinLCLDDec );
}
+
if ( inputSplitRend->splitPostRendWrapper.hLc3plusDec != NULL )
{
IVAS_LC3PLUS_DEC_Close( &inputSplitRend->splitPostRendWrapper.hLc3plusDec );
@@ -2908,8 +2860,33 @@ static void clearInputSplitRend(
return;
}
+
+
+/*-------------------------------------------------------------------------
+ * ivas_rend_openCldfbRend()
+ *
+ * Close CLDFB based fastconv binaural renderer memories
+ *------------------------------------------------------------------------*/
+
+static void ivas_rend_closeCldfbRend(
+ CLDFB_REND_WRAPPER *pCldfbRend )
+{
+ if ( pCldfbRend->hCldfbRend->hInputSetup != NULL )
+ {
+ free( pCldfbRend->hCldfbRend->hInputSetup );
+ pCldfbRend->hCldfbRend->hInputSetup = NULL;
+ }
+
+ ivas_binRenderer_close( &pCldfbRend->hCldfbRend );
+
+ ivas_HRTF_fastconv_binary_close( &pCldfbRend->hHrtfFastConv );
+
+ return;
+}
+
#endif /* SPLIT_REND_WITH_HEAD_ROT */
+
static void clearInputSba(
input_sba *inputSba )
{
@@ -2918,8 +2895,8 @@ static void clearInputSba(
rendCtx = inputSba->base.ctx;
freeInputBaseBufferData( &inputSba->bufferData );
- initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx,
- NULL, 0 );
+
+ initRendInputBase( &inputSba->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );
/* Free input's internal handles */
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -2937,31 +2914,30 @@ static void clearInputSba(
return;
}
+
static ivas_error initMasaDummyDecForMcOut(
input_masa *inputMasa,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
ivas_error error;
int16_t numCldfbAnalyses;
int16_t numCldfbSyntheses;
int16_t i;
- AUDIO_CONFIG output_config;
DecoderDummy *decDummy;
decDummy = inputMasa->decDummy;
- output_config = getIvasAudioConfigFromRendAudioConfig( outConfig );
- decDummy->hDecoderConfig->output_config = output_config;
+ decDummy->hDecoderConfig->output_config = outConfig;
decDummy->sba_analysis_order = 1;
decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */
decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */
- ivas_output_init( &( decDummy->hOutSetup ), output_config );
- ivas_output_init( &( decDummy->hIntSetup ), output_config );
+ ivas_output_init( &( decDummy->hOutSetup ), outConfig );
+ ivas_output_init( &( decDummy->hIntSetup ), outConfig );
decDummy->renderer_type = RENDERER_DIRAC;
- if ( output_config == AUDIO_CONFIG_STEREO )
+ if ( outConfig == AUDIO_CONFIG_STEREO )
{
decDummy->renderer_type = RENDERER_STEREO_PARAMETRIC;
}
@@ -3020,29 +2996,28 @@ static ivas_error initMasaDummyDecForMcOut(
return IVAS_ERR_OK;
}
+
static ivas_error initMasaDummyDecForSbaOut(
input_masa *inputMasa,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
ivas_error error;
int16_t numCldfbAnalyses;
int16_t numCldfbSyntheses;
int16_t i;
- AUDIO_CONFIG output_config;
DecoderDummy *decDummy;
decDummy = inputMasa->decDummy;
- output_config = getIvasAudioConfigFromRendAudioConfig( outConfig );
- decDummy->hDecoderConfig->output_config = output_config;
+ decDummy->hDecoderConfig->output_config = outConfig;
decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */
decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */
decDummy->sba_analysis_order = 1;
- ivas_output_init( &( decDummy->hOutSetup ), output_config );
- ivas_output_init( &( decDummy->hIntSetup ), output_config );
+ ivas_output_init( &( decDummy->hOutSetup ), outConfig );
+ ivas_output_init( &( decDummy->hIntSetup ), outConfig );
decDummy->renderer_type = RENDERER_DIRAC;
decDummy->ivas_format = MASA_FORMAT;
decDummy->transport_config = AUDIO_CONFIG_INVALID;
@@ -3090,32 +3065,26 @@ static ivas_error initMasaDummyDecForSbaOut(
return IVAS_ERR_OK;
}
+
static ivas_error initMasaDummyDecForBinauralOut(
input_masa *inputMasa,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
ivas_error error;
-
int16_t i;
- AUDIO_CONFIG output_config;
DecoderDummy *decDummy;
decDummy = inputMasa->decDummy;
-
- output_config = getIvasAudioConfigFromRendAudioConfig( outConfig );
- decDummy->hDecoderConfig->output_config = output_config;
-
- output_config = decDummy->hDecoderConfig->output_config;
-
+ decDummy->hDecoderConfig->output_config = outConfig;
decDummy->sba_analysis_order = 1;
decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */
decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */
- ivas_output_init( &( decDummy->hOutSetup ), output_config );
- if ( output_config == AUDIO_CONFIG_BINAURAL
+ ivas_output_init( &( decDummy->hOutSetup ), outConfig );
+ if ( outConfig == AUDIO_CONFIG_BINAURAL
#ifdef SPLIT_REND_WITH_HEAD_ROT
- || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM
+ || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM
#endif
)
{
@@ -3144,7 +3113,6 @@ static ivas_error initMasaDummyDecForBinauralOut(
return error;
}
-
for ( i = 0; i < BINAURAL_CHANNELS; i++ )
{
if ( ( error = openCldfb( &( decDummy->cldfbAnaDec[i] ), CLDFB_ANALYSIS, decDummy->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
@@ -3165,9 +3133,10 @@ static ivas_error initMasaDummyDecForBinauralOut(
return IVAS_ERR_OK;
}
+
static ivas_error updateMasaDummyDec(
input_masa *inputMasa,
- const IVAS_REND_AudioConfig outConfig )
+ const AUDIO_CONFIG outConfig )
{
ivas_error error;
@@ -3189,10 +3158,11 @@ static ivas_error updateMasaDummyDec(
return error;
}
+
static DecoderDummy *initDecoderDummy(
const int32_t sampleRate,
const int16_t numTransChannels,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
const uint8_t enableRenderConfig
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
@@ -3225,8 +3195,8 @@ static DecoderDummy *initDecoderDummy(
ivas_init_split_rend_handles( &decDummy->splitBinRend.splitrend );
decDummy->splitBinRend.splitrend = *pSplitRendWrapper;
#ifdef FIX_658_SPLIT_REND_MASA
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
- outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
+ outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#else
if ( decDummy->splitBinRend.splitrend.multiBinPoseData.num_poses > 1 )
#endif
@@ -3259,7 +3229,7 @@ static DecoderDummy *initDecoderDummy(
decDummy->hHeadTrackData = NULL;
decDummy->hDirAC = NULL;
decDummy->hTcBuffer = NULL;
- decDummy->hDecoderConfig->output_config = getIvasAudioConfigFromRendAudioConfig( outConfig );
+ decDummy->hDecoderConfig->output_config = outConfig;
decDummy->nchan_transport = numTransChannels;
if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
@@ -3326,15 +3296,16 @@ static DecoderDummy *initDecoderDummy(
return decDummy;
}
+
static ivas_error setRendInputActiveMasa(
void *input,
- const IVAS_REND_AudioConfig inConfig,
+ const AUDIO_CONFIG inConfig,
const IVAS_REND_InputId id,
RENDER_CONFIG_DATA *hRendCfg ) /* Todo: This is not used at all within MASA. Support might be better to do after refactoring. */
{
ivas_error error;
rendering_context rendCtx;
- IVAS_REND_AudioConfig outConfig;
+ AUDIO_CONFIG outConfig;
input_masa *inputMasa;
int16_t numInChannels;
@@ -3352,8 +3323,7 @@ static ivas_error setRendInputActiveMasa(
{
return error;
}
- initRendInputBase( &inputMasa->base, inConfig, id, rendCtx,
- inputMasa->bufferData, MAX_BUFFER_LENGTH );
+ initRendInputBase( &inputMasa->base, inConfig, id, rendCtx, inputMasa->bufferData, MAX_BUFFER_LENGTH );
if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK )
{
@@ -3362,7 +3332,7 @@ static ivas_error setRendInputActiveMasa(
if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_MASA )
{
inputMasa->metadataHasBeenFed = false;
- if ( ( error = masaPrerendOpen( &inputMasa->hMasaPrerend, inputMasa->base.inConfig == IVAS_REND_AUDIO_CONFIG_MASA1 ? 1 : 2, *( inputMasa->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK )
+ if ( ( error = masaPrerendOpen( &inputMasa->hMasaPrerend, inputMasa->base.inConfig == AUDIO_CONFIG_MASA1 ? 1 : 2, *( inputMasa->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -3375,6 +3345,7 @@ static ivas_error setRendInputActiveMasa(
rendCtx.pSplitRendWrapper
#endif
);
+
inputMasa->metadataHasBeenFed = false;
if ( ( error = updateMasaDummyDec( inputMasa, outConfig ) ) != IVAS_ERR_OK )
@@ -3386,6 +3357,7 @@ static ivas_error setRendInputActiveMasa(
return IVAS_ERR_OK;
}
+
static void freeDecoderDummy(
DecoderDummy **ppDecDummy )
{
@@ -3484,6 +3456,7 @@ static void freeDecoderDummy(
return;
}
+
static void clearInputMasa(
input_masa *inputMasa )
{
@@ -3494,20 +3467,21 @@ static void clearInputMasa(
freeInputBaseBufferData( &inputMasa->bufferData );
masaPrerendClose( &inputMasa->hMasaPrerend );
- initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx,
- NULL, 0 );
+
+ initRendInputBase( &inputMasa->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );
freeDecoderDummy( &inputMasa->decDummy );
return;
}
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
-static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer, const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, IVAS_REND_HeadRotData headRotData, const int32_t outputSampleRate, const IVAS_REND_AudioConfig outConfig, const int16_t cldfb_in )
+static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer, const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, IVAS_REND_HeadRotData headRotData, const int32_t outputSampleRate, const AUDIO_CONFIG outConfig, const int16_t cldfb_in )
{
ivas_error error;
IVAS_REND_AudioBufferConfig bufConfig;
- if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
@@ -3523,7 +3497,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN
pSplit_rend_config,
outputSampleRate,
cldfb_in,
- outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
+ outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
if ( error != IVAS_ERR_OK )
{
return error;
@@ -3555,10 +3529,11 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN
}
#endif /* SPLIT_REND_WITH_HEAD_ROT */
+
ivas_error IVAS_REND_Open(
IVAS_REND_HANDLE *phIvasRend,
const int32_t outputSampleRate,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
const int16_t nonDiegeticPan,
const float nonDiegeticPanGain )
{
@@ -3646,8 +3621,8 @@ ivas_error IVAS_REND_Open(
for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
{
- initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ),
- NULL, 0 );
+ initRendInputBase( &hIvasRend->inputsIsm[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 );
+
hIvasRend->inputsIsm[i].crendWrapper = NULL;
hIvasRend->inputsIsm[i].hReverb = NULL;
hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL;
@@ -3666,8 +3641,8 @@ ivas_error IVAS_REND_Open(
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
{
- initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ),
- NULL, 0 );
+ initRendInputBase( &hIvasRend->inputsMc[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 );
+
hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL;
hIvasRend->inputsMc[i].crendWrapper = NULL;
hIvasRend->inputsMc[i].hReverb = NULL;
@@ -3688,8 +3663,8 @@ ivas_error IVAS_REND_Open(
for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i )
{
- initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ),
- NULL, 0 );
+ initRendInputBase( &hIvasRend->inputsSba[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 );
+
hIvasRend->inputsSba[i].crendWrapper = NULL;
#ifdef SPLIT_REND_WITH_HEAD_ROT
hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL;
@@ -3701,8 +3676,8 @@ ivas_error IVAS_REND_Open(
for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
{
- initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ),
- NULL, 0 );
+ initRendInputBase( &hIvasRend->inputsMasa[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 );
+
hIvasRend->inputsMasa[i].decDummy = NULL;
hIvasRend->inputsMasa[i].metadataHasBeenFed = false;
hIvasRend->inputsMasa[i].bufferData = NULL;
@@ -3711,12 +3686,10 @@ ivas_error IVAS_REND_Open(
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i )
{
- initRendInputBase( &hIvasRend->inputsSplitPost[i].base,
- IVAS_REND_AUDIO_CONFIG_UNKNOWN,
- 0,
- getRendCtx( hIvasRend ),
- NULL, 0 );
+ initRendInputBase( &hIvasRend->inputsSplitPost[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 );
+
ivas_init_split_post_rend_handles( &hIvasRend->inputsSplitPost[i].splitPostRendWrapper );
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
hIvasRend->splitRendBFI = 0;
#endif
@@ -3727,6 +3700,7 @@ ivas_error IVAS_REND_Open(
return IVAS_ERR_OK;
}
+
static LSSETUP_CUSTOM_STRUCT makeCustomLsSetup(
const IVAS_CUSTOM_LS_DATA rendCustomLsLayout )
{
@@ -3754,6 +3728,7 @@ static LSSETUP_CUSTOM_STRUCT makeCustomLsSetup(
return customLs;
}
+
static ivas_error validateCustomLsLayout(
const IVAS_CUSTOM_LS_DATA layout )
{
@@ -3783,6 +3758,7 @@ static ivas_error validateCustomLsLayout(
return IVAS_ERR_OK;
}
+
ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(
IVAS_REND_HANDLE hIvasRend,
const IVAS_CUSTOM_LS_DATA layout )
@@ -3798,7 +3774,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(
return IVAS_ERR_UNEXPECTED_NULL_POINTER;
}
- if ( hIvasRend->outputConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( hIvasRend->outputConfig != AUDIO_CONFIG_LS_CUSTOM )
{
/* Specifying details of custom speaker layout only makes sense if output config is set to custom speaker layout */
return IVAS_ERR_INVALID_OUTPUT_FORMAT;
@@ -3834,7 +3810,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
{
inputMc = &hIvasRend->inputsMc[i];
- if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( inputMc->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Input inactive, skip. */
continue;
@@ -3853,7 +3829,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(
{
inputSba = &hIvasRend->inputsSba[i];
- if ( inputSba->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( inputSba->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Input inactive, skip. */
continue;
@@ -3868,6 +3844,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(
return IVAS_ERR_OK;
}
+
ivas_error IVAS_REND_NumOutChannels(
IVAS_REND_CONST_HANDLE hIvasRend,
int16_t *numOutChannels )
@@ -3883,7 +3860,7 @@ ivas_error IVAS_REND_NumOutChannels(
/* Handle special cases where additional info is needed from the renderer, otherwise use getAudioConfigNumChannels() */
switch ( hIvasRend->outputConfig )
{
- case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM:
+ case AUDIO_CONFIG_LS_CUSTOM:
*numOutChannels = hIvasRend->customLsOut.num_spk + hIvasRend->customLsOut.num_lfe;
break;
default:
@@ -3897,8 +3874,9 @@ ivas_error IVAS_REND_NumOutChannels(
return IVAS_ERR_OK;
}
+
static IVAS_REND_InputId makeInputId(
- IVAS_REND_AudioConfig config,
+ AUDIO_CONFIG config,
const int32_t inputIndex )
{
/* Put config type in second byte (from LSB), put index + 1 in first byte
@@ -3907,6 +3885,7 @@ static IVAS_REND_InputId makeInputId(
return (IVAS_REND_InputId) ( ( ( (uint32_t) getAudioConfigType( config ) ) << 8 ) | ( inputIndex + 1 ) );
}
+
static ivas_error getInputById(
IVAS_REND_HANDLE hIvasRend,
IVAS_REND_InputId inputId,
@@ -3969,7 +3948,7 @@ static ivas_error getInputById(
}
/* Ensure input ID matches and that input is active */
- if ( pInputBase->id != inputId || pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pInputBase->id != inputId || pInputBase->inConfig == AUDIO_CONFIG_INVALID )
{
return IVAS_ERR_INVALID_INPUT_ID;
}
@@ -3980,7 +3959,7 @@ static ivas_error getInputById(
return IVAS_ERR_OK;
}
-/* Unfortunately code duplication here is the only way to avoid warnings about const casting */
+
static ivas_error getConstInputById(
IVAS_REND_CONST_HANDLE hIvasRend,
const IVAS_REND_InputId inputId,
@@ -4043,7 +4022,7 @@ static ivas_error getConstInputById(
}
/* Ensure input ID matches and that input is active */
- if ( pInputBase->id != inputId || pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pInputBase->id != inputId || pInputBase->inConfig == AUDIO_CONFIG_INVALID )
{
return IVAS_ERR_INVALID_INPUT_ID;
}
@@ -4054,6 +4033,7 @@ static ivas_error getConstInputById(
return IVAS_ERR_OK;
}
+
static ivas_error findFreeInputSlot(
const void *inputs,
const int32_t inputStructSize,
@@ -4079,7 +4059,7 @@ static ivas_error findFreeInputSlot(
{
pInputBase = (const input_base *) pByte;
- if ( pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pInputBase->inConfig == AUDIO_CONFIG_INVALID )
{
*inputIndex = i;
canAddInput = true;
@@ -4097,8 +4077,8 @@ static ivas_error findFreeInputSlot(
#ifdef SPLIT_REND_WITH_HEAD_ROT
static int16_t getCldfbRendFlag(
- IVAS_REND_HANDLE hIvasRend, /* i: Renderer handle */
- IVAS_REND_AudioConfigType new_config )
+ IVAS_REND_HANDLE hIvasRend, /* i : Renderer handle */
+ const IVAS_REND_AudioConfigType new_configType )
{
int16_t i;
int16_t numMasaInputs = 0, numSbaInputs = 0, numIsmInputs = 0, numMcInputs = 0;
@@ -4109,27 +4089,26 @@ static int16_t getCldfbRendFlag(
{
for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
{
- numMasaInputs += ( hIvasRend->inputsMasa[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN && new_config != IVAS_REND_AUDIO_CONFIG_TYPE_MASA ) ? 0 : 1;
+ numMasaInputs += ( hIvasRend->inputsMasa[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_MASA ) ? 0 : 1;
}
for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i )
{
- numSbaInputs += ( hIvasRend->inputsSba[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN && new_config != IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ? 0 : 1;
+ numSbaInputs += ( hIvasRend->inputsSba[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ? 0 : 1;
}
for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
{
- numIsmInputs += ( hIvasRend->inputsIsm[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN && new_config != IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) ? 0 : 1;
+ numIsmInputs += ( hIvasRend->inputsIsm[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) ? 0 : 1;
}
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
{
- numMcInputs += ( hIvasRend->inputsMc[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN && new_config != IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? 0 : 1;
+ numMcInputs += ( hIvasRend->inputsMc[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? 0 : 1;
}
if ( numIsmInputs > 0 || numMcInputs > 0 )
{
isCldfbRend = 0;
}
- else if ( ( numMasaInputs > 0 ) ||
- ( numSbaInputs > 0 && hIvasRend->hRendererConfig->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) )
+ else if ( ( numMasaInputs > 0 ) || ( numSbaInputs > 0 && hIvasRend->hRendererConfig->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) )
{
isCldfbRend = 1;
}
@@ -4137,9 +4116,14 @@ static int16_t getCldfbRendFlag(
return isCldfbRend;
}
-static void closeSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer )
+
+
+static void closeSplitRend(
+ SPLIT_REND_WRAPPER *pSplitRendWrapper,
+ IVAS_REND_AudioBuffer *pSplitRendEncBuffer )
{
ivas_split_renderer_close( pSplitRendWrapper );
+
if ( pSplitRendEncBuffer->data != NULL )
{
free( pSplitRendEncBuffer->data );
@@ -4147,9 +4131,12 @@ static void closeSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_Aud
}
pSplitRendEncBuffer->config.numChannels = 0;
pSplitRendEncBuffer->config.numSamplesPerChannel = 0;
+
+ return;
}
#endif
+
/*-------------------------------------------------------------------*
* IVAS_REND_AddInput()
*
@@ -4157,16 +4144,16 @@ static void closeSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_Aud
*-------------------------------------------------------------------*/
ivas_error IVAS_REND_AddInput(
- IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
- const IVAS_REND_AudioConfig inConfig, /* i : audio config for a new input */
- IVAS_REND_InputId *inputId /* o : ID of the new input */
+ IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
+ const AUDIO_CONFIG inConfig, /* i : audio config for a new input */
+ IVAS_REND_InputId *inputId /* o : ID of the new input */
)
{
ivas_error error;
int32_t maxNumInputsOfType;
void *inputsArray;
int32_t inputStructSize;
- ivas_error ( *activateInput )( void *, IVAS_REND_AudioConfig, IVAS_REND_InputId, RENDER_CONFIG_DATA * );
+ ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA * );
int32_t inputIndex;
/* Validate function arguments */
@@ -4184,7 +4171,7 @@ ivas_error IVAS_REND_AddInput(
#ifdef FIX_658_SPLIT_REND_MASA
ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec,
( cldfb_in == 0 ),
- hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
+ hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
#endif
if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper,
&hIvasRend->splitRendEncBuffer,
@@ -4286,7 +4273,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout(
return error;
}
- if ( inputMc->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
/* Specifying details of custom speaker layout only makes sense if input config is set to custom speaker layout */
return IVAS_ERR_INVALID_INPUT_FORMAT;
@@ -4307,7 +4294,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
#else
- if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
+ if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#endif
{
if ( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK )
@@ -4516,7 +4503,7 @@ ivas_error IVAS_REND_RemoveInput(
*-------------------------------------------------------------------*/
ivas_error IVAS_REND_GetInputNumChannels(
- IVAS_REND_CONST_HANDLE hIvasRend, /* i : Renderer handle */
+ IVAS_REND_CONST_HANDLE hIvasRend, /* i : Renderer handle */
const IVAS_REND_InputId inputId, /* i : ID of the input */
int16_t *numChannels /* o : number of channels of the input */
)
@@ -4551,7 +4538,7 @@ ivas_error IVAS_REND_GetInputNumChannels(
*-------------------------------------------------------------------*/
ivas_error IVAS_REND_GetNumAllObjects(
- IVAS_REND_CONST_HANDLE hIvasRend, /* i : Renderer handle */
+ IVAS_REND_CONST_HANDLE hIvasRend, /* i : Renderer handle */
int16_t *numChannels /* o : number of all objects */
)
{
@@ -4560,7 +4547,7 @@ ivas_error IVAS_REND_GetNumAllObjects(
return IVAS_ERR_UNEXPECTED_NULL_POINTER;
}
- if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA2 )
+ if ( hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == AUDIO_CONFIG_MASA2 )
{
*numChannels = (int16_t) hIvasRend->inputsIsm[0].total_num_objects;
}
@@ -4601,7 +4588,7 @@ ivas_error IVAS_REND_GetDelay(
/* Compute the maximum delay across all inputs */
for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ )
{
- if ( hIvasRend->inputsIsm[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( hIvasRend->inputsIsm[i].base.inConfig != AUDIO_CONFIG_INVALID )
{
latency_ns = max( ( hIvasRend->inputsIsm[i].crendWrapper != NULL ) ? hIvasRend->inputsIsm[i].crendWrapper->binaural_latency_ns : 0,
hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns );
@@ -4611,7 +4598,7 @@ ivas_error IVAS_REND_GetDelay(
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ )
{
- if ( hIvasRend->inputsMc[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( hIvasRend->inputsMc[i].base.inConfig != AUDIO_CONFIG_INVALID )
{
latency_ns = max( ( hIvasRend->inputsMc[i].crendWrapper != NULL ) ? hIvasRend->inputsMc[i].crendWrapper->binaural_latency_ns : 0,
hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns );
@@ -4621,7 +4608,7 @@ ivas_error IVAS_REND_GetDelay(
for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ )
{
- if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( hIvasRend->inputsSba[i].base.inConfig != AUDIO_CONFIG_INVALID )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL )
@@ -4653,7 +4640,7 @@ ivas_error IVAS_REND_GetDelay(
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ )
{
- if ( hIvasRend->inputsSplitPost[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( hIvasRend->inputsSplitPost[i].base.inConfig != AUDIO_CONFIG_INVALID )
{
latency_ns = 0;
if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec != NULL )
@@ -4673,7 +4660,7 @@ ivas_error IVAS_REND_GetDelay(
for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ )
{
- if ( hIvasRend->inputsMasa[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( hIvasRend->inputsMasa[i].base.inConfig != AUDIO_CONFIG_INVALID )
{
latency_ns = (int32_t) ( (float) IVAS_FB_DEC_DELAY_NS + 0.5f );
max_latency_ns = max( max_latency_ns, latency_ns );
@@ -4748,7 +4735,7 @@ ivas_error IVAS_REND_FeedInputAudio(
{
return error;
}
- if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) && inputBase->inConfig == IVAS_REND_AUDIO_CONFIG_OBJECT )
+ if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == AUDIO_CONFIG_MASA2 ) && inputBase->inConfig == AUDIO_CONFIG_OBA )
{
numInputChannels = (int16_t) hIvasRend->inputsIsm[0].total_num_objects;
}
@@ -4799,7 +4786,7 @@ ivas_error IVAS_REND_FeedInputObjectMetadata(
return error;
}
- if ( inputBase->inConfig != IVAS_REND_AUDIO_CONFIG_OBJECT )
+ if ( inputBase->inConfig != AUDIO_CONFIG_OBA )
{
/* Object metadata should only be fed for object inputs */
return IVAS_ERR_METADATA_NOT_EXPECTED;
@@ -4887,8 +4874,8 @@ ivas_error IVAS_REND_FeedInputMasaMetadata(
*-------------------------------------------------------------------*/
ivas_error IVAS_REND_InitConfig(
- IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
- const IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */
+ IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
+ const AUDIO_CONFIG outAudioConfig /* i : output audioConfig */
)
{
ivas_error error;
@@ -5048,7 +5035,7 @@ int16_t IVAS_REND_FeedRenderConfig(
hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec;
- if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -5065,7 +5052,7 @@ int16_t IVAS_REND_FeedRenderConfig(
ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec,
( cldfb_in == 0 ),
- hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
+ hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper,
&hIvasRend->splitRendEncBuffer,
&hIvasRend->hRendererConfig->split_rend_config,
@@ -5117,8 +5104,8 @@ ivas_error IVAS_REND_SetHeadRotation(
if ( headRot == NULL )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
- ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
+ ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
hIvasRend->headRotData.headRotEnabled = 1;
for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i )
@@ -5149,10 +5136,10 @@ ivas_error IVAS_REND_SetHeadRotation(
if ( headRot[i].w == -3.0f )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
- ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ||
- ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
- ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
+ ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ||
+ ( hIvasRend->inputsSplitPost[0].base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
+ ( hIvasRend->inputsSplitPost[0].base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat );
}
@@ -5196,7 +5183,7 @@ ivas_error IVAS_REND_SetSplitRendBFI(
*-------------------------------------------------------------------*/
ivas_error IVAS_REND_SetOrientationTrackingMode(
- IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
+ IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */
)
{
@@ -5480,6 +5467,7 @@ static void renderBufferChannelLerp(
return;
}
+
/* Take one channel from input buffer and copy it to each channel
in output buffer, with different gain applied per output channel */
static void renderBufferChannel(
@@ -5493,9 +5481,10 @@ static void renderBufferChannel(
return;
}
+
static ivas_error rotateFrameMc(
IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */
- IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */
+ AUDIO_CONFIG inConfig, /* i : Input Audio config */
LSSETUP_CUSTOM_STRUCT inCustomLs, /* i : Input Custom LS setup */
const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */
const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */
@@ -5521,7 +5510,7 @@ static ivas_error rotateFrameMc(
push_wmops( "rotateFrameMc" );
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
if ( ( error = getAudioConfigNumChannels( inConfig, &nchan ) ) != IVAS_ERR_OK )
{
@@ -5630,9 +5619,10 @@ static ivas_error rotateFrameMc(
return IVAS_ERR_OK;
}
+
static ivas_error rotateFrameSba(
IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */
- IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */
+ const AUDIO_CONFIG inConfig, /* i : Input Audio config */
const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */
const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */
rotation_gains gains_prev, /* i/o: Previous frame rotation gains */
@@ -5751,6 +5741,7 @@ static ivas_error rotateFrameSba(
return IVAS_ERR_OK;
}
+
static ivas_error renderIsmToBinaural(
const input_ism *ismInput,
IVAS_REND_AudioBuffer outAudio )
@@ -5758,20 +5749,14 @@ static ivas_error renderIsmToBinaural(
float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
ivas_error error;
int16_t ism_md_subframe_update_ext;
+
push_wmops( "renderIsmToBinaural" );
/* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */
ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) );
copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer );
- if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper,
- ismInput->base.inConfig,
- NULL,
- ismInput->base.ctx.pCombinedOrientationData,
- &ismInput->currentPos,
- ismInput->hReverb,
- ism_md_subframe_update_ext,
- outAudio.config.numSamplesPerChannel,
- tmpTDRendBuffer ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos,
+ ismInput->hReverb, ism_md_subframe_update_ext, outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -5783,6 +5768,7 @@ static ivas_error renderIsmToBinaural(
return IVAS_ERR_OK;
}
+
static ivas_error renderIsmToBinauralRoom(
input_ism *ismInput,
IVAS_REND_AudioBuffer outAudio )
@@ -5826,7 +5812,6 @@ static ivas_error renderIsmToBinauralRoom(
}
}
-
if ( combinedOrientationEnabled )
{
subframe_len = ismInput->base.inputBuffer.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME;
@@ -5850,7 +5835,7 @@ static ivas_error renderIsmToBinauralRoom(
}
}
}
- (void) subframe_len; // avoid warning
+ (void) subframe_len; /* avoid warning */
}
/* TODO tmu : see issue #518 */
@@ -5896,7 +5881,7 @@ static ivas_error renderIsmToBinauralRoom(
/* intermediate rendering to 7_1_4 */
tmpMcBuffer = ismInput->base.inputBuffer;
- if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -5943,24 +5928,19 @@ static ivas_error renderIsmToBinauralReverb(
ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) );
copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer );
- if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper,
- ismInput->base.inConfig,
- NULL,
- ismInput->base.ctx.pCombinedOrientationData,
- &ismInput->currentPos,
- ismInput->hReverb,
- ism_md_subframe_update_ext,
- outAudio.config.numSamplesPerChannel,
- tmpRendBuffer ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos,
+ ismInput->hReverb, ism_md_subframe_update_ext, outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK )
{
return error;
}
+
accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio );
pop_wmops();
return IVAS_ERR_OK;
}
+
static ivas_error renderIsmToMc(
const input_ism *ismInput,
const IVAS_REND_AudioBuffer outAudio )
@@ -5972,7 +5952,7 @@ static ivas_error renderIsmToMc(
push_wmops( "renderIsmToMc" );
/* TODO(sgi): Possible optimization: less processing needed if position didn't change */
- if ( *ismInput->base.ctx.pOutConfig == IVAS_REND_AUDIO_CONFIG_STEREO )
+ if ( *ismInput->base.ctx.pOutConfig == AUDIO_CONFIG_STEREO )
{
if ( ismInput->nonDiegeticPan )
{
@@ -5983,16 +5963,12 @@ static ivas_error renderIsmToMc(
else
{
set_zero( currentPanGains, 16 );
- ivas_ism_get_stereo_gains( ismInput->currentPos.azimuth,
- ismInput->currentPos.elevation,
- ¤tPanGains[0],
- ¤tPanGains[1] );
+
+ ivas_ism_get_stereo_gains( ismInput->currentPos.azimuth, ismInput->currentPos.elevation, ¤tPanGains[0], ¤tPanGains[1] );
set_zero( previousPanGains, 16 );
- ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth,
- ismInput->previousPos.elevation,
- &previousPanGains[0],
- &previousPanGains[1] );
+
+ ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &previousPanGains[0], &previousPanGains[1] );
}
}
else
@@ -6025,9 +6001,10 @@ static ivas_error renderIsmToMc(
return IVAS_ERR_OK;
}
+
static ivas_error renderIsmToSba(
const input_ism *ismInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
const IVAS_REND_AudioBuffer outAudio )
{
int16_t ambiOrderOut;
@@ -6078,6 +6055,7 @@ static ivas_error renderIsmToSba(
return error;
}
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error renderIsmToSplitBinaural(
input_ism *ismInput,
@@ -6226,7 +6204,8 @@ static ivas_error renderIsmToSplitBinaural(
}
#endif /* SPLIT_REND_WITH_HEAD_ROT */
-static ivas_error renderIsmToMasa(
+
+static void renderIsmToMasa(
input_ism *ismInput,
IVAS_REND_AudioBuffer outAudio )
{
@@ -6235,22 +6214,26 @@ static ivas_error renderIsmToMasa(
push_wmops( "renderIsmToMasa" );
copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer );
+
ivas_omasa_ana( ismInput->hOMasa, tmpRendBuffer, ismInput->base.inputBuffer.config.numSamplesPerChannel, outAudio.config.numChannels, ismInput->base.inputBuffer.config.numChannels );
+
accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio );
pop_wmops();
- return IVAS_ERR_OK;
+ return;
}
+
static ivas_error renderInputIsm(
input_ism *ismInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
const IVAS_REND_AudioBuffer outAudio )
{
ivas_error error;
IVAS_REND_AudioBuffer inAudio;
+ error = IVAS_ERR_OK;
inAudio = ismInput->base.inputBuffer;
if ( ismInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel )
@@ -6274,19 +6257,19 @@ static ivas_error renderInputIsm(
case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL:
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
error = renderIsmToBinaural( ismInput, outAudio );
break;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
error = renderIsmToBinauralRoom( ismInput, outAudio );
break;
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
error = renderIsmToSplitBinaural( ismInput, outAudio );
break;
#endif
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
error = renderIsmToBinauralReverb( ismInput, outAudio );
break;
default:
@@ -6294,20 +6277,22 @@ static ivas_error renderInputIsm(
}
break;
case IVAS_REND_AUDIO_CONFIG_TYPE_MASA:
- error = renderIsmToMasa( ismInput, outAudio );
+ renderIsmToMasa( ismInput, outAudio );
break;
default:
return IVAS_ERR_INVALID_OUTPUT_FORMAT;
}
+
/* Check error here to keep switch statement more compact */
if ( error != IVAS_ERR_OK )
{
return error;
}
- return IVAS_ERR_OK;
+ return error;
}
+
static ivas_error renderActiveInputsIsm(
IVAS_REND_HANDLE hIvasRend,
IVAS_REND_AudioBuffer outAudio )
@@ -6318,14 +6303,13 @@ static ivas_error renderActiveInputsIsm(
for ( i = 0, pCurrentInput = hIvasRend->inputsIsm; i < RENDERER_MAX_ISM_INPUTS; ++i, ++pCurrentInput )
{
- if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Skip inactive inputs */
continue;
}
if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK )
-
{
return error;
}
@@ -6334,10 +6318,11 @@ static ivas_error renderActiveInputsIsm(
return IVAS_ERR_OK;
}
+
static ivas_error renderLfeToBinaural(
const input_mc *mcInput,
#ifdef SPLIT_REND_WITH_HEAD_ROT
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
#endif
IVAS_REND_AudioBuffer outAudio )
{
@@ -6362,7 +6347,7 @@ static ivas_error renderLfeToBinaural(
gain = GAIN_LFE;
- if ( mcInput->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ if ( mcInput->base.inConfig != AUDIO_CONFIG_LS_CUSTOM )
{
lfe_idx = LFE_CHANNEL;
}
@@ -6381,12 +6366,16 @@ static ivas_error renderLfeToBinaural(
frame_size = mcInput->base.inputBuffer.config.numSamplesPerChannel;
num_cpy_smpl_prev_frame = mcInput->binauralDelaySmp;
num_cpy_smpl_cur_frame = frame_size - num_cpy_smpl_prev_frame;
+
/* Assuming LFE should be delayed by less that the duration of one frame */
assert( mcInput->binauralDelaySmp < frame_size );
+
/* Get delayed LFE signal from previous frame, apply gain and save in tmp buffer */
v_multc( mcInput->lfeDelayBuffer, gain, tmpLfeBuffer, num_cpy_smpl_prev_frame );
+
/* Continue filling tmp buffer, now with LFE signal from current frame */
v_multc( lfeInput, gain, tmpLfeBuffer + num_cpy_smpl_prev_frame, num_cpy_smpl_cur_frame );
+
/* Save remaining LFE samples of current frame for next frame */
mvr2r( lfeInput + num_cpy_smpl_cur_frame, mcInput->lfeDelayBuffer, num_cpy_smpl_prev_frame );
@@ -6423,13 +6412,14 @@ static ivas_error renderLfeToBinaural(
return IVAS_ERR_OK;
}
+
static ivas_error renderMcToBinaural(
input_mc *mcInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
- IVAS_REND_AudioConfig inConfig;
+ AUDIO_CONFIG inConfig;
ivas_error error;
IVAS_REND_AudioBuffer tmpRotBuffer;
const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData;
@@ -6461,18 +6451,12 @@ static ivas_error renderMcToBinaural(
}
}
- if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled
-
- && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) )
+ if ( ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ) )
{
copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer );
- if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput,
- mcInput->base.ctx.pCombinedOrientationData,
- NULL,
- mcInput->hReverb,
- 0,
- mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData,
+ NULL, mcInput->hReverb, 0, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -6507,8 +6491,7 @@ static ivas_error renderMcToBinaural(
}
/* call CREND */
- if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate
+ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
0
@@ -6537,13 +6520,14 @@ static ivas_error renderMcToBinaural(
return IVAS_ERR_OK;
}
+
static ivas_error renderMcToBinauralRoom(
input_mc *mcInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
- IVAS_REND_AudioConfig inConfig;
+ AUDIO_CONFIG inConfig;
ivas_error error;
IVAS_REND_AudioBuffer tmpRotBuffer;
float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS];
@@ -6575,7 +6559,7 @@ static ivas_error renderMcToBinauralRoom(
}
}
- if ( ( mcInput->hReverb != NULL && outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) )
+ if ( ( mcInput->hReverb != NULL && outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ) ) )
{
copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer );
@@ -6618,8 +6602,7 @@ static ivas_error renderMcToBinauralRoom(
}
/* call CREND */
- if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate
+ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
0
@@ -6646,9 +6629,10 @@ static ivas_error renderMcToBinauralRoom(
return IVAS_ERR_OK;
}
+
static ivas_error renderMcCustomLsToBinauralRoom(
input_mc *mcInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
int16_t i;
@@ -6709,7 +6693,7 @@ static ivas_error renderMcCustomLsToBinauralRoom(
/* intermediate conversion to 7_1_4 */
tmpMcBuffer = mcInput->base.inputBuffer;
- if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -6726,7 +6710,7 @@ static ivas_error renderMcCustomLsToBinauralRoom(
copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer );
/* call CREND */
- if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL,
+ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL,
p_tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
@@ -6759,6 +6743,7 @@ static ivas_error renderMcCustomLsToBinauralRoom(
return IVAS_ERR_OK;
}
+
static void renderMcToMc(
const input_mc *mcInput,
IVAS_REND_AudioBuffer outAudio )
@@ -6780,6 +6765,7 @@ static void renderMcToMc(
return;
}
+
static void renderMcToSba(
const input_mc *mcInput,
IVAS_REND_AudioBuffer outAudio )
@@ -6801,7 +6787,8 @@ static void renderMcToSba(
return;
}
-static ivas_error renderMcToMasa(
+
+static void renderMcToMasa(
input_mc *mcInput,
IVAS_REND_AudioBuffer outAudio )
{
@@ -6810,18 +6797,21 @@ static ivas_error renderMcToMasa(
push_wmops( "renderMcToMasa" );
copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer );
+
ivas_mcmasa_ana( mcInput->hMcMasa, tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, outAudio.config.numChannels, mcInput->base.inputBuffer.config.numChannels );
+
accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio );
pop_wmops();
- return IVAS_ERR_OK;
+ return;
}
+
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error renderMcToSplitBinaural(
input_mc *mcInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
int16_t i, j, sf, pos_idx;
@@ -6832,7 +6822,7 @@ static ivas_error renderMcToSplitBinaural(
float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS];
float tmpSplitBinauralBuffer[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k];
- IVAS_REND_AudioConfig inConfig;
+ AUDIO_CONFIG inConfig;
IVAS_REND_AudioBuffer tmpRotBuffer;
COMBINED_ORIENTATION_DATA combinedOrientationDataLocal;
COMBINED_ORIENTATION_HANDLE pCombinedOrientationDataLocal;
@@ -6870,7 +6860,7 @@ static ivas_error renderMcToSplitBinaural(
/* temporary buffer for rotation in source format for CREND */
tmpRotBuffer = mcInput->base.inputBuffer;
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_REND_AUDIO_CONFIG_5_1 && inConfig != IVAS_REND_AUDIO_CONFIG_7_1 )
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inConfig != AUDIO_CONFIG_5_1 && inConfig != AUDIO_CONFIG_7_1 )
{
tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) );
}
@@ -6892,7 +6882,7 @@ static ivas_error renderMcToSplitBinaural(
QuatToRotMat( combinedOrientationDataLocal.Quaternions[i], combinedOrientationDataLocal.Rmat[i] );
}
- if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM || inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 )
+ if ( inConfig == AUDIO_CONFIG_LS_CUSTOM || inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 )
{
/* tdrend processing overview:
* 1. copy from inputBuffer to tmpRendBuffer
@@ -6958,16 +6948,7 @@ static ivas_error renderMcToSplitBinaural(
copyBufferTo2dArray( tmpRotBuffer, tmpRendBuffer );
/* call CREND (rotation already performed) */
- if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper,
- getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ),
- getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL,
- NULL,
- NULL,
- NULL,
- p_tmpRendBuffer,
- *mcInput->base.ctx.pOutSampleRate,
- pos_idx ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate, pos_idx ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -6985,7 +6966,7 @@ static ivas_error renderMcToSplitBinaural(
}
}
- if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_REND_AUDIO_CONFIG_5_1 && inConfig != IVAS_REND_AUDIO_CONFIG_7_1 )
+ if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inConfig != AUDIO_CONFIG_5_1 && inConfig != AUDIO_CONFIG_7_1 )
{
/* free temporary buffer for rotation in source format for CREND */
free( tmpRotBuffer.data );
@@ -7004,9 +6985,10 @@ static ivas_error renderMcToSplitBinaural(
}
#endif /* SPLIT_REND_WITH_HEAD_ROT */
+
static ivas_error renderInputMc(
input_mc *mcInput,
- IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
ivas_error error;
@@ -7040,12 +7022,12 @@ static ivas_error renderInputMc(
case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL:
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
error = renderMcToBinaural( mcInput, outConfig, outAudio );
break;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
- if ( mcInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ if ( mcInput->base.inConfig == AUDIO_CONFIG_LS_CUSTOM )
{
error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio );
}
@@ -7055,8 +7037,8 @@ static ivas_error renderInputMc(
}
break;
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
error = renderMcToSplitBinaural( mcInput, outConfig, outAudio );
break;
#endif
@@ -7074,6 +7056,7 @@ static ivas_error renderInputMc(
return error;
}
+
static ivas_error renderActiveInputsMc(
IVAS_REND_HANDLE hIvasRend,
IVAS_REND_AudioBuffer outAudio )
@@ -7084,7 +7067,7 @@ static ivas_error renderActiveInputsMc(
for ( i = 0, pCurrentInput = hIvasRend->inputsMc; i < RENDERER_MAX_MC_INPUTS; ++i, ++pCurrentInput )
{
- if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Skip inactive inputs */
continue;
@@ -7099,6 +7082,7 @@ static ivas_error renderActiveInputsMc(
return IVAS_ERR_OK;
}
+
static void renderSbaToMc(
const input_sba *sbaInput,
IVAS_REND_AudioBuffer outAudio )
@@ -7120,6 +7104,7 @@ static void renderSbaToMc(
return;
}
+
static void renderSbaToSba(
const input_sba *sbaInput,
IVAS_REND_AudioBuffer outAudio )
@@ -7252,13 +7237,10 @@ static ivas_error renderSplitBinauralWithPostRot(
{
if ( !SplitRendBFI )
{
- ivas_splitBinPostRendMdDec(
- &bits,
- hSplitBin->hBinHrSplitPostRend,
- &hSplitBin->multiBinPoseData
+ ivas_splitBinPostRendMdDec( &bits, hSplitBin->hBinHrSplitPostRend, &hSplitBin->multiBinPoseData
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
- ,
- hSplitBin->hBinHrSplitPreRend
+ ,
+ hSplitBin->hBinHrSplitPreRend
#endif /* SPLIT_REND_WITH_HEAD_ROT_DEBUG */
);
}
@@ -7267,16 +7249,11 @@ static ivas_error renderSplitBinauralWithPostRot(
hSplitBin->multiBinPoseData.poseCorrectionMode = bits.pose_correction;
/* decode audio */
- if ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
+ if ( splitBinInput->base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD )
{
- ivas_splitBinLCLDDecProcess(
- hSplitBin->hSplitBinLCLDDec,
- &bits,
- Cldfb_RealBuffer_Binaural,
- Cldfb_ImagBuffer_Binaural,
- SplitRendBFI );
+ ivas_splitBinLCLDDecProcess( hSplitBin->hSplitBinLCLDDec, &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, SplitRendBFI );
isPostRendInputCldfb = 1;
}
else
@@ -7319,19 +7296,12 @@ static ivas_error renderSplitBinauralWithPostRot(
}
else if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
{
- ivas_rend_CldfbSplitPostRendProcess(
- hSplitBin->hBinHrSplitPostRend,
- &hSplitBin->multiBinPoseData,
- QuaternionsPost,
- Cldfb_RealBuffer_Binaural,
- Cldfb_ImagBuffer_Binaural,
- tmpCrendBuffer,
- isPostRendInputCldfb );
+ ivas_rend_CldfbSplitPostRendProcess( hSplitBin->hBinHrSplitPostRend, &hSplitBin->multiBinPoseData, QuaternionsPost, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, tmpCrendBuffer, isPostRendInputCldfb );
}
}
else
{
- if ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
+ if ( splitBinInput->base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
int16_t ch_idx;
for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ )
@@ -7356,7 +7326,7 @@ static ivas_error renderSplitBinauralWithPostRot(
static ivas_error renderSbaToMultiBinaural(
input_sba *sbaInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
float out[][L_FRAME48k] )
{
float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
@@ -7365,11 +7335,10 @@ static ivas_error renderSbaToMultiBinaural(
int16_t sf, i, j, pos_idx;
COMBINED_ORIENTATION_DATA combinedOrientationDataLocal;
COMBINED_ORIENTATION_HANDLE pCombinedOrientationDataLocal;
-
-
ivas_error error;
IVAS_REND_AudioBuffer tmpRotBuffer;
const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData;
+
for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ )
{
p_tmpCrendBuffer[i] = tmpCrendBuffer[i];
@@ -7430,11 +7399,7 @@ static ivas_error renderSbaToMultiBinaural(
assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL );
/* call CREND */
- if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL, NULL, NULL, NULL,
- p_tmpCrendBuffer,
- *sbaInput->base.ctx.pOutSampleRate,
- pos_idx ) ) != IVAS_ERR_OK )
+ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate, pos_idx ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -7458,10 +7423,11 @@ static ivas_error renderSbaToMultiBinaural(
return IVAS_ERR_OK;
}
-static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput,
- float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
- float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
- const int16_t low_res_pre_rend_rot )
+static ivas_error renderSbaToMultiBinauralCldfb(
+ input_sba *sbaInput,
+ float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
+ float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
+ const int16_t low_res_pre_rend_rot )
{
float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
@@ -7482,7 +7448,7 @@ static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput,
static ivas_error renderSbaToSplitBinaural(
input_sba *sbaInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
@@ -7520,9 +7486,10 @@ static ivas_error renderSbaToSplitBinaural(
}
#endif /* SPLIT_REND_WITH_HEAD_ROT */
+
static ivas_error renderSbaToBinaural(
input_sba *sbaInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
@@ -7541,6 +7508,7 @@ static ivas_error renderSbaToBinaural(
{
float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
+
renderSbaToMultiBinauralCldfb( sbaInput,
Cldfb_RealBuffer_Binaural,
Cldfb_ImagBuffer_Binaural,
@@ -7602,8 +7570,7 @@ static ivas_error renderSbaToBinaural(
}
/* call CREND */
- if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate
+ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
0
@@ -7623,7 +7590,7 @@ static ivas_error renderSbaToBinaural(
static ivas_error renderSbaToBinauralRoom(
input_sba *sbaInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
int16_t i;
@@ -7686,7 +7653,7 @@ static ivas_error renderSbaToBinauralRoom(
/* intermediate rendering to 7_1_4 */
tmpMcBuffer = sbaInput->base.inputBuffer;
- if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK )
+ if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK )
{
return error;
}
@@ -7704,8 +7671,7 @@ static ivas_error renderSbaToBinauralRoom(
copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer );
/* call CREND */
- if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ),
- NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate
+ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
0
@@ -7731,7 +7697,7 @@ static ivas_error renderSbaToBinauralRoom(
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error renderInputSplitBin(
input_split_post_rend *splitBinInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio,
IVAS_REND_BitstreamBuffer *hBits,
const int16_t SplitRendBFI )
@@ -7755,7 +7721,7 @@ static ivas_error renderInputSplitBin(
inAudio.config.numSamplesPerChannel * inAudio.config.numChannels );
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
error = renderSplitBinauralWithPostRot( splitBinInput, outAudio,
hBits,
SplitRendBFI );
@@ -7787,7 +7753,7 @@ static ivas_error renderSbaToMasa(
static ivas_error renderInputSba(
input_sba *sbaInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
ivas_error error;
@@ -7799,7 +7765,7 @@ static ivas_error renderInputSba(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) &&
- ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
#else
if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel )
#endif
@@ -7827,8 +7793,8 @@ static ivas_error renderInputSba(
switch ( outConfig )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
error = renderSbaToSplitBinaural( sbaInput,
#ifdef SPLIT_REND_WITH_HEAD_ROT
outConfig,
@@ -7836,11 +7802,11 @@ static ivas_error renderInputSba(
outAudio );
break;
#endif
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
error = renderSbaToBinaural( sbaInput, outConfig, outAudio );
break;
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio );
break;
default:
@@ -7869,7 +7835,7 @@ static ivas_error renderActiveInputsSplitBin(
for ( i = 0, pCurrentInput = hIvasRend->inputsSplitPost; i < RENDERER_MAX_BIN_INPUTS; ++i, ++pCurrentInput )
{
- if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Skip inactive inputs */
continue;
@@ -7896,7 +7862,7 @@ static ivas_error renderActiveInputsSba(
for ( i = 0, pCurrentInput = hIvasRend->inputsSba; i < RENDERER_MAX_SBA_INPUTS; ++i, ++pCurrentInput )
{
- if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Skip inactive inputs */
continue;
@@ -8076,9 +8042,10 @@ static void renderMasaToBinaural(
return;
}
+
static void renderMasaToMasa(
input_masa *masaInput,
- IVAS_REND_AudioBuffer outAudio )
+ const IVAS_REND_AudioBuffer outAudio )
{
int16_t sf, band, dir, numDirs;
float ratioSum;
@@ -8088,7 +8055,6 @@ static void renderMasaToMasa(
int16_t ts, i, j, l_ts;
float Chan_RealBuffer[MASA_MAX_TRANSPORT_CHANNELS][CLDFB_NO_CHANNELS_MAX];
float Chan_ImagBuffer[MASA_MAX_TRANSPORT_CHANNELS][CLDFB_NO_CHANNELS_MAX];
-
int16_t band_m_idx, block_m_idx;
int16_t mrange[2];
int16_t brange[2];
@@ -8100,7 +8066,6 @@ static void renderMasaToMasa(
l_ts = masaInput->base.inputBuffer.config.numSamplesPerChannel / CLDFB_NO_COL_MAX;
numAnalysisChannels = masaInput->hMasaPrerend->num_Cldfb_instances;
-
/* do processing over all CLDFB time slots */
for ( block_m_idx = 0; block_m_idx < MAX_PARAM_SPATIAL_SUBFRAMES; block_m_idx++ )
{
@@ -8204,9 +8169,10 @@ static void renderMasaToMasa(
return;
}
+
static ivas_error renderInputMasa(
input_masa *masaInput,
- const IVAS_REND_AudioConfig outConfig,
+ const AUDIO_CONFIG outConfig,
IVAS_REND_AudioBuffer outAudio )
{
IVAS_REND_AudioBuffer inAudio;
@@ -8219,7 +8185,7 @@ static ivas_error renderInputMasa(
inAudio = masaInput->base.inputBuffer;
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( masaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) &&
- ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
#else
if ( masaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel )
#endif
@@ -8246,7 +8212,7 @@ static ivas_error renderInputMasa(
case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL:
switch ( outConfig )
{
- case IVAS_REND_AUDIO_CONFIG_BINAURAL:
+ case AUDIO_CONFIG_BINAURAL:
renderMasaToBinaural( masaInput, outAudio
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
@@ -8256,16 +8222,16 @@ static ivas_error renderInputMasa(
break;
/* ToDo */
// #ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG
- // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR:
- // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
+ // case AUDIO_CONFIG_BINAURAL_ROOM_IR:
+ // case AUDIO_CONFIG_BINAURAL_ROOM_REVERB:
// #else
// case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM:
// #endif
// renderMasaToBinauralRoom( masaInput, outConfig, outAudio );
// break;
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
- case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
+ case AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
renderMasaToBinaural( masaInput, outAudio
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
@@ -8288,6 +8254,7 @@ static ivas_error renderInputMasa(
return IVAS_ERR_OK;
}
+
static ivas_error renderActiveInputsMasa(
IVAS_REND_HANDLE hIvasRend,
IVAS_REND_AudioBuffer outAudio )
@@ -8299,7 +8266,7 @@ static ivas_error renderActiveInputsMasa(
for ( i = 0, pCurrentInput = hIvasRend->inputsMasa; i < RENDERER_MAX_MASA_INPUTS; ++i, ++pCurrentInput )
{
- if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN )
+ if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID )
{
/* Skip inactive inputs */
continue;
@@ -8439,7 +8406,7 @@ ivas_error IVAS_REND_MergeMasaMetadata(
/* Merge metadata */
ivas_prerend_merge_masa_metadata( *hMasaExtOutMeta, *hMasaExtOutMeta, inputType1, *inEne1, inMeta2, inputType2, *inEne2 );
- ( *hMasaExtOutMeta )->descriptiveMeta.numberOfChannels = hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA1 ? 0u : 1u;
+ ( *hMasaExtOutMeta )->descriptiveMeta.numberOfChannels = hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 ? 0u : 1u;
return IVAS_ERR_OK;
@@ -8454,7 +8421,7 @@ ivas_error IVAS_REND_MergeMasaMetadata(
ivas_error IVAS_REND_SetTotalNumberOfObjects(
IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */
- const uint16_t total_num_objects /* i: total number of objects */
+ const uint16_t total_num_objects /* i : total number of objects */
)
{
if ( hIvasRend == NULL )
@@ -8467,6 +8434,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects(
return IVAS_ERR_OK;
}
+
/*---------------------------------------------------------------------*
* IVAS_REND_SetIsmMetadataDelay( )
*
@@ -8474,8 +8442,8 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects(
*---------------------------------------------------------------------*/
ivas_error IVAS_REND_SetIsmMetadataDelay(
- IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */
- const float sync_md_delay /* i: Ism Metadata Delay in ms to sync with audio delay */
+ IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */
+ const float sync_md_delay /* i : Ism Metadata Delay in ms to sync with audio delay */
)
{
int16_t i;
@@ -8493,6 +8461,7 @@ ivas_error IVAS_REND_SetIsmMetadataDelay(
return IVAS_ERR_OK;
}
+
/*-------------------------------------------------------------------*
* IVAS_REND_GetSamples()
*
@@ -8560,21 +8529,21 @@ ivas_error IVAS_REND_GetSamples(
for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ )
{
- numMasaInputs += hIvasRend->inputsMasa[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1;
+ numMasaInputs += hIvasRend->inputsMasa[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1;
}
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ )
{
- numOtherInputs += hIvasRend->inputsMc[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1;
+ numOtherInputs += hIvasRend->inputsMc[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1;
}
for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ )
{
- numOtherInputs += hIvasRend->inputsSba[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1;
+ numOtherInputs += hIvasRend->inputsSba[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1;
}
/* For ISM, we check only first as all ISMs are handled together via OMASA when merging to MASA. */
- numOtherInputs += hIvasRend->inputsIsm[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1;
+ numOtherInputs += hIvasRend->inputsIsm[0].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1;
if ( numMasaInputs == 0 || numOtherInputs == 0 )
{
@@ -8595,18 +8564,17 @@ ivas_error IVAS_REND_GetSamples(
/* Clear original output buffer */
set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel );
-
#ifdef SPLIT_REND_WITH_HEAD_ROT
outAudioOrig = outAudio;
/* Use internal buffer if outputting split rendering bitstream */
- if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
- ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
+ if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
+ ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
int16_t num_poses_orig;
num_poses_orig = hIvasRend->splitRendWrapper.multiBinPoseData.num_poses;
outAudio = hIvasRend->splitRendEncBuffer;
if ( ( outAudioOrig.config.is_cldfb == 0 ) &&
- ( hIvasRend->inputsMasa[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) )
+ ( hIvasRend->inputsMasa[0].base.inConfig == AUDIO_CONFIG_INVALID ) )
{
outAudio.config.is_cldfb = 0;
outAudio.config.numSamplesPerChannel >>= 1;
@@ -8662,7 +8630,7 @@ ivas_error IVAS_REND_GetSamples(
#endif /* SPLIT_REND_WITH_HEAD_ROT */
#ifdef SPLIT_REND_WITH_HEAD_ROT
- if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
ivas_split_rend_bits_t bits;
int16_t td_input;
@@ -8708,7 +8676,7 @@ ivas_error IVAS_REND_GetSamples(
tmpBinaural,
1,
td_input,
- ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
+ ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
if ( error != IVAS_ERR_OK )
{
return error;
@@ -8717,7 +8685,7 @@ ivas_error IVAS_REND_GetSamples(
convertInternalBitsBuffToBitsBuffer( hBits, bits );
outAudio = outAudioOrig;
- if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+ if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
accumulate2dArrayToBuffer( tmpBinaural_buff, &outAudio );
@@ -8728,7 +8696,6 @@ ivas_error IVAS_REND_GetSamples(
}
#endif /* SPLIT_REND_WITH_HEAD_ROT */
-
return IVAS_ERR_OK;
}
@@ -8802,6 +8769,123 @@ void IVAS_REND_Close(
return;
}
+
+#ifdef SPLIT_REND_WITH_HEAD_ROT
+/*-------------------------------------------------------------------*
+ * IVAS_REND_openCldfb()
+ *
+ *
+ *-------------------------------------------------------------------*/
+
+int16_t IVAS_REND_openCldfb(
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS],
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS],
+ const int16_t num_in_chs,
+ const int16_t num_out_chs,
+ const int32_t output_Fs )
+{
+ int16_t n;
+
+ for ( n = 0; n < num_in_chs; n++ )
+ {
+ if ( openCldfb( &( cldfbAna[n] ), CLDFB_ANALYSIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) != IVAS_ERR_OK )
+ {
+ return -1;
+ }
+ }
+ for ( ; n < IVAS_MAX_INPUT_CHANNELS; n++ )
+ {
+ cldfbAna[n] = NULL;
+ }
+
+ for ( n = 0; n < num_out_chs; n++ )
+ {
+ if ( openCldfb( &( cldfbSyn[n] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) != IVAS_ERR_OK )
+ {
+ return -1;
+ }
+ }
+ for ( ; n < IVAS_MAX_INPUT_CHANNELS; n++ )
+ {
+ cldfbSyn[n] = NULL;
+ }
+
+ return 0;
+}
+
+
+/*-------------------------------------------------------------------*
+ * IVAS_REND_closeCldfb()
+ *
+ *
+ *-------------------------------------------------------------------*/
+
+void IVAS_REND_closeCldfb(
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS],
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS] )
+{
+ int16_t n;
+
+ for ( n = 0; n < IVAS_MAX_INPUT_CHANNELS; n++ )
+ {
+ if ( cldfbAna[n] != NULL )
+ {
+ deleteCldfb( &( cldfbAna[n] ) );
+ cldfbAna[n] = NULL;
+ }
+
+ if ( cldfbSyn[n] != NULL )
+ {
+ deleteCldfb( &( cldfbSyn[n] ) );
+ cldfbSyn[n] = NULL;
+ }
+ }
+
+ return;
+}
+
+
+/*-------------------------------------------------------------------*
+ * IVAS_REND_cldfbSynthesis_wrapper()
+ *
+ *
+ *-------------------------------------------------------------------*/
+
+void IVAS_REND_cldfbAnalysis_ts_wrapper(
+ const float *timeIn, /* i : time buffer */
+ float realBuffer[IVAS_CLDFB_NO_CHANNELS_MAX], /* o : real value buffer */
+ float imagBuffer[IVAS_CLDFB_NO_CHANNELS_MAX], /* o : imag value buffer */
+ const int16_t samplesToProcess, /* i : samples to process */
+ IVAS_CLDFB_FILTER_BANK_HANDLE h_cldfb /* i : filterbank state */
+)
+{
+ cldfbAnalysis_ts( timeIn, realBuffer, imagBuffer, samplesToProcess, h_cldfb );
+
+ return;
+}
+
+
+/*-------------------------------------------------------------------*
+ * IVAS_REND_cldfbSynthesis_wrapper()
+ *
+ *
+ *-------------------------------------------------------------------*/
+
+void IVAS_REND_cldfbSynthesis_wrapper(
+ float **realBuffer, /* i : real values */
+ float **imagBuffer, /* i : imag values */
+ float *timeOut, /* o : output time domain samples */
+ const int16_t samplesToProcess, /* i : number of processed samples */
+ IVAS_CLDFB_FILTER_BANK_HANDLE h_cldfb /* i : filter bank state */
+)
+{
+ cldfbSynthesis( realBuffer, imagBuffer, timeOut, samplesToProcess, h_cldfb );
+
+ return;
+}
+#endif
+
+
#ifdef DEBUGGING
/*-------------------------------------------------------------------*
* IVAS_REND_GetNoCLipping()
diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h
index bd30a8cf328592531c8b897037866c339dd180e6..c246f5e83003d24918851ddcdaf50b9fd12c7283 100644
--- a/lib_rend/lib_rend.h
+++ b/lib_rend/lib_rend.h
@@ -36,6 +36,9 @@
#include "common_api_types.h"
#include
+/*---------------------------------------------------------------------*
+ * Renderer constants
+ *---------------------------------------------------------------------*/
#define RENDERER_MAX_ISM_INPUTS 4
#define RENDERER_MAX_MC_INPUTS 1
@@ -45,6 +48,23 @@
#define RENDERER_MAX_BIN_INPUTS 1
#endif
+#ifdef SPLIT_REND_WITH_HEAD_ROT
+/*----------------------------------------------------------------------------------*
+ * Split rendering bitrate constants
+ *----------------------------------------------------------------------------------*/
+
+#define SPLIT_REND_256k 256000
+#define SPLIT_REND_320k 320000
+#define SPLIT_REND_384k 384000
+#define SPLIT_REND_512k 512000
+#define SPLIT_REND_768k 768000
+#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k
+#define SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1
+#endif
+
+/*---------------------------------------------------------------------*
+ * Renderer structures
+ *---------------------------------------------------------------------*/
typedef float IVAS_REND_LfePanMtx[IVAS_MAX_INPUT_LFE_CHANNELS][IVAS_MAX_OUTPUT_CHANNELS];
@@ -98,62 +118,12 @@ typedef enum
IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN,
} IVAS_REND_AudioConfigType;
-/* TODO(sgi): Harmonize with AUDIO_CONFIG */
-/*
- Note: numerical values carry specific information here.
-
- MSB LSB
- --------------------------------------------------------------------------------
- ... unused (assumed all 0) ... | config type (1 byte) | config variant (1 byte) |
- --------------------------------------------------------------------------------
-
- Where "config type" is the general type from the following list:
- - unknown
- - channel-based
- - ambisonics
- - object-based
- - binaural
- - MASA
-
- Config variants are concrete configs of each type.
- */
-typedef enum
-{
- IVAS_REND_AUDIO_CONFIG_MONO = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 0,
- IVAS_REND_AUDIO_CONFIG_STEREO = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 1,
- IVAS_REND_AUDIO_CONFIG_5_1 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 2,
- IVAS_REND_AUDIO_CONFIG_7_1 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 3,
- IVAS_REND_AUDIO_CONFIG_5_1_2 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 4,
- IVAS_REND_AUDIO_CONFIG_5_1_4 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 5,
- IVAS_REND_AUDIO_CONFIG_7_1_4 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 6,
- IVAS_REND_AUDIO_CONFIG_LS_CUSTOM = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 255,
-
- IVAS_REND_AUDIO_CONFIG_FOA = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS << 8 | 0,
- IVAS_REND_AUDIO_CONFIG_HOA2 = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS << 8 | 1,
- IVAS_REND_AUDIO_CONFIG_HOA3 = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS << 8 | 2,
-
- IVAS_REND_AUDIO_CONFIG_OBJECT = IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED << 8 | 0,
-
- IVAS_REND_AUDIO_CONFIG_BINAURAL = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 0,
- IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 1,
- IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 2,
-#ifdef SPLIT_REND_WITH_HEAD_ROT
- IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 3,
- IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 4,
-#endif
-
- IVAS_REND_AUDIO_CONFIG_MASA1 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 0,
- IVAS_REND_AUDIO_CONFIG_MASA2 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 1,
-
- IVAS_REND_AUDIO_CONFIG_UNKNOWN = IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN << 8 | 0,
-} IVAS_REND_AudioConfig;
-
typedef uint16_t IVAS_REND_InputId;
/* clang-format off */
/*----------------------------------------------------------------------------------*
- * Function prototypes
+ * Renderer function prototypes
*----------------------------------------------------------------------------------*/
/* Functions to be called before rendering */
@@ -161,7 +131,7 @@ typedef uint16_t IVAS_REND_InputId;
ivas_error IVAS_REND_Open(
IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */
const int32_t outputSampleRate, /* i : output sampling rate */
- const IVAS_REND_AudioConfig outConfig, /* i : output audio config */
+ const AUDIO_CONFIG outConfig, /* i : output audio config */
const int16_t nonDiegeticPan, /* i : non-diegetic object flag */
const float nonDiegeticPanGain /* i : non-diegetic panning gain */
);
@@ -182,7 +152,7 @@ ivas_error IVAS_REND_NumOutChannels(
ivas_error IVAS_REND_AddInput(
IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
- const IVAS_REND_AudioConfig inConfig, /* i : audio config for a new input */
+ const AUDIO_CONFIG inConfig, /* i : audio config for a new input */
IVAS_REND_InputId *inputId /* o : ID of the new input */
);
@@ -219,7 +189,7 @@ ivas_error IVAS_REND_RemoveInput(
);
ivas_error IVAS_REND_GetInputNumChannels(
- IVAS_REND_CONST_HANDLE hIvasRend, /* i : Renderer handle */
+ IVAS_REND_CONST_HANDLE hIvasRend, /* i : Renderer handle */
const IVAS_REND_InputId inputId, /* i : ID of the input */
int16_t *numChannels /* o : number of channels of the input */
);
@@ -258,7 +228,7 @@ ivas_error IVAS_REND_FeedInputMasaMetadata(
ivas_error IVAS_REND_InitConfig(
IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
- const IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */
+ const AUDIO_CONFIG outAudioConfig /* i : output audioConfig */
);
int16_t IVAS_REND_GetRenderConfig(
@@ -350,8 +320,8 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects(
);
ivas_error IVAS_REND_SetIsmMetadataDelay(
- IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */
- const float sync_md_delay /* i: Metadata Delay in ms to sync with audio delay */
+ IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */
+ const float sync_md_delay /* i : Metadata Delay in ms to sync with audio delay */
);
ivas_error IVAS_REND_GetNumAllObjects(
@@ -364,7 +334,7 @@ ivas_error IVAS_REND_GetSamples(
IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
- IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/
+ IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/
#endif
);
@@ -374,6 +344,40 @@ void IVAS_REND_Close(
IVAS_REND_HANDLE* phIvasRend /* i/o: Pointer to renderer handle */
);
+
+#ifdef SPLIT_REND_WITH_HEAD_ROT
+/* Split binaural rendering functions */
+
+int16_t IVAS_REND_openCldfb(
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS],
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS],
+ const int16_t num_in_chs,
+ const int16_t num_out_chs,
+ const int32_t output_Fs
+);
+
+void IVAS_REND_closeCldfb(
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS],
+ IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS]
+);
+
+void IVAS_REND_cldfbAnalysis_ts_wrapper(
+ const float *timeIn, /* i : time buffer */
+ float realBuffer[IVAS_CLDFB_NO_CHANNELS_MAX], /* o : real value buffer */
+ float imagBuffer[IVAS_CLDFB_NO_CHANNELS_MAX], /* o : imag value buffer */
+ const int16_t samplesToProcess, /* i : samples to process */
+ IVAS_CLDFB_FILTER_BANK_HANDLE h_cldfb /* i : filterbank state */
+);
+
+void IVAS_REND_cldfbSynthesis_wrapper(
+ float **realBuffer, /* i : real values */
+ float **imagBuffer, /* i : imag values */
+ float *timeOut, /* o : output time domain samples */
+ const int16_t samplesToProcess, /* i : number of processed samples */
+ IVAS_CLDFB_FILTER_BANK_HANDLE h_cldfb /* i : filter bank state */
+);
+#endif
+
#ifdef DEBUGGING
int32_t IVAS_REND_GetNoCLipping(
IVAS_REND_CONST_HANDLE hIvasRend /* i : Renderer handle */
diff --git a/lib_util/g192.h b/lib_util/g192.h
index 2dfd34b9e547a3acf40a40617ebb4d84b5997457..9e5e56d223c4a350b9e7f6d1775c6c3364101ef0 100644
--- a/lib_util/g192.h
+++ b/lib_util/g192.h
@@ -38,7 +38,6 @@
#define G192_H G192_H
#include "common_api_types.h"
-#include
/*-----------------------------------------------------------------------*
diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c
index a9723955df615c39890eb3a5f869c2a23ad5af69..95d9b7c881c670d2658c59a8b43099661e9b6320 100644
--- a/lib_util/hrtf_file_reader.c
+++ b/lib_util/hrtf_file_reader.c
@@ -689,51 +689,6 @@ ivas_error dealloc_HRTF_binary(
}
-/*-------------------------------------------------------------------------
- * ivas_hrtf_init()
- *
- * Initialize hHRTF handle
- *------------------------------------------------------------------------*/
-
-static ivas_error ivas_hrtf_init(
- HRTFS_DATA *hHRTF /* i/o: HRTF handle */
-)
-{
- int16_t i, j;
-
- if ( hHRTF == NULL )
- {
- return IVAS_ERR_WRONG_PARAMS;
- }
-
- hHRTF->latency_s = 0;
- hHRTF->max_num_ir = 0;
- hHRTF->max_num_iterations = 0;
- hHRTF->index_frequency_max_diffuse = 0;
-
- for ( i = 0; i < MAX_INTERN_CHANNELS; i++ )
- {
- hHRTF->inv_diffuse_weight[i] = 0;
- for ( j = 0; j < BINAURAL_CHANNELS; j++ )
- {
- hHRTF->num_iterations[i][j] = 0;
- hHRTF->pIndex_frequency_max[i][j] = NULL;
- hHRTF->pOut_to_bin_re[i][j] = NULL;
- hHRTF->pOut_to_bin_im[i][j] = NULL;
- }
- }
- for ( j = 0; j < BINAURAL_CHANNELS; j++ )
- {
- hHRTF->num_iterations_diffuse[j] = 0;
- hHRTF->pIndex_frequency_max_diffuse[j] = NULL;
- hHRTF->pOut_to_bin_diffuse_re[j] = NULL;
- hHRTF->pOut_to_bin_diffuse_im[j] = NULL;
- }
-
- return IVAS_ERR_OK;
-}
-
-
/*---------------------------------------------------------------------*
* create_HRTF_from_rawdata()
*
diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c
index e7f3aca0b69b6089973f63ca433d33df36aa73c6..8b063fe282e3f1fc4f0dd785f0640a3a89b338cc 100644
--- a/lib_util/masa_file_writer.c
+++ b/lib_util/masa_file_writer.c
@@ -84,9 +84,10 @@ static void getExtMasaMetadataFileName(
return;
}
+
static void delayMasaMetadata(
- MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o : New input metadata which is inplace replaced with delayed metadata frame */
- MASA_META_DELAY_STORAGE *delayStorage /* i/o : Storage for 10 ms of metadata and related descriptive metadata */
+ MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */
+ MASA_META_DELAY_STORAGE *delayStorage /* i/o: Storage for 10 ms of metadata and related descriptive metadata */
)
{
int16_t dir, sf, band;
@@ -141,6 +142,7 @@ static void delayMasaMetadata(
return;
}
+
/*---------------------------------------------------------------------*
* MasaFileWriter_open()
*
diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h
index 62aa8c6b48c0c990138621689f05fc665cabe914..6b1bcbb9fb1886db5e8fa56277c6cacebf6a5a84 100644
--- a/lib_util/masa_file_writer.h
+++ b/lib_util/masa_file_writer.h
@@ -33,10 +33,8 @@
#ifndef IVAS_MASA_FILE_WRITER_H
#define IVAS_MASA_FILE_WRITER_H
-#include
-#include "options.h"
-#include
#include "common_api_types.h"
+#include
struct MasaFileWriter;
diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c
index 98a7bddd7a5b75b120fdb7eed09372ff08e4a5d4..15dd45256ff94b50211c25ac790a7fa81634910f 100644
--- a/lib_util/render_config_reader.c
+++ b/lib_util/render_config_reader.c
@@ -1295,8 +1295,8 @@ ivas_error RenderConfigReader_open(
*------------------------------------------------------------------------------------------*/
static ivas_error RenderConfigReader_readBinary(
- const char *pReverbConfigPath, /* i : Configuration file path */
- RenderConfigReader *pRenderConfigReader /* i/o : RenderConfigReader handle */
+ const char *pReverbConfigPath, /* i : Configuration file path */
+ RenderConfigReader *pRenderConfigReader /* i/o: RenderConfigReader handle */
)
{
uint32_t file_size;
diff --git a/lib_util/rotation_file_reader.h b/lib_util/rotation_file_reader.h
index d597c67a7fa23aa2206079120878f70f285d241c..1ae772fceb19d61eb28392282f0494222b705ffc 100644
--- a/lib_util/rotation_file_reader.h
+++ b/lib_util/rotation_file_reader.h
@@ -36,8 +36,6 @@
#include "common_api_types.h"
-#define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4
-
typedef struct RotFileReader RotFileReader;
/*-----------------------------------------------------------------------*
diff --git a/lib_util/split_rend_bfi_file_reader.h b/lib_util/split_rend_bfi_file_reader.h
index 35418835138451078ac4fa005d009cd060eb762a..fc0a530ddcb5cdc78f3d5eb4b3a63bb49aeb7e35 100644
--- a/lib_util/split_rend_bfi_file_reader.h
+++ b/lib_util/split_rend_bfi_file_reader.h
@@ -33,17 +33,15 @@
#ifndef IVAS_SR_BFI_FILE_READER_H
#define IVAS_SR_BFI_FILE_READER_H
-#include "options.h"
-
#ifdef SPLIT_REND_WITH_HEAD_ROT
#include "common_api_types.h"
-#include "ivas_error.h"
+
typedef struct SplitRendBFIFileReader SplitRendBFIFileReader;
ivas_error SplitRendBFIFileReader_open(
- char *trajFilePath, /* i : head rotation trajectory file name */
- SplitRendBFIFileReader **SplitRendBFIReader /* o : SplitRendBFIFileReader handle */
+ char *trajFilePath, /* i : head rotation trajectory file name */
+ SplitRendBFIFileReader **SplitRendBFIReader /* o : SplitRendBFIFileReader handle */
);
ivas_error SplitRendBFIFileReading(
@@ -55,7 +53,7 @@ void SplitRendBFIFileReader_close(
);
const char *SplitRendBFIFileReader_getFilePath(
- SplitRendBFIFileReader *SplitRendBFIReader /* i/o: SplitRendBFIFileReader handle */
+ SplitRendBFIFileReader *SplitRendBFIReader /* i/o: SplitRendBFIFileReader handle */
);
diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c
index 9c69b3de1dc60d7da5f6e698e52b2fef5de57b9a..5a7929e28c04f231389c3baedca053e5b50bffd5 100644
--- a/lib_util/split_render_file_read_write.c
+++ b/lib_util/split_render_file_read_write.c
@@ -110,6 +110,11 @@ ivas_error split_rend_writer_open( SplitFileReadWrite **hhSplitRendFileReadWrite
size_t header_len, h;
char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "MAIN_SPLITH";
+ if ( filename == NULL )
+ {
+ return IVAS_ERR_UNEXPECTED_NULL_POINTER;
+ }
+
hSplitRendFileReadWrite = (SplitFileReadWrite *) malloc( sizeof( SplitFileReadWrite ) );
hSplitRendFileReadWrite->file = fopen( filename, "wb" );
if ( hSplitRendFileReadWrite->file == NULL )
diff --git a/lib_util/split_render_file_read_write.h b/lib_util/split_render_file_read_write.h
index 19b4b7cf27e3cf164660f84aef8bea2a3d217dc3..29ca49aad7273d785182683e47c0d72485d13149 100644
--- a/lib_util/split_render_file_read_write.h
+++ b/lib_util/split_render_file_read_write.h
@@ -33,29 +33,27 @@
#ifndef SPLIT_RENDER_FILE_READ_WRITE_H
#define SPLIT_RENDER_FILE_READ_WRITE_H
-#include "options.h"
-
#ifdef SPLIT_REND_WITH_HEAD_ROT
#include "common_api_types.h"
-#include "ivas_error.h"
+
typedef struct SplitFileReadWrite SplitFileReadWrite;
-/* Allocates and initializes a a split renderer reader instance */
+/* Allocates and initializes a a split renderer reader instance */
ivas_error split_rend_reader_open( SplitFileReadWrite **hhSplitRendFileReadWrite, char *filename );
-/* Allocates and initializes a a split renderer writer instance */
+/* Allocates and initializes a a split renderer writer instance */
ivas_error split_rend_writer_open(
SplitFileReadWrite **hhSplitRendFileReadWrite,
char *filename,
int16_t delayNumSamples,
int32_t delayTimeScale );
-/* Closes the split renderer reader/writer and deallocates memory */
+/* Closes the split renderer reader/writer and deallocates memory */
ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileReadWrite );
-/*write split rend coded bitstream to file*/
+/*write split rend coded bitstream to file */
ivas_error split_rend_write_bitstream_to_file(
SplitFileReadWrite *hSplitRendFileReadWrite,
uint8_t *bits,
@@ -64,7 +62,7 @@ ivas_error split_rend_write_bitstream_to_file(
IVAS_SPLIT_REND_CODEC codec,
IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection );
-/*read split rend coded bits from file*/
+/* read split rend coded bits from file */
ivas_error split_rend_read_bits_from_file(
SplitFileReadWrite *hSplitRendFileReadWrite,
uint8_t *bits,
@@ -73,7 +71,7 @@ ivas_error split_rend_read_bits_from_file(
IVAS_SPLIT_REND_CODEC *codec,
IVAS_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection );
-/*read split pre rend delay*/
+/* read split pre rend delay */
ivas_error split_rend_read_pre_rend_delay_ns(
SplitFileReadWrite *hSplitRendFileReadWrite,
uint32_t *delay_ns );
diff --git a/lib_util/tsm_scale_file_reader.h b/lib_util/tsm_scale_file_reader.h
index 7a795a25cb27316f36acef8bb07dfe67c6dcbf4c..55ee20f8cfdb47fd178bb84f948c833c9b3de10a 100644
--- a/lib_util/tsm_scale_file_reader.h
+++ b/lib_util/tsm_scale_file_reader.h
@@ -33,9 +33,7 @@
#ifndef IVAS_TSM_SCALE_FILE_READER_H
#define IVAS_TSM_SCALE_FILE_READER_H
-#include
#include "common_api_types.h"
-#include "ivas_error.h"
/* clang-format off */
@@ -44,24 +42,23 @@ typedef struct TsmScaleFileReader TsmScaleFileReader;
/*! r: TsmScaleFileReader handle */
TsmScaleFileReader *TsmScaleFileReader_open(
- const char *filePath /* i : path to TSM scale file */
+ const char *filePath /* i : path to TSM scale file */
);
ivas_error TsmScaleFileReader_readScale(
- TsmScaleFileReader* self, /* i/o: TsmScaleFileReader handle */
- int16_t *scale /* o : next scale */
+ TsmScaleFileReader* self, /* i/o: TsmScaleFileReader handle */
+ int16_t *scale /* o : next scale */
);
void TsmScaleFileReader_close(
- TsmScaleFileReader **selfPtr /* i/o: pointer to TsmScaleFileReader handle */
+ TsmScaleFileReader **selfPtr /* i/o: pointer to TsmScaleFileReader handle */
);
/*! r: path to the currently opened file or NULL if `self` is NULL */
const char *TsmScaleFileReader_getFilePath(
- TsmScaleFileReader* self /* i/o: TsmScaleFileReader handle */
+ TsmScaleFileReader* self /* i/o: TsmScaleFileReader handle */
);
-
/* clang-format on */
#endif /* IVAS_TSM_SCALE_FILE_READER_H */
diff --git a/lib_util/vector3_pair_file_reader.h b/lib_util/vector3_pair_file_reader.h
index 4ab687848c25265bc08fc33a7f2d5e474516e25b..e4691939220cfaded272c9481c715f73cd018d65 100644
--- a/lib_util/vector3_pair_file_reader.h
+++ b/lib_util/vector3_pair_file_reader.h
@@ -34,8 +34,6 @@
#define IVAS_V3PAIR_FILE_READER_H
#include "common_api_types.h"
-#include "ivas_error.h"
-#include "options.h" /* only included to get access to the feature-defines */
typedef struct Vector3PairFileReader Vector3PairFileReader;
diff --git a/readme.txt b/readme.txt
index ab6bc2fa755224cd75d397fc1b687189724511fe..c990e516bea8700186f7a13b4d5a8e8b52659899 100644
--- a/readme.txt
+++ b/readme.txt
@@ -31,12 +31,13 @@
*******************************************************************************************************/
-These files represent a pre-release of a codec candidate to the IVAS
-Extension to the 3GPP EVS Codec floating-point C simulation. All code is
-written in ANSI-C. The system is implemented as two separate programs:
+These files represent the 3GPP EVS Codec Extension for Immersive Voice and
+Audio Services (IVAS) floating-point C simulation. All code is writtten
+in ISO/IEC C99. The system is implemented as three separate programs:
IVAS_cod Encoder
IVAS_dec Decoder
+ IVAS_rend Renderer
For encoding using the coder program, the input is a binary
audio file (*.8k, *.16k, *.32k, *.48k) and the output is a binary
@@ -61,8 +62,9 @@ If the software is to be run on some other platform than PC,
such as an HP (HP-UX) or a Sun, then binary files will need to be modified
by swapping the byte order in the files.
-The input and output files (*.8k, *.16k, *.32k, *.48k) are 16-bit signed
-binary files with 8/16/32/48 kHz sampling rate with no headers.
+The input and output files (*.8k, *.16k, *.32k, *.48k) are 16-bit integer
+PCM files with 8/16/32/48 kHz sampling rate with no headers. Alternatively,
+the input and output files are WAV files.
The Encoder produces bitstream files in either ITU G.192 or MIME file
storage format.
@@ -128,8 +130,6 @@ should have the following structure:
|-- lib_enc
|-- lib_rend
|-- lib_util
- |-- scripts
- |-- tests
|-- readme.txt
The package includes a Makefile for gcc, which has been verified on
@@ -140,9 +140,10 @@ in the c-code directory.
The package also includes a solution-file for Microsoft Visual Studio 2017 (x86).
To compile the code, please open "Workspace_msvc\Workspace_msvc.sln" and build
-"encoder" for the encoder and "decoder" for the decoder executable. The resulting
-encoder/decoder/renderer executables are named "IVAS_cod.exe", "IVAS_dec.exe",
-and "IVAS_rend.exe". All reside in the c-code directory.
+"encoder" for the encoder, "decoder" for the decoder, and "renderer" for the
+renderer executable. The resulting encoder/decoder/renderer executables are
+"IVAS_cod.exe", "IVAS_dec.exe", and "IVAS_rend.exe". All reside in the c-code
+main directory.
RUNNING THE SOFTWARE
@@ -167,9 +168,9 @@ R : Bitrate in bps,
(24400, 32000, 48000, 64000, 80000, 96000,128000)
for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000
for 3 ISM and 4 ISM also 384000
- for 4 ISM also 512000
- for IVAS SBA, MASA, MC R=(13200, 16400, 24400, 32000, 48000, 64000, 80000,
- 96000, 128000, 160000, 192000, 256000, 384000, 512000)
+ for 4 ISM also 512000
+ for IVAS SBA, MASA, MC, ISM-MASA, and ISM-SBA R=(13200, 16400, 24400, 32000,
+ 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000)
Alternatively, R can be a bitrate switching file which consists of R values
indicating the bitrate for each frame in bps. These values are stored in
binary format using 4 bytes per value
@@ -201,27 +202,24 @@ EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba,
where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4
Loudspeaker positions are assumed to have azimuth and elevation as per
ISO/IEC 23091-3:2018 Table 3. Channel order is as per ISO/IEC 23008-3:2015 Table 95.
- See readme.txt for details.
+ See below for details.
-dtx D : Activate DTX mode, D = (0, 3-100) is the SID update rate
- where 0 = adaptive, 3-100 = fixed in number of frames,
- default is deactivated
+ where 0 = adaptive, 3-100 = fixed in number of frames, default is deactivated
-dtx : Activate DTX mode with a SID update rate of 8 frames
- Note: DTX is supported in EVS, stereo, ISM, SBA up to 80kbps and MASA up to 128kbps
--rf p o : Activate channel-aware mode for WB and SWB signal at 13.2kbps,
+ Note: DTX is supported in EVS, stereo, ISM, MASA, and SBA up to 80kbps
+-rf p o : Activate channel-aware mode in EVS for WB and SWB signal at 13.2kbps,
where FEC indicator, p: LO or HI, and FEC offset, o: 2, 3, 5, or 7 in number of frames.
Alternatively p and o can be replaced by a rf configuration file with each line
- contains the values of p and o separated by a space,
- default is deactivated
+ contains the values of p and o separated by a space, default is deactivated
-max_band B : Activate bandwidth limitation, B = (NB, WB, SWB or FB)
alternatively, B can be a text file where each line contains "nb_frames B"
-no_delay_cmp : Turn off delay compensation
--stereo_dmx_evs : Activate stereo downmix function for EVS.
+-stereo_dmx_evs : Stereo downmix function for EVS
-mime : Mime output bitstream file format
The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).
default output bitstream file format is G.192
-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1
--q : Quiet mode, no frame counters
- default is deactivated
+-q : Quiet mode, limit printouts to terminal, default is deactivated
The usage of the "IVAS_dec" program is as follows:
@@ -232,15 +230,15 @@ Usage for IVAS: IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file
Mandatory parameters:
---------------------
-OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,
- HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, BINAURAL_SPLIT_CODED, BINAURAL_SPLIT_PCM, EXT
- By default, channel order and loudspeaker positions are equal to the
- encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker
- layout file. See below for details.
- Parameter is only used when decoding IVAS bitstream.
-Fs : Output sampling rate in kHz (8, 16, 32 or 48)
-bitstream_file : Input bitstream filename or RTP packet filename (in VOIP mode)
-output_file : Output audio filename
+OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,
+ HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, EXT
+ By default, channel order and loudspeaker positions are equal to the
+ encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker
+ layout file. See below for details.
+ Parameter is only used when decoding IVAS bitstream.
+Fs : Output sampling rate in kHz (8, 16, 32 or 48)
+bitstream_file : Input bitstream filename or RTP packet filename (in VOIP mode)
+output_file : Output audio filename
Options:
--------
@@ -261,55 +259,61 @@ Options:
Format files, the magic word in the mime file is used to determine
which of the two supported formats is in use.
default bitstream file format is G.192
--hrtf File : HRTF filter File used in ISm format and BINAURAL output configuration
+-hrtf File : HRTF filter File used in BINAURAL rendering
-T File : Head rotation specified by external trajectory File
-otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec'
or 'ref_vec_lev' (only for binaural rendering)
--rf File : Reference rotation specified by external trajectory file
+-rf File : Reference rotation specified by external trajectory File
works only in combination with '-otr ref' mode
--rvf File : Reference vector specified by external trajectory file
+-rvf File : Reference vector specified by external trajectory File
works only in combination with '-otr ref_vec' and 'ref_vec_lev' modes
--render_config File : Renderer configuration option File
+-render_config File : Renderer configuration option with parameters specified in File
-non_diegetic_pan P : panning mono non-diegetic sound to stereo -90<= P <=90,
left or l or 90->left, right or r or -90->right, center or c or 0->middle
--q : Quiet mode, no frame counter
- default is deactivated
+-exof File : External orientation trajectory File for simulation of external orientations
+-dpid ID : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be
+ specified) for binaural output configuration
+-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output config.
+-q : Quiet mode, limit printouts to terminal, default is deactivated
The usage of the "IVAS_rend" program is as follows:
---------------------------------------------------
-Usage: IVAS_rend [options]
-
-Valid options:
- --input_file, -i Path to the input file (WAV, raw PCM or scene description file)
- --input_format, -if Audio format of input file (e.g. 5_1 or HOA3 or META, use -l for a list)
- --input_metadata, -im Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode
- --output_file, -o Path to the output file
- --output_format, -of Output format to render.
- Alternatively, can be a custom loudspeaker layout file
- --sample_rate, -fs Input sampling rate in kHz (16, 32, 48) - required only with raw PCM inputs
- --trajectory_file, -tf Head rotation trajectory file for simulation of head tracking (only for binaural outputs)
- --output_metadata, -om coded metadata file for BINAURAL_SPLIT_PCM output mode
- --post_rend_bfi_file, -prbfi Split rendering option: bfi file
- --reference_rotation_file, -rf Reference rotation trajectory file for simulation of head tracking (only for binaural outputs)
- --custom_hrtf, -hrtf Custom HRTF file for binaural rendering (only for binaural outputs)
- --render_config, -rc Binaural renderer configuration file (only for binaural outputs)
- --non_diegetic_pan, -ndp Panning mono non diegetic sound to stereo -90<= pan <= 90
- left or l or 90->left, right or r or -90->right, center or c or 0 ->middle
-
- --tracking_type, -otr Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for binaural outputs)
- --lfe_position, -lp Output LFE position. Comma-delimited triplet of [gain, azimuth, elevation] where gain is linear (like --gain, -g) and azimuth, elevation are in degrees.
- If specified, overrides the default behavior which attempts to map input to output LFE channel(s)
- --lfe_matrix, -lm LFE panning matrix. File (CSV table) containing a matrix of dimensions [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g).
- If specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)
- --no_delay_cmp, -ndc [flag] Turn off delay compensation
- --quiet, -q [flag] Limit printouts to terminal
- --gain, -g Input gain (linear, not in dB) to be applied to input audio file
- --list, -l List supported audio formats
- --reference_vector_file, -rvf Reference vector trajectory file for simulation of head tracking (only for binaural outputs)
- --exterior_orientation_file, -exof External orientation trajectory file for simulation of external orientations
- --sync_md_delay, -smd Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)
+Usage: IVAS_rend [Options]
+
+Options:
+--------
+-i File : Input audio File (WAV, raw PCM or scene description file)
+-if Format : Audio Format of input file (e.g. 5_1 or HOA3 or META, use -l for a list)
+-im Files : Metadata files for ISM (one file per object) or MASA inputs
+-o File : Output audio File
+-of Format : Audio Format of output file
+ Alternatively, it can be a custom loudspeaker layout File
+-fs : Input sampling rate in kHz (16, 32, 48) - required only with raw PCM inputs
+-tf File : Head rotation trajectory File for simulation of head tracking (only for binaural outputs)
+-rf File : Reference rotation trajectory File for simulation of head tracking (only for binaural outputs)
+-rvf File : Reference vector trajectory File for simulation of head tracking (only for binaural outputs)
+-hrtf File : Custom HRTF File for binaural rendering (only for binaural outputs)
+-rc File : Binaural renderer configuration File (only for binaural outputs)
+-ndp P : Panning mono non-diegetic sound to stereo -90<= P <= 90
+ left or l or 90->left, right or r or -90->right, center or c or 0 ->middle
+-otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for binaural outputs)
+-lp Position : Output LFE position. Comma-delimited triplet of [gain, azimuth, elevation] where gain is linear
+ (like --gain, -g) and azimuth, elevation are in degrees.
+ If specified, overrides the default behavior which attempts to map input to output LFE channel(s)
+-lm File : LFE panning matrix File (CSV table) containing a matrix of dimensions
+ [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g).
+ If specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)
+-ndc : Turn off delay compensation
+-g : Input gain (linear, not in dB) to be applied to input audio file
+-l : List supported audio formats
+-exof File : External orientation trajectory File for simulation of external orientations
+-dpid ID : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be
+ specified) for binaural output configuration
+-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output config.
+-smd : Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes.
+-q : Quiet mode, limit printouts to terminal, default is deactivated
MULTICHANNEL LOUDSPEAKER INPUT / OUTPUT CONFIGURATIONS
@@ -344,10 +348,10 @@ An example custom loudspeaker layout file is available: ls_setup_16ch_8+4+4.txt
RUNNING THE SELF TEST
=====================
-A codec verification script is available in scripts/self_test.py. The
-script demonstrates how to use the software at several operating points and
-compares the output to a reference version/implementation. Please note:
-In order to keep the run-time short it does not cover all operating
+A codec verification script is available at https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/
+in scripts/self_test.py. The script demonstrates how to use the software at several operating points
+and compares the output to a reference version/implementation.
+Please note: In order to keep the run-time short it does not cover all operating
points or complete coverage.
Documentation on the self_test.py can be found as a part of scripts/README.md.
@@ -385,14 +389,32 @@ stvST32c.wav - 2 channels, 32000 Hz, 659200 samples per channel, clean spe
stvST32n.wav - 2 channels, 32000 Hz, 620800 samples per channel, noisy speech
stvST48c.wav - 2 channels, 48000 Hz, 988800 samples per channel, clean speech/audio
stvST48n.wav - 2 channels, 48000 Hz, 931200 samples per channel, noisy speech
-stv1MASA1TC48c.wav - 1 channel (1 MASA transport channel), 48000 Hz, 48000 Hz, 144000 samples
-stv1MASA1TC48n.wav - 1 channel (1 MASA transport channel), 48000 Hz, 48000 Hz, 963840 samples
-stv1MASA2TC48c.wav - 2 channels (2 MASA transport channel), 48000 Hz, 48000 Hz, 288000 samples per channel
-stv1MASA2TC48n.wav - 2 channels (2 MASA transport channel), 48000 Hz, 48000 Hz, 963840 samples per channel
-stv2MASA1TC48c.wav - 1 channel (1 MASA transport channel), 48000 Hz, 48000 Hz, 288000
-stv2MASA2TC48c.wav - 2 channels (2 MASA transport channel), 48000 Hz, 48000 Hz, 144000 samples per channel
-
-
+stv1MASA1TC48c.wav - 1 channel (1 MASA 1 transport channel), 48000 Hz, 48000 Hz, 144000 samples
+stv1MASA1TC48n.wav - 1 channel (1 MASA 1 transport channel), 48000 Hz, 48000 Hz, 963840 samples
+stv1MASA2TC48c.wav - 2 channels (2 MASA 2 transport channels), 48000 Hz, 48000 Hz, 288000 samples per channel
+stv1MASA2TC48n.wav - 2 channels (2 MASA 2 transport channels), 48000 Hz, 48000 Hz, 963840 samples per channel
+stv2MASA1TC48c.wav - 1 channel (1 MASA 1 transport channel), 48000 Hz, 48000 Hz, 288000
+stv2MASA2TC48c.wav - 2 channels (2 MASA 2 transport channels), 48000 Hz, 48000 Hz, 144000 samples per channel
+stvOMASA_1ISM_1MASA2TC48c.wav - 3 channels (1 discrete audio object and 1 MASA 2 transport channels), 48000 Hz
+stvOMASA_1ISM_2MASA1TC32c.wav - 2 channels (1 discrete audio object and 2 MASA 1 transport channel), 32000 Hz
+stvOMASA_1ISM_2MASA2TC48c.wav - 3 channels (1 discrete audio object and 2 MASA 2 transport channels), 48000 Hz
+stvOMASA_2ISM_1MASA1TC16c.wav - 3 channels (2 discrete audio object and 1 MASA 1 transport channel), 48000 Hz
+stvOMASA_2ISM_1MASA2TC48c.wav - 4 channels (2 discrete audio object and 1 MASA 2 transport channels), 16000 Hz
+stvOMASA_2ISM_2MASA2TC48c.wav - 4 channels (2 discrete audio object and 2 MASA 2 transport channels), 48000 Hz
+stvOMASA_3ISM_1MASA1TC32c.wav - 4 channels (3 discrete audio object and 1 MASA 1 transport channel), 32000 Hz
+stvOMASA_3ISM_1MASA2TC16c.wav - 5 channels (3 discrete audio object and 1 MASA 2 transport channels), 16000 Hz
+stvOMASA_3ISM_1MASA2TC32c.wav - 5 channels (3 discrete audio object and 1 MASA 2 transport channels), 32000 Hz
+stvOMASA_3ISM_1MASA2TC48c.wav - 5 channels (3 discrete audio object and 1 MASA 2 transport channels), 32000 Hz
+stvOMASA_3ISM_2MASA1TC48c.wav - 4 channels (3 discrete audio object and 2 MASA 1 transport channel), 48000 Hz
+stvOMASA_3ISM_2MASA2TC32c.wav - 5 channels (3 discrete audio object and 2 MASA 2 transport channels), 32000 Hz
+stvOMASA_3ISM_2MASA2TC48c.wav - 5 channels (3 discrete audio object and 2 MASA 2 transport channels), 48000 Hz
+stvOMASA_4ISM_1MASA1TC48c.wav - 5 channels (4 discrete audio object and 1 MASA 1 transport channel), 48000 Hz
+stvOMASA_4ISM_1MASA2TC48c.wav - 6 channels (4 discrete audio object and 1 MASA 2 transport channels), 48000 Hz
+stvOMASA_4ISM_2MASA1TC48c.wav - 5 channels (4 discrete audio object and 2 MASA 1 transport channel), 48000 Hz
+stvOMASA_4ISM_2MASA2TC48c.wav - 6 channels (4 discrete audio object and 2 MASA 2 transport channels), 48000 Hz
+
+MASA metadata file
+------------------
For the MASA operation modes, in addition the following metadata files
located in /scripts/testv/ folder are required:
@@ -403,12 +425,17 @@ stv1MASA2TC48n.met
stv2MASA1TC48c.met
stv2MASA2TC48c.met
+The detailed syntax of MASA metadata files can be found in 3GPP TS 26.258.
+
It is strongly recommended to align these files to the corresponding
PCM audio files. The MASA metadata files can be generated with the
latest version of the IVAS MASA C Reference Software, which was made
available at
https://www.3gpp.org/ftp/TSG_SA/WG4_CODEC/TSGS4_118-e/Docs/S4-220443.zip
+
+Object based audio metadata file
+--------------------------------
For the ISM operation modes, in addition the following metadata files
located at /scripts/testv/ folder are required:
@@ -450,13 +477,39 @@ with the following meaning:
The metadata reader accepts 1-8 values specified per line. If a value is not specified, the default
value is assumed.
+
+HRTF filter file
+----------------
For the HRTF filter File option, external HRTF filter Files are available in folder
-/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data :
+/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data:
ivas_binaural_16kHz.bin
ivas_binaural_32kHz.bin
ivas_binaural_48kHz.bin
+The HRTF filter file has a specific container format with a header and a sequence of entries. The
+detailed syntax can be found in 3GPP TS 26.258.
+
+
+Head rotation trajectory file
+-----------------------------
+
+Input data representing the current rotation of the listeners head can be provided to the decoder
+in an ASCII formatted file comprising four columns separated by commas. These columns contain
+floating-point numbers representing either a quaternion or a Euler angle. The distinction between
+these two input formats is made by a magic number in the first column. If this value is set to -3.0,
+it is assumed that the remaining three columns contain three Euler angles. Otherwise, all four
+columns are interpreted as a Quaternion. The input is expected to have one line for each subframe of 5 ms.
+
+In the case of Quaternion-based input, the columns are the w, x, y, z components of a unit quaternion.
+Proper normalization to 1 mustshall be maintained in the input. The coordinate system is defined such that
+the x-axis points from the left to the right ear, the y axis points into the direction of view, and the
+z axis point from bottom to top. The origin is in the center of the head.
+
+In the case of Euler angle input, the first column contains the magic number -3.0, and the next three
+columns are the Euler angles yaw, pitch, and roll. The rotations are applied in the order yaw-pitch-roll.
+The yaw angle rotates around the z axis, the pitch angle rotates aroud the new y axis, and the roll angle
+rotates around the new x axis.
For the Head rotation operation modes, external trajectory files are available:
@@ -466,21 +519,53 @@ headrot_case01_3000_q.csv
headrot_case02_3000_q.csv
headrot_case03_3000_q.csv
-For Reference vector specified by external trajectory file, example files are available at
-/scripts/trajectories folder.
+Reference rotation/vector file
+------------------------------
+The external reference orientation of the orientation tracking feature can either be provided as a
+rotation (Quaternion or Euler angles) or as a pair of 3-dimensional positions (listener position
+and acoustic reference position).
+
+The Reference Rotation format is identical to Head rotation trajectory file.
+
+The Reference Vector file format describes a pair of x/y/z positions, one for the listener and one
+for the acoustic reference. The acoustic reference direction is defined by the vector from the
+listener towards the acoustic reference position. The reference vector file is a CSV file with
+comma as separator. Each line must contain a listener and an acoustic reference position in the
+following order:
+ x axis position of the listener.
+ y axis position of the listener.
+ z axis position of the listener.
+ x axis position of the acoustic reference.
+ y axis position of the acoustic reference.
+ z axis position of the acoustic reference.
+
+For Reference vector specified by external trajectory file, example files are available in folder
+/scripts/trajectories.
+
+
+External orientation file
+-------------------------
+The external orientation file provides orientation information for any non-listener dependent orientations.
+The orientations shall be given as floating point quaternions to the decoder/renderer in (w, x, y, z) order.
+Additional information may be given as HeadRotIndicator, ExtOriIndicator, ExtIntrpFlag and ExtIntrpNFrames.
+Each entry line represents a sub-frame entry, where the sub-frame resolution is 5ms. In the processing, the
+quaternions are inverted to act as a rotation instead of orientation.
+
+The detailed syntax can be found in 3GPP TS 26.258.
-For the Renderer configuration option operation modes, external configuration files are available:
-rend_config_hospital_patientroom.cfg
-config_recreation.cfg
-config_renderer.cfg
+Renderer config file
+--------------------
+The renderer configuration file provides metadata for controlling the rendering process. This metadata
+includes acoustics environment parameters and source directivity. The data can be provided using
+binary bitstream or a text file.
+The detailed syntax can be found in 3GPP TS 26.258.
- ADDITIONAL SCRIPTS
- ==================
+Example renderer configuration files are available, e.g.:
-Additional scripts for item generation and codec testing are available
-in the directories scripts and tests. Please refer to scripts/README.md, resp.
-tests/README.md for additional documentation.
+rend_rend_config_hospital_patientroom.cfg
+rend_config_recreation.cfg
+rend_config_renderer.cfg