diff --git a/apps/decoder.c b/apps/decoder.c index a24c177c84278825dccfa7b768ad7731d60385c0..1942fe7cfa72d02e5b7ca8a68294460bf5ac11b5 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 1477e2279e925b55ccbae1dfbed170a51c53ba38..68300d295040754b3c3ceb9ed025d39581894b6f 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_com/common_api_types.h b/lib_com/common_api_types.h index 61c68eae5d5bc8ceeb717b7bd4a7b2cc1112575c..3f0f8b305bb7707533d9a3db9a9d185d80c237c8 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 d764ad95e92d04c2825f705a36e9f17bceecf9ec..b107631d7e083983733d6fbefffa51c88a4a4094 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.c b/lib_dec/lib_dec.c index 85bcd76c5570906b925a3560fcb73f9ff5c3670e..9a18cbf356cb5ebf0701c2fa78946f30de378b6b 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; @@ -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 diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index df67102e2c4e6a27f15f74bbf46204c893b5cb66..091f50ca234bb9a9f813e1225c30785ab2278b00 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 *---------------------------------------------------------------------*/ @@ -136,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 de4b589c147415675e12c8c638677a47f085e014..ae646b4d5c4b05f4164366730274e152ef58de92 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 55ff934168af4a17570214e1db7606d4ffa04571..34d4edc65a1bc6f7226dfb198350f756edf7116b 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 230fda130a7c94bbb02b51f29e95e62ed8a2b84c..a987a1f83509570c2fc82a9b2f75c3baf1f0d128 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 e889900fe4dd7ade64a2cd78aca70d1f5d0dedc4..2fb8ba675377681e59e5c18ebb76b1085e565fd7 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 1e9d41fd38c1c49044b537b6d5826ab3f520acb3..8e681c3832aa98c9f5c3f4ce6efa86019861d656 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,12 +245,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(