Loading apps/renderer.c +28 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,10 @@ typedef struct char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientation_tracking; #ifdef FIX_1135_EXT_RENDERER_HANDLES int16_t Opt_Headrotation; int16_t Opt_ExternalOrientation; #endif int16_t nonDiegeticPan; float nonDiegeticPanGain; IVAS_REND_COMPLEXITY_LEVEL complexityLevel; Loading Loading @@ -979,7 +983,12 @@ int main( Word32 nonDiegeticPanGain_fx = ( args.nonDiegeticPanGain == 1.0f ) ? ONE_IN_Q31 : ( args.nonDiegeticPanGain == -1.0f ) ? L_negate( ONE_IN_Q31 ) : (Word32) ( args.nonDiegeticPanGain * ( 1LL << Q31 ) ); #ifdef FIX_1135_EXT_RENDERER_HANDLES IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) #else IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) ); goto cleanup; Loading Loading @@ -2757,7 +2766,13 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); #ifdef FIX_1135_EXT_RENDERER_HANDLES args.Opt_Headrotation = 0; args.Opt_ExternalOrientation = 0; #endif args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; Loading Loading @@ -2849,6 +2864,9 @@ static void parseOption( break; case CmdLnOptionId_trajFile: assert( numOptionValues == 1 ); #ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_Headrotation = 1; #endif strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_outputMetadata: Loading @@ -2869,6 +2887,9 @@ static void parseOption( break; case CmdLnOptionId_exteriorOrientationFile: assert( numOptionValues == 1 ); #ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_ExternalOrientation = 1; #endif strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_customHrtfFile: Loading Loading @@ -3002,6 +3023,13 @@ static CmdlnArgs parseCmdlnArgs( exit( -1 ); /* Error printout handled by failing function */ } #ifdef FIX_1135_EXT_RENDERER_HANDLES if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { args.Opt_Headrotation = 1; } #endif return args; } Loading lib_com/bitstream_fx.c +0 −2 Original line number Diff line number Diff line Loading @@ -4461,8 +4461,6 @@ ivas_error read_indices_fx( st_ivas->BER_detect = 0; move16(); st_ivas->num_bits = num_bits; move16(); sts = reset_elements( st_ivas ); #ifdef DEBUGGING Loading lib_com/ivas_prot_fx.h +12 −8 Original line number Diff line number Diff line Loading @@ -4017,12 +4017,14 @@ void sns_avq_dec_stereo_fx( Word32 *SNS_Ql, /* o : Quantized SNS vectors (left channel) */ Word16 *q_l, Word32 *SNS_Qr, /* o : Quantized SNS vectors (right channe) */ Word16 *q_r ); Word16 *q_r ); void dequantize_sns_fx( Word16 indices[CPE_CHANNELS][NPRM_LPC_NEW], Word32 snsQ_out[CPE_CHANNELS][NB_DIV][M], Decoder_State **sts ); Decoder_State **sts ); void inverseMS_fx( const Word16 L_frame, /* i : frame length Q0*/ Loading @@ -4038,7 +4040,6 @@ void ivas_syn_output_f_fx( Word32 *synth_out /* o : integer 16 bits synthesis signal */ ); ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); Loading Loading @@ -4134,7 +4135,8 @@ Word16 ivas_smc_gmm_fx( const Word16 flag_spitch, /* i : flag to indicate very short stable pitch */ Word16 Qfact_PS, Word16 Q_esp, Word16 Qfact_PS_past ); Word16 Qfact_PS_past ); void ivas_signaling_enc_fx( Encoder_State *st, /* i/o: encoder state structure */ Loading Loading @@ -4180,12 +4182,13 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx( const Word16 subframe_idx, const Word16 core, const Word16 crossfade_gain, const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode ); const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode ); Word16 rand_triangular_signed_fx( Word16 *seed, Word16 *exp_fac ); Word16 *exp_fac ); Word64 var_32_fx( const Word32 *x, /* i : input vector */ Loading @@ -4195,7 +4198,8 @@ Word64 var_32_fx( ivas_error ivas_jbm_dec_tc_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *data_fx ); Word32 *data_fx ); ivas_error ivas_jbm_dec_flush_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ /* #################### End BASOP porting switches ############################ */ Loading lib_dec/ivas_init_dec_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -2732,8 +2732,7 @@ ivas_error ivas_init_decoder_fx( /*-----------------------------------------------------------------* * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ st_ivas->p_out_len = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { /* note: these are intra-frame heap memories */ Loading @@ -2743,14 +2742,15 @@ ivas_error ivas_init_decoder_fx( } set32_fx( st_ivas->p_output_fx[n], 0, 48000 / FRAMES_PER_SEC ); } FOR( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { st_ivas->p_output_fx[n] = NULL; } return error; } /*------------------------------------------------------------------------- * destroy_core_dec() * Loading Loading
apps/renderer.c +28 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,10 @@ typedef struct char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientation_tracking; #ifdef FIX_1135_EXT_RENDERER_HANDLES int16_t Opt_Headrotation; int16_t Opt_ExternalOrientation; #endif int16_t nonDiegeticPan; float nonDiegeticPanGain; IVAS_REND_COMPLEXITY_LEVEL complexityLevel; Loading Loading @@ -979,7 +983,12 @@ int main( Word32 nonDiegeticPanGain_fx = ( args.nonDiegeticPanGain == 1.0f ) ? ONE_IN_Q31 : ( args.nonDiegeticPanGain == -1.0f ) ? L_negate( ONE_IN_Q31 ) : (Word32) ( args.nonDiegeticPanGain * ( 1LL << Q31 ) ); #ifdef FIX_1135_EXT_RENDERER_HANDLES IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) #else IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) ); goto cleanup; Loading Loading @@ -2757,7 +2766,13 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); #ifdef FIX_1135_EXT_RENDERER_HANDLES args.Opt_Headrotation = 0; args.Opt_ExternalOrientation = 0; #endif args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; Loading Loading @@ -2849,6 +2864,9 @@ static void parseOption( break; case CmdLnOptionId_trajFile: assert( numOptionValues == 1 ); #ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_Headrotation = 1; #endif strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_outputMetadata: Loading @@ -2869,6 +2887,9 @@ static void parseOption( break; case CmdLnOptionId_exteriorOrientationFile: assert( numOptionValues == 1 ); #ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_ExternalOrientation = 1; #endif strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_customHrtfFile: Loading Loading @@ -3002,6 +3023,13 @@ static CmdlnArgs parseCmdlnArgs( exit( -1 ); /* Error printout handled by failing function */ } #ifdef FIX_1135_EXT_RENDERER_HANDLES if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { args.Opt_Headrotation = 1; } #endif return args; } Loading
lib_com/bitstream_fx.c +0 −2 Original line number Diff line number Diff line Loading @@ -4461,8 +4461,6 @@ ivas_error read_indices_fx( st_ivas->BER_detect = 0; move16(); st_ivas->num_bits = num_bits; move16(); sts = reset_elements( st_ivas ); #ifdef DEBUGGING Loading
lib_com/ivas_prot_fx.h +12 −8 Original line number Diff line number Diff line Loading @@ -4017,12 +4017,14 @@ void sns_avq_dec_stereo_fx( Word32 *SNS_Ql, /* o : Quantized SNS vectors (left channel) */ Word16 *q_l, Word32 *SNS_Qr, /* o : Quantized SNS vectors (right channe) */ Word16 *q_r ); Word16 *q_r ); void dequantize_sns_fx( Word16 indices[CPE_CHANNELS][NPRM_LPC_NEW], Word32 snsQ_out[CPE_CHANNELS][NB_DIV][M], Decoder_State **sts ); Decoder_State **sts ); void inverseMS_fx( const Word16 L_frame, /* i : frame length Q0*/ Loading @@ -4038,7 +4040,6 @@ void ivas_syn_output_f_fx( Word32 *synth_out /* o : integer 16 bits synthesis signal */ ); ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); Loading Loading @@ -4134,7 +4135,8 @@ Word16 ivas_smc_gmm_fx( const Word16 flag_spitch, /* i : flag to indicate very short stable pitch */ Word16 Qfact_PS, Word16 Q_esp, Word16 Qfact_PS_past ); Word16 Qfact_PS_past ); void ivas_signaling_enc_fx( Encoder_State *st, /* i/o: encoder state structure */ Loading Loading @@ -4180,12 +4182,13 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx( const Word16 subframe_idx, const Word16 core, const Word16 crossfade_gain, const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode ); const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode ); Word16 rand_triangular_signed_fx( Word16 *seed, Word16 *exp_fac ); Word16 *exp_fac ); Word64 var_32_fx( const Word32 *x, /* i : input vector */ Loading @@ -4195,7 +4198,8 @@ Word64 var_32_fx( ivas_error ivas_jbm_dec_tc_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *data_fx ); Word32 *data_fx ); ivas_error ivas_jbm_dec_flush_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ /* #################### End BASOP porting switches ############################ */ Loading
lib_dec/ivas_init_dec_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -2732,8 +2732,7 @@ ivas_error ivas_init_decoder_fx( /*-----------------------------------------------------------------* * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ st_ivas->p_out_len = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { /* note: these are intra-frame heap memories */ Loading @@ -2743,14 +2742,15 @@ ivas_error ivas_init_decoder_fx( } set32_fx( st_ivas->p_output_fx[n], 0, 48000 / FRAMES_PER_SEC ); } FOR( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { st_ivas->p_output_fx[n] = NULL; } return error; } /*------------------------------------------------------------------------- * destroy_core_dec() * Loading