Commit 912e08b9 authored by Nishant S Kulgod's avatar Nishant S Kulgod
Browse files

commit 1

parent d4fc334d
Loading
Loading
Loading
Loading
Loading
+21 −19
Original line number Diff line number Diff line
@@ -1950,7 +1950,9 @@ void analysisCldfbEncoder_ivas(

void analysisCldfbEncoder_ivas_fx(
    Encoder_State *st,    /* i/o: encoder state structure   */
    const Word16 *timeIn,
    const Word32 *timeIn, /*q11*/
    Word16 timeInq,
    Word16 samplesToProcess,
    Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    Word16 realBuffer16[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
@@ -1965,7 +1967,6 @@ void analysisCldfbEncoder_ivas_fx(
    Word32 *ppBuf_Imag[CLDFB_NO_COL_MAX];
    Word16 *ppBuf_Real16[CLDFB_NO_COL_MAX];
    Word16 *ppBuf_Imag16[CLDFB_NO_COL_MAX];
    Word32 workBuffer[256];

    FOR( i = 0; i < CLDFB_NO_COL_MAX; i++ )
    {
@@ -1974,13 +1975,14 @@ void analysisCldfbEncoder_ivas_fx(
        ppBuf_Real16[i] = &realBuffer16[i][0];
        ppBuf_Imag16[i] = &imagBuffer16[i][0];
    }
    cldfbAnalysis_ivas_fx( timeIn, ppBuf_Real, ppBuf_Imag, samplesToProcess, st->cldfbAnaEnc );

    cldfbAnalysisFiltering( st->cldfbAnaEnc, ppBuf_Real, ppBuf_Imag, scale, timeIn, 0, CLDFB_NO_COL_MAX, workBuffer );

    scale->lb_scale = sub( 16 + 5, timeInq );
    enerScale.lb_scale = negate( scale->lb_scale );
    enerScale.lb_scale16 = negate( scale->lb_scale );
    move16();
    move16();
    move16();

    AnalysisPostSpectrumScaling_Fx( st->cldfbAnaEnc, ppBuf_Real, ppBuf_Imag, ppBuf_Real16, ppBuf_Imag16, &enerScale.lb_scale16 );

@@ -2793,7 +2795,7 @@ static void cldfb_init_proto_and_twiddles_enc(
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 17036;
                hs->scale = cldfb_scale_2_5ms[0];
                hs->p_filter = cldfb_protoFilter_2_5ms[0];
                hs->p_filter = CLDFB80_10_fx;
#endif
            }
            else if ( hs->prototype == CLDFB_PROTOTYPE_5_00MS )
@@ -2808,7 +2810,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_im = rot_vec_delay_im_LDQMF;
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 15388;
                hs->p_filter = cldfb_protoFilter_5_0ms[0];
                hs->p_filter = LDQMF_10_fx;
                hs->scale = cldfb_scale_5_0ms[0];
#endif
            }
@@ -2843,7 +2845,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_im = NULL;
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 17051;
                hs->p_filter = cldfb_protoFilter_2_5ms[1];
                hs->p_filter = CLDFB80_16_fx;
                hs->scale = cldfb_scale_2_5ms[1];
#endif
            }
@@ -2859,7 +2861,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_im = rot_vec_delay_im_LDQMF;
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 15388;
                hs->p_filter = cldfb_protoFilter_5_0ms[1];
                hs->p_filter = LDQMF_16_fx;
                hs->scale = cldfb_scale_5_0ms[1];
#endif
            }
@@ -2900,7 +2902,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_im = NULL;
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 17050;
                hs->p_filter = cldfb_protoFilter_2_5ms[2];
                hs->p_filter = CLDFB80_20_fx;
                hs->scale = cldfb_scale_2_5ms[2];
#endif
            }
@@ -2916,7 +2918,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_im = rot_vec_delay_im_LDQMF;
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 15390;
                hs->p_filter = cldfb_protoFilter_5_0ms[2];
                hs->p_filter = LDQMF_20_fx;
                hs->scale = cldfb_scale_5_0ms[2];
#endif
            }
@@ -2958,7 +2960,7 @@ static void cldfb_init_proto_and_twiddles_enc(
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 17051;
                hs->scale = cldfb_scale_2_5ms[6];
                hs->p_filter = cldfb_protoFilter_2_5ms[6];
                hs->p_filter = CLDFB80_30_fx;
#endif
            }
            else if ( hs->prototype == CLDFB_PROTOTYPE_5_00MS )
@@ -2974,7 +2976,7 @@ static void cldfb_init_proto_and_twiddles_enc(
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 15388;
                hs->scale = cldfb_scale_5_0ms[6];
                hs->p_filter = cldfb_protoFilter_5_0ms[6];
                hs->p_filter = LDQMF_30_fx;
#endif
            }
            break;
@@ -3008,7 +3010,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_im = NULL;
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 17050;
                hs->p_filter = cldfb_protoFilter_2_5ms[3];
                hs->p_filter = CLDFB80_32_fx;
                hs->scale = cldfb_scale_2_5ms[3];
#endif
            }
@@ -3025,7 +3027,7 @@ static void cldfb_init_proto_and_twiddles_enc(
#ifdef IVAS_FLOAT_FIXED
                hs->p_filter_sf = (Word16) 15392;
                hs->scale = cldfb_scale_5_0ms[3];
                hs->p_filter = cldfb_protoFilter_5_0ms[3];
                hs->p_filter = LDQMF_32_fx;
#endif
            }
            break;
@@ -3067,7 +3069,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->p_filter_sf = (Word16) 17051;
                hs->q_scale = norm_s( (Word16) CLDFB80_40_SCALE );
                hs->scale = cldfb_scale_2_5ms[4];
                hs->p_filter = cldfb_protoFilter_2_5ms[4];
                hs->p_filter = CLDFB80_40_fx;
#endif
            }
            else if ( hs->prototype == CLDFB_PROTOTYPE_5_00MS )
@@ -3086,7 +3088,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
                hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
                hs->p_filter_sf = (Word16) 15391;
                hs->p_filter = cldfb_protoFilter_5_0ms[4];
                hs->p_filter = LDQMF_40_fx;
                hs->scale = cldfb_scale_5_0ms[4];
#endif
            }
@@ -3131,7 +3133,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_re_fx = NULL;
                hs->rot_vec_syn_delay_im_fx = NULL;
                hs->p_filter_sf = (Word16) 17051;
                hs->p_filter = cldfb_protoFilter_2_5ms[5];
                hs->p_filter = CLDFB80_60_fx;
                hs->scale = cldfb_scale_2_5ms[5];
#endif
            }
@@ -3151,7 +3153,7 @@ static void cldfb_init_proto_and_twiddles_enc(
                hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
                hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
                hs->p_filter_sf = (Word16) 15391;
                hs->p_filter = cldfb_protoFilter_5_0ms[5];
                hs->p_filter = LDQMF_60_fx;
                hs->scale = cldfb_scale_5_0ms[5];
#endif
            }
+1 −0
Original line number Diff line number Diff line
@@ -745,6 +745,7 @@ enum
#define PIT_UP_SAMP6                        6
#define PIT_L_INTERPOL6_2                   17
#define PIT_FIR_SIZE6_2                     ( PIT_UP_SAMP6 * PIT_L_INTERPOL6_2 + 1 )
#define E_MIN_Q11_FX                            7                      /* minimum allowable energy in Q11*/
#define E_MIN                               0.0035f                /* minimum allowable energy */
#define E_MIN_Q11_FX                            7                      /* minimum allowable energy in Q11*/
#define STEP_DELTA                          0.0625f                /* quantization step for tilt compensation of gaussian cb. excitation */
+8 −0
Original line number Diff line number Diff line
@@ -258,6 +258,7 @@ ivas_error pre_proc_front_ivas_fx(
    const int16_t nb_bits_metadata,                             /* i  : number of metadata bits                    */
    const int16_t input_frame,                                  /* i  : frame length                               */
    const int16_t n,                                            /* i  : channel number                             */
    Word16 old_inp_12k8_fx[],                                   /* o  : buffer of old input signal                 */
    float old_inp_12k8[],                                       /* o  : buffer of old input signal                 */
    float old_inp_16k[],                                        /* o  : buffer of old input signal @16kHz          */
    float *ener,                                                /* o  : residual energy from Levinson-Durbin       */
@@ -279,6 +280,7 @@ ivas_error pre_proc_front_ivas_fx(
    int16_t *vad_flag_dtx,                                      /* o  : HE-SAD flag with additional DTX HO         */
    float enerBuffer[CLDFB_NO_CHANNELS_MAX],                    /* o  : energy buffer                              */
    float fft_buff[2 * L_FFT],                                  /* o  : FFT buffer                                 */
    Word16 fft_buff_fx[2 * L_FFT],                                  /* o  : FFT buffer                                 */
    const float tdm_A_PCh[M + 1],                               /* i  : unq. LP coeff. of primary channel          */
    const float tdm_lsp_new_PCh[M],                             /* i  : unq. LSPs of primary channel               */
    const float currFlatness,                                   /* i  : flatness parameter                         */
@@ -1805,10 +1807,12 @@ void stereo_dft_enc_res(
    const int16_t max_bits 
);

#ifndef IVAS_FLOAT_FIXED
void stereo_dft_enc_write_BS(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure               */
    int16_t *nb_bits                                            /* o  : number of bits written              */
);
#endif

void stereo_dtf_cng( 
    CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure               */
@@ -1857,6 +1861,7 @@ void stereo_dft_dequantize_itd(
    const int32_t output_Fs 
);

#ifndef IVAS_FLOAT_FIXED
void stereo_dft_enc_sid_calc_coh(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft,                      /* i/o: DFT stereo handle                   */
    float prev_cohBand[2*(STEREO_DFT_BAND_MAX/2)],              /* i/o: Previous coherence                  */
@@ -1864,7 +1869,9 @@ void stereo_dft_enc_sid_calc_coh(
    int16_t *first_SID,                                         /* i/o: First SID indicator                 */
    float *cohBand                                              /* i/o: Coherence per band                  */
);
#endif

#ifndef IVAS_FLOAT_FIXED
void stereo_dft_enc_sid_coh(
    BSTR_ENC_HANDLE hBstr,                                      /* i/o: bitstream handle                    */
    float *mem_cohBand,                                         /* i/o: Coherence memory                    */
@@ -1872,6 +1879,7 @@ void stereo_dft_enc_sid_coh(
    int16_t *nb_bits,                                           /* i/o: number of bits written              */
    float *cohBand                                              /* i/o: Coherence per band                  */
);
#endif
#ifdef IVAS_FLOAT_FIXED
void stereo_dft_dec_sid_coh_fx(
    Decoder_State *st,                                          /* i/o: decoder state structure             */
+30 −0
Original line number Diff line number Diff line
@@ -2741,6 +2741,28 @@ void stereo_cng_upd_counters_fx(
    Word16 *coh_fade_counter          /* i  : Coherence fade counter        */
);


void stereo_dft_enc_sid_calc_coh_fx(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft,                /* i/o: DFT stereo handle           */
    Word32 prev_cohBand[2 * ( STEREO_DFT_BAND_MAX / 2 )], /* i/o: Previous coherence  Q31 */
    Word16 *td_active,                                    /* i/o: TD stereo mode indicator    */
    Word16 *first_SID,                                    /* i/o: First SID indicator         */
    Word32 *cohBand                                       /* i/o: Coherence per band Q31         */
);

void stereo_dft_enc_sid_coh_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle             */
    Word32 *mem_cohBand,   /* i/o: Coherence memory             */
    const Word16 nbands,   /* i  : number of DFT stereo bands   */
    Word16 *nb_bits,       /* i/o: number of bits written       */
    Word32 *cohBand        /* i/o: Coherence per band           */
);

void stereo_dft_enc_write_BS_fx(
    CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure   */
    Word16 *nb_bits      /* o  : number of bits written  */
);

void spectral_balancer_fx16(
    Word16 *signal,        /* i/o  : signal  Qx                 */
    Word16 *mem,           /* i/o  : mem  Qx                    */
@@ -2863,4 +2885,12 @@ void stereo_tcx_core_enc(
    const Word16 vad_hover_flag       /* i  : VAD hangover flag, Q0                      */
);


Word16 transient_analysis_ivas_fx(
    TRAN_DET_HANDLE hTranDet,  /* i  : handle transient detection       */
    const Word16 cor_map_LT[], /* i  : LT correlation map  Q_cor_map = Qx */
    Word16 Q_cor_map,
    const Word16 multi_harm_limit, /* i  : multi harmonic threshold Q_multi_harm_limit = Qx */
    Word16 Q_multi_harm_limit );

#endif
+2 −0
Original line number Diff line number Diff line
@@ -159,9 +159,11 @@ extern const float nf_tw_smoothing_coeffs[N_LTP_GAIN_MEMS];
 * Stereo DTX ROM tables
 *----------------------------------------------------------------------------------*/

extern const Word16 dft_cng_coh_pred_fx[][STEREO_DFT_COH_PRED_COEFFS];
extern const float dft_cng_coh_pred[][STEREO_DFT_COH_PRED_COEFFS];
extern const int16_t dft_cng_coh_u2i[9];
extern const int16_t dft_cng_coh_i2u[9];
extern const Word16 dft_cng_alpha_bits_fx[STEREO_DFT_N_COH_ALPHA_STEPS][STEREO_DFT_N_COH_ALPHA_LEVELS];
extern const float dft_cng_alpha_bits[STEREO_DFT_N_COH_ALPHA_STEPS][STEREO_DFT_N_COH_ALPHA_LEVELS];
extern const int16_t dft_cng_coh_alpha_start[STEREO_DFT_N_COH_ALPHA_STEPS - 1];

Loading