Commit 8bb3cf45 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ivas_enc_struct_commonization' into 'main'

IVAS encoder structure commonization for EVS/IVAS

See merge request !206
parents 07562d57 9cdc6b22
Loading
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -414,13 +414,12 @@ int main(
    /*------------------------------------------------------------------------------------------*
     * Open input audio file
     *------------------------------------------------------------------------------------------*/
    short isInputRawFile;
    if ( AudioFileReader_open( &audioReader, arg.inputWavFilename, &isInputRawFile ) != IVAS_ERR_OK )

    if ( AudioFileReader_open( &audioReader, arg.inputWavFilename ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nCan't open %s\n\n", arg.inputWavFilename );
        goto cleanup;
    }
    set_raw_file_flag( hIvasEnc, isInputRawFile );

    /* Validate input sampling rate */
    int32_t inFileSampleRate = 0;
+2 −2
Original line number Diff line number Diff line
@@ -780,8 +780,8 @@ int main(
            exit( -1 );
        }
    }
    short ignore;
    if ( AudioFileReader_open( &audioReader, audioFilePath, &ignore ) != IVAS_ERR_OK )

    if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening file: %s\n", audioFilePath );
        exit( -1 );
+2 −2
Original line number Diff line number Diff line
@@ -665,7 +665,7 @@ void write_indices_fx(
 *-------------------------------------------------------------------*/

void write_indices_buf_fx(
    Encoder_State_fx *st_fx,  /* i/o: encoder state structure */
    Encoder_State *st_fx,  /* i/o: encoder state structure */
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    UWord16 *out_buf,      /* i  : output bitstream buf   */
    UWord8 *pFrame,        /* i: byte array with bit packet and byte aligned coded speech data */
@@ -726,7 +726,7 @@ void write_indices_buf_fx(
    {
        /* Create and write ToC header */
        /*  qbit always  set to  1 on encoder side  for AMRWBIO ,  no qbit in use for EVS, but set to 0(bad)  */
        header = (UWord8) ( st_fx->Opt_AMR_WB_fx << 5 | st_fx->Opt_AMR_WB_fx << 4 | rate2EVSmode( hBstr->nb_bits_tot_fx * 50, &isAmrWb ) );
        header = (UWord8) ( st_fx->Opt_AMR_WB << 5 | st_fx->Opt_AMR_WB << 4 | rate2EVSmode( hBstr->nb_bits_tot_fx * 50, &isAmrWb ) );
        // fwrite(&header, sizeof(UWord8), 1, file);
        memcpy( out_buf, &header, sizeof( UWord8 ) );
        *num_bits += sizeof( UWord8 );
+5 −5
Original line number Diff line number Diff line
@@ -1183,7 +1183,7 @@ AnalysisPostSpectrumScaling_Fx (HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle
*--------------------------------------------------------------------*/

void analysisCldfbEncoder_fx(
    Encoder_State_fx *st_fx,              /* i/o: encoder state structure                    */
    Encoder_State *st_fx,              /* i/o: encoder state structure                    */
    const Word16 *timeIn,
    Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
@@ -1213,7 +1213,7 @@ void analysisCldfbEncoder_fx(

    /* perform analysis */
    cldfbAnalysisFiltering (
        st_fx->cldfbAna_Fx,
        st_fx->cldfbAnaEnc,
        ppBuf_Real,
        ppBuf_Imag,
        scale,
@@ -1228,7 +1228,7 @@ void analysisCldfbEncoder_fx(

    /* get 16bit respresentation */
    AnalysisPostSpectrumScaling_Fx (
        st_fx->cldfbAna_Fx,
        st_fx->cldfbAnaEnc,
        ppBuf_Real,
        ppBuf_Imag,
        ppBuf_Real16,
@@ -1243,8 +1243,8 @@ void analysisCldfbEncoder_fx(
                    ppBuf_Real16,
                    ppBuf_Imag16,
                    enerScale.lb_scale16,
                    st_fx->cldfbAna_Fx->no_channels,
                    st_fx->cldfbAna_Fx->no_col,
                    st_fx->cldfbAnaEnc->no_channels,
                    st_fx->cldfbAnaEnc->no_col,
                    &st_fx->currEnergyHF_fx,
                    &st_fx->currEnergyHF_e_fx,
                    enerBuffSum,
+2 −1
Original line number Diff line number Diff line
@@ -94,7 +94,8 @@ ivas_error create_sce_enc(

ivas_error create_evs_sce_enc(
    Encoder_Struct *st_ivas,    /* i/o: IVAS encoder structure      */
    const int16_t sce_id        /* i  : SCE # identifier            */
    const int16_t sce_id,       /* i  : SCE # identifier            */
    const int32_t element_brate /* i  : element bitrate             */
);

ivas_error create_cpe_enc(
Loading