diff --git a/apps/decoder.c b/apps/decoder.c index 9b6b85676508d94c60b728bf651da78c8332a555..ca91fd1bf5332c0eb9102f0c214178d881481843 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -226,10 +226,18 @@ int main( * Open decoder handle *------------------------------------------------------------------------------------------*/ +#ifdef FIX_439_OTR_PARAMS +#ifdef NON_DIEGETIC_PAN + if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) +#endif +#else #ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) +#endif #endif { fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -395,10 +403,18 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ +#ifdef FIX_439_OTR_PARAMS +#ifdef NON_DIEGETIC_PAN + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain ) ) != IVAS_ERR_OK ) +#else + 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 ) +#endif +#else #ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain ) ) != 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 #endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); diff --git a/apps/renderer.c b/apps/renderer.c index 533472b428c854c7a0deba8804e75de4d1c562a4..4fcd3f92e1e90662bdea298892111fc7ba5e0c21 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 #ifdef NON_DIEGETIC_PAN int16_t nonDiegeticPan; float nonDiegeticPanGain; @@ -732,7 +736,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; } @@ -1424,30 +1432,54 @@ 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 ); if ( strcmp( value, "NONE" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *orientation_tracking = HEAD_ORIENT_TRK_NONE; +#else *tracking_type = IVAS_ORIENT_TRK_NONE; +#endif } else if ( strcmp( value, "REF" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *orientation_tracking = HEAD_ORIENT_TRK_REF; +#else *tracking_type = IVAS_ORIENT_TRK_REF; +#endif } else if ( strcmp( value, "AVG" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *orientation_tracking = HEAD_ORIENT_TRK_AVG; +#else *tracking_type = IVAS_ORIENT_TRK_AVG; +#endif } else if ( strcmp( value, "REF_VEC" ) == 0 ) { +#ifdef FIX_439_OTR_PARAMS + *orientation_tracking = 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 + *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC_LEV; +#else *tracking_type = IVAS_ORIENT_TRK_REF_VEC_LEV; +#endif } else { @@ -1671,7 +1703,11 @@ static CmdlnArgs defaultArgs( clearString( args.customHrtfFilePath ); clearString( args.renderConfigFilePath ); +#ifdef FIX_439_OTR_PARAMS + args.orientation_tracking = HEAD_ORIENT_TRK_NONE; +#else args.orientationTracking = IVAS_ORIENT_TRK_NONE; +#endif #ifdef NON_DIEGETIC_PAN args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; @@ -1784,7 +1820,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_com/common_api_types.h b/lib_com/common_api_types.h index a1ab432ead3a38ca56c0098160a6139ada36c7ed..3b9a3319085acdb16b34bd4354aa3ca7171d51d0 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -96,6 +96,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 b5e3964319561de2bb35cfc157c0fe32031b3104..3a13e67b56ffc6230cd31f400dfe75795f95da74 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1642,6 +1642,7 @@ typedef enum } SFX_OpMode_t; +#ifndef FIX_439_OTR_PARAMS /*----------------------------------------------------------------------------------* * Orientation tracking constants *----------------------------------------------------------------------------------*/ @@ -1662,7 +1663,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 49d8d544d2b6700f0c8fb400ed092ae9aef3ec71..453ba00eaf2c46061401cf53bea58f6283f029df 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -187,6 +187,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 LBR_SBA_DIRAC_FIX /* DLB: Bug fix for DirAC at low bitrates */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index ef9cbdf54bf9fe4e1237807f4f65175111bac9e3..d5982c63a059fb5afc03b349b0bae3b30add3f11 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -767,6 +767,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 ) @@ -806,6 +812,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 98df8c3dcade50d3a372f45734cf1fd60b0fe72f..727b01c0ed3b6a9c67bf9d0e8de453775f6f1bda 100755 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1219,7 +1219,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 */ - int16_t orientation_tracking; /* indicates orientation tracking type */ +#ifdef FIX_439_OTR_PARAMS + HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ +#else + int16_t orientation_tracking; /* indicates orientation tracking type */ +#endif #ifdef NON_DIEGETIC_PAN int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ float non_diegetic_pan_gain; /* non diegetic panning gain*/ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 17c718bb48291022b3cd71862a3c2399c5c1f239..c5d1173c8dcc8cd0b8594c5cc2db3b1205ca9c69 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -115,11 +115,19 @@ static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSampl static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSamples, int16_t *pcmBuf ); #endif 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 +#ifdef NON_DIEGETIC_PAN +static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); +#else +static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const float non_diegetic_pan ); +#endif +#else #ifdef NON_DIEGETIC_PAN static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int16_t orientation_tracking ); #else static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int16_t orientation_tracking, const float non_diegetic_pan ); #endif +#endif #ifdef JBM_TSM_ON_TCS static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas ); static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( IVAS_DEC_HANDLE hIvasDec ); @@ -138,9 +146,12 @@ static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const u /* 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 #ifndef NON_DIEGETIC_PAN , float no_diegetic_pan /* i : non diegetic panning gain */ @@ -198,12 +209,19 @@ ivas_error IVAS_DEC_Open( st_ivas = hIvasDec->st_ivas; /* initialize Decoder Config. handle */ +#ifdef FIX_439_OTR_PARAMS +#ifdef NON_DIEGETIC_PAN + init_decoder_config( hIvasDec->st_ivas->hDecoderConfig ); +#else + init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, no_diegetic_pan ); +#endif +#else #ifdef NON_DIEGETIC_PAN init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, orientation_tracking ); #else init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, orientation_tracking, no_diegetic_pan ); #endif - +#endif /* initialize pointers to handles to NULL */ ivas_initialize_handles_dec( st_ivas ); @@ -253,8 +271,11 @@ ivas_error IVAS_DEC_Open( *---------------------------------------------------------------------*/ static void init_decoder_config( - DECODER_CONFIG_HANDLE hDecoderConfig, /* i/o: configuration structure */ + DECODER_CONFIG_HANDLE hDecoderConfig /* i/o: configuration structure */ +#ifndef FIX_439_OTR_PARAMS + , const int16_t orientation_tracking +#endif #ifndef NON_DIEGETIC_PAN , const float no_diegetic_pan @@ -268,7 +289,11 @@ static void init_decoder_config( hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; hDecoderConfig->Opt_RendConfigCustom = 0; +#ifdef FIX_439_OTR_PARAMS + hDecoderConfig->orientation_tracking = HEAD_ORIENT_TRK_NONE; +#else hDecoderConfig->orientation_tracking = orientation_tracking; +#endif #ifdef NON_DIEGETIC_PAN hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; @@ -440,6 +465,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 + const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ +#endif #ifdef NON_DIEGETIC_PAN const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ @@ -502,6 +530,9 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = enableHeadRotation; +#ifdef FIX_439_OTR_PARAMS + hDecoderConfig->orientation_tracking = orientation_tracking; +#endif hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; #ifdef NON_DIEGETIC_PAN @@ -2734,6 +2765,28 @@ 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; + default: + break; + } + } +#else if ( st_ivas->hDecoderConfig->orientation_tracking != IVAS_ORIENT_TRK_NONE ) { switch ( st_ivas->hDecoderConfig->orientation_tracking ) @@ -2752,6 +2805,7 @@ static ivas_error printConfigInfo_dec( break; } } +#endif #ifdef NON_DIEGETIC_PAN if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) @@ -2885,10 +2939,12 @@ static ivas_error evs_dec_main( mdct_switching_dec( hCoreCoder[0] ); #ifdef JBM_TSM_ON_TCS +#ifdef NON_DIEGETIC_PAN for ( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) { p_output[ch] = output[ch]; } +#endif #endif /* run the main EVS decoding routine */ diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index fd8735dda63eff206e85de26e0ab2721dbaa0e41..c61d3f91fd9feafa9b1dfd8479075b6584c2021f 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -36,7 +36,6 @@ #include "common_api_types.h" #include - /*---------------------------------------------------------------------* * Decoder enums *---------------------------------------------------------------------*/ @@ -135,11 +134,14 @@ typedef ivas_error ( *JbmTraceFileWriterFn )( const void *data, void *writer ); /*! r: error code */ 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 */ + 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 #ifndef NON_DIEGETIC_PAN , - float no_diegetic_pan_gain /* i : non diegetic panning gain */ + float no_diegetic_pan_gain /* i : non diegetic panning gain */ #endif ); @@ -151,6 +153,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 + const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ +#endif #ifdef NON_DIEGETIC_PAN const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index 63d863c4b635dcdfc832f9c0027d165a7c902238..ae646b4d5c4b05f4164366730274e152ef58de92 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->orientation_tracking = HEAD_ORIENT_TRK_NONE; +#else pOTR->trackingType = OTR_TRACKING_NONE; +#endif return IVAS_ERR_OK; } @@ -419,15 +423,24 @@ 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 + const HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ +#else const OTR_TRACKING_T trackingType /* i/o: orientation tracking type */ +#endif ) { if ( pOTR == NULL ) { 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; } @@ -477,17 +490,36 @@ 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: +#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; } @@ -539,15 +571,30 @@ 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: + 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; @@ -605,14 +652,28 @@ 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: +#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 +685,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 b43a048f38f901638e8e2885fa4da2d0feaaf0fc..402b98a4d035034f287ed368cf93786d6909f912 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -954,7 +954,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 + const HEAD_ORIENT_TRK_T orientation_tracking /* 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 a3308e23c21e39a73a6ef9554257a9fdf52f7af2..a987a1f83509570c2fc82a9b2f75c3baf1f0d128 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_T orientation_tracking; +#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 ef5561ca98d61ab4e8736c8a35cc76be74774cb4..5becd351d61fae13361dd175be3d33356f594cc6 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3915,9 +3915,16 @@ 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 + const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ +#else + const uint8_t otrMode /* i : Orientation tracking mode */ +#endif ) { +#ifdef FIX_439_OTR_PARAMS + return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking ); +#else OTR_TRACKING_T mode; ivas_error error; @@ -3952,6 +3959,7 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( } return IVAS_ERR_OK; +#endif } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index f9b2781110875e8d03da2a8e4d7f4c206e0b1d8a..aaec5f4658de01327280a70cdc19744a9a53afda 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -234,8 +234,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( @@ -251,12 +251,16 @@ 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 */ - const uint8_t otrMode /* i : Orientation tracking mode */ +#ifdef FIX_439_OTR_PARAMS + const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ +#else + const uint8_t otrMode /* i : Orientation tracking mode */ +#endif ); ivas_error IVAS_REND_SetReferenceRotation(