Commit 8eab3be8 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into...

- Merge remote-tracking branch 'remotes/origin/main' into 1244-artifacts-when-switching-from-fb-coding-to-acelp-swb-bwe
parents 5ce99876 7aa8874e
Loading
Loading
Loading
Loading
Loading
+38 −15
Original line number Diff line number Diff line
@@ -175,8 +175,8 @@ stages:
.merge-request-comparison-check: &merge-request-comparison-check
  - echo "--------------- Running merge-request-comparison-check anchor ---------------"
  - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
  - if [ $exit_code -ne 0 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -ne 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
  - exit 0

.update-ltv-repo: &update-ltv-repo
@@ -274,6 +274,7 @@ stages:
    - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
      when: never      
    - if: $MANUAL_PIPELINE_TYPE == 'check-clipping'
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'test-branch-vs-input-passthrough'
      when: never
    - when: on_success
@@ -453,6 +454,8 @@ branch-is-up-to-date-with-main-post:
    - make -j -C ivas-basop
    - python3 ci/remove_unsupported_testcases.py $PARAM_FILE
    - python3 tests/create_short_testvectors.py
    - *update-ltv-repo
    - *copy-ltv-files-to-testv-dir

    - python3 -m pytest tests/codec_be_on_mr_nonselection --param_file $PARAM_FILE --update_ref 1 --ref_encoder_path ivas-basop/IVAS_cod --ref_decoder_path ivas-basop/IVAS_dec --html=report.html --self-contained-html --junit-xml=report-junit.xml || true
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
@@ -670,9 +673,9 @@ pytest-compare-20ms-and-5ms-rendering:
    - if [ $zero_errors5 != 1 ]; then echo "run error in with 5ms rendering encountered"; zero_errors=0 ; fi
    - if [ $zero_errors10 != 1 ]; then echo "run error in with 10ms rendering encountered"; zero_errors=0 ; fi
    - if [ $zero_errors != 1 ]; then exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code5 -eq 1 ]; then echo "Non-bitexact cases encountered with 5ms rendering!"; exit_code=1; fi
    - if [ $exit_code10 -eq 1 ]; then echo "Non-bitexact cases encountered with 10ms rendering!"; exit_code=1; fi
    - if [ $exit_code -eq 1 ]; then exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code5 -ne 0 ]; then echo "Non-bitexact cases encountered with 5ms rendering!"; exit_code=1; fi
    - if [ $exit_code10 -ne 0 ]; then echo "Non-bitexact cases encountered with 10ms rendering!"; exit_code=1; fi
    - if [ $exit_code -ne 0 ]; then exit $EXIT_CODE_FAIL; fi
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
@@ -818,7 +821,7 @@ renderer-pytest-on-merge-request:
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    # run test
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

    - *merge-request-comparison-check
@@ -1364,9 +1367,9 @@ codec-comparison-on-main-push:
    ### run pytest
    - exit_code=0
    - 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=$?
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -ne 0 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi;
  allow_failure:
    exit_codes:
@@ -1457,6 +1460,7 @@ ivas-conformance:
    - mkdir testvec/bin    
    - cp    -force -ErrorAction Ignore scripts/testv/* testvec/testv
    - cp -r -force -ErrorAction Ignore scripts/ls_layouts testvec
    - cp -r -force -ErrorAction Ignore scripts/object_edit testvec
    - cp -r -force -ErrorAction Ignore scripts/switchPaths testvec
    - cp -r -force -ErrorAction Ignore scripts/trajectories testvec
    - cp -r -force -ErrorAction Ignore scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface
@@ -1543,6 +1547,7 @@ ivas-conformance-linux:
    - mkdir testvec/bin    
    - cp -r scripts/testv/* testvec/testv
    - cp -r scripts/ls_layouts testvec
    - cp -r scripts/object_edit testvec
    - cp -r scripts/switchPaths testvec
    - cp -r scripts/trajectories testvec
    - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface
@@ -1590,7 +1595,7 @@ ivas-conformance-linux:
    - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"

    # Check for failures
    - if [ $exit_code -eq 1 ]; then echo "Test failures encountered"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -ne 0 ]; then echo "Test failures encountered"; exit $EXIT_CODE_FAIL; fi
    
  artifacts:
    name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA"
@@ -1667,7 +1672,7 @@ test-long-self-test:
    - zero_errors=$(cat report-junit-ltv.xml | grep -c 'errors="0"') || true

    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ]; then echo "Non-bitexact cases encountered!"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "Non-bitexact cases encountered!"; exit $EXIT_CODE_NON_BE; fi
    - exit 0


@@ -1732,7 +1737,7 @@ test-branch-vs-input-passthrough:
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - python3 scripts/parse_xml_report.py report-junit.xml report.csv
    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ]; then echo "Differences encountered."; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "Differences encountered."; exit $EXIT_CODE_NON_BE; fi
    - exit 0

  artifacts:
@@ -1748,7 +1753,6 @@ test-branch-vs-input-passthrough:
      junit:
        - report-junit.xml


# ---------------------------------------------------------------
# Scheduled jobs on main
# ---------------------------------------------------------------
@@ -1814,7 +1818,7 @@ ltv-usan:
    - ivas-linux-fast
  artifacts:
    name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
    expire_in: 2 weeks
    expire_in: 4 weeks
    when: always
    paths:
      - ep_015.g192
@@ -2403,8 +2407,27 @@ coverage-test-on-main-scheduled:
  - 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
  - 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
  # 1. check for public_dir being there as this might not be the case when artifact download failed
  # 2. check for public dir not being empty - handle job failures in prev job that happen after the dir is created. In that case, the empty dir is in the artifacts
  - if [ -d $public_dir ] && [ ! -z "$( ls -A $public_dir )" ]; then
  -   mv $public_dir/* wmops/
  # check here if we have the split-by-levels files present - if not, fake them up with the existing global one
  # this is needed for the first run with split graphs on a branch where the global version did run previously
  # NOTE: checking only for level_1 file here as this should already be sufficient
  # NOTE2: also not chechking for RAM for same reason
  -   wmops_all_global="wmops/log_wmops_all.txt"
  -   ram_all_global="wmops/log_ram_all.txt"
  -   if [ -f "${wmops_all_global}" ] && [ ! -f "wmops/log_wmops_all_level_1.txt" ]; then
  -     declare -a suffixes=("level_1" "level_2" "level_3" "rate_sw")
  -     for suffix in "${suffixes[@]}"; do
  -       cp ${wmops_all_global} wmops/log_wmops_all_${suffix}.txt
  -       cp ${ram_all_global} wmops/log_ram_all_${suffix}.txt
  -     done
  -   fi
  - fi

  - ls wmops
  - rm artifacts.zip
  - rm -rf $public_dir
@@ -2413,7 +2436,7 @@ coverage-test-on-main-scheduled:
  &complexity-measurements-prepare-artifacts # prepare artifacts -> move to public directory
  - public_dir="$CI_JOB_NAME-public"
  - mkdir $public_dir
  - mv -f wmops/log_*_all.txt ./*.js ${public_dir}/
  - mv -f wmops/log_*_all*.txt ./*.js ${public_dir}/
  # move logfiles for links
  - mkdir $public_dir/logs
  # first move logs
+2 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@
    <ClCompile Include="..\lib_util\masa_file_reader.c" />
    <ClCompile Include="..\lib_util\masa_file_writer.c" />
    <ClCompile Include="..\lib_util\mime_io.c" />
    <ClCompile Include="..\lib_util\obj_edit_file_reader.c" />
    <ClCompile Include="..\lib_util\render_config_reader.c" />
    <ClCompile Include="..\lib_util\rotation_file_reader.c" />
    <ClCompile Include="..\lib_util\rtpdump.c" />
@@ -146,6 +147,7 @@
    <ClInclude Include="..\lib_util\jbm_file_writer.h" />
    <ClInclude Include="..\lib_util\ls_custom_file_reader.h" />
    <ClInclude Include="..\lib_util\mime_io.h" />
    <ClInclude Include="..\lib_util\obj_edit_file_reader.h" />
    <ClInclude Include="..\lib_util\masa_file_reader.h" />
    <ClInclude Include="..\lib_util\masa_file_writer.h" />
    <ClInclude Include="..\lib_util\render_config_reader.h" />
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@
    <ClCompile Include="..\lib_util\mime_io.c">
      <Filter>util_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_util\obj_edit_file_reader.c">
      <Filter>util_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_util\render_config_reader.c">
      <Filter>util_c</Filter>
    </ClCompile>
@@ -138,6 +141,9 @@
    <ClInclude Include="..\lib_util\mime_io.h">
      <Filter>util_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_util\obj_edit_file_reader.h">
      <Filter>util_h</Filter>
    </ClInclude>
    <ClInclude Include="..\lib_util\render_config_reader.h">
      <Filter>util_h</Filter>
    </ClInclude>
+162 −119

File changed.

Preview size limit exceeded, changes collapsed.

+120 −59
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ typedef struct
    int32_t sampleRate;
    InputConfig inConfig;
    OutputConfig outConfig;
    char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH];
    char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH];
    int16_t numInMetadataFiles;
    char outMetadataFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
@@ -238,7 +238,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_inputMetadata,
        .match = "input_metadata",
        .matchShort = "im",
        .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode",
        .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode. For OMASA, ISM files must be specified first.",
    },
    {
        .id = CmdLnOptionId_outputFile,
@@ -397,6 +397,8 @@ static IVAS_AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order );

static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs );

static void parseCombinedFormatInput( InputConfig *inConfig, char **configString );

static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom );

static CmdlnArgs parseCmdlnArgs( const int argc, char **argv );
@@ -555,25 +557,7 @@ static void setupWithSingleFormatInput(
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );

    /* Depending on input format, prepare metadata reading for ISM or MASA */
    if ( args.inConfig.numMasaBuses != 0 )
    {
        if ( args.inConfig.numMasaBuses != args.numInMetadataFiles )
        {
            fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" );
            exit( -1 );
        }

        for ( int16_t i = 0; i < args.numInMetadataFiles; ++i )
        {
            masaReaders[i] = MasaFileReader_open( args.inMetadataFilePaths[i] );
            if ( masaReaders[i] == NULL )
            {
                fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] );
                exit( -1 );
            }
        }
    }
    else if ( args.inConfig.numAudioObjects != 0 )
    if ( args.inConfig.numAudioObjects != 0 )
    {
        positionProvider->numObjects = args.inConfig.numAudioObjects;
        for ( int16_t i = 0; i < positionProvider->numObjects; ++i )
@@ -596,6 +580,26 @@ static void setupWithSingleFormatInput(
            }
        }
    }
    if ( args.inConfig.numMasaBuses != 0 )
    {
        if ( args.inConfig.numMasaBuses != ( args.numInMetadataFiles - args.inConfig.numAudioObjects ) )
        {
            fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" );
            exit( -1 );
        }

        int16_t reader_idx = 0;
        for ( int16_t i = args.inConfig.numAudioObjects; i < args.numInMetadataFiles; ++i )
        {
            reader_idx = i - args.inConfig.numAudioObjects;
            masaReaders[reader_idx] = MasaFileReader_open( args.inMetadataFilePaths[i] );
            if ( masaReaders[reader_idx] == NULL )
            {
                fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] );
                exit( -1 );
            }
        }
    }

    return;
}
@@ -665,11 +669,7 @@ int main(
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    Vector3PairFileReader *referenceVectorReader = NULL;
    hrtfFileReader *hrtfFileReader = NULL;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
    IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL;
#else
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL;
#endif
    IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL;
    IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL;
    IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
@@ -737,6 +737,8 @@ int main(
        lfeRoutingConfigs[i] = NULL;
    }

    IVAS_REND_PrintDisclaimer();

    CmdlnArgs args = parseCmdlnArgs( argc, argv );

    if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) ||
@@ -894,6 +896,47 @@ int main(
        exit( -1 );
    }

    fprintf( stdout, "Input audio file:       %s\n", args.inputFilePath );
    fprintf( stdout, "Output audio file:      %s\n\n", args.outputFilePath );

    if ( args.inConfig.numAudioObjects > 0 )
    {
        if ( args.inConfig.numAudioObjects == 1 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM1 );
        }
        else if ( args.inConfig.numAudioObjects == 2 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM2 );
        }
        else if ( args.inConfig.numAudioObjects == 3 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM3 );
        }
        else if ( args.inConfig.numAudioObjects == 4 )
        {
            IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM4 );
        }
    }
    for ( i = 0; i < args.inConfig.numMultiChannelBuses; i++ )
    {
        IVAS_REND_PrintInputConfig( args.inConfig.multiChannelBuses[i].audioConfig );
    }
    for ( i = 0; i < args.inConfig.numMasaBuses; i++ )
    {
        IVAS_REND_PrintInputConfig( args.inConfig.masaBuses[i].audioConfig );
    }
    for ( i = 0; i < args.inConfig.numAmbisonicsBuses; i++ )
    {
        IVAS_REND_PrintInputConfig( args.inConfig.ambisonicsBuses[i].audioConfig );
    }

    if ( ( error = IVAS_REND_PrintConfig( hIvasRend ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\n IVAS_REND_PrintConfig failed: %s\n\n", ivas_error_to_string( error ) );
        goto cleanup;
    }

    if ( !isEmptyString( args.customHrtfFilePath ) )
    {
        if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK )
@@ -910,11 +953,7 @@ int main(
                goto cleanup;
            }

#ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE
            if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -928,17 +967,12 @@ int main(
            }


#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
            if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
            IVAS_AUDIO_CONFIG hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4;
            if ( args.inConfig.ambisonicsBuses->audioConfig != IVAS_AUDIO_CONFIG_INVALID && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
            {
@@ -946,9 +980,6 @@ int main(
            }

            if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.outConfig.audioConfig, hrtf_set_audio_cfg, args.sampleRate ) ) != IVAS_ERR_OK )
#else
            if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -957,11 +988,7 @@ int main(
                }
                else
                {
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
                    destroy_crend_hrtf( hHrtfCrend );
#else
                    destroy_SetOfHRTF( hSetOfHRTF );
#endif
                }
            }

@@ -971,11 +998,7 @@ int main(
                goto cleanup;
            }

#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, args.inConfig.ambisonicsBuses->audioConfig, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -1982,9 +2005,6 @@ cleanup:

    Vector3PairFileReader_close( &referenceVectorReader );
    destroy_td_hrtf( hHrtfTD );
#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM
    destroy_SetOfHRTF( hSetOfHRTF );
#endif
    destroy_hrtf_statistics( hHrtfStatistics );
    IVAS_REND_Close( &hIvasRend );
    IsmPositionProvider_close( positionProvider );
@@ -2093,16 +2113,11 @@ static bool parseInConfig(
            inConfig->masaBuses[0].gain_dB = 0.0f;
            break;
        case IVAS_AUDIO_CONFIG_OBA:
            /* If input format is objects, parse the characters after "ISM" to get number of objects */
            /* If input format is objects, parse the characters after "ISM" to get
             * number of objects and check for combined formats. */
            {
                char *ptr = NULL;
                inConfig->numAudioObjects = (uint16_t) strtol( inFormatStr + 3, &ptr, 10 );
                if ( ptr == NULL || *ptr != '\0' )
                {
                    /* Failed to parse string as a number */
                    fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr );
                    return false;
                }
                if ( inConfig->numAudioObjects > RENDERER_MAX_ISM_INPUTS )
                {
                    fprintf( stderr, "Too many objects at input. Max %d supported.", RENDERER_MAX_ISM_INPUTS );
@@ -2114,6 +2129,17 @@ static bool parseInConfig(
                    inConfig->audioObjects[i].inputChannelIndex = i;
                    inConfig->audioObjects[i].gain_dB = 0.0f;
                }
                if ( *ptr != '\0' )
                {
                    /* Try to parse combined format */
                    parseCombinedFormatInput( inConfig, &ptr );
                }
                if ( ptr == NULL || *ptr != '\0' )
                {
                    /* Failed to parse string as a number */
                    fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr );
                    return false;
                }
            }
            break;
        case IVAS_AUDIO_CONFIG_INVALID:
@@ -2527,9 +2553,7 @@ static CmdlnArgs defaultArgs(
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID;
    args.outConfig.outSetupCustom.num_spk = 0;
    args.outConfig.outSetupCustom.num_lfe = 0;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
    args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID;
#endif

    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
    {
@@ -2608,7 +2632,7 @@ static void parseOption(
            }
            break;
        case CmdLnOptionId_inputMetadata:
            assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS );
            assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS );
            for ( int16_t i = 0; i < numOptionValues; ++i )
            {
                strncpy( args->inMetadataFilePaths[i], optionValues[i], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
@@ -3436,6 +3460,41 @@ static void parseMasa(
    return;
}

static void parseCombinedFormatInput(
    InputConfig *inConfig,
    char **configString )
{
    IVAS_AUDIO_CONFIG audioConfig;
    audioConfig = parseAudioConfig( *configString );

    if ( audioConfig == IVAS_AUDIO_CONFIG_FOA || audioConfig == IVAS_AUDIO_CONFIG_HOA2 || audioConfig == IVAS_AUDIO_CONFIG_HOA3 )
    {
        /* OSBA */
        inConfig->numAmbisonicsBuses = 1;
        inConfig->ambisonicsBuses[0].audioConfig = audioConfig;
        inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects;
        inConfig->ambisonicsBuses[0].gain_dB = -6.f;
        *configString += 4;

        /* Modify input gain for objects too */
        for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i )
        {
            inConfig->audioObjects[i].gain_dB = -6.f;
        }
    }
    else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 )
    {
        /* OMASA */
        inConfig->numMasaBuses = 1;
        inConfig->masaBuses[0].audioConfig = audioConfig;
        inConfig->masaBuses[0].inputChannelIndex = inConfig->numAudioObjects;
        inConfig->masaBuses[0].gain_dB = 0.0f;
        *configString += 5;
    }

    return;
}

static ivas_error parseCustomLayoutFile(
    const char *filePath,
    IVAS_CUSTOM_LS_DATA *pLsSetupCustom )
@@ -3652,6 +3711,8 @@ static void printSupportedAudioConfigs( void )
        "HOA2",
        "HOA3",
        "ISMx (input only)",
        "ISMxSBAy (OSBA, input only)",
        "ISMxMASAy (OMASA, input only)",
        "MASAx",
        "BINAURAL (output only)",
        "BINAURAL_SPLIT_PCM",
Loading