Commit ecab5be6 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_739_fix' into 'main'

SVD functions fixed point implementation

See merge request !342
parents 9651030f 34498a8a
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -4823,7 +4823,9 @@ Word16 matrix_product_mant_exp(
  Word32 *Z_fx,          /* o  : resulting matrix after the matrix multiplication                                       */
  Word16 *Z_e            /* o  : resulting matrix after the matrix multiplication                                       */
);
#endif

#ifdef IVAS_FLOAT_FIXED
void mat2svdMat_fx(
    const Word32 *mat,                                       /* i  : matrix as column ordered vector */
    Word32 svdMat[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS], /* o  : matrix as two-dimensional arry  */
@@ -4838,7 +4840,7 @@ void svdMat2mat_fx(
    const Word16 nRows,                                    /* i  : number of rows of the matrix    */
    const Word16 mCols                                     /* i  : number of columns of the matrix */
);
#endif
#else

void mat2svdMat(
    const float *mat,                                           /* i  : matrix as column ordered vector */
@@ -4854,6 +4856,7 @@ void svdMat2mat(
    const int16_t nRows,                                        /* i  : number of rows of the matrix    */
    const int16_t mCols                                         /* i  : number of columns of the matrix */
);
#endif

int16_t matrix_diag_product(
    const float *X,                                             /* i  : left hand matrix                                                                       */
@@ -4896,6 +4899,7 @@ void cmplx_matrix_square(
    float *imagZ                                                /* o  : imaginary part of the resulting matrix                                      */
);

#ifndef IVAS_FLOAT_FIXED
int16_t computeMixingMatrices(
    const int16_t num_inputs,                                   /* i  : number of input channels                                                                                      */
    const int16_t num_outputs,                                  /* i  : number of output channels                                                                                     */
@@ -4909,7 +4913,7 @@ int16_t computeMixingMatrices(
    float *Cr                                                   /* o  : residual covariance matrix                                                                                    */
);

#ifdef IVAS_FLOAT_FIXED
#else
Word16 computeMixingMatrices_fx(
    const Word16 num_inputs,               /* i  : number of input channels                                                                                      */
    const Word16 num_outputs,              /* i  : number of output channels                                                                                     */
@@ -4931,6 +4935,7 @@ Word16 computeMixingMatrices_fx(
);
#endif

#ifndef IVAS_FLOAT_FIXED
int16_t computeMixingMatricesResidual(
    const int16_t num_outputs,                                  /* i  : number of output channels                                           */
    const float *Cx,                                            /* i  : vector containing the diagonal diffuse prototype covariance         */
@@ -4940,7 +4945,7 @@ int16_t computeMixingMatricesResidual(
    float *mixing_matrix                                        /* o  : resulting residual mixing matrix                                    */
);

#ifdef IVAS_FLOAT_FIXED
#else
Word16 computeMixingMatricesResidual_fx(
    const Word32 num_outputs, /* i  : number of output channels                                           */
    const Word32 *Cx_fx,           /* i  : vector containing the diagonal diffuse prototype covariance         */
@@ -4956,6 +4961,19 @@ Word16 computeMixingMatricesResidual_fx(
);
#endif

#ifdef IVAS_FLOAT_FIXED
/*! r: error or success */
Word16 svd_fx(
    Word32 InputMatrix[][MAX_OUTPUT_CHANNELS],           /* i  : matrix to be decomposed (M)                      */
    Word16 InputMatrix_e,
    Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS],  /* o  : left singular vectors (U)                        */
    Word32 singularValues[MAX_OUTPUT_CHANNELS],          /* o  : singular values vector (S)                       */
    Word32 singularVectors_Right[][MAX_OUTPUT_CHANNELS], /* o  : right singular vectors (V)                       */
    Word16 *singularValues_fx_e,
    const Word16 nChannelsL,                           /* i  : number of rows in the matrix to be decomposed    */
    const Word16 nChannelsC                            /* i  : number of columns in the matrix to be decomposed */
);
#else
/*! r: error or success */
int16_t svd(
    float InputMatrix[][MAX_OUTPUT_CHANNELS],                   /* i  : matrix to be decomposed (M)                      */
@@ -4965,6 +4983,8 @@ int16_t svd(
    const int16_t nChannelsL,                                   /* i  : number of rows in the matrix to be decomposed    */
    const int16_t nChannelsC                                    /* i  : number of columns in the matrix to be decomposed */
);
#endif

#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_dirac_dec_output_synthesis_cov_open_fx(
    DIRAC_OUTPUT_SYNTHESIS_PARAMS *h_dirac_output_synthesis_params,   /* i/o: handle for the covariance synthesis parameters                                                        */
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@
#define FIX_747_TDBWE_ENERGY_BURST
#define FIX_770_DISCONTINUITIES_SW_TCX2ACELP  // Fix discontinuities when switching from TCX to ACELP
#define FIX_680_CNG_FRAME_BOUNDARIES_ISSUE /* Step was right shift by 2, which made the OVA wrong */
#define NONBE_FIX_1069_SVD_TUNING                       /* FhG: issue 1069: tune SVD constants */
/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+234 −184

File changed.

Preview size limit exceeded, changes collapsed.

+1142 −17

File changed.

Preview size limit exceeded, changes collapsed.