Commit 5e67b847 authored by vaclav's avatar vaclav
Browse files

Merge branch '55-correction-of-encoder-printouts' into 'main'

Resolve "Correction of encoder printouts"

See merge request !54
parents 7b42994a 2f4f22da
Loading
Loading
Loading
Loading
+39 −22
Original line number Diff line number Diff line
@@ -366,9 +366,10 @@ int main(
    {
        if ( bandwidth == IVAS_ENC_BANDWIDTH_NB && arg.inputFormat != IVAS_ENC_INPUT_MONO )
        {
            fprintf( stdout, "\nNB coding not supported in IVAS. Switching to WB.\n" );
            fprintf( stdout, "\nNB coding not supported in IVAS. Switching to WB.\n\n" );
        }

        else
        {
            switch ( bandwidth )
            {
                case IVAS_ENC_BANDWIDTH_UNDEFINED:
@@ -391,6 +392,11 @@ int main(
                    goto cleanup;
            }
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Handle Channel-aware mode
     *------------------------------------------------------------------------------------------*/

    IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig = arg.caConfig;

@@ -410,6 +416,13 @@ int main(
        fprintf( stdout, "Channel-aware mode:     ON, FEC indicator : %s  FEC offset: %d \n\n", ( caConfig.fec_indicator == IVAS_ENC_FEC_LO ) ? "LO" : "HI", caConfig.fec_offset );
    }

    if ( arg.inputFormat != IVAS_ENC_INPUT_MONO && ( caConfig.channelAwareModeEnabled || arg.ca_config_file ) )
    {
        fprintf( stderr, "Channel-aware mode is not supported in IVAS.\n\n" );
        usage_enc();
        goto cleanup;
    }

    /*------------------------------------------------------------------------------------------*
     * Configure and initialize (allocate memory for static variables) the encoder
     *------------------------------------------------------------------------------------------*/
@@ -468,7 +481,11 @@ int main(
            goto cleanup;
    }

    IVAS_ENC_PrintConfig( hIvasEnc, caConfig.channelAwareModeEnabled );
    if( ( error = IVAS_ENC_PrintConfig( hIvasEnc, caConfig.channelAwareModeEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\n IVAS_ENC_PrintConfig failed %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
        goto cleanup;
    }

    /*------------------------------------------------------------------------------------------*
     * Open input metadata files
+14 −16
Original line number Diff line number Diff line
@@ -698,7 +698,14 @@ static ivas_error configureEncoder(
    {
        if ( !is_IVAS_bitrate( hEncoderConfig->ivas_total_brate ) )
        {
            return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in IVAS: %d", hEncoderConfig->ivas_total_brate );
            if( hEncoderConfig->Opt_SC_VBR )
            {
                return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in IVAS [bps]: %d", ACELP_5k90 );
            }
            else
            {
                return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in IVAS [bps]: %d", hEncoderConfig->ivas_total_brate );
            }
        }

        if ( hEncoderConfig->ivas_format == STEREO_FORMAT )
@@ -865,11 +872,6 @@ static ivas_error configureEncoder(
        return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." );
    }

    if ( hEncoderConfig->ivas_format != MONO_FORMAT && hEncoderConfig->Opt_RF_ON )
    {
        return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Channel-aware mode is not supported in IVAS yet." );
    }

#ifdef SBA_CLEANING
    if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) )
#else
@@ -1322,7 +1324,9 @@ const char *IVAS_ENC_GetErrorMessage(
        case IVAS_ERR_OK:
            return "no error";
        case IVAS_ERR_FAILED_ALLOC:
            return "memory error";
            return "Failed allocation error";
        case IVAS_ERR_WRONG_PARAMS:
            return "wrong parameters";
        case IVAS_ERR_INVALID_BANDWIDTH:
            return "invalid bandwidth";
        case IVAS_ERR_INVALID_DTX_UPDATE_RATE:
@@ -1549,17 +1553,13 @@ static ivas_error printConfigInfo_enc(

    if ( st_ivas->hEncoderConfig->Opt_SC_VBR && !hEncoderConfig->Opt_DTX_ON )
    {
        return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: SC-VBR 5900 bps not supported without DTX\n\n" );
        return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "\nError: SC-VBR 5900 bps not supported without DTX\n\n" );
    }

    if ( hIvasEnc->maxBandwidthUser )
    {
        fprintf( stdout, "\nBandwidth limited to %s.\n", max_bwidth_string );
    }
    if ( hIvasEnc->maxBandwidthUser && hEncoderConfig->max_bwidth < FB && hEncoderConfig->input_Fs == 48000 )
    {
        fprintf( stdout, "\nBandwidth limited to %s. To enable FB coding, please use -max_band FB.\n", max_bwidth_string );
    }

    if ( hEncoderConfig->ivas_format == MONO_FORMAT )
    {
@@ -2003,14 +2003,12 @@ static ivas_error forcedModeApiToInternal(
 *
 *---------------------------------------------------------------------*/

void IVAS_ENC_PrintConfig(
ivas_error IVAS_ENC_PrintConfig(
    const IVAS_ENC_HANDLE hIvasEnc,       /* i  : IVAS encoder handle             */
    const int16_t channelAwareModeEnabled /* i  : channel-aware mode enabled flag */
)
{
    printConfigInfo_enc( hIvasEnc, channelAwareModeEnabled );

    return;
    return printConfigInfo_enc( hIvasEnc, channelAwareModeEnabled );
}


+1 −1
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ const char *IVAS_ENC_GetErrorMessage(
);


void IVAS_ENC_PrintConfig(
ivas_error IVAS_ENC_PrintConfig(
    const IVAS_ENC_HANDLE hIvasEnc,                 /* i  : IVAS encoder handle                                                                                 */
    const int16_t channelAwareModeEnabled           /* i  : channel-aware mode enabled flag                                                                     */
);