Loading apps/decoder.c +0 −57 Original line number Diff line number Diff line Loading @@ -117,12 +117,8 @@ typedef struct bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; #ifdef NON_DIEGETIC_PAN int16_t Opt_non_diegetic_pan; float non_diegetic_pan_gain; #else float no_diegetic_pan; #endif bool renderConfigEnabled; char *renderConfigFilename; #ifdef COMPLEXITY_LEVEL_INDICATION Loading Loading @@ -227,17 +223,9 @@ int main( *------------------------------------------------------------------------------------------*/ #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 ) ); Loading Loading @@ -404,17 +392,9 @@ int main( *------------------------------------------------------------------------------------------*/ #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 ) ); Loading Loading @@ -868,12 +848,8 @@ static bool parseCmdlIVAS_dec( arg->renderConfigFilename = NULL; arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; #ifdef NON_DIEGETIC_PAN arg->Opt_non_diegetic_pan = 0; arg->non_diegetic_pan_gain = 0.f; #else arg->no_diegetic_pan = 0.f; #endif #ifdef VARIABLE_SPEED_DECODING arg->variableSpeedMode = 0; arg->tsmScale = 100; Loading Loading @@ -1172,56 +1148,27 @@ static bool parseCmdlIVAS_dec( else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 ) { i++; #ifdef NON_DIEGETIC_PAN arg->Opt_non_diegetic_pan = 1; #else if ( argc - i <= 4 || ( argv[i][0] == '-' ) ) { fprintf( stderr, "Error: Argument for panning option not specified!\n\n" ); usage_dec(); return false; } #endif strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; #ifdef NON_DIEGETIC_PAN to_upper( argv_to_upper ); #endif if ( ( strcmp( argv_to_upper, "CENTER" ) == 0 ) || ( strchr( argv_to_upper, 'C' ) != NULL ) ) { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = 0.f; #else arg->no_diegetic_pan = 0.f; #endif } else if ( ( strcmp( argv_to_upper, "LEFT" ) == 0 ) || ( strchr( argv_to_upper, 'L' ) != NULL ) ) { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = 1.f; #else arg->no_diegetic_pan = 1.f; #endif } else if ( ( strcmp( argv_to_upper, "RIGHT" ) == 0 ) || ( strchr( argv_to_upper, 'R' ) != NULL ) ) { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = -1.f; #else arg->no_diegetic_pan = -1.f; #endif } else { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = (float) atof( argv_to_upper ) / 90.f; if ( arg->non_diegetic_pan_gain > 1.0f || arg->non_diegetic_pan_gain < -1.0f ) #else arg->no_diegetic_pan = (float) atof( argv_to_upper ); if ( arg->no_diegetic_pan > 1.0f || arg->no_diegetic_pan < -1.0f ) #endif { fprintf( stderr, "Error: Incorrect value for panning gain value specified: %s\n\n", argv[i] ); usage_dec(); Loading Loading @@ -1277,25 +1224,21 @@ static bool parseCmdlIVAS_dec( arg->customLsSetupFilename = argv[i]; } i++; #ifdef NON_DIEGETIC_PAN if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputFormat != IVAS_DEC_OUTPUT_STEREO ) ) { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); return false; } #endif } else { arg->outputFormat = IVAS_DEC_OUTPUT_MONO; arg->decMode = IVAS_DEC_MODE_EVS; #ifdef NON_DIEGETIC_PAN if ( ( arg->Opt_non_diegetic_pan ) ) { arg->outputFormat = IVAS_DEC_OUTPUT_STEREO; } #endif } /*-----------------------------------------------------------------* Loading apps/renderer.c +0 −66 Original line number Diff line number Diff line Loading @@ -140,12 +140,8 @@ typedef struct #else int8_t orientationTracking; #endif #ifdef NON_DIEGETIC_PAN int16_t nonDiegeticPan; float nonDiegeticPanGain; #else float noDiegeticPan; #endif bool delayCompensationEnabled; bool quietModeEnabled; bool sceneDescriptionInput; Loading Loading @@ -560,7 +556,6 @@ int main( CmdlnArgs args = parseCmdlnArgs( argc, argv ); #ifdef NON_DIEGETIC_PAN 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 ) ) ) { Loading @@ -573,7 +568,6 @@ int main( fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" ); exit( -1 ); } #endif positionProvider = IsmPositionProvider_open(); Loading Loading @@ -689,11 +683,7 @@ int main( IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; #ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); Loading Loading @@ -1366,7 +1356,6 @@ static bool parseOutConfig( return true; } #ifdef NON_DIEGETIC_PAN static bool parseDiegeticPan( char *value, float *nonDiegeticPan ) Loading Loading @@ -1397,37 +1386,6 @@ static bool parseDiegeticPan( } return true; #else static bool parseDiegeticPan( char *value, float *noDiegeticPan ) { to_upper( value ); if ( ( strcmp( value, "CENTER" ) == 0 ) || ( strchr( value, 'C' ) != NULL ) ) { *noDiegeticPan = 0.f; } else if ( ( strcmp( value, "LEFT" ) == 0 ) || ( strchr( value, 'L' ) != NULL ) ) { *noDiegeticPan = -1.f; } else if ( ( strcmp( value, "RIGHT" ) == 0 ) || ( strchr( value, 'R' ) != NULL ) ) { *noDiegeticPan = 1.f; } else { *noDiegeticPan = (float) atof( value ); if ( *noDiegeticPan > 1.0f || *noDiegeticPan < -1.0f ) { fprintf( stderr, "Error: Incorrect value for panning option argument specified!\n\n" ); return false; } } return false; #endif } static bool parseOrientationTracking( Loading Loading @@ -1708,12 +1666,8 @@ static CmdlnArgs defaultArgs( #else args.orientationTracking = IVAS_ORIENT_TRK_NONE; #endif #ifdef NON_DIEGETIC_PAN args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; #else args.noDiegeticPan = 0.0f; #endif args.delayCompensationEnabled = true; args.quietModeEnabled = false; Loading Loading @@ -1805,18 +1759,12 @@ static void parseOption( break; case CmdLnOptionId_nonDiegeticPan: assert( numOptionValues == 1 ); #ifdef NON_DIEGETIC_PAN if ( !parseDiegeticPan( optionValues[0], &args->nonDiegeticPanGain ) ) #else if ( !parseDiegeticPan( optionValues[0], &args->noDiegeticPan ) ) #endif { fprintf( stderr, "Unknown option for diegetic panning: %s\n", optionValues[0] ); exit( -1 ); } #ifdef NON_DIEGETIC_PAN args->nonDiegeticPan = 1; #endif break; case CmdLnOptionId_orientationTracking: assert( numOptionValues == 1 ); Loading Loading @@ -1931,9 +1879,7 @@ void getMetadataFromFileReader( objectMetadataBuffer->positions[objIdx].radius = ismMetadata.radius; objectMetadataBuffer->positions[objIdx].yaw = ismMetadata.yaw; objectMetadataBuffer->positions[objIdx].pitch = ismMetadata.pitch; #ifdef ISM_NON_DIEGETIC_PAN objectMetadataBuffer->positions[objIdx].non_diegetic_flag = ismMetadata.non_diegetic_flag; #endif return; } Loading Loading @@ -1991,9 +1937,7 @@ static void IsmPositionProvider_getNextFrame( objectMetadataBuffer->positions[objIdx].radius = 1.0f; objectMetadataBuffer->positions[objIdx].yaw = 0.0f; objectMetadataBuffer->positions[objIdx].pitch = 0.0f; #ifdef ISM_NON_DIEGETIC_PAN objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0; #endif } /* Wrap azimuth to lie within (-180, 180] range */ Loading Loading @@ -2255,22 +2199,14 @@ static void parseObjectPosition( { char *endptr; int16_t read_values; #ifdef ISM_NON_DIEGETIC_PAN float meta_prm[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f }; #else float meta_prm[7] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; #endif readNextMetadataChunk( line, "," ); *positionDuration = (uint16_t) strtol( line, &endptr, 10 ); readNextMetadataChunk( line, "\n" ); #ifdef ISM_NON_DIEGETIC_PAN read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6], &meta_prm[7] ); #else read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6] ); #endif if ( read_values < 2 ) { Loading @@ -2283,9 +2219,7 @@ static void parseObjectPosition( position->radius = meta_prm[2]; position->yaw = meta_prm[5]; position->pitch = meta_prm[6]; #ifdef ISM_NON_DIEGETIC_PAN position->non_diegetic_flag = (int16_t) meta_prm[7]; #endif return; } Loading lib_com/common_api_types.h +0 −4 Original line number Diff line number Diff line Loading @@ -80,9 +80,7 @@ typedef struct _IVAS_ISM_METADATA float gainFactor; float yaw; float pitch; #ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag; #endif } IVAS_ISM_METADATA; typedef struct Loading Loading @@ -131,9 +129,7 @@ typedef struct float radius; float yaw; float pitch; #ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag; #endif } IVAS_REND_AudioObjectPosition; typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG Loading lib_com/ivas_cnst.h +0 −16 Original line number Diff line number Diff line Loading @@ -156,12 +156,8 @@ typedef enum RENDERER_MCMASA_MONO_STEREO, RENDERER_PARAM_ISM, RENDERER_BINAURAL_MIXER_CONV, #if defined NON_DIEGETIC_PAN || defined ISM_NON_DIEGETIC_PAN RENDERER_BINAURAL_MIXER_CONV_ROOM, RENDERER_NON_DIEGETIC_DOWNMIX #else RENDERER_BINAURAL_MIXER_CONV_ROOM #endif } RENDERER_TYPE; Loading @@ -175,9 +171,7 @@ typedef enum #define HEAD_ROTATION_HOA_ORDER 3 /* HOA 3rd order */ #define MAX_CICP_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts)*/ #define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order) */ #ifdef NON_DIEGETIC_PAN #define MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN 2 /* Maximum number of output channels with non diegetic panning */ #endif #define BINAURAL_CHANNELS 2 /* number of channels for binaural output configuration */ #define CPE_CHANNELS 2 /* number of CPE (stereo) channels */ Loading Loading @@ -366,9 +360,7 @@ typedef enum #define ISM_RADIUS_MIN 0.0f #define ISM_RADIUS_DELTA 0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ #define ISM_EXTENDED_METADATA_BRATE IVAS_64k #ifdef ISM_NON_DIEGETIC_PAN #define ISM_METADATA_IS_NDP_BITS 1 #endif #define ISM_EXTENDED_METADATA_BITS 1 #define ISM_METADATA_RS_MAX_FRAMES 5 /* Number of frames with opposite extended metadata flags before switching */ Loading Loading @@ -410,9 +402,7 @@ enum { IND_ISM_NUM_OBJECTS, IND_ISM_EXTENDED_FLAG = IND_ISM_NUM_OBJECTS + MAX_NUM_OBJECTS, #ifdef ISM_NON_DIEGETIC_PAN IND_ISM_EXTENDED_NDP_FLAG, #endif IND_ISM_METADATA_FLAG, IND_ISM_VAD_FLAG = IND_ISM_METADATA_FLAG + MAX_NUM_OBJECTS, IND_ISM_NOISY_SPEECH_FLAG = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS, Loading @@ -421,9 +411,7 @@ enum /* ------------- loop for objects -------------- */ TAG_ISM_LOOP_START = IND_ISM_DTX_COH_SCA + MAX_NUM_OBJECTS, #ifdef ISM_NON_DIEGETIC_PAN IND_ISM_NDP_FLAG = TAG_ISM_LOOP_START, #endif IND_ISM_AZIMUTH_DIFF_FLAG = TAG_ISM_LOOP_START, IND_ISM_AZIMUTH = TAG_ISM_LOOP_START, IND_ISM_ELEVATION_DIFF_FLAG = TAG_ISM_LOOP_START, Loading Loading @@ -1621,12 +1609,8 @@ typedef enum typedef enum { TDREND_PLAYSTATUS_INITIAL, #ifdef ISM_NON_DIEGETIC_PAN TDREND_PLAYSTATUS_PLAYING, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC #else TDREND_PLAYSTATUS_PLAYING #endif } TDREND_PlayStatus_t; typedef enum Loading lib_com/ivas_ism_com.c +0 −9 Original line number Diff line number Diff line Loading @@ -92,9 +92,7 @@ ivas_error ivas_ism_config( const int16_t nchan_transport, /* i : number of transport channels */ const int16_t nchan_ism, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ #ifdef ISM_NON_DIEGETIC_PAN const int16_t ism_extended_metadata_flag, /* i : extended metadata flag */ #endif const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD flag */ const int16_t ism_imp[], /* i : ISM importance flags */ int32_t element_brate[], /* o : element bitrate per object */ Loading Loading @@ -139,12 +137,10 @@ ivas_error ivas_ism_config( { nb_bits_metadata[0] += ISM_EXTENDED_METADATA_BITS; #ifdef ISM_NON_DIEGETIC_PAN if ( ism_extended_metadata_flag ) { nb_bits_metadata[0] += ISM_METADATA_IS_NDP_BITS; } #endif } nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism; Loading Loading @@ -347,10 +343,8 @@ void ivas_ism_reset_metadata( hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; #ifdef ISM_NON_DIEGETIC_PAN hIsmMeta->ism_metadata_flag = 0; hIsmMeta->non_diegetic_flag = 0; #endif return; } Loading @@ -366,9 +360,6 @@ void ivas_ism_reset_metadata_API( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { #ifndef ISM_NON_DIEGETIC_PAN hIsmMeta->ism_metadata_flag = 0; #endif ivas_ism_reset_metadata( hIsmMeta ); return; Loading Loading
apps/decoder.c +0 −57 Original line number Diff line number Diff line Loading @@ -117,12 +117,8 @@ typedef struct bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; #ifdef NON_DIEGETIC_PAN int16_t Opt_non_diegetic_pan; float non_diegetic_pan_gain; #else float no_diegetic_pan; #endif bool renderConfigEnabled; char *renderConfigFilename; #ifdef COMPLEXITY_LEVEL_INDICATION Loading Loading @@ -227,17 +223,9 @@ int main( *------------------------------------------------------------------------------------------*/ #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 ) ); Loading Loading @@ -404,17 +392,9 @@ int main( *------------------------------------------------------------------------------------------*/ #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 ) ); Loading Loading @@ -868,12 +848,8 @@ static bool parseCmdlIVAS_dec( arg->renderConfigFilename = NULL; arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; #ifdef NON_DIEGETIC_PAN arg->Opt_non_diegetic_pan = 0; arg->non_diegetic_pan_gain = 0.f; #else arg->no_diegetic_pan = 0.f; #endif #ifdef VARIABLE_SPEED_DECODING arg->variableSpeedMode = 0; arg->tsmScale = 100; Loading Loading @@ -1172,56 +1148,27 @@ static bool parseCmdlIVAS_dec( else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 ) { i++; #ifdef NON_DIEGETIC_PAN arg->Opt_non_diegetic_pan = 1; #else if ( argc - i <= 4 || ( argv[i][0] == '-' ) ) { fprintf( stderr, "Error: Argument for panning option not specified!\n\n" ); usage_dec(); return false; } #endif strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; #ifdef NON_DIEGETIC_PAN to_upper( argv_to_upper ); #endif if ( ( strcmp( argv_to_upper, "CENTER" ) == 0 ) || ( strchr( argv_to_upper, 'C' ) != NULL ) ) { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = 0.f; #else arg->no_diegetic_pan = 0.f; #endif } else if ( ( strcmp( argv_to_upper, "LEFT" ) == 0 ) || ( strchr( argv_to_upper, 'L' ) != NULL ) ) { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = 1.f; #else arg->no_diegetic_pan = 1.f; #endif } else if ( ( strcmp( argv_to_upper, "RIGHT" ) == 0 ) || ( strchr( argv_to_upper, 'R' ) != NULL ) ) { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = -1.f; #else arg->no_diegetic_pan = -1.f; #endif } else { #ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = (float) atof( argv_to_upper ) / 90.f; if ( arg->non_diegetic_pan_gain > 1.0f || arg->non_diegetic_pan_gain < -1.0f ) #else arg->no_diegetic_pan = (float) atof( argv_to_upper ); if ( arg->no_diegetic_pan > 1.0f || arg->no_diegetic_pan < -1.0f ) #endif { fprintf( stderr, "Error: Incorrect value for panning gain value specified: %s\n\n", argv[i] ); usage_dec(); Loading Loading @@ -1277,25 +1224,21 @@ static bool parseCmdlIVAS_dec( arg->customLsSetupFilename = argv[i]; } i++; #ifdef NON_DIEGETIC_PAN if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputFormat != IVAS_DEC_OUTPUT_STEREO ) ) { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); return false; } #endif } else { arg->outputFormat = IVAS_DEC_OUTPUT_MONO; arg->decMode = IVAS_DEC_MODE_EVS; #ifdef NON_DIEGETIC_PAN if ( ( arg->Opt_non_diegetic_pan ) ) { arg->outputFormat = IVAS_DEC_OUTPUT_STEREO; } #endif } /*-----------------------------------------------------------------* Loading
apps/renderer.c +0 −66 Original line number Diff line number Diff line Loading @@ -140,12 +140,8 @@ typedef struct #else int8_t orientationTracking; #endif #ifdef NON_DIEGETIC_PAN int16_t nonDiegeticPan; float nonDiegeticPanGain; #else float noDiegeticPan; #endif bool delayCompensationEnabled; bool quietModeEnabled; bool sceneDescriptionInput; Loading Loading @@ -560,7 +556,6 @@ int main( CmdlnArgs args = parseCmdlnArgs( argc, argv ); #ifdef NON_DIEGETIC_PAN 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 ) ) ) { Loading @@ -573,7 +568,6 @@ int main( fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" ); exit( -1 ); } #endif positionProvider = IsmPositionProvider_open(); Loading Loading @@ -689,11 +683,7 @@ int main( IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; #ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); Loading Loading @@ -1366,7 +1356,6 @@ static bool parseOutConfig( return true; } #ifdef NON_DIEGETIC_PAN static bool parseDiegeticPan( char *value, float *nonDiegeticPan ) Loading Loading @@ -1397,37 +1386,6 @@ static bool parseDiegeticPan( } return true; #else static bool parseDiegeticPan( char *value, float *noDiegeticPan ) { to_upper( value ); if ( ( strcmp( value, "CENTER" ) == 0 ) || ( strchr( value, 'C' ) != NULL ) ) { *noDiegeticPan = 0.f; } else if ( ( strcmp( value, "LEFT" ) == 0 ) || ( strchr( value, 'L' ) != NULL ) ) { *noDiegeticPan = -1.f; } else if ( ( strcmp( value, "RIGHT" ) == 0 ) || ( strchr( value, 'R' ) != NULL ) ) { *noDiegeticPan = 1.f; } else { *noDiegeticPan = (float) atof( value ); if ( *noDiegeticPan > 1.0f || *noDiegeticPan < -1.0f ) { fprintf( stderr, "Error: Incorrect value for panning option argument specified!\n\n" ); return false; } } return false; #endif } static bool parseOrientationTracking( Loading Loading @@ -1708,12 +1666,8 @@ static CmdlnArgs defaultArgs( #else args.orientationTracking = IVAS_ORIENT_TRK_NONE; #endif #ifdef NON_DIEGETIC_PAN args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; #else args.noDiegeticPan = 0.0f; #endif args.delayCompensationEnabled = true; args.quietModeEnabled = false; Loading Loading @@ -1805,18 +1759,12 @@ static void parseOption( break; case CmdLnOptionId_nonDiegeticPan: assert( numOptionValues == 1 ); #ifdef NON_DIEGETIC_PAN if ( !parseDiegeticPan( optionValues[0], &args->nonDiegeticPanGain ) ) #else if ( !parseDiegeticPan( optionValues[0], &args->noDiegeticPan ) ) #endif { fprintf( stderr, "Unknown option for diegetic panning: %s\n", optionValues[0] ); exit( -1 ); } #ifdef NON_DIEGETIC_PAN args->nonDiegeticPan = 1; #endif break; case CmdLnOptionId_orientationTracking: assert( numOptionValues == 1 ); Loading Loading @@ -1931,9 +1879,7 @@ void getMetadataFromFileReader( objectMetadataBuffer->positions[objIdx].radius = ismMetadata.radius; objectMetadataBuffer->positions[objIdx].yaw = ismMetadata.yaw; objectMetadataBuffer->positions[objIdx].pitch = ismMetadata.pitch; #ifdef ISM_NON_DIEGETIC_PAN objectMetadataBuffer->positions[objIdx].non_diegetic_flag = ismMetadata.non_diegetic_flag; #endif return; } Loading Loading @@ -1991,9 +1937,7 @@ static void IsmPositionProvider_getNextFrame( objectMetadataBuffer->positions[objIdx].radius = 1.0f; objectMetadataBuffer->positions[objIdx].yaw = 0.0f; objectMetadataBuffer->positions[objIdx].pitch = 0.0f; #ifdef ISM_NON_DIEGETIC_PAN objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0; #endif } /* Wrap azimuth to lie within (-180, 180] range */ Loading Loading @@ -2255,22 +2199,14 @@ static void parseObjectPosition( { char *endptr; int16_t read_values; #ifdef ISM_NON_DIEGETIC_PAN float meta_prm[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f }; #else float meta_prm[7] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; #endif readNextMetadataChunk( line, "," ); *positionDuration = (uint16_t) strtol( line, &endptr, 10 ); readNextMetadataChunk( line, "\n" ); #ifdef ISM_NON_DIEGETIC_PAN read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6], &meta_prm[7] ); #else read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6] ); #endif if ( read_values < 2 ) { Loading @@ -2283,9 +2219,7 @@ static void parseObjectPosition( position->radius = meta_prm[2]; position->yaw = meta_prm[5]; position->pitch = meta_prm[6]; #ifdef ISM_NON_DIEGETIC_PAN position->non_diegetic_flag = (int16_t) meta_prm[7]; #endif return; } Loading
lib_com/common_api_types.h +0 −4 Original line number Diff line number Diff line Loading @@ -80,9 +80,7 @@ typedef struct _IVAS_ISM_METADATA float gainFactor; float yaw; float pitch; #ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag; #endif } IVAS_ISM_METADATA; typedef struct Loading Loading @@ -131,9 +129,7 @@ typedef struct float radius; float yaw; float pitch; #ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag; #endif } IVAS_REND_AudioObjectPosition; typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG Loading
lib_com/ivas_cnst.h +0 −16 Original line number Diff line number Diff line Loading @@ -156,12 +156,8 @@ typedef enum RENDERER_MCMASA_MONO_STEREO, RENDERER_PARAM_ISM, RENDERER_BINAURAL_MIXER_CONV, #if defined NON_DIEGETIC_PAN || defined ISM_NON_DIEGETIC_PAN RENDERER_BINAURAL_MIXER_CONV_ROOM, RENDERER_NON_DIEGETIC_DOWNMIX #else RENDERER_BINAURAL_MIXER_CONV_ROOM #endif } RENDERER_TYPE; Loading @@ -175,9 +171,7 @@ typedef enum #define HEAD_ROTATION_HOA_ORDER 3 /* HOA 3rd order */ #define MAX_CICP_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts)*/ #define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order) */ #ifdef NON_DIEGETIC_PAN #define MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN 2 /* Maximum number of output channels with non diegetic panning */ #endif #define BINAURAL_CHANNELS 2 /* number of channels for binaural output configuration */ #define CPE_CHANNELS 2 /* number of CPE (stereo) channels */ Loading Loading @@ -366,9 +360,7 @@ typedef enum #define ISM_RADIUS_MIN 0.0f #define ISM_RADIUS_DELTA 0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ #define ISM_EXTENDED_METADATA_BRATE IVAS_64k #ifdef ISM_NON_DIEGETIC_PAN #define ISM_METADATA_IS_NDP_BITS 1 #endif #define ISM_EXTENDED_METADATA_BITS 1 #define ISM_METADATA_RS_MAX_FRAMES 5 /* Number of frames with opposite extended metadata flags before switching */ Loading Loading @@ -410,9 +402,7 @@ enum { IND_ISM_NUM_OBJECTS, IND_ISM_EXTENDED_FLAG = IND_ISM_NUM_OBJECTS + MAX_NUM_OBJECTS, #ifdef ISM_NON_DIEGETIC_PAN IND_ISM_EXTENDED_NDP_FLAG, #endif IND_ISM_METADATA_FLAG, IND_ISM_VAD_FLAG = IND_ISM_METADATA_FLAG + MAX_NUM_OBJECTS, IND_ISM_NOISY_SPEECH_FLAG = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS, Loading @@ -421,9 +411,7 @@ enum /* ------------- loop for objects -------------- */ TAG_ISM_LOOP_START = IND_ISM_DTX_COH_SCA + MAX_NUM_OBJECTS, #ifdef ISM_NON_DIEGETIC_PAN IND_ISM_NDP_FLAG = TAG_ISM_LOOP_START, #endif IND_ISM_AZIMUTH_DIFF_FLAG = TAG_ISM_LOOP_START, IND_ISM_AZIMUTH = TAG_ISM_LOOP_START, IND_ISM_ELEVATION_DIFF_FLAG = TAG_ISM_LOOP_START, Loading Loading @@ -1621,12 +1609,8 @@ typedef enum typedef enum { TDREND_PLAYSTATUS_INITIAL, #ifdef ISM_NON_DIEGETIC_PAN TDREND_PLAYSTATUS_PLAYING, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC #else TDREND_PLAYSTATUS_PLAYING #endif } TDREND_PlayStatus_t; typedef enum Loading
lib_com/ivas_ism_com.c +0 −9 Original line number Diff line number Diff line Loading @@ -92,9 +92,7 @@ ivas_error ivas_ism_config( const int16_t nchan_transport, /* i : number of transport channels */ const int16_t nchan_ism, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ #ifdef ISM_NON_DIEGETIC_PAN const int16_t ism_extended_metadata_flag, /* i : extended metadata flag */ #endif const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD flag */ const int16_t ism_imp[], /* i : ISM importance flags */ int32_t element_brate[], /* o : element bitrate per object */ Loading Loading @@ -139,12 +137,10 @@ ivas_error ivas_ism_config( { nb_bits_metadata[0] += ISM_EXTENDED_METADATA_BITS; #ifdef ISM_NON_DIEGETIC_PAN if ( ism_extended_metadata_flag ) { nb_bits_metadata[0] += ISM_METADATA_IS_NDP_BITS; } #endif } nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism; Loading Loading @@ -347,10 +343,8 @@ void ivas_ism_reset_metadata( hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; #ifdef ISM_NON_DIEGETIC_PAN hIsmMeta->ism_metadata_flag = 0; hIsmMeta->non_diegetic_flag = 0; #endif return; } Loading @@ -366,9 +360,6 @@ void ivas_ism_reset_metadata_API( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { #ifndef ISM_NON_DIEGETIC_PAN hIsmMeta->ism_metadata_flag = 0; #endif ivas_ism_reset_metadata( hIsmMeta ); return; Loading