From 0cdbc77084913495fae11311cce5fcfa1cc56922 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 11 May 2023 14:22:27 +0200 Subject: [PATCH 1/8] Orientation tracking parameter aspects --- apps/decoder.c | 9 +++++++- apps/renderer.c | 24 +++++++++++++++++++ lib_com/ivas_cnst.h | 12 +++++++++- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 7 ++++++ lib_dec/ivas_stat_dec.h | 4 ++++ lib_dec/lib_dec.c | 42 +++++++++++++++++++++++++++++++++- lib_dec/lib_dec.h | 10 +++++++- lib_rend/ivas_orient_trk.c | 47 ++++++++++++++++++++++++++++++++++++++ lib_rend/ivas_prot_rend.h | 4 ++++ lib_rend/ivas_stat_rend.h | 4 ++++ lib_rend/lib_rend.c | 8 +++++++ 12 files changed, 168 insertions(+), 4 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 22dc235fff..a24c177c84 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -189,8 +189,11 @@ int main( /*------------------------------------------------------------------------------------------* * Open decoder handle *------------------------------------------------------------------------------------------*/ - +#ifdef FIX_439_OTR_PARAMS + if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -355,7 +358,11 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ +#ifdef FIX_439_OTR_PARAMS + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 9045bbeaa0..1477e2279e 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1374,23 +1374,43 @@ static bool parseOrientationTracking( if ( strcmp( value, "NONE" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *tracking_type = HEAD_ORIENT_TRK_NONE; +#else *tracking_type = IVAS_ORIENT_TRK_NONE; +#endif } else if ( strcmp( value, "REF" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *tracking_type = HEAD_ORIENT_TRK_REF; +#else *tracking_type = IVAS_ORIENT_TRK_REF; +#endif } else if ( strcmp( value, "AVG" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *tracking_type = HEAD_ORIENT_TRK_AVG; +#else *tracking_type = IVAS_ORIENT_TRK_AVG; +#endif } else if ( strcmp( value, "REF_VEC" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *tracking_type = HEAD_ORIENT_TRK_REF_VEC; +#else *tracking_type = IVAS_ORIENT_TRK_REF_VEC; +#endif } else if ( strcmp( value, "REF_VEC_LEV" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *tracking_type = HEAD_ORIENT_TRK_REF_VEC_LEV; +#else *tracking_type = IVAS_ORIENT_TRK_REF_VEC_LEV; +#endif } else { @@ -1614,7 +1634,11 @@ static CmdlnArgs defaultArgs( clearString( args.customHrtfFilePath ); clearString( args.renderConfigFilePath ); +#ifdef FIX_439_OTR_PARAMS + args.orientationTracking = HEAD_ORIENT_TRK_NONE; +#else args.orientationTracking = IVAS_ORIENT_TRK_NONE; +#endif args.noDiegeticPan = 0.0f; args.delayCompensationEnabled = true; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 01b11b21e4..290f7318ad 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1544,6 +1544,16 @@ typedef enum *----------------------------------------------------------------------------------*/ /* Orientation tracking types */ +#ifdef FIX_439_OTR_PARAMS +typedef enum +{ + HEAD_ORIENT_TRK_NONE, + HEAD_ORIENT_TRK_REF, + HEAD_ORIENT_TRK_AVG, + HEAD_ORIENT_TRK_REF_VEC, + HEAD_ORIENT_TRK_REF_VEC_LEV +} HEAD_ORIENT_TRK_TYPE; +#else #define IVAS_ORIENT_TRK_NONE 0 #define IVAS_ORIENT_TRK_REF 1 #define IVAS_ORIENT_TRK_AVG 2 @@ -1559,7 +1569,7 @@ typedef enum OTR_TRACKING_REF_VEC = IVAS_ORIENT_TRK_REF_VEC, /* track orientation relative to external reference vector */ OTR_TRACKING_REF_VEC_LEV = IVAS_ORIENT_TRK_REF_VEC_LEV /* track orientation relative to level component of external reference vector */ } OTR_TRACKING_T; - +#endif /*----------------------------------------------------------------------------------* * Reverberator constants diff --git a/lib_com/options.h b/lib_com/options.h index b9dbd6e1f9..0ea2b6948a 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -188,6 +188,7 @@ #define FIX_446_STEREO_DMX_CRASH /* FhG: fix discrepancy with EVS code that could cause crashes in rare cases */ #define FIX_386_CORECODER_RECONFIG_2 /* VA: Issue 386: Resolve remaining ToDo comments in CoreCoder reconfig. */ +#define FIX_439_OTR_PARAMS /* Philips: Issue 439: orientation tracking parameter aspects. */ #define FIX_440_PARAM_ISM_DIR_NOISE /* FhG: Issue 440: Fix directional background noise becoming diffuse in ParamISM */ #define FIX_445_SNS_BUGFIXES /* FhG: bug fix for spectral tilt in SNS computation + necessary update of codebooks and converison to fixedpoint-compatible tables */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index b317d81cd1..1ca5ae512a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -750,6 +750,12 @@ ivas_error ivas_init_decoder( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { +#ifdef FIX_439_OTR_PARAMS + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, st_ivas->hDecoderConfig->orientation_tracking ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( st_ivas->hDecoderConfig->orientation_tracking == IVAS_ORIENT_TRK_NONE ) { if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, OTR_TRACKING_NONE ) ) != IVAS_ERR_OK ) @@ -789,6 +795,7 @@ ivas_error ivas_init_decoder( { return IVAS_ERR_WRONG_MODE; } +#endif } /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4174b2772b..f059dfb88e 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1151,7 +1151,11 @@ typedef struct decoder_config_structure int16_t Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE orientation_tracking; /* indicates orientation tracking type */ +#else int16_t orientation_tracking; /* indicates orientation tracking type */ +#endif float no_diegetic_pan; int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index ee315bf399..6d9617517d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -95,8 +95,11 @@ static void store_JbmData( IVAS_DEC_VOIP *hVoIP, JB4_DATAUNIT_HANDLE dataUnit, c #endif static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSamples, 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 ); +#ifdef FIX_439_OTR_PARAMS +static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const float no_diegetic_pan ); +#else static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int16_t orientation_tracking, const float no_diegetic_pan ); - +#endif /*---------------------------------------------------------------------* * IVAS_DEC_Open() @@ -108,7 +111,9 @@ static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int ivas_error IVAS_DEC_Open( IVAS_DEC_HANDLE *phIvasDec, /* i/o: pointer to an IVAS decoder handle to be opened */ const IVAS_DEC_MODE mode, /* i : compatibility mode (EVS or IVAS) */ +#ifndef FIX_439_OTR_PARAMS const int16_t orientation_tracking, /* i : orientation tracking type */ +#endif float no_diegetic_pan ) { IVAS_DEC_HANDLE hIvasDec; @@ -162,7 +167,11 @@ ivas_error IVAS_DEC_Open( st_ivas = hIvasDec->st_ivas; /* initialize Decoder Config. handle */ +#ifdef FIX_439_OTR_PARAMS + init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, no_diegetic_pan ); +#else init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, orientation_tracking, no_diegetic_pan ); +#endif /* initialize pointers to handles to NULL */ ivas_initialize_handles_dec( st_ivas ); @@ -214,7 +223,9 @@ ivas_error IVAS_DEC_Open( static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, /* i/o: configuration structure */ +#ifndef FIX_439_OTR_PARAMS const int16_t orientation_tracking, +#endif const float no_diegetic_pan ) { hDecoderConfig->Opt_AMR_WB = 0; @@ -224,7 +235,9 @@ static void init_decoder_config( hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; hDecoderConfig->Opt_RendConfigCustom = 0; +#ifndef FIX_439_OTR_PARAMS hDecoderConfig->orientation_tracking = orientation_tracking; +#endif hDecoderConfig->no_diegetic_pan = no_diegetic_pan; return; @@ -388,6 +401,9 @@ ivas_error IVAS_DEC_Configure( 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 */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE orientationTracking, /* i : head orientation tracking mode */ +#endif const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ) { @@ -436,6 +452,9 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = enableHeadRotation; +#ifdef FIX_439_OTR_PARAMS + hDecoderConfig->orientation_tracking = orientationTracking; +#endif hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; @@ -1985,6 +2004,26 @@ static ivas_error printConfigInfo_dec( fprintf( stdout, "Head rotation: ON\n" ); } +#ifdef FIX_439_OTR_PARAMS + if ( st_ivas->hDecoderConfig->orientation_tracking != HEAD_ORIENT_TRK_NONE ) + { + switch ( st_ivas->hDecoderConfig->orientation_tracking ) + { + case HEAD_ORIENT_TRK_AVG: + fprintf( stdout, "Orientation tracking: AVG\n" ); + break; + case HEAD_ORIENT_TRK_REF: + fprintf( stdout, "Orientation tracking: REF\n" ); + break; + case HEAD_ORIENT_TRK_REF_VEC: + fprintf( stdout, "Orientation tracking: REF_VEC\n" ); + break; + case HEAD_ORIENT_TRK_REF_VEC_LEV: + fprintf( stdout, "Orientation tracking: REF_VEC_LEV\n" ); + break; + } + } +#else if ( st_ivas->hDecoderConfig->orientation_tracking != IVAS_ORIENT_TRK_NONE ) { switch ( st_ivas->hDecoderConfig->orientation_tracking ) @@ -2003,6 +2042,7 @@ static ivas_error printConfigInfo_dec( break; } } +#endif } return IVAS_ERR_OK; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 17af564295..2258361f30 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -34,6 +34,9 @@ #define LIB_DEC_H #include "common_api_types.h" +#ifdef FIX_439_OTR_PARAMS +#include "ivas_cnst.h" +#endif #include @@ -118,7 +121,9 @@ typedef ivas_error ( *JbmTraceFileWriterFn )( const void *data, void *writer ); ivas_error IVAS_DEC_Open( IVAS_DEC_HANDLE *phIvasDec, /* i/o: pointer to an IVAS decoder handle to be opened */ IVAS_DEC_MODE mode, /* i : compatibility mode (EVS or IVAS) */ - const int16_t orientation_tracking, /* i : orientation tracking type */ +#ifndef FIX_439_OTR_PARAMS + const int16_t orientation_tracking, /* i : orientation tracking type */ +#endif float no_diegetic_pan ); @@ -130,6 +135,9 @@ ivas_error IVAS_DEC_Configure( 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 */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE orientationTracking, /* i : head orientation tracking mode */ +#endif const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ); diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index 63d863c4b6..fd70611d62 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -406,7 +406,11 @@ ivas_error ivas_orient_trk_Init( pOTR->refRot = identity; /* set safe default tracking mode */ +#ifdef FIX_439_OTR_PARAMS + pOTR->trackingType = HEAD_ORIENT_TRK_NONE; + #else pOTR->trackingType = OTR_TRACKING_NONE; +#endif return IVAS_ERR_OK; } @@ -420,7 +424,11 @@ ivas_error ivas_orient_trk_Init( ivas_error ivas_orient_trk_SetTrackingType( ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE trackingType /* i/o: orientation tracking type */ +#else const OTR_TRACKING_T trackingType /* i/o: orientation tracking type */ +#endif ) { if ( pOTR == NULL ) @@ -479,15 +487,29 @@ ivas_error ivas_orient_trk_GetMainOrientation( } switch ( pOTR->trackingType ) { +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_NONE: +#else case OTR_TRACKING_NONE: +#endif *pOrientation = IdentityQuaternion(); break; +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_REF_VEC: + case HEAD_ORIENT_TRK_REF_VEC_LEV: + case HEAD_ORIENT_TRK_REF: +#else case OTR_TRACKING_REF_VEC: case OTR_TRACKING_REF_VEC_LEV: case OTR_TRACKING_REF_ORIENT: +#endif *pOrientation = pOTR->refRot; break; +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_AVG: +#else case OTR_TRACKING_AVG_ORIENT: +#endif *pOrientation = pOTR->absAvgRot; break; } @@ -541,13 +563,24 @@ ivas_error ivas_orient_trk_SetReferenceVector( switch ( pOTR->trackingType ) { +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_NONE: + case HEAD_ORIENT_TRK_REF: + case HEAD_ORIENT_TRK_AVG: + case HEAD_ORIENT_TRK_REF_VEC: +#else case OTR_TRACKING_NONE: case OTR_TRACKING_REF_ORIENT: case OTR_TRACKING_AVG_ORIENT: case OTR_TRACKING_REF_VEC: +#endif acousticFrontVector = VectorSubtract( listenerPos, refPos ); break; +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_REF_VEC_LEV: +#else case OTR_TRACKING_REF_VEC_LEV: +#endif /* ignore the height difference between listener position and reference position */ listenerPosLevel.z = refPosLevel.z = listenerPos.z; listenerPosLevel.x = listenerPos.x; @@ -607,12 +640,22 @@ ivas_error ivas_orient_trk_Process( switch ( pOTR->trackingType ) { +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_NONE: +#else case OTR_TRACKING_NONE: +#endif pOTR->trkRot = absRot; break; +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_REF: + case HEAD_ORIENT_TRK_REF_VEC: + case HEAD_ORIENT_TRK_REF_VEC_LEV: +#else case OTR_TRACKING_REF_VEC: case OTR_TRACKING_REF_VEC_LEV: case OTR_TRACKING_REF_ORIENT: +#endif /* Reset average orientation */ pOTR->absAvgRot = absRot; @@ -624,7 +667,11 @@ ivas_error ivas_orient_trk_Process( QuaternionProduct( pOTR->trkRot, absRot, &pOTR->trkRot ); break; +#ifdef FIX_439_OTR_PARAMS + case HEAD_ORIENT_TRK_AVG: +#else case OTR_TRACKING_AVG_ORIENT: +#endif /* Compute average (low-pass filtered) absolute orientation */ QuaternionSlerp( pOTR->absAvgRot, absRot, alpha, &pOTR->absAvgRot ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index efa2111243..6b39e611d8 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -873,7 +873,11 @@ ivas_error ivas_orient_trk_Init( ivas_error ivas_orient_trk_SetTrackingType( ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE trackingType /* i : orientation tracking type */ +#else const OTR_TRACKING_T trackingType /* i : orientation tracking type */ +#endif ); ivas_error ivas_orient_trk_SetReferenceRotation( diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index a3308e23c2..94db3e5242 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -228,7 +228,11 @@ typedef struct EFAP typedef struct ivas_orient_trk_state_t { +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE trackingType; +#else OTR_TRACKING_T trackingType; +#endif float centerAdaptationRate; float offCenterAdaptationRate; float adaptationAngle; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 731b284b0e..8632ca456f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3857,9 +3857,16 @@ ivas_error IVAS_REND_SetHeadRotation( ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_TYPE otrMode /* i : Head orientation tracking mode */ +#else const uint8_t otrMode /* i : Orientation tracking mode */ +#endif ) { +#ifdef FIX_439_OTR_PARAMS + return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, otrMode ); +#else OTR_TRACKING_T mode; ivas_error error; @@ -3892,6 +3899,7 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( { return error; } +#endif return IVAS_ERR_OK; } -- GitLab From d0225f1edc3b74fbb419e1a379c8550707025bdc Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 11 May 2023 15:12:53 +0200 Subject: [PATCH 2/8] Orientation tracking parameter aspects --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8632ca456f..8aa44ef8ea 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3899,9 +3899,9 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( { return error; } -#endif return IVAS_ERR_OK; +#endif } -- GitLab From 1958d7df6155a7dc1078812391b200334aba50c3 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 11 May 2023 16:21:31 +0200 Subject: [PATCH 3/8] Cleanup --- lib_com/ivas_cnst.h | 2 +- lib_dec/ivas_stat_dec.h | 2 +- lib_dec/lib_dec.c | 2 +- lib_dec/lib_dec.h | 2 +- lib_rend/ivas_orient_trk.c | 4 ++-- lib_rend/ivas_prot_rend.h | 2 +- lib_rend/ivas_stat_rend.h | 2 +- lib_rend/lib_rend.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 1d4c36e49b..d764ad95e9 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1608,7 +1608,7 @@ typedef enum HEAD_ORIENT_TRK_AVG, HEAD_ORIENT_TRK_REF_VEC, HEAD_ORIENT_TRK_REF_VEC_LEV -} HEAD_ORIENT_TRK_TYPE; +} HEAD_ORIENT_TRK_T; #else #define IVAS_ORIENT_TRK_NONE 0 #define IVAS_ORIENT_TRK_REF 1 diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 16d5404243..dae7ea68c3 100755 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1175,7 +1175,7 @@ typedef struct decoder_config_structure int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE orientation_tracking; /* indicates orientation tracking type */ + HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ #else int16_t orientation_tracking; /* indicates orientation tracking type */ #endif diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 6d9617517d..85bcd76c55 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -402,7 +402,7 @@ ivas_error IVAS_DEC_Configure( const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE orientationTracking, /* i : head orientation tracking mode */ + HEAD_ORIENT_TRK_T orientationTracking, /* i : head orientation tracking mode */ #endif const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 2258361f30..df67102e2c 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -136,7 +136,7 @@ ivas_error IVAS_DEC_Configure( const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE orientationTracking, /* i : head orientation tracking mode */ + HEAD_ORIENT_TRK_T orientationTracking, /* i : head orientation tracking mode */ #endif const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ); diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index fd70611d62..de4b589c14 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -408,7 +408,7 @@ ivas_error ivas_orient_trk_Init( /* set safe default tracking mode */ #ifdef FIX_439_OTR_PARAMS pOTR->trackingType = HEAD_ORIENT_TRK_NONE; - #else +#else pOTR->trackingType = OTR_TRACKING_NONE; #endif @@ -425,7 +425,7 @@ ivas_error ivas_orient_trk_Init( ivas_error ivas_orient_trk_SetTrackingType( ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE trackingType /* i/o: orientation tracking type */ + HEAD_ORIENT_TRK_T trackingType /* i/o: orientation tracking type */ #else const OTR_TRACKING_T trackingType /* i/o: orientation tracking type */ #endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 6b39e611d8..55ff934168 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -874,7 +874,7 @@ ivas_error ivas_orient_trk_Init( ivas_error ivas_orient_trk_SetTrackingType( ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE trackingType /* i : orientation tracking type */ + HEAD_ORIENT_TRK_T trackingType /* i : orientation tracking type */ #else const OTR_TRACKING_T trackingType /* i : orientation tracking type */ #endif diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 94db3e5242..230fda130a 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -229,7 +229,7 @@ typedef struct EFAP typedef struct ivas_orient_trk_state_t { #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE trackingType; + HEAD_ORIENT_TRK_T trackingType; #else OTR_TRACKING_T trackingType; #endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8aa44ef8ea..e889900fe4 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3858,7 +3858,7 @@ ivas_error IVAS_REND_SetHeadRotation( ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_TYPE otrMode /* i : Head orientation tracking mode */ + HEAD_ORIENT_TRK_T otrMode /* i : Head orientation tracking mode */ #else const uint8_t otrMode /* i : Orientation tracking mode */ #endif -- GitLab From 7effe8d15672031c64917f23a3b89ff25354e022 Mon Sep 17 00:00:00 2001 From: hsd Date: Fri, 12 May 2023 15:58:25 +0200 Subject: [PATCH 4/8] Moved HEAD_ORIENT_TRK_T to common_api_types.h to avoid including the private ivas_cnst.h header in the decoder/renderer APIs --- lib_com/common_api_types.h | 10 ++++++++++ lib_com/ivas_cnst.h | 11 +---------- lib_dec/lib_dec.h | 4 ---- lib_rend/lib_rend.h | 6 +++++- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 61c68eae5d..3f0f8b305b 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -93,6 +93,16 @@ typedef struct float x, y, z; } IVAS_VECTOR3; +#ifdef FIX_439_OTR_PARAMS +typedef enum +{ + HEAD_ORIENT_TRK_NONE, + HEAD_ORIENT_TRK_REF, + HEAD_ORIENT_TRK_AVG, + HEAD_ORIENT_TRK_REF_VEC, + HEAD_ORIENT_TRK_REF_VEC_LEV +} HEAD_ORIENT_TRK_T; +#endif typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index d764ad95e9..b107631d7e 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1595,21 +1595,12 @@ typedef enum } SFX_OpMode_t; +#ifndef FIX_439_OTR_PARAMS /*----------------------------------------------------------------------------------* * Orientation tracking constants *----------------------------------------------------------------------------------*/ /* Orientation tracking types */ -#ifdef FIX_439_OTR_PARAMS -typedef enum -{ - HEAD_ORIENT_TRK_NONE, - HEAD_ORIENT_TRK_REF, - HEAD_ORIENT_TRK_AVG, - HEAD_ORIENT_TRK_REF_VEC, - HEAD_ORIENT_TRK_REF_VEC_LEV -} HEAD_ORIENT_TRK_T; -#else #define IVAS_ORIENT_TRK_NONE 0 #define IVAS_ORIENT_TRK_REF 1 #define IVAS_ORIENT_TRK_AVG 2 diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index df67102e2c..069137fddd 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -34,12 +34,8 @@ #define LIB_DEC_H #include "common_api_types.h" -#ifdef FIX_439_OTR_PARAMS -#include "ivas_cnst.h" -#endif #include - /*---------------------------------------------------------------------* * Decoder enums *---------------------------------------------------------------------*/ diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1e9d41fd38..9d9ed3555a 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -250,7 +250,11 @@ ivas_error IVAS_REND_SetHeadRotation( ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const uint8_t otrMode /* i : Orientation tracking mode */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_T otrMode /* i : Head orientation tracking mode */ +#else + const uint8_t otrMode /* i : Orientation tracking mode */ +#endif ); ivas_error IVAS_REND_SetReferenceRotation( -- GitLab From 1173116fccec4b253fab20d20b4b2976ab07fbf4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 May 2023 09:20:54 +0200 Subject: [PATCH 5/8] harmonize parameter names; add "const" to fucntion input parameters --- apps/decoder.c | 1 + apps/renderer.c | 31 ++++++++++++++++++++++++------- lib_dec/lib_dec.c | 10 +++++----- lib_dec/lib_dec.h | 2 +- lib_rend/ivas_orient_trk.c | 24 +++++++++++++++++++++--- lib_rend/ivas_prot_rend.h | 2 +- lib_rend/ivas_stat_rend.h | 2 +- lib_rend/lib_rend.c | 6 +++--- lib_rend/lib_rend.h | 8 ++++---- 9 files changed, 61 insertions(+), 25 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index a24c177c84..1942fe7cfa 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -189,6 +189,7 @@ int main( /*------------------------------------------------------------------------------------------* * Open decoder handle *------------------------------------------------------------------------------------------*/ + #ifdef FIX_439_OTR_PARAMS if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) #else diff --git a/apps/renderer.c b/apps/renderer.c index 1477e2279e..68300d2950 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -135,7 +135,11 @@ typedef struct char referenceRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef FIX_439_OTR_PARAMS + int8_t orientation_tracking; +#else int8_t orientationTracking; +#endif float noDiegeticPan; bool delayCompensationEnabled; bool quietModeEnabled; @@ -708,7 +712,11 @@ int main( } } +#ifdef FIX_439_OTR_PARAMS + if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientation_tracking ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientationTracking ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -1367,7 +1375,12 @@ static bool parseDiegeticPan( static bool parseOrientationTracking( char *value, - int8_t *tracking_type ) +#ifdef FIX_439_OTR_PARAMS + int8_t *orientation_tracking +#else + int8_t *tracking_type +#endif +) { to_upper( value ); @@ -1375,7 +1388,7 @@ static bool parseOrientationTracking( if ( strcmp( value, "NONE" ) == 0 ) { #ifdef FIX_439_OTR_PARAMS - *tracking_type = HEAD_ORIENT_TRK_NONE; + *orientation_tracking = HEAD_ORIENT_TRK_NONE; #else *tracking_type = IVAS_ORIENT_TRK_NONE; #endif @@ -1383,7 +1396,7 @@ static bool parseOrientationTracking( else if ( strcmp( value, "REF" ) == 0 ) { #ifdef FIX_439_OTR_PARAMS - *tracking_type = HEAD_ORIENT_TRK_REF; + *orientation_tracking = HEAD_ORIENT_TRK_REF; #else *tracking_type = IVAS_ORIENT_TRK_REF; #endif @@ -1391,7 +1404,7 @@ static bool parseOrientationTracking( else if ( strcmp( value, "AVG" ) == 0 ) { #ifdef FIX_439_OTR_PARAMS - *tracking_type = HEAD_ORIENT_TRK_AVG; + *orientation_tracking = HEAD_ORIENT_TRK_AVG; #else *tracking_type = IVAS_ORIENT_TRK_AVG; #endif @@ -1399,7 +1412,7 @@ static bool parseOrientationTracking( else if ( strcmp( value, "REF_VEC" ) == 0 ) { #ifdef FIX_439_OTR_PARAMS - *tracking_type = HEAD_ORIENT_TRK_REF_VEC; + *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC; #else *tracking_type = IVAS_ORIENT_TRK_REF_VEC; #endif @@ -1407,7 +1420,7 @@ static bool parseOrientationTracking( else if ( strcmp( value, "REF_VEC_LEV" ) == 0 ) { #ifdef FIX_439_OTR_PARAMS - *tracking_type = HEAD_ORIENT_TRK_REF_VEC_LEV; + *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC_LEV; #else *tracking_type = IVAS_ORIENT_TRK_REF_VEC_LEV; #endif @@ -1635,7 +1648,7 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); #ifdef FIX_439_OTR_PARAMS - args.orientationTracking = HEAD_ORIENT_TRK_NONE; + args.orientation_tracking = HEAD_ORIENT_TRK_NONE; #else args.orientationTracking = IVAS_ORIENT_TRK_NONE; #endif @@ -1739,7 +1752,11 @@ static void parseOption( break; case CmdLnOptionId_orientationTracking: assert( numOptionValues == 1 ); +#ifdef FIX_439_OTR_PARAMS + if ( !parseOrientationTracking( optionValues[0], &args->orientation_tracking ) ) +#else if ( !parseOrientationTracking( optionValues[0], &args->orientationTracking ) ) +#endif { fprintf( stderr, "Unknown option for orientation tracking: %s\n", optionValues[0] ); exit( -1 ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 85bcd76c55..bb00dc6559 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -109,8 +109,8 @@ static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int /* may return an error but may still have allocated memory - thus run Close also in case of error to release memory */ ivas_error IVAS_DEC_Open( - IVAS_DEC_HANDLE *phIvasDec, /* i/o: pointer to an IVAS decoder handle to be opened */ - const IVAS_DEC_MODE mode, /* i : compatibility mode (EVS or IVAS) */ + IVAS_DEC_HANDLE *phIvasDec, /* i/o: pointer to an IVAS decoder handle to be opened */ + const IVAS_DEC_MODE mode, /* i : compatibility mode (EVS or IVAS) */ #ifndef FIX_439_OTR_PARAMS const int16_t orientation_tracking, /* i : orientation tracking type */ #endif @@ -402,9 +402,9 @@ ivas_error IVAS_DEC_Configure( const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T orientationTracking, /* i : head orientation tracking mode */ + const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ #endif - const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ + const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ) { Decoder_Struct *st_ivas; @@ -453,7 +453,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = enableHeadRotation; #ifdef FIX_439_OTR_PARAMS - hDecoderConfig->orientation_tracking = orientationTracking; + hDecoderConfig->orientation_tracking = orientation_tracking; #endif hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 069137fddd..091f50ca23 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -132,7 +132,7 @@ ivas_error IVAS_DEC_Configure( const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T orientationTracking, /* i : head orientation tracking mode */ + const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ #endif const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ ); diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index de4b589c14..ae646b4d5c 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -407,7 +407,7 @@ ivas_error ivas_orient_trk_Init( /* set safe default tracking mode */ #ifdef FIX_439_OTR_PARAMS - pOTR->trackingType = HEAD_ORIENT_TRK_NONE; + pOTR->orientation_tracking = HEAD_ORIENT_TRK_NONE; #else pOTR->trackingType = OTR_TRACKING_NONE; #endif @@ -423,9 +423,9 @@ ivas_error ivas_orient_trk_Init( *-------------------------------------------------------------------*/ ivas_error ivas_orient_trk_SetTrackingType( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T trackingType /* i/o: orientation tracking type */ + const HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ #else const OTR_TRACKING_T trackingType /* i/o: orientation tracking type */ #endif @@ -435,7 +435,12 @@ ivas_error ivas_orient_trk_SetTrackingType( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + +#ifdef FIX_439_OTR_PARAMS + pOTR->orientation_tracking = orientation_tracking; +#else pOTR->trackingType = trackingType; +#endif return IVAS_ERR_OK; } @@ -485,7 +490,12 @@ ivas_error ivas_orient_trk_GetMainOrientation( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + +#ifdef FIX_439_OTR_PARAMS + switch ( pOTR->orientation_tracking ) +#else switch ( pOTR->trackingType ) +#endif { #ifdef FIX_439_OTR_PARAMS case HEAD_ORIENT_TRK_NONE: @@ -561,7 +571,11 @@ ivas_error ivas_orient_trk_SetReferenceVector( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef FIX_439_OTR_PARAMS + switch ( pOTR->orientation_tracking ) +#else switch ( pOTR->trackingType ) +#endif { #ifdef FIX_439_OTR_PARAMS case HEAD_ORIENT_TRK_NONE: @@ -638,7 +652,11 @@ ivas_error ivas_orient_trk_Process( result = IVAS_ERR_OK; +#ifdef FIX_439_OTR_PARAMS + switch ( pOTR->orientation_tracking ) +#else switch ( pOTR->trackingType ) +#endif { #ifdef FIX_439_OTR_PARAMS case HEAD_ORIENT_TRK_NONE: diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 55ff934168..34d4edc65a 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -874,7 +874,7 @@ ivas_error ivas_orient_trk_Init( ivas_error ivas_orient_trk_SetTrackingType( ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T trackingType /* i : orientation tracking type */ + const HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ #else const OTR_TRACKING_T trackingType /* i : orientation tracking type */ #endif diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 230fda130a..a987a1f835 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -229,7 +229,7 @@ typedef struct EFAP typedef struct ivas_orient_trk_state_t { #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T trackingType; + HEAD_ORIENT_TRK_T orientation_tracking; #else OTR_TRACKING_T trackingType; #endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e889900fe4..2fb8ba6753 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3858,14 +3858,14 @@ ivas_error IVAS_REND_SetHeadRotation( ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T otrMode /* i : Head orientation tracking mode */ + const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ #else - const uint8_t otrMode /* i : Orientation tracking mode */ + const uint8_t otrMode /* i : Orientation tracking mode */ #endif ) { #ifdef FIX_439_OTR_PARAMS - return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, otrMode ); + return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking ); #else OTR_TRACKING_T mode; ivas_error error; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 9d9ed3555a..8e681c3832 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -228,8 +228,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 IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */ ); int16_t IVAS_REND_GetRenderConfig( @@ -245,13 +245,13 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ - const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ + const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ ); ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T otrMode /* i : Head orientation tracking mode */ + const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ #else const uint8_t otrMode /* i : Orientation tracking mode */ #endif -- GitLab From 5b2ea567d1151c8bdfb47106a88501657d9469fb Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 15 May 2023 09:28:06 +0200 Subject: [PATCH 6/8] fix compilation warning --- lib_dec/lib_dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index bb00dc6559..9a18cbf356 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2021,6 +2021,8 @@ static ivas_error printConfigInfo_dec( case HEAD_ORIENT_TRK_REF_VEC_LEV: fprintf( stdout, "Orientation tracking: REF_VEC_LEV\n" ); break; + default: + break; } } #else -- GitLab From b0e3fcc7458c736b54d9ce24c89a15771ccb196d Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 May 2023 17:23:43 +0200 Subject: [PATCH 7/8] add initialization of "orientation_tracking" parameter --- apps/renderer.c | 1 - lib_dec/lib_dec.c | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 44cbeb0f36..4fcd3f92e1 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1439,7 +1439,6 @@ static bool parseOrientationTracking( #endif ) { - to_upper( value ); if ( strcmp( value, "NONE" ) == 0 ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index bac60476a2..c5d1173c8d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -156,7 +156,7 @@ ivas_error IVAS_DEC_Open( , float no_diegetic_pan /* i : non diegetic panning gain */ #endif - ) +) { IVAS_DEC_HANDLE hIvasDec; Decoder_Struct *st_ivas; @@ -289,7 +289,9 @@ static void init_decoder_config( hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; hDecoderConfig->Opt_RendConfigCustom = 0; -#ifndef FIX_439_OTR_PARAMS +#ifdef FIX_439_OTR_PARAMS + hDecoderConfig->orientation_tracking = HEAD_ORIENT_TRK_NONE; +#else hDecoderConfig->orientation_tracking = orientation_tracking; #endif #ifdef NON_DIEGETIC_PAN @@ -2804,6 +2806,7 @@ static ivas_error printConfigInfo_dec( } } #endif + #ifdef NON_DIEGETIC_PAN if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) { -- GitLab From b927f0ef0eb84c65836de664a245c028e3394404 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 May 2023 17:27:03 +0200 Subject: [PATCH 8/8] clang-format --- lib_com/common_api_types.h | 10 +++++----- lib_dec/ivas_stat_dec.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 1040817ea1..3b9a331908 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -99,11 +99,11 @@ typedef struct #ifdef FIX_439_OTR_PARAMS typedef enum { - HEAD_ORIENT_TRK_NONE, - HEAD_ORIENT_TRK_REF, - HEAD_ORIENT_TRK_AVG, - HEAD_ORIENT_TRK_REF_VEC, - HEAD_ORIENT_TRK_REF_VEC_LEV + HEAD_ORIENT_TRK_NONE, + HEAD_ORIENT_TRK_REF, + HEAD_ORIENT_TRK_AVG, + HEAD_ORIENT_TRK_REF_VEC, + HEAD_ORIENT_TRK_REF_VEC_LEV } HEAD_ORIENT_TRK_T; #endif diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 7177c34b76..727b01c0ed 100755 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1220,9 +1220,9 @@ typedef struct decoder_config_structure int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ #ifdef FIX_439_OTR_PARAMS - HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ + HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ #else - int16_t orientation_tracking; /* indicates orientation tracking type */ + int16_t orientation_tracking; /* indicates orientation tracking type */ #endif #ifdef NON_DIEGETIC_PAN int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ -- GitLab