Loading Workspace_msvc/lib_isar.vcxproj +0 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,6 @@ <ClCompile Include="..\lib_isar\isar_lc3plus_enc.c" /> <ClCompile Include="..\lib_isar\isar_lc3plus_payload.c" /> <ClCompile Include="..\lib_isar\isar_MSPred.c" /> <ClCompile Include="..\lib_isar\isar_NoiseGen.c" /> <ClCompile Include="..\lib_isar\isar_PerceptualModel.c" /> <ClCompile Include="..\lib_isar\isar_PredDecoder.c" /> <ClCompile Include="..\lib_isar\isar_PredEncoder.c" /> Loading apps/decoder.c +7 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,13 @@ int main( fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR if ( !arg.renderConfigEnabled && ( arg.renderFramesize != asked_frame_size ) ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } #endif } /*------------------------------------------------------------------------------------------* Loading lib_com/gs_gains_fx.c +26 −7 Original line number Diff line number Diff line Loading @@ -260,7 +260,8 @@ void Comp_and_apply_gain_ivas_fx( /* _ None */ /*========================================================================*/ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ /* o : Band gain Q12 */ static Word16 Comp_band_log_ener( const Word16 *pt_fx, /* i : Dct input Q_sc */ const Word16 Len, /* i : Lenght en energy accumulation */ const Word16 Q_sc, /* i : scaling of input */ Loading @@ -269,12 +270,14 @@ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ { Word32 L_tmp; Word16 e_tmp, f_tmp, tmp16, ener_exp; L_tmp = Calc_Energy_Autoscaled( pt_fx, Q_sc, Len, &ener_exp ); e_tmp = norm_l( L_tmp ); f_tmp = Log2_norm_lc( L_shl( L_tmp, e_tmp ) ); e_tmp = sub( sub( add( 30, E_sc ), e_tmp ), ener_exp ); L_tmp = Mpy_32_16( e_tmp, f_tmp, 19728 ); /* Q16 */ /*log10(2) in Q17 */ tmp16 = round_fx( L_shl( L_tmp, 12 - 2 ) ); /* Q12 -1 is to compensate Q17 */ return tmp16; } Loading @@ -283,7 +286,12 @@ void Ener_per_band_comp_fx( Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ const Word16 Q_exc, /* i : frame length */ const Word16 Mband, /* i : Max band */ #ifdef FIX_1904_HARM_GSC_ENC const Word16 Eflag, /* i : flag of highest band */ const Word16 L_frame /* i : frame length */ #else const Word16 Eflag /* i : flag of highest band */ #endif ) { const Word16 *pt_fx; Loading Loading @@ -311,9 +319,19 @@ void Ener_per_band_comp_fx( pt_fx += 32; } return; #ifdef FIX_1904_HARM_GSC_ENC IF( EQ_16( L_frame, L_FRAME16k ) ) { y_gain4_fx[j + 2] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/ move16(); y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 64, Q_exc, -1 ); /*Q12*/ move16(); } #endif return; } #ifndef FIX_1904_HARM_GSC_ENC void Ener_per_band_comp_ivas_fx( const Word16 exc_diff_fx[], /* i : target signal Q_exc_diff */ Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ Loading Loading @@ -359,6 +377,7 @@ void Ener_per_band_comp_ivas_fx( return; } #endif /*-------------------------------------------------------------------* Loading lib_com/gs_inact_switching_fx.c +13 −0 Original line number Diff line number Diff line Loading @@ -77,7 +77,11 @@ void Inac_switch_ematch_fx( test(); IF( ( EQ_16( coder_type, AUDIO ) || ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) ) ) && bfi == 0 ) { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) Loading @@ -91,7 +95,11 @@ void Inac_switch_ematch_fx( /* Find spectrum and energy per band for GC and VC frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) Loading @@ -104,7 +112,12 @@ void Inac_switch_ematch_fx( { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* More agressive smoothing in the first 50 frames */ pt_exc = dct_exc_tmp; Loading lib_com/gs_noisefill_fx.c +27 −2 Original line number Diff line number Diff line Loading @@ -636,7 +636,7 @@ static void envelop_modify_fx( return; } #ifndef FIX_1904_HARM_GSC_ENC void highband_exc_dct_in_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Loading Loading @@ -801,12 +801,19 @@ void highband_exc_dct_in_fx( test(); IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) ) { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame ); #else Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0 ); #endif } ELSE { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1 ); #endif IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) ) { FOR( i = L_FRAME - 16; i < L_FRAME; i++ ) Loading Loading @@ -1010,8 +1017,14 @@ void highband_exc_dct_in_fx( return; } #endif #ifdef FIX_1904_HARM_GSC_ENC void highband_exc_dct_in_fx( #else void highband_exc_dct_in_ivas_fx( #endif const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Word16 last_bin, /* i : last bin of bit allocation */ Loading Loading @@ -1168,19 +1181,29 @@ void highband_exc_dct_in_ivas_fx( { Apply_NoiseFill_fx( exc_diffQ, seed_tcx, noisepb, Diff_len, last_bin, coder_type, mfreq_bindiv, Qexc_diffQ ); } /*--------------------------------------------------------------------------------------* * Quantize average gain * Subtract Q averaged gain * VQ of remaining gain per band *--------------------------------------------------------------------------------------*/ test(); IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) ) { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame ); #else Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame ); #endif } ELSE { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #endif test(); IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) ) Loading @@ -1195,9 +1218,11 @@ void highband_exc_dct_in_ivas_fx( } } } /*--------------------------------------------------------------------------------------* * Check potential energy excitation overshoot *--------------------------------------------------------------------------------------*/ IF( bfi ) { test(); Loading Loading
Workspace_msvc/lib_isar.vcxproj +0 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,6 @@ <ClCompile Include="..\lib_isar\isar_lc3plus_enc.c" /> <ClCompile Include="..\lib_isar\isar_lc3plus_payload.c" /> <ClCompile Include="..\lib_isar\isar_MSPred.c" /> <ClCompile Include="..\lib_isar\isar_NoiseGen.c" /> <ClCompile Include="..\lib_isar\isar_PerceptualModel.c" /> <ClCompile Include="..\lib_isar\isar_PredDecoder.c" /> <ClCompile Include="..\lib_isar\isar_PredEncoder.c" /> Loading
apps/decoder.c +7 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,13 @@ int main( fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR if ( !arg.renderConfigEnabled && ( arg.renderFramesize != asked_frame_size ) ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } #endif } /*------------------------------------------------------------------------------------------* Loading
lib_com/gs_gains_fx.c +26 −7 Original line number Diff line number Diff line Loading @@ -260,7 +260,8 @@ void Comp_and_apply_gain_ivas_fx( /* _ None */ /*========================================================================*/ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ /* o : Band gain Q12 */ static Word16 Comp_band_log_ener( const Word16 *pt_fx, /* i : Dct input Q_sc */ const Word16 Len, /* i : Lenght en energy accumulation */ const Word16 Q_sc, /* i : scaling of input */ Loading @@ -269,12 +270,14 @@ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ { Word32 L_tmp; Word16 e_tmp, f_tmp, tmp16, ener_exp; L_tmp = Calc_Energy_Autoscaled( pt_fx, Q_sc, Len, &ener_exp ); e_tmp = norm_l( L_tmp ); f_tmp = Log2_norm_lc( L_shl( L_tmp, e_tmp ) ); e_tmp = sub( sub( add( 30, E_sc ), e_tmp ), ener_exp ); L_tmp = Mpy_32_16( e_tmp, f_tmp, 19728 ); /* Q16 */ /*log10(2) in Q17 */ tmp16 = round_fx( L_shl( L_tmp, 12 - 2 ) ); /* Q12 -1 is to compensate Q17 */ return tmp16; } Loading @@ -283,7 +286,12 @@ void Ener_per_band_comp_fx( Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ const Word16 Q_exc, /* i : frame length */ const Word16 Mband, /* i : Max band */ #ifdef FIX_1904_HARM_GSC_ENC const Word16 Eflag, /* i : flag of highest band */ const Word16 L_frame /* i : frame length */ #else const Word16 Eflag /* i : flag of highest band */ #endif ) { const Word16 *pt_fx; Loading Loading @@ -311,9 +319,19 @@ void Ener_per_band_comp_fx( pt_fx += 32; } return; #ifdef FIX_1904_HARM_GSC_ENC IF( EQ_16( L_frame, L_FRAME16k ) ) { y_gain4_fx[j + 2] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/ move16(); y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 64, Q_exc, -1 ); /*Q12*/ move16(); } #endif return; } #ifndef FIX_1904_HARM_GSC_ENC void Ener_per_band_comp_ivas_fx( const Word16 exc_diff_fx[], /* i : target signal Q_exc_diff */ Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ Loading Loading @@ -359,6 +377,7 @@ void Ener_per_band_comp_ivas_fx( return; } #endif /*-------------------------------------------------------------------* Loading
lib_com/gs_inact_switching_fx.c +13 −0 Original line number Diff line number Diff line Loading @@ -77,7 +77,11 @@ void Inac_switch_ematch_fx( test(); IF( ( EQ_16( coder_type, AUDIO ) || ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) ) ) && bfi == 0 ) { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) Loading @@ -91,7 +95,11 @@ void Inac_switch_ematch_fx( /* Find spectrum and energy per band for GC and VC frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) Loading @@ -104,7 +112,12 @@ void Inac_switch_ematch_fx( { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* More agressive smoothing in the first 50 frames */ pt_exc = dct_exc_tmp; Loading
lib_com/gs_noisefill_fx.c +27 −2 Original line number Diff line number Diff line Loading @@ -636,7 +636,7 @@ static void envelop_modify_fx( return; } #ifndef FIX_1904_HARM_GSC_ENC void highband_exc_dct_in_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Loading Loading @@ -801,12 +801,19 @@ void highband_exc_dct_in_fx( test(); IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) ) { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame ); #else Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0 ); #endif } ELSE { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1 ); #endif IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) ) { FOR( i = L_FRAME - 16; i < L_FRAME; i++ ) Loading Loading @@ -1010,8 +1017,14 @@ void highband_exc_dct_in_fx( return; } #endif #ifdef FIX_1904_HARM_GSC_ENC void highband_exc_dct_in_fx( #else void highband_exc_dct_in_ivas_fx( #endif const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Word16 last_bin, /* i : last bin of bit allocation */ Loading Loading @@ -1168,19 +1181,29 @@ void highband_exc_dct_in_ivas_fx( { Apply_NoiseFill_fx( exc_diffQ, seed_tcx, noisepb, Diff_len, last_bin, coder_type, mfreq_bindiv, Qexc_diffQ ); } /*--------------------------------------------------------------------------------------* * Quantize average gain * Subtract Q averaged gain * VQ of remaining gain per band *--------------------------------------------------------------------------------------*/ test(); IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) ) { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame ); #else Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame ); #endif } ELSE { #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #endif test(); IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) ) Loading @@ -1195,9 +1218,11 @@ void highband_exc_dct_in_ivas_fx( } } } /*--------------------------------------------------------------------------------------* * Check potential energy excitation overshoot *--------------------------------------------------------------------------------------*/ IF( bfi ) { test(); Loading