Commit 2dff3ba4 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge remote-tracking branch 'origin/float-pc' into 1626_ref+porting-mr-111-port-mr-1433-to-float

parents 34fabe3c fbcb8e94
Loading
Loading
Loading
Loading
Loading

.gitattributes

0 → 100644
+24 −0
Original line number Diff line number Diff line
# Default behavior. Converts all text files to use LF in repository.
* text=auto

# List all known generic text files
*.c text
*.csv text
*.h text
*.json text
*.m text
*.md text
*.prm text
*.py text
*.txt text

# Set Windows specific text files to always use CRLF in working tree.
*.bat text eol=crlf
*.cmd text eol=crlf
*.sln text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf

# Set Unix specific text files to always use LF (also covers Windows subsystem for Linux) in working tree
*.sh text eol=lf
+11 −12
Original line number Diff line number Diff line
@@ -12,13 +12,15 @@ variables:
  LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  TEST_SUITE: ""
  DISABLE_HRTF_MODEL_TESTS: ""
  # DISABLE_HRTF_MODEL_TESTS: "-k not model" #enable this declaration to disable HRTF model from file tests
  DUT_ENCODER_PATH: "./IVAS_cod"
  DUT_DECODER_PATH: "./IVAS_dec"
  REF_ENCODER_PATH: "./IVAS_cod_ref"
  REF_DECODER_PATH: "./IVAS_dec_ref"
  LEVEL_SCALING: "1.0"
  IVAS_PIPELINE_NAME: ''
  BASOP_CI_BRANCH_PC_REPO: "basop-ci-branch"
  BASOP_CI_BRANCH_PC_REPO: "basop-ci-branch-pc"
  PRM_FILES: "scripts/config/self_test.prm scripts/config/self_test_ltv.prm"
  TESTCASE_TIMEOUT_STV: 900
  TESTCASE_TIMEOUT_LTV: 2400
@@ -236,10 +238,12 @@ stages:
  - sed -i '/fetch/d' .git/config # Remove all fetch lines to clean out dead links
  - git remote set-branches --add origin "$BASOP_CI_BRANCH_PC_REPO" # Add currently used branch
  - git fetch
  - git restore --staged . # Needed if HRTF model files were updated.
  - git restore . # Just as a precaution
  - git checkout "$BASOP_CI_BRANCH_PC_REPO"
  - git reset --hard origin/"$BASOP_CI_BRANCH_PC_REPO"
  - git pull

  - cd -
  - cp -r $SCRIPTS_DIR/ci .
  - cp -r $SCRIPTS_DIR/scripts .
@@ -487,7 +491,7 @@ stages:

.build-job-linux:
  stage: build
  timeout: "2 minutes"
  timeout: "20 minutes"
  needs: []
  tags:
    - ivas-basop-linux
@@ -1705,7 +1709,7 @@ codec-smoke-test:
    # LTV update needed as ltv ISM metadata files are used
    - *update-ltv-repo
    - python3 scripts/smoketest-basop-filter.py scripts/config/ivas_modes.json --inline
    - bash ci/smoke_test.sh
    - bash ci/smoke_test.sh || true
    - tar cJf logs.tar.xz out/logs/
    - ls -al logs.tar.*
    ### analyze for failures
@@ -2030,7 +2034,7 @@ ivas-pytest-on-merge-request:

    ### prepare pytest
    # create references
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 $DISABLE_HRTF_MODEL_TESTS

    ### Run test using branch scripts and input
    - if [ $ref_using_target == 1 ]; then git checkout $source_branch_commit_sha; fi
@@ -2038,7 +2042,7 @@ ivas-pytest-on-merge-request:
    ### run pytest
    - exit_code=0
    - testcase_timeout=60
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$?
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout $DISABLE_HRTF_MODEL_TESTS || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

    - *merge-request-comparison-check
@@ -2122,13 +2126,11 @@ ivas-interop-on-merge-request:

  - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_COMMIT_REF_NAME $CI_JOB_NAME $CI_PROJECT_ID)
  - echo $job_id
  - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$job_id/artifacts" --output artifacts.zip
  - unzip artifacts.zip || true # this may fail on first run, when there are no artifacts there and the zip file is actually just "404"-html
  - ls
  - curl --silent --show-error  --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$job_id/artifacts" --output artifacts.zip
  - unzip -qq artifacts.zip || true # this may fail on first run, when there are no artifacts there and the zip file is actually just "404"-html
  - public_dir="$CI_JOB_NAME-public"
  # if is needed to catch case when no artifact is there (first run), similarly as above
  - if [[ -d $public_dir ]]; then mv $public_dir/* wmops/;  fi
  - ls wmops
  - rm artifacts.zip
  - rm -rf $public_dir

@@ -2141,8 +2143,6 @@ ivas-interop-on-merge-request:
  - mkdir $public_dir/logs
  # first move logs
  - log_files=$(cat $public_dir/graphs*.js | grep logFile | sed "s/.*\(wmops_newsletter_.*\.csv\).*/\1/g")
  - echo $log_files
  - ls wmops/logs
  - for f in $log_files; do [ -f wmops/logs/$f ] && mv wmops/logs/$f $public_dir/logs/$f; done
  - mv wmops/logs/latest_WMOPS.csv $public_dir/logs/
  # copy index page blueprint
@@ -2151,7 +2151,6 @@ ivas-interop-on-merge-request:
  - sed -i "s/IVAS FORMAT/IVAS $in_format to $out_format/g" ${public_dir}/index.html
  # do separately here to avoid overwrite complaints by mv
  - mv -f ci/complexity_measurements/style.css ${public_dir}/
  - ls $public_dir

.complexity-template:
  extends:
+59 −245

File changed.

Preview size limit exceeded, changes collapsed.

+6 −5
Original line number Diff line number Diff line
@@ -709,11 +709,7 @@ int main(
        {
            if ( ( error = JbmFileReader_readCAconfig( jbmReader, &caConfig ) ) != IVAS_ERR_OK )
            {
#ifdef FIX_699_FILE_READER_JBM_TSM
                fprintf( stderr, "\nError (%s) while reading Channel-Aware Config. from: %s\n\n", IVAS_ENC_GetErrorMessage( error ), JbmFileReader_getFilePath( jbmReader ) );
#else
                fprintf( stderr, "JbmFileReader_readCAconfig() failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
#endif
                goto cleanup;
            }

@@ -789,7 +785,12 @@ int main(
        }

        /* *** Encode one frame *** */
        if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits
#ifdef DBG_BITSTREAM_ANALYSIS
                                                     ,
                                                     frame
#endif
                                                     ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
            goto cleanup;
+77 −106
Original line number Diff line number Diff line
@@ -32,17 +32,6 @@

#include "lib_isar_post_rend.h"

#ifndef SPLIT_REND_WITH_HEAD_ROT

int main( int argc, char **argv )
{
    (void) argc;
    (void) argv;
    ISAR_POST_REND_void_func();
    return 0;
}

#else

#include <assert.h>
#include <math.h>
@@ -689,19 +678,20 @@ int main(
    int argc,
    char **argv )
{
    ISAR_POST_REND_HANDLE hIsarPostRend;
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
    ISAR_POST_REND_HANDLE hIsarPostRend = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    AudioFileReader *audioReader = NULL;
    AudioFileWriter *audioWriter;
    AudioFileWriter *audioWriter = NULL;
    int32_t inBufferSize;
    int32_t outBufferSize;
    int32_t bitsBufferSize;
    int16_t *inpInt16Buffer;
    float *inFloatBuffer;
    int16_t *outInt16Buffer;
    float *outFloatBuffer;
    int16_t *inpInt16Buffer = NULL;
    float *inFloatBuffer = NULL;
    int16_t *outInt16Buffer = NULL;
    float *outFloatBuffer = NULL;
    uint8_t *bitsBufferData = NULL;
    IVAS_REND_AudioBuffer inBuffer;
    IVAS_REND_AudioBuffer outBuffer;
@@ -730,13 +720,9 @@ int main(
    bitsBuffer.config.bufLenInBytes = 0;
    bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    bitsBuffer.config.codec_frame_size_ms = 5;
    bitsBuffer.config.isar_frame_size_ms = 20;
    bitsBuffer.config.lc3plusHighRes = 0;
#else
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif


    CmdlnArgs args = parseCmdlnArgs( argc, argv );
@@ -749,8 +735,8 @@ int main(
    {
        if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error opening file: %s\n", args.headRotationFilePath );
            exit( -1 );
            fprintf( stderr, "\nError opening file: %s\n", args.headRotationFilePath );
            goto cleanup;
        }
    }

@@ -760,9 +746,7 @@ int main(
        SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader );
    }

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
    hSplitRendFileReadWrite = NULL;
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
@@ -771,24 +755,20 @@ int main(
                                        args.inMetadataFilePaths[0],
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.codec_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
            exit( -1 );
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
            goto cleanup;
        }

        if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error opening file: %s\n", audioFilePath );
            exit( -1 );
            fprintf( stderr, "\nError opening file: %s\n", audioFilePath );
            goto cleanup;
        }
    }

@@ -799,33 +779,23 @@ int main(
                                        args.inputFilePath,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.codec_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
            exit( -1 );
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.inputFilePath );
            goto cleanup;
        }
        audioReader = NULL;
    }

#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    if ( audioReader != NULL )
    {
        error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
    }
    else
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        if ( hSplitRendFileReadWrite == NULL )
#endif
    else if ( hSplitRendFileReadWrite == NULL )
    {
        inFileSampleRate = args.sampleRate;
    }
@@ -841,20 +811,20 @@ int main(
            /* else if sampling rate given on command line, compare with wav file */
            else if ( inFileSampleRate != args.sampleRate )
            {
                fprintf( stderr, "Sampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
                exit( -1 );
                fprintf( stderr, "\nSampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
                goto cleanup;
            }
            break;
        case IVAS_ERR_SAMPLING_RATE_UNKNOWN: /* Returned when input is raw PCM */
            if ( args.sampleRate == 0 )
            {
                fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" );
                exit( -1 );
                fprintf( stderr, "\nSampling rate must be specified on command line when using raw PCM input\n" );
                goto cleanup;
            }
            break;
        default:
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            fprintf( stderr, "\nError: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
    }

    int16_t inFileNumChannels = 0;
@@ -863,23 +833,24 @@ int main(
        error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
        if ( error != IVAS_ERR_OK && error != IVAS_ERR_NUM_CHANNELS_UNKNOWN )
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            fprintf( stderr, "\nAudioFileReader_getNumChannels failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
    }

    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL;
    if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
        fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
    }

    /* === Configure === */
    if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
        fprintf( stderr, "\nError in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
    }

    if ( args.inConfig.numBinBuses > 0 )
@@ -887,20 +858,15 @@ int main(
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
                                                              bitsBuffer.config.codec,
                                                              bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                              ,
                                                              bitsBuffer.config.codec_frame_size_ms,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes
#endif
                                                              ) ) != IVAS_ERR_OK )
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            fprintf( stderr, "\nError in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
    }


    ISAR_POST_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS];

    for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ )
@@ -912,8 +878,8 @@ int main(
    {
        if ( ( error = ISAR_POST_REND_AddInput( hIsarPostRend, args.inConfig.binBuses[i].audioConfig, &splitBinIds[i] ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            fprintf( stderr, "\nISAR_POST_REND_AddInput failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
    }

@@ -921,16 +887,16 @@ int main(

    if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels )
    {
        fprintf( stderr, "Number of channels in input file does not match selected configuration\n" );
        exit( -1 );
        fprintf( stderr, "\nNumber of channels in input file does not match selected configuration\n" );
        goto cleanup;
    }

    int16_t numOutChannels = 2;

    if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath );
        exit( -1 );
        fprintf( stderr, "\nFailed to open file: %s\n", args.outputFilePath );
        goto cleanup;
    }

    inBufferSize = frameSize_smpls * totalNumInChannels;
@@ -1005,7 +971,7 @@ int main(
                else
                {
                    fprintf( stderr, "\nUnable to read from bitstream file!\n" );
                    exit( -1 );
                    goto cleanup;
                }
            }
        }
@@ -1016,7 +982,7 @@ int main(
            if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError reading from file %s\n", audioFilePath );
                exit( -1 );
                goto cleanup;
            }
        }

@@ -1042,21 +1008,21 @@ int main(

                if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    fprintf( stderr, "\nError in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
                }

                if ( ( error = ISAR_POST_REND_SetHeadRotation( hIsarPostRend, headRot, Pos, DEFAULT_AXIS, sf_idx ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    fprintf( stderr, "\nError setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
                }
            }
        }
        else
        {
            fprintf( stderr, "Head Rotation should be enabled in post renderer\n" );
            exit( -1 );
            fprintf( stderr, "\nHead Rotation should be enabled in post renderer\n" );
            goto cleanup;
        }

        /* Read from split renderer bfi file if specified */
@@ -1065,14 +1031,14 @@ int main(
            int16_t bfi;
            if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                exit( -1 );
                fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                exit( -1 );
                fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
        }

@@ -1082,31 +1048,31 @@ int main(
            {
                if ( ( error = ISAR_POST_REND_GetInputNumChannels( hIsarPostRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    fprintf( stderr, "\nISAR_POST_REND_GetInputNumChannels failed: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
                }
                ISAR_POST_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels );

                if ( ( error = ISAR_POST_REND_FeedInputAudio( hIsarPostRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    fprintf( stderr, "\nISAR_POST_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
                }
            }
            if ( splitBinNeedsNewFrame )
            {
                if ( ( error = ISAR_POST_REND_FeedSplitBinauralBitstream( hIsarPostRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    fprintf( stderr, "\nISAR_POST_REND_FeedSplitBinauralBitstream failed: %s\n", ivas_error_to_string( error ) );
                    goto cleanup;
                }
            }
        }

        if ( ( error = ISAR_POST_REND_GetSplitBinauralSamples( hIsarPostRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            fprintf( stderr, "\nISAR_POST_REND_GetSplitBinauralSamples failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }

        int16_t num_out_channels;
@@ -1123,7 +1089,7 @@ int main(
                if ( ISAR_POST_REND_GetDelay( hIsarPostRend, &delayNumSamples, &delayTimeScale ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to get delay of renderer!\n" );
                    exit( -1 );
                    goto cleanup;
                }

                if ( hSplitRendFileReadWrite != NULL )
@@ -1148,8 +1114,8 @@ int main(
            {
                if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error writing audio file %s\n", args.outputFilePath );
                    exit( -1 );
                    fprintf( stderr, "\nError writing audio file %s\n", args.outputFilePath );
                    goto cleanup;
                }
                delayNumSamples = 0;
            }
@@ -1183,7 +1149,7 @@ int main(
            if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, outBufferSize ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nOutput audio file writer error\n" );
                exit( -1 );
                goto cleanup;
            }
        }

@@ -1191,7 +1157,7 @@ int main(
        if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nOutput audio file writer error\n" );
            exit( -1 );
            goto cleanup;
        }
        zeroPadToWrite = 0;
    }
@@ -1215,7 +1181,14 @@ int main(
    }
#endif

    /* === Close === */
    /*------------------------------------------------------------------------------------------*
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

cleanup:

    free( inpInt16Buffer );
    free( inFloatBuffer );
    free( outInt16Buffer );
@@ -1244,10 +1217,8 @@ int main(
    print_mem( NULL );
#endif

    return 0;
    return mainFailed ? -1 : 0;
}


#undef WMC_TOOL_SKIP

#endif /* SPLIT_REND_WITH_HEAD_ROT */
Loading