Commit 60b765fe authored by vaclav's avatar vaclav
Browse files

maintenance: formatting, add error returns

parent 0fc9528d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -590,10 +590,12 @@
    <ClCompile Include="..\lib_enc\ivas_mc_paramupmix_enc.c">
      <Filter>enc_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_enc\ivas_osba_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_omasa_enc.c">
      <Filter>enc_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_enc\ivas_osba_enc.c">
      <Filter>enc_ivas_c</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_enc\ivas_stat_enc.h">
+8 −20
Original line number Diff line number Diff line
@@ -407,15 +407,7 @@ int main(
            break;
        case IVAS_ENC_INPUT_SBA:
            if ( ( error =
                       IVAS_ENC_ConfigureForAmbisonics(
                           hIvasEnc,
                           arg.inputFs,
                           totalBitrate,
                           arg.max_bwidth_user,
                           bandwidth,
                           arg.dtxConfig,
                           arg.inputFormatConfig.sba.order,
                           arg.inputFormatConfig.sba.isPlanar,
                       IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar,
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
                                                        arg.agc,
#endif
@@ -445,7 +437,6 @@ int main(
                goto cleanup;
            }
            break;

        case IVAS_ENC_INPUT_SBA_ISM:
            if ( ( error = IVAS_ENC_ConfigureForSBAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba_ism.numObjects, arg.inputFormatConfig.sba_ism.order, arg.inputFormatConfig.sba_ism.isPlanar, arg.pca ) ) != IVAS_ERR_OK )
            {
@@ -453,7 +444,6 @@ int main(
                exit( -1 );
            }
            break;

        case IVAS_ENC_INPUT_MASA_ISM:
            if ( ( error = IVAS_ENC_ConfigureForMASAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masa_ism.numObjects, arg.inputFormatConfig.masa_ism.masaVariant ) ) != IVAS_ERR_OK )
            {
@@ -461,7 +451,6 @@ int main(
                exit( -1 );
            }
            break;

        default:
            fprintf( stderr, "\nInvalid input type\n\n" );
            goto cleanup;
@@ -512,6 +501,7 @@ int main(
        fprintf( stderr, "\nError: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
    }

    int16_t inFileNumChannels = 0;
    error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
    switch ( error )
@@ -546,9 +536,7 @@ int main(
        }
    }

    const int16_t numIsmInputs = ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_MASA_ISM || arg.inputFormat == IVAS_ENC_INPUT_SBA_ISM )
                                     ? arg.inputFormatConfig.ism.numObjects
                                     : 0;
    const int16_t numIsmInputs = ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_MASA_ISM || arg.inputFormat == IVAS_ENC_INPUT_SBA_ISM ) ? arg.inputFormatConfig.ism.numObjects : 0;

    for ( i = 0; i < numIsmInputs; ++i )
    {
+1 −1
Original line number Diff line number Diff line
@@ -4309,7 +4309,7 @@ ivas_error ivas_sba_dec_digest_tc(
    const int16_t nSamplesForRendering                          /* i  : number of samples provided              */
);

void ivas_sba_dec_render(
ivas_error ivas_sba_dec_render(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                     */
    const uint16_t nSamplesAsked,                               /* i  : number of CLDFB slots requested         */
    uint16_t *nSamplesRendered,                                 /* o  : number of CLDFB slots rendered          */
+2 −6
Original line number Diff line number Diff line
@@ -445,9 +445,7 @@ ivas_error ivas_dec(
                    ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, output );
                }

                ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi,
                                           ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate,
                                                                               st_ivas->last_active_ivas_total_brate ) );
                ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );
            }

            ivas_sba_dirac_stereo_dec( st_ivas, output, output_frame, st_ivas->ivas_format == MC_FORMAT );
@@ -690,9 +688,7 @@ ivas_error ivas_dec(
                ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &output[sba_ch_idx] );
            }

            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi,
                                       ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate,
                                                                           st_ivas->last_active_ivas_total_brate ) );
            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );

            ivas_sba_dirac_stereo_dec( st_ivas, &output[sba_ch_idx], output_frame, 0 );
        }
+6 −1
Original line number Diff line number Diff line
@@ -1069,6 +1069,10 @@ ivas_error ivas_init_decoder(
    hDecoderConfig->last_ivas_total_brate = ivas_total_brate;
    st_ivas->last_active_ivas_total_brate = ivas_total_brate;

    /*-----------------------------------------------------------------*
     * Set number of output channels for EXTERNAL output config.
     *-----------------------------------------------------------------*/

    if ( output_config == AUDIO_CONFIG_EXTERNAL )
    {
        if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
@@ -1152,7 +1156,6 @@ ivas_error ivas_init_decoder(
        }
    }


#ifdef SPLIT_REND_WITH_HEAD_ROT
    /*-----------------------------------------------------------------*
     * Initialize binuaral split rendering
@@ -2625,6 +2628,7 @@ void ivas_destroy_dec(
        free( st_ivas->hMonoDmxRenderer );
        st_ivas->hMonoDmxRenderer = NULL;
    }

    /* MASA ISM structure */
    ivas_masa_ism_data_close( &st_ivas->hMasaIsmData );

@@ -2654,6 +2658,7 @@ void ivas_destroy_dec(

    /* CRend binaural renderer handle */
    ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF );

    /* Fastconv HRTF memories */
    ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv );

Loading