Commit 64efb3d5 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

ISM path fixed functions integration

[x] core switching post dec fixed point implementation.
[x] Ported ivas_jbm_dec_tc_buffer_playout, ivas_syn_output functions.
parent 8e7b3fe5
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1657,6 +1657,7 @@ ivas_error openCldfb_ivas(
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" );
    }
	hs->cldfb_state_length = buf_len;//Temporarily added to store the length of buffer
	hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/
    set32_fx(hs->cldfb_state_fx, 0, buf_len);
#endif // IVAS_FLOAT_FIXED

@@ -1709,6 +1710,7 @@ ivas_error openCldfb_ivas_fx(
    }

    hs->cldfb_state_length = buf_len; // Temporarily added to store the length of buffer
	hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/
    set32_fx(hs->cldfb_state_fx, 0, buf_len);

    /* TODO: remove the floating point dependency */
+8 −0
Original line number Diff line number Diff line
@@ -1725,4 +1725,12 @@ void update_bits_next_block(
    const Word16 max_k           /* i  : n umber of subframes          */
);
#endif

UWord32 ivas_syn_output_fx(
    Word32 *synth[],             /* i/o: float synthesis signal              */
    const Word16 q_synth,
    const Word16 output_frame, /* i  : output frame length (one channel)   */
    const Word16 n_channels,   /* i  : number of output channels           */
    Word16 *synth_out          /* o  : integer 16 bits synthesis signal    */
);
#endif
+31 −0
Original line number Diff line number Diff line
@@ -151,6 +151,37 @@ uint32_t ivas_syn_output(
    return noClipping;
}

#ifdef IVAS_FLOAT_FIXED
UWord32 ivas_syn_output_fx(
    Word32 *synth[],             /* i/o: float synthesis signal              */
    const Word16 q_synth,
    const Word16 output_frame, /* i  : output frame length (one channel)   */
    const Word16 n_channels,   /* i  : number of output channels           */
    Word16 *synth_out          /* o  : integer 16 bits synthesis signal    */
)
{
    Word16 i, n;
    Word16 synth_loc[MAX_JBM_L_FRAME48k];
    UWord32 noClipping = 0;

    /*-----------------------------------------------------------------*
     * float to integer conversion with saturation control
     *-----------------------------------------------------------------*/

    FOR ( n = 0; n < n_channels; n++ )
    {
        noClipping += mvl2s_r( synth[n], q_synth, synth_loc, output_frame );

        FOR ( i = 0; i < output_frame; i++ )
        {
            synth_out[i * n_channels + n] = synth_loc[i];
        }
    }

    return noClipping;
}
#endif


/*-------------------------------------------------------------------*
 * ivas_syn_output_f()
+28 −1
Original line number Diff line number Diff line
@@ -7421,6 +7421,21 @@ void generate_comfort_noise_dec_hf_ivas_fx(
   Word16* Qsynth                /* i/o: Scaling of ACELP exit (Q_syn2-1) or HQ exit (Qsynth); changes after this function */
 );

 ivas_error core_switching_post_dec_ivas_fx(
   Decoder_State *st_fx,               /* i/o: decoder state structure                                                           */
   Word16 *synth,                      /* i/o: output synthesis Qsynth                                                           */
   Word32 *output_fx,                  /* i/o: LB synth/upsampled LB synth                                                       */
   Word16 output_mem_fx[],             /* i  : OLA memory from last TCX/HQ frame                                                 */
   const IVAS_FORMAT ivas_format,      /* i  : IVAS format                                                                       */
   const Word16 use_cldfb_for_dft,     /* i  : flag to use of CLDFB for DFT Stereo                                               */
   const Word16 output_frame,          /* i  : frame length                                                                      */
   const Word16 core_switching_flag,   /* i  : ACELP->HQ switching flag                                                          */
   const Word16 sba_dirac_stereo_flag, /* i  : signal stereo output for SBA DirAC                                                */
   const Word16 nchan_out,             /* i  : number of output channels                                                         */
   const Word16 last_element_mode,     /* i  : element mode of previous frame                                                    */
   Word16 *Qsynth                      /* i/o: Scaling of ACELP exit (Q_syn2-1) or HQ exit (Qsynth); changes after this function */
 );

 void core_switching_hq_prepare_dec_fx(
   Decoder_State *st_fx,                /* i/o: encoder state structure */
   Word16 *num_bits,          /* i/o: bit budget update       */
@@ -8939,6 +8954,11 @@ void cldfbAnalysis_ts_fx_fixed_q(
    Word16* q_cldfb
);

void configureCldfb_ivas_fx(
    HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i/o: filter bank handle        */
    const Word32 sampling_rate        /* i  : sampling rate             */
);

// dec4t64.c
void dec_acelp_fast_fx(
    Decoder_State *st,       /* i/o: decoder state structure                 */
@@ -9194,3 +9214,10 @@ void ivas_bw_switching_pre_proc_fx(
void acelp_decoder_state_float2fix(Decoder_State *st, STEREO_CNG_DEC_HANDLE hStereoCng);
void acelp_decoder_state_fix2float(Decoder_State *st, STEREO_CNG_DEC_HANDLE hStereoCng);
#endif

uint32_t mvl2s_r(
    const Word32 x[], /* i  : input vector  */
    const Word16 q,
    int16_t y[],     /* o  : output vector */
    const int16_t n  /* i  : vector size   */
);
+1 −0
Original line number Diff line number Diff line
@@ -771,6 +771,7 @@ typedef struct cldfb_filter_bank_struct
#ifdef IVAS_FLOAT_FIXED
    Word32 *cldfb_state_fx;
    Word16 cldfb_state_length;
    Word16 cldfb_size;
    Word16 Q_cldfb_state;
#endif

Loading