Commit a3f4c871 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[revert] whitespace changes

parent ee4a0f8d
Loading
Loading
Loading
Loading
Loading
+21 −96
Original line number Diff line number Diff line
@@ -824,20 +824,12 @@ int main(
    if ( args.sceneDescriptionInput )
    {
        /* With scene description input, inputFilePath is the path to the scene description file. Parse it. */
        parseSceneDescriptionFile( args.inputFilePath,
                                   audioFilePath,
                                   &args.inConfig,
                                   positionProvider,
                                   masaReaders,
                                   lfeRoutingConfigs );
        parseSceneDescriptionFile( args.inputFilePath, audioFilePath, &args.inConfig, positionProvider, masaReaders, lfeRoutingConfigs );
    }
    else
    {
        /* With single-format input, all information is given on command line. */
        setupWithSingleFormatInput( args,
                                    audioFilePath,
                                    positionProvider,
                                    masaReaders );
        setupWithSingleFormatInput( args, audioFilePath, positionProvider, masaReaders );
    }

    /* Check that there is allowed configuration for MASA format output */
@@ -903,15 +895,7 @@ int main(

    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );

    if ( ( error = IVAS_REND_Open( &hIvasRend,
                                   args.sampleRate,
                                   args.outConfig.audioConfig,
                                   !isEmptyString( args.customHrtfFilePath ),
                                   args.nonDiegeticPan,
                                   args.nonDiegeticPanGain,
                                   args.Opt_Headrotation,
                                   args.Opt_ExternalOrientation,
                                   (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
@@ -1234,9 +1218,7 @@ int main(
            goto cleanup;
        }

        if ( ( error = IVAS_REND_SetInputGain( hIvasRend,
                                               mcIds[i],
                                               args.inputGainGlobal * dBToLin( args.inConfig.multiChannelBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_REND_SetInputGain( hIvasRend, mcIds[i], args.inputGainGlobal * dBToLin( args.inConfig.multiChannelBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_REND_SetInputGain failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
@@ -1269,11 +1251,7 @@ int main(
        /* set panning gains for input LFE */
        else if ( args.lfePanningEnabled )
        {
            if ( ( error = IVAS_REND_SetInputLfePos( hIvasRend,
                                                     mcIds[i],
                                                     args.lfeConfigGain,
                                                     args.lfeConfigAzimuth,
                                                     args.lfeConfigElevation ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_REND_SetInputLfePos( hIvasRend, mcIds[i], args.lfeConfigGain, args.lfeConfigAzimuth, args.lfeConfigElevation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_REND_SetInputLfePos failed: %s\n", ivas_error_to_string( error ) );
                goto cleanup;
@@ -1302,11 +1280,7 @@ int main(
                /* set position based gains */
                else
                {
                    if ( ( error = IVAS_REND_SetInputLfePos( hIvasRend,
                                                             mcIds[i],
                                                             lfeRoutingConfigs[i]->lfe_gain_dB,
                                                             lfeRoutingConfigs[i]->lfe_azi,
                                                             lfeRoutingConfigs[i]->lfe_ele ) ) != IVAS_ERR_OK )
                    if ( ( error = IVAS_REND_SetInputLfePos( hIvasRend, mcIds[i], lfeRoutingConfigs[i]->lfe_gain_dB, lfeRoutingConfigs[i]->lfe_azi, lfeRoutingConfigs[i]->lfe_ele ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nIVAS_REND_SetInputLfePos failed: %s\n", ivas_error_to_string( error ) );
                        goto cleanup;
@@ -1324,9 +1298,7 @@ int main(
            goto cleanup;
        }

        if ( ( error = IVAS_REND_SetInputGain( hIvasRend,
                                               ismIds[i],
                                               args.inputGainGlobal * dBToLin( args.inConfig.audioObjects[i].gain_dB ) ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_REND_SetInputGain( hIvasRend, ismIds[i], args.inputGainGlobal * dBToLin( args.inConfig.audioObjects[i].gain_dB ) ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_REND_SetInputGain failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
@@ -1347,9 +1319,7 @@ int main(
            goto cleanup;
        }

        if ( ( error = IVAS_REND_SetInputGain( hIvasRend,
                                               sbaIds[i],
                                               args.inputGainGlobal * dBToLin( args.inConfig.ambisonicsBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_REND_SetInputGain( hIvasRend, sbaIds[i], args.inputGainGlobal * dBToLin( args.inConfig.ambisonicsBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_REND_SetInputGain failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
@@ -1364,9 +1334,7 @@ int main(
            goto cleanup;
        }

        if ( ( error = IVAS_REND_SetInputGain( hIvasRend,
                                               masaIds[i],
                                               args.inputGainGlobal * dBToLin( args.inConfig.masaBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_REND_SetInputGain( hIvasRend, masaIds[i], args.inputGainGlobal * dBToLin( args.inConfig.masaBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_REND_SetInputGain failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
@@ -1398,11 +1366,7 @@ int main(

    if ( cldfb_in_flag )
    {
        if ( ( error = IVAS_REND_openCldfb( cldfbAna,
                                            cldfbSyn,
                                            totalNumInChannels,
                                            numOutChannels,
                                            args.sampleRate ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_REND_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_openCldfb(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
@@ -1433,16 +1397,7 @@ int main(
            goto cleanup;
        }

        if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite,
                                               outFile,
                                               delayNumSamples_temp,
                                               delayTimeScale_temp,
                                               bitsBuffer.config.codec,
                                               bitsBuffer.config.poseCorrection,
                                               bitsBuffer.config.codec_frame_size_ms,
                                               bitsBuffer.config.isar_frame_size_ms,
                                               args.sampleRate,
                                               bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", outFile );
            goto cleanup;
@@ -1544,9 +1499,7 @@ int main(
                    args.aeSequence.selected = 0;
                }
                args.aeSequence.frameCounter = 0;
                if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader,
                                                                          args.aeSequence.pID[args.aeSequence.selected],
                                                                          &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
                if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.aeSequence.pID[args.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
                {
                    if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                    {
@@ -1675,12 +1628,7 @@ int main(
            int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
            {
                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader,
                                                               &quatBuffer[sf_idx],
                                                               &enableHeadRotation[sf_idx],
                                                               &enableExternalOrientation[sf_idx],
                                                               &enableRotationInterpolation[sf_idx],
                                                               &numFramesToTargetOrientation[sf_idx] ) ) != IVAS_ERR_OK )
                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[sf_idx], &enableHeadRotation[sf_idx], &enableExternalOrientation[sf_idx], &enableRotationInterpolation[sf_idx], &numFramesToTargetOrientation[sf_idx] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in External Orientation File Reading: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
@@ -1688,13 +1636,7 @@ int main(
            }
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
            {
                if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend,
                                                                 &quatBuffer[sf_idx],
                                                                 enableHeadRotation[sf_idx],
                                                                 enableExternalOrientation[sf_idx],
                                                                 enableRotationInterpolation[sf_idx],
                                                                 numFramesToTargetOrientation[sf_idx],
                                                                 sf_idx ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx], sf_idx ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError setting External Orientation: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
@@ -1717,9 +1659,7 @@ int main(
                fprintf( stderr, "\nIVAS_REND_GetInputNumChannels failed: %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
            IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer,
                                                                            (int16_t) args.inConfig.multiChannelBuses[i].inputChannelIndex,
                                                                            numChannels );
            IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.multiChannelBuses[i].inputChannelIndex, numChannels );

            if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, mcIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
            {
@@ -1734,9 +1674,7 @@ int main(
            {
                if ( i == 0 )
                {
                    IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer,
                                                                                    (int16_t) args.inConfig.audioObjects[i].inputChannelIndex,
                                                                                    args.inConfig.numAudioObjects );
                    IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.audioObjects[i].inputChannelIndex, args.inConfig.numAudioObjects );

                    if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, ismIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
                    {
@@ -1753,9 +1691,7 @@ int main(
            }
            else
            {
                IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer,
                                                                                (int16_t) args.inConfig.audioObjects[i].inputChannelIndex,
                                                                                1 );
                IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.audioObjects[i].inputChannelIndex, 1 );

                if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, ismIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
                {
@@ -1778,9 +1714,7 @@ int main(
                fprintf( stderr, "\nIVAS_REND_GetInputNumChannels failed: %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
            IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer,
                                                                            (int16_t) args.inConfig.ambisonicsBuses[i].inputChannelIndex,
                                                                            numChannels );
            IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.ambisonicsBuses[i].inputChannelIndex, numChannels );

            if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, sbaIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
            {
@@ -1796,9 +1730,7 @@ int main(
                fprintf( stderr, "IVAS_REND_GetInputNumChannels failed: %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
            IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer,
                                                                            (int16_t) args.inConfig.masaBuses[i].inputChannelIndex,
                                                                            numChannels );
            IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.masaBuses[i].inputChannelIndex, numChannels );

            if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, masaIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
            {
@@ -1848,12 +1780,7 @@ int main(

        /* Convert from float to int and from packed to interleaved.
         * Values in outFloatBuffer are guaranteed to be within range INT16_MIN:INT16_MAX */
        convertOutputBuffer( outFloatBuffer,
                             outBuffer.config.numSamplesPerChannel,
                             num_out_channels,
                             outInt16Buffer,
                             cldfb_in_flag,
                             cldfbSyn );
        convertOutputBuffer( outFloatBuffer, outBuffer.config.numSamplesPerChannel, num_out_channels, outInt16Buffer, cldfb_in_flag, cldfbSyn );

        if ( delayNumSamples == -1 )
        {
@@ -1888,9 +1815,7 @@ int main(
        {
            if ( delayNumSamples * num_out_channels < outBufferSize )
            {
                if ( AudioFileWriter_write( audioWriter,
                                            &outInt16Buffer[delayNumSamples * num_out_channels],
                                            outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
                if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError writing audio file %s\n", args.outputFilePath );
                    goto cleanup;
+4 −25
Original line number Diff line number Diff line
@@ -3655,13 +3655,7 @@ static ivas_error isar_pre_rend_init(
            isar_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData );
        }

        if ( ( error = ISAR_PRE_REND_open( pSplitRendWrapper,
                                           pSplit_rend_config,
                                           outputSampleRate,
                                           cldfb_in_flag,
                                           outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM,
                                           num_subframes,
                                           0 ) ) != IVAS_ERR_OK )
        if ( ( error = ISAR_PRE_REND_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, num_subframes, 0 ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -4634,14 +4628,7 @@ ivas_error IVAS_REND_FeedRenderConfig(
            hIvasRend->splitRendWrapper = NULL;
        }

        if ( ( error = isar_pre_rend_init( hIvasRend->splitRendWrapper,
                                           &hIvasRend->splitRendEncBuffer,
                                           &hIvasRend->hRendererConfig->split_rend_config,
                                           hIvasRend->headRotData,
                                           hIvasRend->sampleRateOut,
                                           hIvasRend->outputConfig,
                                           cldfb_in_flag,
                                           hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        if ( ( error = isar_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -5804,16 +5791,8 @@ static ivas_error renderIsmToSplitBinaural(
        }

        /* Render */
        if ( ( error = ivas_td_binaural_renderer_ext( ( pos_idx == 0 ) ? &ismInput->tdRendWrapper : &ismInput->splitTdRendWrappers[pos_idx - 1],
                                                      ismInput->base.inConfig,
                                                      NULL,
                                                      ismInput->base.ctx.pCombinedOrientationData,
                                                      &ismInput->currentPos,
                                                      NULL,
                                                      ism_md_subframe_update_ext,
                                                      *ismInput->base.ctx.pOutSampleRate,
                                                      output_frame,
                                                      tmpProcessing ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_td_binaural_renderer_ext( ( pos_idx == 0 ) ? &ismInput->tdRendWrapper : &ismInput->splitTdRendWrappers[pos_idx - 1], ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos,
                                                      NULL, ism_md_subframe_update_ext, *ismInput->base.ctx.pOutSampleRate, output_frame, tmpProcessing ) ) != IVAS_ERR_OK )
        {
            return error;
        }