Commit 7b0fd2a0 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Functions in ivas_omasa_dec.c converted to fixed point.

[x] Ported ivas_omasa_data_open, ivas_omasa_data_close,
ivas_dirac_dec_binaural_internal(partial), generate_masking_noise_dirac,
ivas_combined_orientation_update_index, resampleCldfb_ivas, rand_gauss,
v_multc_32_16_fixed, generate_masking_noise_dirac functions
parent 3139c23d
Loading
Loading
Loading
Loading
Loading
+349 −83

File changed.

Preview size limit exceeded, changes collapsed.

+18 −0
Original line number Diff line number Diff line
@@ -1072,7 +1072,25 @@ float rand_gauss_flt(

    return temp;
}
#ifdef IVAS_FLOAT_FIXED
Word32 rand_gauss_fx(
    Word32 *x,
    Word16 *seed,
    Word16 q
)
{
    Word32 temp;

    temp = own_random( seed );
    temp = L_add(temp, own_random( seed ));
    temp = L_add(temp, own_random( seed ));
    temp = L_shr(temp, 15 - q);

    *x = temp;

    return temp;
}
#endif

/*-------------------------------------------------------------------
 * lpc_from_spectrum_flt()
+8 −0
Original line number Diff line number Diff line
@@ -364,4 +364,12 @@ const Word32 ls_elevation_CICP16_fx[9] = { 0, 0, 0, 0, 0, 146800640, 146800640,
const Word32 ls_azimuth_CICP19_fx[11] = { 125829120, -125829120, 0, 566231040, -566231040, 377487360, -377487360, 125829120, -125829120, 566231040, -566231040 };
const Word32 ls_elevation_CICP19_fx[11] = { 0, 0, 0, 0, 0, 0, 0, 146800640, 146800640, 146800640, 146800640 };

const Word16 pow_10_q11[128] = {
    2048, 2085, 2123, 2161, 2200, 2240, 2281, 2322, 2364, 2407, 2451, 2496, 2541, 2587, 2634, 2682, 2731, 2780, 2831, 2882, 2934, 2988, 3042, 3097, 3153, 3211, 3269,
    3328, 3389, 3450, 3513, 3576, 3641, 3708, 3775, 3843, 3913, 3984, 4056, 4130, 4205, 4281, 4359, 4438, 4519, 4601, 4684, 4769, 4856, 4944, 5034, 5125, 5218, 5313,
    5410, 5508, 5608, 5710, 5813, 5919, 6026, 6136, 6247, 6360, 6476, 6593, 6713, 6835, 6959, 7085, 7214, 7345, 7478, 7614, 7752, 7893, 8036, 8182, 8331, 8482, 8636,
    8793, 8952, 9115, 9280, 9449, 9620, 9795, 9973, 10154, 10338, 10526, 10717, 10911, 11109, 11311, 11516, 11725, 11938, 12155, 12375, 12600, 12829, 13062, 13299,
    13540, 13786, 14036, 14291, 14550, 14815, 15084, 15357, 15636, 15920, 16209, 16503, 16803, 17108, 17418, 17734, 18056, 18384, 18718, 19058, 19404, 19756, 20114
};

/* clang-format on */
+1 −0
Original line number Diff line number Diff line
@@ -75,5 +75,6 @@ extern const Word32 ls_azimuth_CICP16_fx[9];
extern const Word32 ls_elevation_CICP16_fx[9];
extern const Word32 ls_azimuth_CICP19_fx[11];
extern const Word32 ls_elevation_CICP19_fx[11];
extern const Word16 pow_10_q11[128];

#endif
 No newline at end of file
+47 −4
Original line number Diff line number Diff line
@@ -5167,6 +5167,13 @@ void v_add_w64(
    const Word16 hdrm  /* i  : headroom for when subtraction result > 1 or < -1 */
);

void v_multc_32_16_fixed(
    const Word32 x[], /* i  : Input vector                                     */
    const Word16 c,   /* i  : Constant                                         */
    Word32 y[],       /* o  : Output vector that contains c*x                  */
    const Word16 N    /* i  : Vector length                                    */
);

void v_sub_fixed(
    const Word32 x1[], /* i  : Input vector 1                                   */
    const Word32 x2[], /* i  : Input vector 2                                   */
@@ -8186,12 +8193,23 @@ void v_add_fx(
);

void cldfbAnalysis_ts_fx(
    const Word32 *timeIn_fx,                     /* i  : time buffer         */  // q = 31
    Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o  : real value buffer   */  // q = 29
    Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o  : imag value buffer   */ // q = 29
    const Word32 *timeIn_fx,                     /* i  : time buffer         */
    Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o  : real value buffer   */
    Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o  : imag value buffer   */
    const Word16 samplesToProcess,          /* i  : samples to process  */
    HANDLE_CLDFB_FILTER_BANK h_cldfb ,
    Word16* q_cldfb
);

void cldfbAnalysis_ts_fx_fixed_q(
    const Word32 *timeIn_fx,                     /* i  : time buffer         */  // q
    Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o  : real value buffer   */  // q - 5
    Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o  : imag value buffer   */ // q - 5
    const Word16 samplesToProcess,          /* i  : samples to process  */
    HANDLE_CLDFB_FILTER_BANK h_cldfb 
    HANDLE_CLDFB_FILTER_BANK h_cldfb,         /* i  : filterbank state    */
    Word16* q_cldfb
);

// dec4t64.c
void dec_acelp_fast_fx(
    Decoder_State *st,       /* i/o: decoder state structure                 */
@@ -8292,4 +8310,29 @@ ivas_error openCldfb_ivas_fx(
    const Word32 sampling_rate,       /* i  : sampling rate                     */
    CLDFB_PROTOTYPE prototype          /* i  : CLDFB version (1.25ms/5ms delay)  */
);

Word32 rand_gauss_fx(
    Word32 *x,
    Word16 *seed,
    Word16 q
);

void resampleCldfb_ivas_fx(
    HANDLE_CLDFB_FILTER_BANK hs, /* i/o: filter bank handle  */
    const Word32 newSamplerate
);

void generate_masking_noise_dirac_fx(
    HANDLE_FD_CNG_COM hFdCngCom,      /* i/o: FD_CNG structure containing all buffers and variables */
    HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i  : filterbank state                                      */
    Word32 *tdBuffer_fx,                  /* i/o: time-domain signal, if NULL no LB-CNA                 */
    Word32 *Cldfb_RealBuffer_fx,          /* o  : CLDFD real buffer                                     */
    Word32 *Cldfb_ImagBuffer_fx,          /* o  : CLDFD imaginary buffer                                */
    const Word16 slot_index,         /* i  : CLDFB slot index                                      */
    const Word16 cna_flag,           /* i  : CNA flag for LB and HB                                */
    const Word16 fd_cng_flag,         /* i  : FD-CNG flag for HB                                    */
    Word16 q_input,
    Word16 *q_cldfb
);

#endif
Loading