Commit 2faa7594 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'perform_noise_estimation_fxd' into 'main'

ApplyFdCng call stack converted to fixed point.

See merge request !158
parents dda6b18d ea73b2a0
Loading
Loading
Loading
Loading
Loading
+677 −1

File changed.

Preview size limit exceeded, changes collapsed.

+27 −0
Original line number Diff line number Diff line
@@ -397,6 +397,24 @@ void v_multc_att32(
    Word32 y[],       /* o  : Output vector that contains att*x                */
    const Word16 N    /* i  : Vector length                                    */
);
void v_multc_att3232(
  const Word32 x[], /* i  : Input vector   Qx                                */
  const Word32 att, /* i  : Constant Q32, <= MAX_32                          */
  Word32 y[],       /* o  : Output vector that contains att*x                */
  const Word16 N    /* i  : Vector length                                    */
);
void v_L_mult_1616(
    const Word16 x1[], /* i  : Input vector 1                                   */
    const Word16 x2[], /* i  : Input vector 2                                   */
    Word32 y[],        /* o  : Output vector that contains vector 1 .* vector 2 */
    const Word16 N     /* i  : Vector length                                    */
);
void v_L_mult_3216(
    const Word32 x1[], /* i  : Input vector 1                                   */
    const Word16 x2[], /* i  : Input vector 2                                   */
    Word32 y[],        /* o  : Output vector that contains vector 1 .* vector 2 */
    const Word16 N     /* i  : Vector length                                    */
);
void add_vec_fx(
    const Word16 x1[],                               /* i  : Input vector 1                       */
    const Word16 Qx1,                                /* i  : SCaling of input 1                    */
@@ -513,6 +531,15 @@ void delay_signal32(
  const Word16 delay  /* i  : delay in samples                  */
);

Word16 lin_interp_fx(
  const Word16 x,         /* i  : the value to be mapped                       */
  const Word16 x1,        /* i  : source range interval: low end               */
  const Word16 y1,        /* i  : source range interval: high end              */
  const Word16 x2,        /* i  : target range interval: low                   */
  const Word16 y2,        /* i  : target range interval: high                  */
  const Word16 flag_sat /* i  : flag to indicate whether to apply saturation */
);

Word16 ceil_log_2( UWord64 val );

#ifdef IVAS_FLOAT_FIXED
+62 −0
Original line number Diff line number Diff line
@@ -4601,6 +4601,35 @@ void minimum_statistics(Word16 len, /* i : Total number of
  Word16 *msPeriodogBufPtr,       /* i/o: Counter                                                   */
  HANDLE_FD_CNG_COM st            /* i/o: FD_CNG structure containing buffers and variables         */
);

#ifdef IVAS_FLOAT_FIXED
void minimum_statistics_fx(
    Word16 len,                    /* i  : Total number of partitions (CLDFB or FFT)                   */
    Word16 lenFFT,                 /* i  : Number of FFT partitions                                  */
    Word16 *psize,                 /* i  : Partition sizes, fractional                               */
    Word16 *msPeriodog,            /* i  : Periodogram (energies)                                    */
    Word16 *msNoiseFloor,          /* i/o: Noise floors (energies)                                   */
    Word16 *msNoiseEst,            /* i/o: Noise estimates (energies)                                */
    Word32 *msAlpha,               /* i/o: Forgetting factors                                        */
    Word16 *msPsd,                 /* i/o: Power Spectral Density (smoothed periodogram => energies) */
    Word16 *msPsdFirstMoment,      /* i/o: PSD statistics of 1st order (energy means)                */
    Word32 *msPsdSecondMoment,     /* i/o: PSD statistics of 2nd order (energy variances)            */
    Word32 *msMinBuf,              /* i/o: Buffer of minima (energies)                               */
    Word32 *msBminWin,             /* o  : Bias correction factors                                   */
    Word32 *msBminSubWin,          /* o  : Bias correction factors                                   */
    Word32 *msCurrentMin,          /* i/o: Local minima (energies)                                   */
    Word32 *msCurrentMinOut,       /* i/o: Local minima (energies)                                   */
    Word32 *msCurrentMinSubWindow, /* i/o: Local minima (energies)                                   */
    Word16 *msLocalMinFlag,        /* i  : Binary flag                                               */
    Word16 *msNewMinFlag,          /* i  : Binary flag                                               */
    Word16 *msPeriodogBuf,         /* i/o: Buffer of periodograms (energies)                         */
    Word16 *msPeriodogBufPtr,      /* i/o: Counter                                                   */
    HANDLE_FD_CNG_COM hFdCngCom,   /* i/o: FD_CNG structure containing all buffers and variables */
    const Word16 enc_dec,          /* i  : encoder/decoder indicator */
    const Word16 element_mode      /* i  : IVAS element mode type    */
);
#endif // IVAS_FLOAT_FIXED

/* Apply bitrate-dependant scale */
void apply_scale(
  Word32* scale,                  /* o  : scalefactor             */
@@ -4642,6 +4671,14 @@ void AnalysisSTFT(
  HANDLE_FD_CNG_COM hFdCngCom          /* i/o: FD_CNG structure containing all buffers and variables */
);

void AnalysisSTFT_fx(
  const Word16 *timeDomainInput,
  Word16 Q,
  Word32 *fftBuffer,          /* o  : FFT bins */
  Word16 *fftBuffer_exp,      /* i  : exponent of FFT bins */
  HANDLE_FD_CNG_COM hFdCngCom /* i/o: FD_CNG structure containing all buffers and variables */
);

/* STFT synthesis filterbank */
void SynthesisSTFT(
  Word32* fftBuffer,           /* i    : pointer to FFT bins */
@@ -6528,6 +6565,18 @@ void init_tcx_cfg_fx(
   Word16 is_music
 );

 Word16 ApplyFdCng_fx(
     Word16 *timeDomainInput, /* i  : pointer to time domain input */
     Word16 Q,
     Word32 *powerSpectrum,
     Word32 **cldfbBufferReal, /* i/o: real part of the CLDFB buffer */
     Word32 **cldfbBufferImag, /* i/o: imaginary part of the CLDFB buffer */
     Word16 *cldfbBufferScale, /* o  : pointer to the scalefactor for real and imaginary part of the CLDFB buffer */
     Decoder_State *st,
     const Word16 concealWholeFrame, /* i  : binary flag indicating frame loss */
     Word16 is_music
);

 /* Perform noise estimation */
 void perform_noise_estimation_dec(
   const Word16* timeDomainInput, /* i:   pointer to time domain i   */
@@ -6546,6 +6595,19 @@ void init_tcx_cfg_fx(
#endif
 );

 void perform_noise_estimation_dec_fx(
     const Word16 *timeDomainInput, /* i:   pointer to time domain input */
     const Word16 Q,
     Word32 *power_spectrum,
     HANDLE_FD_CNG_DEC hFdCngDec,  /* i/o: FD_CNG structure containing all buffers and variables */
     const Word16 element_mode,    /* i  : element mode                                          */
     const Word16 bwidth,          /* i  : audio bandwidth                                       */
     const Word16 L_frame,         /* i  : frame length at internal Fs                           */
     const Word16 last_L_frame,    /* i  : frame length of the last frame at internal Fs         */
     const Word32 last_core_brate, /* i  : previous frame core bitrate                           */
     const Word16 VAD              /* i  : VAD flag in the decoder                               */
 );

 /* Decode the CLDFB-CNG bitstream */
 void FdCng_decodeSID(HANDLE_FD_CNG_COM st,         /* i/o: FD_CNG structure containing all buffers and variables */
   Decoder_State *corest);     /* i/o: decoder state structure */
+152 −0

File changed.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
@@ -1694,6 +1694,10 @@ extern const Word16 fftSineTab640_fx[321];

extern const float olapWinAna512[512];
extern const float olapWinAna640[640];
#ifdef IVAS_FLOAT_FIXED
extern const Word32 olapWinAna512_fx[512]; // Q30
extern const Word32 olapWinAna640_fx[640]; // Q30
#endif // IVAS_FLOAT_FIXED

extern const float olapWinSyn256[256];
extern const Word16 olapWinSyn256_fx[256];
Loading