Loading lib_com/ivas_prot_fx.h +1 −7 Original line number Diff line number Diff line Loading @@ -698,17 +698,11 @@ Word16 read_flag_EC_DFT( Word16 *flag /* o : flag value */ ); void ivas_init_dec_get_num_cldfb_instances( void ivas_init_dec_get_num_cldfb_instances_fx( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ Word16 *numCldfbAnalyses, /* o : number of CLDFB analysis instances */ Word16 *numCldfbSyntheses /* o : number of CLDFB synthesis instances */ ); /*file:ivas_init_dec_fx.c*/ void ivas_init_dec_get_num_cldfb_instances_ivas_fx( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ Word16 *numCldfbAnalyses, /* o : number of needed CLDFB analysis instances */ Word16 *numCldfbSyntheses /* o : number of needed CLDFB synthesis instances */ ); Word16 masa_sq_fx( const Word32 in, /* i : input value */ Loading lib_com/options.h +5 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,8 @@ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ #define FIX_1762_COMPILER_ISSUE_NEW /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */ #define ISSUE_1796_replace_shl_o /* FhG: replace shl_ro by overflow-free alternatives - BE*/ #define ISSUE_1799_replace_L_shr_o /* FhG: replace by non-overflow-alternative - BE */ #define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */ Loading Loading @@ -187,8 +189,10 @@ #endif #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ /*#define NONBE_FIX_MC_LFE_LPF */ /* Dlb: Adding the LFE LPF filter back for MC content. */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ /* #################### End BASOP porting switches ############################ */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ #endif lib_dec/FEC_HQ_core_fx.c +30 −4 Original line number Diff line number Diff line Loading @@ -43,9 +43,11 @@ static void Regression_Anal_fx( Word32 L_tmp1, L_tmp2; Word16 aindex_fx[MAX_PGF + 1]; // Q0 Word32 b_p_fx[MAX_PGF + 1]; // Q10 #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /* Initialize */ Loading Loading @@ -78,7 +80,11 @@ static void Regression_Anal_fx( { b_p_fx[0] = L_add( b_p_fx[0], L_shr( values_fx[i], 2 ) ); /*10 */ move32(); #ifdef ISSUE_1796_replace_shl_o b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */ #else b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_o( sub( num_pgf, i ), 13, &Overflow ) ) ); /*10 */ #endif move32(); } Loading Loading @@ -162,9 +168,11 @@ void HQ_FEC_processing_fx( Word16 energy_diff_fx; // Q10 HQ_NBFEC_HANDLE hHQ_nbfec; HQ_DEC_HANDLE hHQ_core; #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; Loading Loading @@ -382,7 +390,11 @@ void HQ_FEC_processing_fx( FOR( j = 0; j < Num_bands_p[i]; j++ ) { #ifdef ISSUE_1796_replace_shl_o hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 ); #else hHQ_nbfec->Norm_gain_fx[k] = shl_o( tmp_fx, 1, &Overflow ); #endif move16(); k = add( k, 1 ); } Loading Loading @@ -518,7 +530,11 @@ void ivas_HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ Loading Loading @@ -803,7 +819,11 @@ void HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ Loading Loading @@ -995,9 +1015,11 @@ static Word16 find_best_delay_fx( Word32 min_sq_cross_fx, min_corr_fx; Word32 accA_fx, accB_fx; Word32 Rxy_fx[MAXDELAY_FEC], Ryy_fx[MAXDELAY_FEC]; #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif move16(); // d1m Loading Loading @@ -1064,7 +1086,11 @@ static Word16 find_best_delay_fx( L_tmp1 = L_shl( min_sq_cross_fx, exp1 ); L_tmp2 = L_shl( min_corr_fx, exp2 ); tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ #ifdef ISSUE_1796_replace_shl_o tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ #else tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow ); /*14 */ #endif } *false_flag = 0; Loading lib_dec/LD_music_post_filter_fx.c +12 −2 Original line number Diff line number Diff line Loading @@ -599,7 +599,11 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult( tmpN, m_binE ); /*2*Qdct+e_binE+9*/ e_binE = sub( add( e_tmp, e_binE ), 15 ); #ifdef ISSUE_1799_replace_L_shr_o Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/ #else Ltmp = L_shr_o( Ltmp, e_binE, &Overflow ); /*2*Qdct+9*/ #endif Lgain = L_add_o( Ltmp, Lshift, &Overflow ); /*Saturation can occure here result in Q30*/ } Loading Loading @@ -901,8 +905,10 @@ static Word16 norm_lfe( { Word32 Ltmp; Word16 exp2, tmp16, exp3; #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move32(); Loading @@ -923,7 +929,11 @@ static Word16 norm_lfe( exp3 = sub( exp2, 12 + 16 - 3 ); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } #ifdef ISSUE_1796_replace_shl_o tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */ #else tmp16 = shl_o( tmp16, exp3, &Overflow ); /* Result in Q12 */ #endif return tmp16; } Loading lib_dec/ivas_corecoder_dec_reconfig_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -577,7 +577,7 @@ ivas_error ivas_cldfb_dec_reconfig_fx( hDecoderConfig = st_ivas->hDecoderConfig; ivas_init_dec_get_num_cldfb_instances_ivas_fx( st_ivas, &numCldfbAnalyses, &numCldfbSyntheses ); ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses, &numCldfbSyntheses ); /* special case, if there was one transport channel in the previous frame and more than one in the current frame, remove the second CLDFB here, it was for CNA/CNG */ Loading Loading
lib_com/ivas_prot_fx.h +1 −7 Original line number Diff line number Diff line Loading @@ -698,17 +698,11 @@ Word16 read_flag_EC_DFT( Word16 *flag /* o : flag value */ ); void ivas_init_dec_get_num_cldfb_instances( void ivas_init_dec_get_num_cldfb_instances_fx( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ Word16 *numCldfbAnalyses, /* o : number of CLDFB analysis instances */ Word16 *numCldfbSyntheses /* o : number of CLDFB synthesis instances */ ); /*file:ivas_init_dec_fx.c*/ void ivas_init_dec_get_num_cldfb_instances_ivas_fx( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ Word16 *numCldfbAnalyses, /* o : number of needed CLDFB analysis instances */ Word16 *numCldfbSyntheses /* o : number of needed CLDFB synthesis instances */ ); Word16 masa_sq_fx( const Word32 in, /* i : input value */ Loading
lib_com/options.h +5 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,8 @@ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ #define FIX_1762_COMPILER_ISSUE_NEW /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */ #define ISSUE_1796_replace_shl_o /* FhG: replace shl_ro by overflow-free alternatives - BE*/ #define ISSUE_1799_replace_L_shr_o /* FhG: replace by non-overflow-alternative - BE */ #define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */ Loading Loading @@ -187,8 +189,10 @@ #endif #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ /*#define NONBE_FIX_MC_LFE_LPF */ /* Dlb: Adding the LFE LPF filter back for MC content. */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ /* #################### End BASOP porting switches ############################ */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ #endif
lib_dec/FEC_HQ_core_fx.c +30 −4 Original line number Diff line number Diff line Loading @@ -43,9 +43,11 @@ static void Regression_Anal_fx( Word32 L_tmp1, L_tmp2; Word16 aindex_fx[MAX_PGF + 1]; // Q0 Word32 b_p_fx[MAX_PGF + 1]; // Q10 #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /* Initialize */ Loading Loading @@ -78,7 +80,11 @@ static void Regression_Anal_fx( { b_p_fx[0] = L_add( b_p_fx[0], L_shr( values_fx[i], 2 ) ); /*10 */ move32(); #ifdef ISSUE_1796_replace_shl_o b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */ #else b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_o( sub( num_pgf, i ), 13, &Overflow ) ) ); /*10 */ #endif move32(); } Loading Loading @@ -162,9 +168,11 @@ void HQ_FEC_processing_fx( Word16 energy_diff_fx; // Q10 HQ_NBFEC_HANDLE hHQ_nbfec; HQ_DEC_HANDLE hHQ_core; #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; Loading Loading @@ -382,7 +390,11 @@ void HQ_FEC_processing_fx( FOR( j = 0; j < Num_bands_p[i]; j++ ) { #ifdef ISSUE_1796_replace_shl_o hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 ); #else hHQ_nbfec->Norm_gain_fx[k] = shl_o( tmp_fx, 1, &Overflow ); #endif move16(); k = add( k, 1 ); } Loading Loading @@ -518,7 +530,11 @@ void ivas_HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ Loading Loading @@ -803,7 +819,11 @@ void HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ Loading Loading @@ -995,9 +1015,11 @@ static Word16 find_best_delay_fx( Word32 min_sq_cross_fx, min_corr_fx; Word32 accA_fx, accB_fx; Word32 Rxy_fx[MAXDELAY_FEC], Ryy_fx[MAXDELAY_FEC]; #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif move16(); // d1m Loading Loading @@ -1064,7 +1086,11 @@ static Word16 find_best_delay_fx( L_tmp1 = L_shl( min_sq_cross_fx, exp1 ); L_tmp2 = L_shl( min_corr_fx, exp2 ); tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ #ifdef ISSUE_1796_replace_shl_o tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ #else tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow ); /*14 */ #endif } *false_flag = 0; Loading
lib_dec/LD_music_post_filter_fx.c +12 −2 Original line number Diff line number Diff line Loading @@ -599,7 +599,11 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult( tmpN, m_binE ); /*2*Qdct+e_binE+9*/ e_binE = sub( add( e_tmp, e_binE ), 15 ); #ifdef ISSUE_1799_replace_L_shr_o Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/ #else Ltmp = L_shr_o( Ltmp, e_binE, &Overflow ); /*2*Qdct+9*/ #endif Lgain = L_add_o( Ltmp, Lshift, &Overflow ); /*Saturation can occure here result in Q30*/ } Loading Loading @@ -901,8 +905,10 @@ static Word16 norm_lfe( { Word32 Ltmp; Word16 exp2, tmp16, exp3; #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move32(); Loading @@ -923,7 +929,11 @@ static Word16 norm_lfe( exp3 = sub( exp2, 12 + 16 - 3 ); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } #ifdef ISSUE_1796_replace_shl_o tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */ #else tmp16 = shl_o( tmp16, exp3, &Overflow ); /* Result in Q12 */ #endif return tmp16; } Loading
lib_dec/ivas_corecoder_dec_reconfig_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -577,7 +577,7 @@ ivas_error ivas_cldfb_dec_reconfig_fx( hDecoderConfig = st_ivas->hDecoderConfig; ivas_init_dec_get_num_cldfb_instances_ivas_fx( st_ivas, &numCldfbAnalyses, &numCldfbSyntheses ); ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses, &numCldfbSyntheses ); /* special case, if there was one transport channel in the previous frame and more than one in the current frame, remove the second CLDFB here, it was for CNA/CNG */ Loading