From b27603d8470543a9b92affef01082d3b5d8b394a Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Mon, 16 Oct 2023 12:47:08 +0300 Subject: [PATCH] Issue 866, move vbap to lib_rend. --- Workspace_msvc/lib_dec.vcxproj | 1 - Workspace_msvc/lib_dec.vcxproj.filters | 3 --- Workspace_msvc/lib_rend.vcxproj | 1 + Workspace_msvc/lib_rend.vcxproj.filters | 3 +++ lib_com/ivas_prot.h | 10 ++++++++-- lib_com/options.h | 2 +- lib_rend/ivas_prot_rend.h | 25 +++++++++++++++++++++++++ {lib_dec => lib_rend}/ivas_vbap.c | 1 + 8 files changed, 39 insertions(+), 7 deletions(-) rename {lib_dec => lib_rend}/ivas_vbap.c (99%) diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index 354348b4c9..662502a1a6 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -264,7 +264,6 @@ - diff --git a/Workspace_msvc/lib_dec.vcxproj.filters b/Workspace_msvc/lib_dec.vcxproj.filters index ef14ddf0e4..8eddbb60a0 100644 --- a/Workspace_msvc/lib_dec.vcxproj.filters +++ b/Workspace_msvc/lib_dec.vcxproj.filters @@ -1,9 +1,6 @@  - - decoder_ivas_c - decoder_ivas_c diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index e0bcd06033..672c6dfac2 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -191,6 +191,7 @@ + diff --git a/Workspace_msvc/lib_rend.vcxproj.filters b/Workspace_msvc/lib_rend.vcxproj.filters index 406ba2c85e..6d71aabf03 100644 --- a/Workspace_msvc/lib_rend.vcxproj.filters +++ b/Workspace_msvc/lib_rend.vcxproj.filters @@ -158,6 +158,9 @@ rend_c + + rend_c + rend_c diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c07df11308..5cb17e1faf 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5377,10 +5377,15 @@ void ivas_ism2sba_sf( const int16_t sba_order /* i : Ambisonic (SBA) order */ ); - +#ifndef FIX_866_MOVE_VBAP +/*----------------------------------------------------------------------------------* + * Amplitude Panning tool prototypes + *----------------------------------------------------------------------------------*/ +#else /*----------------------------------------------------------------------------------* * Amplitude Panning VBAP prototypes *----------------------------------------------------------------------------------*/ +#endif void panning_wrap_angles( const float azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ @@ -5388,7 +5393,7 @@ void panning_wrap_angles( float *azi_wrapped, /* o : wrapped azimuth component */ float *ele_wrapped /* o : wrapped elevation component */ ); - +#ifndef FIX_866_MOVE_VBAP ivas_error vbap_init_data( VBAP_HANDLE *hVBAPdata, /* i/o: handle for VBAP data structure that will be initialized */ const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ @@ -5408,6 +5413,7 @@ void vbap_determine_gains( const int16_t ele_deg, /* i : elevation in degrees for panning direction (positive up) */ const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ ); +#endif void v_sort_ind( float *x, /* i/o: Vector to be sorted */ diff --git a/lib_com/options.h b/lib_com/options.h index 88a8a07572..3a567dc620 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,7 @@ #define FIX_852_FIX_HANDLE_DEREF /* VA: issue 852: Fix missing handle dereferencing of hIsmMetadaData in ivas_ism_metadata_close() */ #define FIX_520_REMOVE_MEMMOVE_JBM /* VA: issue 520: Remove memmove() from JBM code */ #define FIX_853_ARRAY_SIZE_MISMATCH /* Nokia: Issue #853: Mismatch of declaration and definition of computeIntensityVector_ana and computeReferencePower_ana */ - +#define FIX_866_MOVE_VBAP /* Nokia: Issue 866: Move VBAP to lib_rend */ /* #################### End BE switches ################################## */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index dbed26f719..cc2425e49b 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -133,7 +133,32 @@ void efap_determine_gains( const float ele_deg, /* i : elevation in degrees for panning direction (positive up) */ const int16_t efap_mode /* i : indicates whether EFAP or EFIP is used */ ); +#ifdef FIX_866_MOVE_VBAP +/*----------------------------------------------------------------------------------* + * Amplitude Panning VBAP prototypes + *----------------------------------------------------------------------------------*/ + +ivas_error vbap_init_data( + VBAP_HANDLE *hVBAPdata, /* i/o: handle for VBAP data structure that will be initialized */ + const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ + const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ + const int16_t num_speaker_nodes, /* i : number of speaker nodes in the set */ + const IVAS_FORMAT ivas_format /* i : IVAS format */ +); + +void vbap_free_data( + VBAP_HANDLE *hVBAPdata /* i/o: VBAP handle to be freed */ +); + +void vbap_determine_gains( + const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ + float *gains, /* o : gain vector for speaker nodes for given direction */ + const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ + const int16_t ele_deg, /* i : elevation in degrees for panning direction (positive up) */ + const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ +); +#endif /*----------------------------------------------------------------------------------* * DirAC/MASA rendering diff --git a/lib_dec/ivas_vbap.c b/lib_rend/ivas_vbap.c similarity index 99% rename from lib_dec/ivas_vbap.c rename to lib_rend/ivas_vbap.c index 52e92ed7e3..602d64df68 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_rend/ivas_vbap.c @@ -36,6 +36,7 @@ #include #include "prot.h" #include "ivas_prot.h" +#include "ivas_prot_rend.h" #include "ivas_stat_dec.h" #ifdef DEBUGGING #include "debug.h" -- GitLab