Commit df121ec9 authored by Nishant S Kulgod's avatar Nishant S Kulgod
Browse files

commit 1

parent b8035fc8
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3577,12 +3577,20 @@ Word16 div_l( Word32 L_num, Word16 den )

    if ( den == (Word16) 0 )
    {
#ifdef IVAS_FLOAT_FIXED
        /* NOTE: This is just for temporary usage for identifying crashes */
        assert( 0 );
#endif // IVAS_FLOAT_FIXED
        /* printf("Division by 0 in div_l, Fatal error in "); printStack(); */
        exit( -1 );
    }

    if ( ( L_num < (Word32) 0 ) || ( den < (Word16) 0 ) )
    {
#ifdef IVAS_FLOAT_FIXED
        /* NOTE: This is just for temporary usage for identifying crashes */
        assert( 0 );
#endif // IVAS_FLOAT_FIXED
        /* printf("Division Error in div_l, Fatal error in "); printStack(); */
        exit( -1 );
    }
+2 −2
Original line number Diff line number Diff line
@@ -95,14 +95,14 @@ static void calc_rc0_h(


/*----------------------------------------------------------------------------
 * calc_st_filt_fx()
 * calc_st_filt()
 *
 * computes impulse response of A(gamma2) / A(gamma1)
 * controls gain : computation of energy impulse response as
 *                 SUMn  (abs (h[n])) and computes parcor0
 *---------------------------------------------------------------------------- */

void calc_st_filt_fx(
void calc_st_filt(
    const float *apond2,   /* i  : coefficients of numerator               */
    const float *apond1,   /* i  : coefficients of denominator             */
    float *parcor0,        /* o  : 1st parcor calcul. on composed filter   */
+44 −1
Original line number Diff line number Diff line
@@ -1614,7 +1614,7 @@ void configureCldfb_ivas_fx(
 *
 * open and configures a CLDFB handle
 *--------------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
ivas_error openCldfb_ivas(
    HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle                */
    CLDFB_TYPE type,                   /* i  : analysis or synthesis             */
@@ -1667,7 +1667,50 @@ ivas_error openCldfb_ivas(

    return IVAS_ERR_OK;
}
#else
ivas_error openCldfb_ivas(
  HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle                */
  CLDFB_TYPE type,                   /* i  : analysis or synthesis             */
  const int32_t sampling_rate,       /* i  : sampling rate                     */
  CLDFB_PROTOTYPE prototype          /* i  : CLDFB version (1.25ms/5ms delay)  */
)
{
  HANDLE_CLDFB_FILTER_BANK hs;
  int16_t buf_len;

  if ((hs = (HANDLE_CLDFB_FILTER_BANK)malloc(sizeof(CLDFB_FILTER_BANK))) == NULL)
  {
    return IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB");
  }

  hs->type = type;
  hs->prototype = prototype;

  configureCldfb_ivas(hs, sampling_rate);
  hs->memory_flt = NULL;
  hs->memory_length = 0;

  if (type == CLDFB_ANALYSIS)
  {
    buf_len = hs->p_filter_length - hs->no_channels;
  }
  else
  {
    buf_len = hs->p_filter_length;
  }

  if ((hs->cldfb_state = (float *)malloc(buf_len * sizeof(float))) == NULL)
  {
    return IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB");
  }

  set_f(hs->cldfb_state, 0.0f, buf_len);

  *h_cldfb = hs;

  return IVAS_ERR_OK;
}
#endif
#ifdef IVAS_FLOAT_FIXED
ivas_error openCldfb_ivas_fx(
    HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle                */
+19 −7
Original line number Diff line number Diff line
@@ -787,6 +787,16 @@ void ivas_ism_reset_metadata_enc(

    return;
}

void ivas_ism_reset_metadata_API(
  ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle     */
)
{
  ivas_ism_reset_metadata_enc(hIsmMeta);

  return;
}

#else
void ivas_ism_reset_metadata(
    ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle     */
@@ -802,6 +812,15 @@ void ivas_ism_reset_metadata(

    return;
}

void ivas_ism_reset_metadata_API(
  ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle     */
)
{
  ivas_ism_reset_metadata(hIsmMeta);

  return;
}
#endif

/*-------------------------------------------------------------------*
@@ -810,14 +829,7 @@ void ivas_ism_reset_metadata(
 * Reset ISM metadata parameters
 *-------------------------------------------------------------------*/

void ivas_ism_reset_metadata_API(
    ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle     */
)
{
    ivas_ism_reset_metadata_enc( hIsmMeta );

    return;
}


/*-------------------------------------------------------------------*
+17 −4
Original line number Diff line number Diff line
@@ -503,7 +503,7 @@ ivas_error ivas_core_enc(
    const int16_t ivas_format,                                   /* i  : IVAS format                            */
    const int16_t flag_16k_smc                                   /* i  : flag to indicate if the OL SMC is run at 16 kHz */
);

#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_core_dec(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    SCE_DEC_HANDLE hSCE,                                        /* i/o: SCE decoder structure                   */
@@ -515,6 +515,20 @@ ivas_error ivas_core_dec(
    Word32 DFT_fx[CPE_CHANNELS][STEREO_DFT_BUF_MAX],                /* o  : DFT buffers                             */
    const int16_t sba_dirac_stereo_flag                         /* i  : signal stereo output for SBA DirAC      */
);
#else
ivas_error ivas_core_dec(
  Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
  SCE_DEC_HANDLE hSCE,                                        /* i/o: SCE decoder structure                   */
  CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure                   */
  MCT_DEC_HANDLE hMCT,                                        /* i/o: MCT decoder structure                   */
  const int16_t n_channels,                                   /* i  : number of channels to be decoded        */
  float *output[],                                            /* o  : output synthesis signal                 */
  float outputHB[][L_FRAME48k],                               /* o  : output HB synthesis signal              */
  float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX],                /* o  : DFT buffers                             */
  const int16_t sba_dirac_stereo_flag                         /* i  : signal stereo output for SBA DirAC      */
);
#endif


void encod_gen_2sbfr(
    Encoder_State *st,                                          /* i/o: state structure                         */
@@ -1095,11 +1109,10 @@ void bitbudget_to_brate(
void ivas_ism_reset_metadata(
    ISM_METADATA_HANDLE hIsmMeta                                /* i/o: ISM metadata handles                        */
);
#ifdef IVAS_FLOAT_FIXED //to be removed when converting encoder

void ivas_ism_reset_metadata_enc(
    ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle     */
);
#endif
void ivas_ism_reset_metadata_API(
    ISM_METADATA_HANDLE hIsmMeta                                /* i/o: ISM metadata handles                        */
);
@@ -4982,7 +4995,7 @@ void FdCngEncodeDiracMDCTStereoSID(
    CPE_ENC_HANDLE hCPE                                         /* i/o: CPE encoder state structure             */
);

void FdCngDecodeDiracMDCTStereoSID_fx(
void FdCngDecodeDiracMDCTStereoSID(
    CPE_DEC_HANDLE hCPE                                         /* i/o: CPE decoder state structure             */
);

Loading