Commit 10e93071 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 684-update-of-readme-txt

parents 28c0217b 4dae1328
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -179,6 +179,19 @@ ivas_error ivas_dec(

    if ( st_ivas->bfi && st_ivas->ini_frame == 0 )
    {
#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
        for ( n = 0; n < nchan_out; n++ )
        {
            /* note: these are intra-frame heap memories */
            if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) );
            }
            output[n] = st_ivas->p_output_f[n];
            p_output[n] = output[n];
        }
#endif

        /* zero output when first frame(s) is lost */
        for ( n = 0; n < nchan_out; n++ )
        {
@@ -1255,6 +1268,18 @@ ivas_error ivas_dec(
    st_ivas->last_ivas_format = st_ivas->ivas_format;
#endif

#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP
    /* in case first frame(s) was/were lost, deallocate output buffers */
    if ( st_ivas->bfi && st_ivas->ini_frame == 0 )
    {
        for ( n = 0; n < nchan_out; n++ )
        {
            free( st_ivas->p_output_f[n] );
            st_ivas->p_output_f[n] = NULL;
        }
    }
#endif

#ifdef DEBUG_MODE_INFO
    dbgwrite( &st_ivas->bfi, sizeof( int16_t ), 1, output_frame, "res/bfi" );
    dbgwrite( &st_ivas->BER_detect, sizeof( int16_t ), 1, output_frame, "res/BER_detect" );
+5 −1
Original line number Diff line number Diff line
@@ -417,7 +417,11 @@ ivas_error ivas_init_encoder(
     *-----------------------------------------------------------------*/

    nchan_inp_buff = hEncoderConfig->nchan_inp;
    if ( ivas_format == MASA_ISM_FORMAT )
    if ( ivas_format == MONO_FORMAT )
    {
        nchan_inp_buff = 0;
    }
    else if ( ivas_format == MASA_ISM_FORMAT )
    {
        if ( hEncoderConfig->nchan_inp - hEncoderConfig->nchan_ism == 1 ) /* mono is duplicated in monoMASA */
        {
+5 −1
Original line number Diff line number Diff line
@@ -274,7 +274,11 @@ int16_t ivas_get_nchan_buffers_dec(

    nchan_out_buff = MAX_OUTPUT_CHANNELS;

    if ( st_ivas->ivas_format == STEREO_FORMAT )
    if ( st_ivas->ivas_format == MONO_FORMAT )
    {
        nchan_out_buff = 0;
    }
    else if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
        nchan_out_buff = max( st_ivas->hDecoderConfig->nchan_out, CPE_CHANNELS );
    }