Loading lib_com/basop32.c +8 −0 Original line number Diff line number Diff line Loading @@ -3577,12 +3577,20 @@ Word16 div_l( Word32 L_num, Word16 den ) if ( den == (Word16) 0 ) { #ifdef IVAS_FLOAT_FIXED /* NOTE: This is just for temporary usage for identifying crashes */ assert( 0 ); #endif // IVAS_FLOAT_FIXED /* printf("Division by 0 in div_l, Fatal error in "); printStack(); */ exit( -1 ); } if ( ( L_num < (Word32) 0 ) || ( den < (Word16) 0 ) ) { #ifdef IVAS_FLOAT_FIXED /* NOTE: This is just for temporary usage for identifying crashes */ assert( 0 ); #endif // IVAS_FLOAT_FIXED /* printf("Division Error in div_l, Fatal error in "); printStack(); */ exit( -1 ); } Loading lib_com/common_api_types.h +1 −0 Original line number Diff line number Diff line Loading @@ -255,4 +255,5 @@ typedef struct _IVAS_RENDER_CONFIG #endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; #endif /* COMMON_API_TYPES_H */ lib_com/float_to_fix_ops.c +27 −19 Original line number Diff line number Diff line Loading @@ -371,8 +371,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed( st->hHQ_core->Q_old_out = Q_factor_arr( st->hHQ_core->old_out, L_FRAME48k ); st->hHQ_core->Q_old_outLB = Q_factor_arr( st->hHQ_core->old_outLB, L_FRAME32k ); st->hHQ_core->Q_fer_samples = 0; floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); //floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -461,8 +461,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed( IF( st->hHQ_core ) { fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_out, L_FRAME48k ); fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_out, L_FRAME48k ); //fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -591,8 +591,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( st->hHQ_core->Q_old_out = 0; st->hHQ_core->Q_old_outLB = 0; st->hHQ_core->Q_fer_samples = 0; floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); //floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -684,8 +684,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( IF( st->hHQ_core ) { fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_out, L_FRAME48k ); fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_wtda, L_FRAME48k ); //fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -763,7 +763,7 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( //hTcxDec->tcxltp_last_gain_unmodified = (Word16) floatToFixed( hTcxDec->tcxltp_last_gain_unmodified_float, Q15 ); } floatToFixed_arr( st->hHQ_core->old_out + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), st->hHQ_core->old_out_fx + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), 0, NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) ); //floatToFixed_arr( st->hHQ_core->old_out + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), st->hHQ_core->old_out_fx + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), 0, NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) ); //if ( !st->tcxonly ) //{ Loading Loading @@ -833,17 +833,17 @@ void fixed_to_float_stereo_tcx_core_dec( { if (st->hHQ_core->Q_old_wtda >= 0) { for ( int p = 0; p < st->L_frame; p++ ) for ( int p = 0; p < 960; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); //st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); //st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); } } else{ for ( int p = 0; p < st->L_frame; p++ ) for ( int p = 0; p < 960; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); //st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); //st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); } } } Loading Loading @@ -877,13 +877,21 @@ void fixed_to_float_stereo_tcx_core_dec( IF( EQ_16( st->core, TCX_20_CORE ) || EQ_16( st->core, TCX_10_CORE ) ) { FOR( Word16 ind = 0; ind < 640; ind++ ) //FOR( Word16 ind = 0; ind < 640; ind++ ) //{ // st->hHQ_core->old_outLB[ind] = (float) st->hHQ_core->old_out_LB_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //} //FOR( Word16 ind = 0; ind < 960; ind++ ) //{ // st->hHQ_core->old_out[ind] = (float) st->hHQ_core->old_out_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //} FOR( Word16 ind = 0; ind < L_FRAME32k / 2; ind++ ) { st->hHQ_core->old_outLB[ind] = (float) st->hHQ_core->old_out_LB_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //st->hTcxDec->syn_Overl_float[ind] = (float) st->hTcxDec->syn_Overl[ind] / ( (float) pow( 2, st->Q_syn + 1 ) ); } FOR( Word16 ind = 0; ind < 960; ind++ ) FOR( Word16 ind = 0; ind < L_FRAME_MAX / 2; ind++ ) { st->hHQ_core->old_out[ind] = (float) st->hHQ_core->old_out_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //st->hTcxDec->syn_OverlFB_float[ind] = (float) st->hTcxDec->syn_OverlFB[ind] / ( (float) pow( 2, st->Q_syn ) ); } } } Loading lib_com/ivas_prot.h +11 −0 Original line number Diff line number Diff line Loading @@ -4924,6 +4924,17 @@ Word16 computeMixingMatricesResidual_fx( ); #endif /*! r: error or success */ Word16 svd_fx( Word32 InputMatrix[][MAX_OUTPUT_CHANNELS], /* i : matrix to be decomposed (M) */ Word16 InputMatrix_e, float singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* o : left singular vectors (U) */ float singularValues[MAX_OUTPUT_CHANNELS], /* o : singular values vector (S) */ float singularVectors_Right[][MAX_OUTPUT_CHANNELS], /* o : right singular vectors (V) */ const Word16 nChannelsL, /* i : number of rows in the matrix to be decomposed */ const Word16 nChannelsC /* i : number of columns in the matrix to be decomposed */ ); /*! r: error or success */ int16_t svd( float InputMatrix[][MAX_OUTPUT_CHANNELS], /* i : matrix to be decomposed (M) */ Loading lib_com/ivas_sns_com_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ void sns_compute_scf_fx( FOR( i = 0; i < FDNS_NPTS; i++ ) { xs[i] = Mpy_32_16_1( xs[i], pow_tilt[i] ); xs[i] = L_shl( xs[i], Q6 ); // xs => Q10 xs[i] = L_shl( xs[i], Q4 ); // xs => Q8 } /* Noise floor at -40dB */ Loading Loading
lib_com/basop32.c +8 −0 Original line number Diff line number Diff line Loading @@ -3577,12 +3577,20 @@ Word16 div_l( Word32 L_num, Word16 den ) if ( den == (Word16) 0 ) { #ifdef IVAS_FLOAT_FIXED /* NOTE: This is just for temporary usage for identifying crashes */ assert( 0 ); #endif // IVAS_FLOAT_FIXED /* printf("Division by 0 in div_l, Fatal error in "); printStack(); */ exit( -1 ); } if ( ( L_num < (Word32) 0 ) || ( den < (Word16) 0 ) ) { #ifdef IVAS_FLOAT_FIXED /* NOTE: This is just for temporary usage for identifying crashes */ assert( 0 ); #endif // IVAS_FLOAT_FIXED /* printf("Division Error in div_l, Fatal error in "); printStack(); */ exit( -1 ); } Loading
lib_com/common_api_types.h +1 −0 Original line number Diff line number Diff line Loading @@ -255,4 +255,5 @@ typedef struct _IVAS_RENDER_CONFIG #endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; #endif /* COMMON_API_TYPES_H */
lib_com/float_to_fix_ops.c +27 −19 Original line number Diff line number Diff line Loading @@ -371,8 +371,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed( st->hHQ_core->Q_old_out = Q_factor_arr( st->hHQ_core->old_out, L_FRAME48k ); st->hHQ_core->Q_old_outLB = Q_factor_arr( st->hHQ_core->old_outLB, L_FRAME32k ); st->hHQ_core->Q_fer_samples = 0; floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); //floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -461,8 +461,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed( IF( st->hHQ_core ) { fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_out, L_FRAME48k ); fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_out, L_FRAME48k ); //fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -591,8 +591,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( st->hHQ_core->Q_old_out = 0; st->hHQ_core->Q_old_outLB = 0; st->hHQ_core->Q_fer_samples = 0; floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //floatToFixed_arr( st->hHQ_core->old_out, st->hHQ_core->old_out_fx, st->hHQ_core->Q_old_out, L_FRAME48k ); //floatToFixed_arr( st->hHQ_core->old_outLB, st->hHQ_core->old_out_LB_fx, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -684,8 +684,8 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( IF( st->hHQ_core ) { fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_out, L_FRAME48k ); fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); //fixedToFloat_arr( st->hHQ_core->old_out_fx, st->hHQ_core->old_out, st->hHQ_core->Q_old_wtda, L_FRAME48k ); //fixedToFloat_arr( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_outLB, st->hHQ_core->Q_old_outLB, L_FRAME32k ); } IF( st->cldfbAna ) { Loading Loading @@ -763,7 +763,7 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( //hTcxDec->tcxltp_last_gain_unmodified = (Word16) floatToFixed( hTcxDec->tcxltp_last_gain_unmodified_float, Q15 ); } floatToFixed_arr( st->hHQ_core->old_out + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), st->hHQ_core->old_out_fx + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), 0, NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) ); //floatToFixed_arr( st->hHQ_core->old_out + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), st->hHQ_core->old_out_fx + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), 0, NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) ); //if ( !st->tcxonly ) //{ Loading Loading @@ -833,17 +833,17 @@ void fixed_to_float_stereo_tcx_core_dec( { if (st->hHQ_core->Q_old_wtda >= 0) { for ( int p = 0; p < st->L_frame; p++ ) for ( int p = 0; p < 960; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); //st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); //st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); } } else{ for ( int p = 0; p < st->L_frame; p++ ) for ( int p = 0; p < 960; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); //st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); //st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); } } } Loading Loading @@ -877,13 +877,21 @@ void fixed_to_float_stereo_tcx_core_dec( IF( EQ_16( st->core, TCX_20_CORE ) || EQ_16( st->core, TCX_10_CORE ) ) { FOR( Word16 ind = 0; ind < 640; ind++ ) //FOR( Word16 ind = 0; ind < 640; ind++ ) //{ // st->hHQ_core->old_outLB[ind] = (float) st->hHQ_core->old_out_LB_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //} //FOR( Word16 ind = 0; ind < 960; ind++ ) //{ // st->hHQ_core->old_out[ind] = (float) st->hHQ_core->old_out_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //} FOR( Word16 ind = 0; ind < L_FRAME32k / 2; ind++ ) { st->hHQ_core->old_outLB[ind] = (float) st->hHQ_core->old_out_LB_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //st->hTcxDec->syn_Overl_float[ind] = (float) st->hTcxDec->syn_Overl[ind] / ( (float) pow( 2, st->Q_syn + 1 ) ); } FOR( Word16 ind = 0; ind < 960; ind++ ) FOR( Word16 ind = 0; ind < L_FRAME_MAX / 2; ind++ ) { st->hHQ_core->old_out[ind] = (float) st->hHQ_core->old_out_fx[ind] / ( (float) pow( 2, st->hHQ_core->Q_old_wtda ) ); //st->hTcxDec->syn_OverlFB_float[ind] = (float) st->hTcxDec->syn_OverlFB[ind] / ( (float) pow( 2, st->Q_syn ) ); } } } Loading
lib_com/ivas_prot.h +11 −0 Original line number Diff line number Diff line Loading @@ -4924,6 +4924,17 @@ Word16 computeMixingMatricesResidual_fx( ); #endif /*! r: error or success */ Word16 svd_fx( Word32 InputMatrix[][MAX_OUTPUT_CHANNELS], /* i : matrix to be decomposed (M) */ Word16 InputMatrix_e, float singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* o : left singular vectors (U) */ float singularValues[MAX_OUTPUT_CHANNELS], /* o : singular values vector (S) */ float singularVectors_Right[][MAX_OUTPUT_CHANNELS], /* o : right singular vectors (V) */ const Word16 nChannelsL, /* i : number of rows in the matrix to be decomposed */ const Word16 nChannelsC /* i : number of columns in the matrix to be decomposed */ ); /*! r: error or success */ int16_t svd( float InputMatrix[][MAX_OUTPUT_CHANNELS], /* i : matrix to be decomposed (M) */ Loading
lib_com/ivas_sns_com_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ void sns_compute_scf_fx( FOR( i = 0; i < FDNS_NPTS; i++ ) { xs[i] = Mpy_32_16_1( xs[i], pow_tilt[i] ); xs[i] = L_shl( xs[i], Q6 ); // xs => Q10 xs[i] = L_shl( xs[i], Q4 ); // xs => Q8 } /* Noise floor at -40dB */ Loading