Commit c2428c99 authored by Arash Azizi's avatar Arash Azizi
Browse files

issue: 2479 Harmonizing function tcx_ltp_find_gain_fx(), removing one...

issue: 2479 Harmonizing function tcx_ltp_find_gain_fx(), removing one definition. Changing instances accordingly
parent c56d2eba
Loading
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -553,7 +553,7 @@ static void tcx_ltp_pitch_search_fx(
    }
}


#ifndef FIX_2479_HARM_PITCH_GAIN
static void tcx_ltp_find_gain( Word16 *speech, Word16 *pred_speech, Word16 L_frame, Word16 *gain, Word16 *gain_index )
{
    Word32 corr, ener;
@@ -600,8 +600,12 @@ static void tcx_ltp_find_gain( Word16 *speech, Word16 *pred_speech, Word16 L_fra
    *gain = imult1616( add( g, 1 ), 0x1400 );
    move16();
}

#endif // !FIX_2479_HARM_PITCH_GAIN
#ifndef FIX_2479_HARM_PITCH_GAIN
static void tcx_ltp_find_gain_ivas_fx(Word16* speech /*Qx*/, Word16* pred_speech /*Qx*/, Word16 L_frame, Word16* gain, Word16* gain_index)
#else
static void tcx_ltp_find_gain_fx(Word16* speech /*Qx*/, Word16* pred_speech /*Qx*/, Word16 L_frame, Word16* gain, Word16* gain_index)
#endif // !FIX_2479_HARM_PITCH_GAIN
{
    Word32 corr, ener;
    Word16 i, g, s1, s2, tmp;
@@ -789,8 +793,11 @@ void tcx_ltp_encode_fx(
        predict_signal( speech, pred_speech, *pitch_int, *pitch_fr, pitres, L_frame );

        /* Find gain */
#ifndef FIX_2479_HARM_PITCH_GAIN
        tcx_ltp_find_gain(speech, pred_speech, L_frame, gain, &ltp_param[2]);

#else
        tcx_ltp_find_gain_fx(speech, pred_speech, L_frame, gain, &ltp_param[2]);
#endif // !FIX_2479_HARM_PITCH_GAIN
        /* Total number of bits for LTP */
        IF( NE_16( ltp_param[2], -1 ) ) /* gain > 0 */
        {
@@ -1207,8 +1214,11 @@ void tcx_ltp_encode_ivas_fx(
    predict_signal( speech_fx, pred_speech_fx, hTcxEnc->tcxltp_pitch_int, hTcxEnc->tcxltp_pitch_fr, st->pit_res_max, L_frame );

    /* Find gain */
#ifndef FIX_2479_HARM_PITCH_GAIN
    tcx_ltp_find_gain_ivas_fx(speech_fx, pred_speech_fx, L_frame, &hTcxEnc->tcxltp_gain, &ltp_param[2]);

#else
    tcx_ltp_find_gain_fx(speech_fx, pred_speech_fx, L_frame, &hTcxEnc->tcxltp_gain, &ltp_param[2]);
#endif // !FIX_2479_HARM_PITCH_GAIN
    IF( ltp_param[0] )
    {
        /* Total number of bits for LTP */