Commit 9635c6b2 authored by vaclav's avatar vaclav
Browse files

introduce input_frame to init_encoder()

parent 45d9f2c1
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -64,11 +64,11 @@ ivas_error init_encoder(
    const int32_t element_brate      /* i  : element bitrate                      */
)
{
    int16_t i;
    int16_t i, input_frame;
    ivas_error error;
    int32_t igf_brate;

    error = IVAS_ERR_OK;
    input_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC );

    /*-----------------------------------------------------------------*
     * General parameters
@@ -303,11 +303,11 @@ ivas_error init_encoder(
        st->old_input_signal = st->input_buff;
        if ( st->element_mode == EVS_MONO )
        {
            st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS );
            st->input = st->input_buff + input_frame + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS );
        }
        else
        {
            st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC;
            st->input = st->input_buff + input_frame;
        }
    }
    else
@@ -475,7 +475,7 @@ ivas_error init_encoder(
        st->core = -1;
        st->rf_mode = 0;

        return error;
        return IVAS_ERR_OK;
    }

    /*-----------------------------------------------------------------*
@@ -862,11 +862,11 @@ ivas_error init_encoder(

    if ( st->element_mode > EVS_MONO )
    {
        InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), 0, st->hTranDet, 1 );
        InitTransientDetection( input_frame, 0, st->hTranDet, 1 );
    }
    else
    {
        InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 );
        InitTransientDetection( input_frame, NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 );
    }

    /*-----------------------------------------------------------------*
@@ -878,7 +878,7 @@ ivas_error init_encoder(
    st->bits_frame_channel = 0;
    st->side_bits_frame_channel = 0;

    return error;
    return IVAS_ERR_OK;
}