Commit 3f287a66 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into update_crend

parents 285cadb9 46f90c62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -654,7 +654,7 @@ build-codec-linux-make:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web'
    - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # trigger build job for all MRs
    - if: $CI_PIPELINE_SOURCE == 'schedule'
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
+4 −0
Original line number Diff line number Diff line
@@ -1405,7 +1405,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead)
        {
            FOR( j = 20; j < numberBandsM; j++ )
            {
#ifdef BASOP_NOGLOB
                nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#else
                nrg = L_add( nrg, L_shr( energyValues[k][j], s ) );
#endif
            }
        }

+18 −34
Original line number Diff line number Diff line
@@ -600,9 +600,11 @@ void enhancer_ivas_fx2(
    Word16 tmp, fac, *pt_exc2;
    Word16 i;
    Word32 L_tmp;
    Word32 L_tmp1, L_tmp2;
    Word16 gain_code_hi;
    Word16 pit_sharp, tmp16;
    Word16 excp[L_SUBFR], sc;
    Word64 w_temp;


    pit_sharp = gain_pit;
@@ -751,50 +753,32 @@ void enhancer_ivas_fx2(
         * filter with coefs [-tmp 1.0 -tmp] where tmp=0...0.25.
         * This is applied to code and add_fxed to exc2
         *-----------------------------------------------------------------*/

        L_tmp1 = L_deposit_h( gain_code_hi ); // Q = 16 + Q_exc, gain_code
        L_tmp2 = L_mult( tmp, gain_code_hi ); // Q = 16 + Q_exc, gain_code * temp

        /* pt_exc2[0] += code[0] - tmp * code[1] */
        L_tmp = L_deposit_h( code[0] );       /* if Enc :Q9 * Q15 -> Q25 */
        L_tmp = L_msu( L_tmp, code[1], tmp ); /* Q12 * Q15 -> Q28 */
#ifdef BASOP_NOGLOB
        L_tmp = L_shl_sat( L_mult( gain_code_hi, extract_h( L_tmp ) ), sc );
        pt_exc2[0] = msu_r_sat( L_tmp, -32768, pt_exc2[0] );
        w_temp = W_msu_32_16( W_mult_32_16( L_tmp1, code[0] ), L_tmp2, code[1] ); // Q = 32 + Q_exc - sc (16+Q_exc+15-sc+1)
        w_temp = W_shl( w_temp, sc );                                             // Q = 32 + Q_exc
        pt_exc2[0] = W_round32_s( W_msu_32_16( w_temp, MIN_32, pt_exc2[0] ) );    // Q = Q_exc
        move16();
#else
        L_tmp = L_shl( L_mult( gain_code_hi, extract_h( L_tmp ) ), sc );
        pt_exc2[0] = msu_r( L_tmp, -32768, pt_exc2[0] );
        move16();
#endif
        move16(); /* in Q_exc */

        FOR( i = 1; i < L_SUBFR - 1; i++ )
        {
            /* pt_exc2[i] += code[i] - tmp * code[i-1] - tmp * code[i+1] */
            L_tmp = L_msu( -32768, code[i], -32768 );
            L_tmp = L_msu( L_tmp, code[i + 1], tmp );
#ifdef BASOP_NOGLOB
            tmp16 = msu_r_sat( L_tmp, code[i - 1], tmp );
            L_tmp = L_shl_sat( L_mult( gain_code_hi, tmp16 ), sc );
            pt_exc2[i] = msu_r_sat( L_tmp, -32768, pt_exc2[i] );
            /* pt_exc2[i] += (code[i] - tmp * code[i-1] - tmp * code[i+1]) * gain_code */
            w_temp = W_msu_32_16( W_mult_32_16( L_tmp1, code[i] ), L_tmp2, code[i - 1] ); // Q = 32 + Q_exc - sc (16+Q_exc+15-sc+1)
            w_temp = W_msu_32_16( w_temp, L_tmp2, code[i + 1] );                          // Q = 32 + Q_exc - sc (16+Q_exc+15-sc+1)
            w_temp = W_shl( w_temp, sc );                                                 // Q = 32 + Q_exc
            pt_exc2[i] = W_round32_s( W_msu_32_16( w_temp, MIN_32, pt_exc2[i] ) );        // Q = Q_exc
            move16();
#else
            tmp16 = msu_r( L_tmp, code[i - 1], tmp );
            L_tmp = L_shl( L_mult( gain_code_hi, tmp16 ), sc );
            pt_exc2[i] = msu_r( L_tmp, -32768, pt_exc2[i] );
#endif
            move16(); /* in Q_exc */
        }

        /* pt_exc2[L_SUBFR-1] += code[L_SUBFR-1] - tmp * code[L_SUBFR-2] */
        L_tmp = L_deposit_h( code[L_SUBFR - 1] );       /*Q28 */
        L_tmp = L_msu( L_tmp, code[L_SUBFR - 2], tmp ); /*Q28 */
        L_tmp = L_shl( L_mult( gain_code_hi, extract_h( L_tmp ) ), sc );
#ifdef BASOP_NOGLOB
        pt_exc2[L_SUBFR - 1] = msu_r_sat( L_tmp, -32768, pt_exc2[L_SUBFR - 1] );
        w_temp = W_msu_32_16( W_mult_32_16( L_tmp1, code[L_SUBFR - 1] ), L_tmp2, code[L_SUBFR - 2] ); // Q = 32 + Q_exc - sc (16+Q_exc+15-sc+1)
        w_temp = W_shl( w_temp, sc );                                                                 // Q = 32 + Q_exc
        pt_exc2[L_SUBFR - 1] = W_round32_s( W_msu_32_16( w_temp, MIN_32, pt_exc2[L_SUBFR - 1] ) );    // Q = Q_exc
        move16();
#else
        pt_exc2[L_SUBFR - 1] = msu_r( L_tmp, -32768, pt_exc2[L_SUBFR - 1] );
        move16();
#endif
        move16(); /* in Q_exc */

        test();
        test();
        IF( Opt_AMR_WB && ( EQ_32( core_brate, ACELP_8k85 ) || EQ_32( core_brate, ACELP_6k60 ) ) )
+1 −0
Original line number Diff line number Diff line
@@ -344,6 +344,7 @@ void int_lsp4_ivas_fx(
        }
        ELSE IF( EQ_16( relax_prev_lsf_interp, -2 ) )
        {
            // This condition not present in int_lsp4_fx
            pt_int_coeffs = interpol_frac2_mid_fx; /*Q15*/
        }
        ELSE
+48 −47
Original line number Diff line number Diff line
@@ -229,49 +229,50 @@ ivas_error pre_proc_front_ivas(
ivas_error pre_proc_front_ivas_fx(
    SCE_ENC_HANDLE hSCE,                                       /* i/o: SCE encoder structure                   */
    CPE_ENC_HANDLE hCPE,                                       /* i/o: CPE encoder structure                   */
    const int32_t element_brate,                                /* i  : SCE/CPE element bitrate                    */
    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                 */
    const Word32 element_brate,                                /* i  : SCE/CPE element bitrate                 */
    const Word16 nb_bits_metadata,                             /* i  : number of metadata bits                 */
    const Word16 input_frame,                                  /* i  : frame length                            */
    const Word16 n,                                            /* i  : channel number                          */
    Word16 old_inp_12k8_fx[],                                  /* o  : (Q-1) 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    */
    float *relE,                                                /* o  : frame relative energy                      */
    float A[NB_SUBFR16k * ( M + 1 )],                           /* o  : A(z) unquantized for the 4 subframes       */
    float Aw[NB_SUBFR16k * ( M + 1 )],                          /* o  : weighted A(z) unquantized for subframes    */
    Word16 *relE_fx,                                               /* o  : frame relative energy                  Q8 */
    Word16 A_fx[NB_SUBFR16k * ( M + 1 )],                          /* o  : A(z) unquantized for the 4 subframes    */
    Word16 Aw_fx[NB_SUBFR16k * ( M + 1 )],                         /* o  : weighted A(z) unquantized for subframes */
    float epsP[M + 1],                                         /* o  : LP prediction errors                    */
    float lsp_new[M],                                           /* o  : LSPs at the end of the frame               */
    float lsp_mid[M],                                           /* o  : LSPs in the middle of the frame            */
    int16_t *vad_hover_flag,                                    /* o  : VAD hangover flag                          */
    int16_t *attack_flag,                                       /* o  : flag signaling attack                      */
    float realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],  /* i/o: real buffer                                */
    float imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],  /* i/o: imag buffer                                */
    Word16 lsp_new_fx[M],                                          /* o  : LSPs at the end of the frame      Q15      */
    Word16 lsp_mid_fx[M],                                          /* o  : LSPs in the middle of the frame   Q15      */
    Word16 *vad_hover_flag,                                    /* o  : VAD hangover flag                       */
    Word16 *attack_flag,                                       /* o  : flag signaling attack                  */
    Word32 realBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer              Q(q_re_im_buf) */
    Word32 imagBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer              Q(q_re_im_buf) */
    Word16 *q_re_im_buf,                                           /* i/o: Q-factor of real and imag buffer        */
    float old_wsp[],                                           /* o  : weighted input signal buffer            */
    float pitch_fr[NB_SUBFR],                                   /* o  : fractional pitch values                    */
    float voicing_fr[NB_SUBFR],                                 /* o  : fractional pitch gains                     */
    int16_t *loc_harm,                                          /* o  : harmonicity flag                           */
    float *cor_map_sum,                                         /* o  : speech/music clasif. parameter             */
    int16_t *vad_flag_dtx,                                      /* o  : HE-SAD flag with additional DTX HO         */
    Word16 pitch_fr_fx[NB_SUBFR],                                  /* o  : fractional pitch values               Q6  */
    Word16 voicing_fr_fx[NB_SUBFR],                                /* o  : fractional pitch gains                Q15 */
    Word16 *loc_harm,                                          /* o  : harmonicity flag                        */
    Word16 *cor_map_sum_fx,                                    /* o  : speech/music clasif. parameter       Q8 */
    Word16 *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                         */
    const int16_t tdm_ratio_idx,                                /* i  : Current Ratio_L index                      */ 
    const Word16 tdm_A_PCh_fx[M + 1],                              /* i  : unq. LP coeff. of primary channel  Q12     */
    const Word16 tdm_lsp_new_PCh_fx[M],                            /* i  : unq. LSPs of primary channel       Q15     */
    const Word16 currFlatness_fx,                                  /* i  : flatness parameter                    Q7  */
    const Word16 tdm_ratio_idx,                                /* i  : Current Ratio_L index                   */
    float fr_bands_LR[][2 * NB_BANDS],                         /* i  : energy in frequency bands               */
    const float Etot_LR[],                                      /* i  : total energy Left & Right channel          */
    const Word16 Etot_LR_fx[],                                     /* i  : total energy Left & Right channel       Q8*/
    float lf_E_LR[][2 * VOIC_BINS],                            /* i  : per bin spectrum energy in lf, LR channels */
    const int16_t localVAD_HE_SAD_LR[],                         /* i  : HE-SAD flag without hangover, LR channels  */
    const Word16 localVAD_HE_SAD_LR[],                         /* i  : HE-SAD flag without hangover, LR channels  */
    float band_energies_LR[2 * NB_BANDS],                      /* o  : energy in critical bands without minimum noise floor E_MIN */
    const int16_t flag_16k_smc,                                 /* i  : flag to indicate if the OL SMC is run at 16 kHz */
    const int16_t front_vad_flag,                               /* i  : front-VAD flag to overwrite VAD decision   */
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
    const int16_t front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const Word16 flag_16k_smc,                                 /* i  : flag to indicate if the OL SMC is run at 16 kHz */
    const Word16 front_vad_flag,                               /* i  : front-VAD flag to overwrite VAD decision */
    const Word16 force_front_vad,                              /* i  : flag to force VAD decision               */
    const Word16 front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const IVAS_FORMAT ivas_format,                             /* i  : IVAS format                              */
    const int16_t MCT_flag, /* i  : hMCT handle allocated (1) or not (0)    */
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                         */
    const Word16 MCT_flag,                                     /* i  : hMCT handle allocated (1) or not (0)    */
    const Word32 ivas_total_brate                              /* i  : IVAS total bitrate - for setting the DTX */
);
ivas_error pre_proc_ivas(
    Encoder_State *st,                                          /* i/o: encoder state structure                 */
@@ -611,6 +612,7 @@ void stereo_tcx_core_dec(
);
#endif // !IVAS_FLOAT_FIXED

#ifndef IVAS_FLOAT_FIXED
void stereo_tcx_core_enc(
    Encoder_State *st,                /* i/o: encoder state structure                    */
    const float new_samples_12k8[],   /* i  : buffer of input signal @12.8 kHz           */
@@ -622,6 +624,7 @@ void stereo_tcx_core_enc(
    const Word16 last_element_mode,   /* i  : last element mode, Q0                      */
    const Word16 vad_hover_flag       /* i  : VAD hangover flag, Q0                      */
);
#endif


void stereo_tcx_init_dec(
@@ -2276,7 +2279,6 @@ void td_stereo_param_updt(
    const int16_t flag_ACELP16k,                                /* i  : ACELP@16kHz flag                        */
    const int16_t tdm_use_IAWB_Ave_lpc                          /* i  : flag to indicate the usage of mean inactive LP coefficients */
);
#endif

void gsc_enc(
    Encoder_State *st,                                          /* i/o: State structure                         */
@@ -2290,7 +2292,6 @@ void gsc_enc(
    float *tmp_noise                                            /* o  : long-term noise energy                  */
);

#ifndef IVAS_FLOAT_FIXED
void tdm_low_rate_enc(
    Encoder_State *st,                                          /* i/o: State structure                         */
    const float Aq[],                                           /* i  : 12k8 Lp coefficient                     */
Loading