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

add error exit code

parent 0477b0c6
Loading
Loading
Loading
Loading
Loading
+31 −16
Original line number Diff line number Diff line
@@ -223,9 +223,6 @@ static ivas_error get_ls_conversion_matrix(
    int16_t index;
    float value;
    const LS_CONVERSION_MATRIX *conversion_matrix;
    ivas_error error;

    error = IVAS_ERR_OK;

    conversion_matrix = NULL;

@@ -260,7 +257,7 @@ static ivas_error get_ls_conversion_matrix(
                        }
                    }
                }
                return error;
                return IVAS_ERR_OK;
            }
            else
            {
@@ -273,7 +270,7 @@ static ivas_error get_ls_conversion_matrix(
                    {
                        hLsSetUpConversion->dmxMtx[k][k] = 1.0f;
                    }
                    return error;
                    return IVAS_ERR_OK;
                }
                else
                {
@@ -288,7 +285,7 @@ static ivas_error get_ls_conversion_matrix(
                        hLsSetUpConversion->dmxMtx[ch_in][ch_out] = value;
                    }
                }
                return error;
                return IVAS_ERR_OK;
            }
        }
    }
@@ -311,8 +308,10 @@ ivas_error ivas_ls_setup_conversion_open(
    int16_t chIdx, inChannels, outChannels;
    int16_t output_frame;
    int32_t output_Fs;
    int16_t nchan_out;
    int16_t paramUpmixMonoStereo;
#ifdef FIX_1314_STEREO_TO_EXT
    ivas_error error;
#endif

    if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) )
    {
@@ -323,7 +322,7 @@ ivas_error ivas_ls_setup_conversion_open(
        paramUpmixMonoStereo = FALSE;
    }
    output_Fs = st_ivas->hDecoderConfig->output_Fs;
    nchan_out = st_ivas->hDecoderConfig->nchan_out;
    outChannels = st_ivas->hDecoderConfig->nchan_out;
    output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC );

    /* Allocate memory to the handle */
@@ -332,9 +331,8 @@ ivas_error ivas_ls_setup_conversion_open(
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LS configuration Conversion Handle \n" ) );
    }

    assert( nchan_out <= MAX_OUTPUT_CHANNELS );
    assert( outChannels <= MAX_OUTPUT_CHANNELS );

    outChannels = nchan_out;
    if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC )
    {
        inChannels = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe;
@@ -423,16 +421,37 @@ ivas_error ivas_ls_setup_conversion_open(
        {
            if ( paramUpmixMonoStereo == TRUE )
            {
#ifdef FIX_1314_STEREO_TO_EXT
                if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#else
                get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config );
#endif
            }
            else
            {
#ifdef FIX_1314_STEREO_TO_EXT
                if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#else
                get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config );
#endif
            }
        }
        else
        {
#ifdef FIX_1314_STEREO_TO_EXT
            if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#else
            get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config );
#endif
        }
    }

@@ -633,9 +652,7 @@ void ivas_ls_setup_conversion_process_mdct(
        {
            dmxCoeff = hLsSetUpConversion->dmxMtx[chInIdx][chOutIdx];

            if (
                chInIdx != LFE_CHANNEL &&
                mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE )
            if ( chInIdx != LFE_CHANNEL && mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE )
            {
                /* Step 1: Compute the target energy and DMX signal (possible since we have all signals in TCX20 resolution) */
                if ( dmxCoeff )
@@ -728,9 +745,7 @@ void ivas_ls_setup_conversion_process_mdct(
    /* Step 4: Perform equalization */
    for ( chInIdx = 0; chInIdx < inChannels; chInIdx++ )
    {
        if (
            chInIdx != LFE_CHANNEL &&
            mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE )
        if ( chInIdx != LFE_CHANNEL && mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE )
        {
            if ( transform_type[chInIdx][0] == TCX_20 )
            {