Loading .gitignore +3 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ binary/ tests/**/[c|d]ut tests/**/ref tests/*/testv tests/hrtf_binary_loading/bitstream/* tests/hrtf_binary_loading/dec_out_*/* scripts/testv/*_cut*.pcm scripts/testv/*_cut*.wav scripts/testv/stvOMASA_*.met scripts/testv/stvOMASA_*.csv scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav Loading .gitlab-ci.yml +46 −27 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ variables: - 'default' - 'test-be-release' - 'test-long-self-test' GIT_CLEAN_FLAGS: -ffdxq default: Loading Loading @@ -125,6 +126,7 @@ stages: - *mr-fetch-target-branch - *mr-get-target-commit - git checkout $target_commit - echo "Building reference codec at commit $target_commit" ### build reference binaries - *disable-debugging-macro Loading Loading @@ -244,6 +246,7 @@ stages: extends: .test-job-linux before_script: - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi - python3 scripts/prepare_combined_format_inputs.py - cp -r scripts/testv/* $TESTV_DIR/ # --------------------------------------------------------------- Loading Loading @@ -397,7 +400,7 @@ build-codec-windows-msbuild: - *print-common-info-windows - *activate-WX-windows - py .\scripts\strip_split_rendering.py - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug # --------------------------------------------------------------- # Test jobs for merge requests Loading @@ -408,7 +411,7 @@ codec-smoke-test: extends: - .test-job-linux-needs-testv-dir - .rules-merge-request timeout: "17 minutes" timeout: "20 minutes" tags: - ivas-linux-fast stage: test Loading Loading @@ -440,7 +443,7 @@ codec-smoke-test: # code selftest testvectors with memory-sanitizer binaries codec-msan: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-sanitizers-linux"] Loading @@ -448,22 +451,26 @@ codec-msan: - *print-common-info - make clean - make -j CLANG=1 - python3 scripts/self_test.py -z console --create | tee test_output.txt - run_errors=$(cat test_output.txt | grep -ic "run errors") || true - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang memory-sanitizer"; exit 1; fi - testcase_timeout=180 - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$? - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang memory-sanitizer"; exit 1; fi artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always paths: - scripts/ref/logs/ - test_output.txt - report-junit.xml - report.html expose_as: "msan selftest results" reports: junit: - report-junit.xml # code selftest testvectors with address-sanitizer binaries codec-asan: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-sanitizers-linux"] Loading @@ -471,22 +478,26 @@ codec-asan: - *print-common-info - make clean - make -j CLANG=2 - python3 scripts/self_test.py -z console --create | tee test_output.txt - run_errors=$(cat test_output.txt | grep -ic "run errors") || true - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang address-sanitizer"; exit 1; fi - testcase_timeout=180 - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$? - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang address-sanitizer"; exit 1; fi artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always paths: - scripts/ref/logs/ - test_output.txt - report-junit.xml - report.html expose_as: "asan selftest results" reports: junit: - report-junit.xml # code selftest testvectors with address-sanitizer binaries codec-usan: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-sanitizers-linux"] Loading @@ -494,17 +505,21 @@ codec-usan: - *print-common-info - make clean - make -j CLANG=3 - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 scripts/self_test.py -z console --create - grep_exit_code=0 - grep UndefinedBehaviorSanitizer scripts/ref/logs/* || grep_exit_code=$? - if [ $grep_exit_code != 1 ] ; then echo "Run errors in self_test.py with Clang undefined-behavior-sanitizer"; exit 1; fi - testcase_timeout=180 - exit_code=0 - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$? - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang undefined-behavior-sanitizer"; exit 1; fi artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always paths: - scripts/ref/logs/ - report-junit.xml - report.html expose_as: "usan selftest results" reports: junit: - report-junit.xml # test renderer executable renderer-smoke-test: Loading Loading @@ -607,7 +622,7 @@ renderer-usan: # compare renderer bitexactness between target and source branch renderer-pytest-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request needs: ["build-codec-linux-make"] # TODO: set reasonable timeout, will most likely take less Loading Loading @@ -682,7 +697,7 @@ split-rendering-smoke-test: # compare split-rendering bitexactness between target and source branch split-rendering-pytest-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request needs: ["build-codec-linux-make"] # TODO: set reasonable timeout, will most likely take less Loading @@ -705,6 +720,7 @@ split-rendering-pytest-on-merge-request: - *mr-fetch-target-branch - *mr-get-target-commit - git checkout $target_commit - echo "Building reference codec at commit $target_commit" # build reference binaries - *enable-split-rendering Loading Loading @@ -755,7 +771,7 @@ split-rendering-pytest-on-merge-request: # compare bit exactness between target and source branch ivas-pytest-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: compare needs: ["build-codec-linux-cmake", "codec-smoke-test"] Loading Loading @@ -812,7 +828,7 @@ ivas-pytest-on-merge-request: # Check interop IVAS_cod_test -> IVAS_dec_ref ivas-interop-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-linux-cmake"] Loading Loading @@ -1045,7 +1061,7 @@ be-2-evs-windows: - *print-common-info-windows - $winoutdata = $null - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 # copy over to never change the testvector dir Loading Loading @@ -1085,7 +1101,7 @@ be-2-evs-linux: codec-comparison-on-main-push: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-main-push stage: compare needs: ["build-codec-linux-cmake"] Loading Loading @@ -1113,6 +1129,7 @@ codec-comparison-on-main-push: ### compare to the previous merge commit in the main branch - git fetch origin main - git checkout $previous_merge_commit - echo "Building reference codec at commit $previous_merge_commit" ### build reference binaries - cd build Loading Loading @@ -1182,7 +1199,7 @@ test-be-to-release: script: - echo "$CI_COMMIT_BRANCH" - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata # path to release candidate refs defined in config.toml Loading Loading @@ -1224,6 +1241,8 @@ test-long-self-test: ### switch to main - git checkout main - git pull origin main - echo "Building reference codec at commit $(git rev-parse HEAD)" ### build main (ref) binaries - cmake . -Bbuild-ref Loading LICENSE.md +1 −1 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other Loading apps/decoder.c +107 −71 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other Loading Loading @@ -196,10 +196,9 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; #endif IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; Loading Loading @@ -456,9 +455,14 @@ int main( *------------------------------------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_LCLD_5MS asked_frame_size = arg.renderFramesize; #endif if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifndef SPLIT_REND_LCLD_5MS asked_frame_size = arg.renderFramesize; #endif if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading @@ -471,11 +475,12 @@ int main( goto cleanup; } #ifndef SPLIT_REND_LCLD_5MS if ( arg.renderFramesize != asked_frame_size ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for split rendering!\n" ); } #endif arg.enableHeadRotation = true; } #endif Loading Loading @@ -629,6 +634,7 @@ int main( } #ifdef SPLIT_REND_WITH_HEAD_ROT #ifndef SPLIT_REND_LCLD_5MS if ( arg.renderFramesize == IVAS_RENDER_FRAMESIZE_5MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || renderConfig.split_rend_config.dof == 0 ) ) { Loading @@ -646,7 +652,7 @@ int main( } #endif #endif if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); Loading @@ -659,6 +665,30 @@ int main( goto cleanup; } #ifdef SPLIT_REND_LCLD_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || renderConfig.split_rend_config.dof == 0 ) ) { arg.renderFramesize = asked_frame_size; } else { arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; } if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK ) { return error; } if ( arg.renderFramesize != asked_frame_size ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } #endif #endif if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) Loading Loading @@ -712,16 +742,12 @@ int main( if ( arg.hrtfReaderEnabled ) { #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -734,43 +760,14 @@ int main( destroy_td_hrtf( hHrtfTD ); } } #else if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } #endif #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } } #else if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } #endif #endif #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -783,20 +780,14 @@ int main( destroy_SetOfHRTF( hSetOfHRTF ); } } #endif #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; #else IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -809,26 +800,14 @@ int main( destroy_fastconv_hrtf( hHrtfFastConv ); } } #else if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfFileName ); goto cleanup; } #endif #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; #else IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -841,13 +820,24 @@ int main( destroy_parambin_hrtf( hHrtfParambin ); } } #else if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName ); fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif if ( ( error = load_reverb_binary( *hHrtfStatistics, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_hrtf_statistics( hHrtfStatistics ); } } } /*------------------------------------------------------------------------------------------* Loading Loading @@ -924,21 +914,14 @@ cleanup: #endif if ( arg.hrtfReaderEnabled ) { #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; #endif IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); #ifdef NONBE_FIX_BINARY_BINAURAL_READING destroy_td_hrtf( hHrtfTD ); #else dealloc_HRTF_binary( hHrtfTD ); #endif #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; #endif IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); destroy_SetOfHRTF( hSetOfHRTF ); IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); } IVAS_DEC_Close( &hIvasDec ); Loading Loading @@ -2031,6 +2014,7 @@ static ivas_error initOnFirstGoodFrame( { /* Duplicate good first frame metadata to fill the beginning of stream. */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading @@ -2039,7 +2023,12 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; Loading Loading @@ -2345,7 +2334,11 @@ static ivas_error decodeG192( { if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) { #ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) when reading TSM data from %s \n\n", arg.inputBitstreamFilename, TsmScaleFileReader_getFilePath( tsmScaleFileReader ) ); #else fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); #endif goto cleanup; } int16_t maxScaling; Loading Loading @@ -2437,7 +2430,6 @@ static ivas_error decodeG192( #endif } } } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); if ( error == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -2546,13 +2538,28 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading Loading @@ -2687,13 +2694,27 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading Loading @@ -3368,13 +3389,28 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; /* delayNumSamples_orig is fetched only for the first good frame, but here the delay can change between frames, so need to re-fetch */ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading apps/encoder.c +5 −1 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
.gitignore +3 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ binary/ tests/**/[c|d]ut tests/**/ref tests/*/testv tests/hrtf_binary_loading/bitstream/* tests/hrtf_binary_loading/dec_out_*/* scripts/testv/*_cut*.pcm scripts/testv/*_cut*.wav scripts/testv/stvOMASA_*.met scripts/testv/stvOMASA_*.csv scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav Loading
.gitlab-ci.yml +46 −27 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ variables: - 'default' - 'test-be-release' - 'test-long-self-test' GIT_CLEAN_FLAGS: -ffdxq default: Loading Loading @@ -125,6 +126,7 @@ stages: - *mr-fetch-target-branch - *mr-get-target-commit - git checkout $target_commit - echo "Building reference codec at commit $target_commit" ### build reference binaries - *disable-debugging-macro Loading Loading @@ -244,6 +246,7 @@ stages: extends: .test-job-linux before_script: - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi - python3 scripts/prepare_combined_format_inputs.py - cp -r scripts/testv/* $TESTV_DIR/ # --------------------------------------------------------------- Loading Loading @@ -397,7 +400,7 @@ build-codec-windows-msbuild: - *print-common-info-windows - *activate-WX-windows - py .\scripts\strip_split_rendering.py - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug # --------------------------------------------------------------- # Test jobs for merge requests Loading @@ -408,7 +411,7 @@ codec-smoke-test: extends: - .test-job-linux-needs-testv-dir - .rules-merge-request timeout: "17 minutes" timeout: "20 minutes" tags: - ivas-linux-fast stage: test Loading Loading @@ -440,7 +443,7 @@ codec-smoke-test: # code selftest testvectors with memory-sanitizer binaries codec-msan: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-sanitizers-linux"] Loading @@ -448,22 +451,26 @@ codec-msan: - *print-common-info - make clean - make -j CLANG=1 - python3 scripts/self_test.py -z console --create | tee test_output.txt - run_errors=$(cat test_output.txt | grep -ic "run errors") || true - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang memory-sanitizer"; exit 1; fi - testcase_timeout=180 - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$? - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang memory-sanitizer"; exit 1; fi artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always paths: - scripts/ref/logs/ - test_output.txt - report-junit.xml - report.html expose_as: "msan selftest results" reports: junit: - report-junit.xml # code selftest testvectors with address-sanitizer binaries codec-asan: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-sanitizers-linux"] Loading @@ -471,22 +478,26 @@ codec-asan: - *print-common-info - make clean - make -j CLANG=2 - python3 scripts/self_test.py -z console --create | tee test_output.txt - run_errors=$(cat test_output.txt | grep -ic "run errors") || true - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang address-sanitizer"; exit 1; fi - testcase_timeout=180 - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$? - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang address-sanitizer"; exit 1; fi artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always paths: - scripts/ref/logs/ - test_output.txt - report-junit.xml - report.html expose_as: "asan selftest results" reports: junit: - report-junit.xml # code selftest testvectors with address-sanitizer binaries codec-usan: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-sanitizers-linux"] Loading @@ -494,17 +505,21 @@ codec-usan: - *print-common-info - make clean - make -j CLANG=3 - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 scripts/self_test.py -z console --create - grep_exit_code=0 - grep UndefinedBehaviorSanitizer scripts/ref/logs/* || grep_exit_code=$? - if [ $grep_exit_code != 1 ] ; then echo "Run errors in self_test.py with Clang undefined-behavior-sanitizer"; exit 1; fi - testcase_timeout=180 - exit_code=0 - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$? - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang undefined-behavior-sanitizer"; exit 1; fi artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always paths: - scripts/ref/logs/ - report-junit.xml - report.html expose_as: "usan selftest results" reports: junit: - report-junit.xml # test renderer executable renderer-smoke-test: Loading Loading @@ -607,7 +622,7 @@ renderer-usan: # compare renderer bitexactness between target and source branch renderer-pytest-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request needs: ["build-codec-linux-make"] # TODO: set reasonable timeout, will most likely take less Loading Loading @@ -682,7 +697,7 @@ split-rendering-smoke-test: # compare split-rendering bitexactness between target and source branch split-rendering-pytest-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request needs: ["build-codec-linux-make"] # TODO: set reasonable timeout, will most likely take less Loading @@ -705,6 +720,7 @@ split-rendering-pytest-on-merge-request: - *mr-fetch-target-branch - *mr-get-target-commit - git checkout $target_commit - echo "Building reference codec at commit $target_commit" # build reference binaries - *enable-split-rendering Loading Loading @@ -755,7 +771,7 @@ split-rendering-pytest-on-merge-request: # compare bit exactness between target and source branch ivas-pytest-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: compare needs: ["build-codec-linux-cmake", "codec-smoke-test"] Loading Loading @@ -812,7 +828,7 @@ ivas-pytest-on-merge-request: # Check interop IVAS_cod_test -> IVAS_dec_ref ivas-interop-on-merge-request: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-merge-request stage: test needs: ["build-codec-linux-cmake"] Loading Loading @@ -1045,7 +1061,7 @@ be-2-evs-windows: - *print-common-info-windows - $winoutdata = $null - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 # copy over to never change the testvector dir Loading Loading @@ -1085,7 +1101,7 @@ be-2-evs-linux: codec-comparison-on-main-push: extends: - .test-job-linux - .test-job-linux-needs-testv-dir - .rules-main-push stage: compare needs: ["build-codec-linux-cmake"] Loading Loading @@ -1113,6 +1129,7 @@ codec-comparison-on-main-push: ### compare to the previous merge commit in the main branch - git fetch origin main - git checkout $previous_merge_commit - echo "Building reference codec at commit $previous_merge_commit" ### build reference binaries - cd build Loading Loading @@ -1182,7 +1199,7 @@ test-be-to-release: script: - echo "$CI_COMMIT_BRANCH" - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata # path to release candidate refs defined in config.toml Loading Loading @@ -1224,6 +1241,8 @@ test-long-self-test: ### switch to main - git checkout main - git pull origin main - echo "Building reference codec at commit $(git rev-parse HEAD)" ### build main (ref) binaries - cmake . -Bbuild-ref Loading
LICENSE.md +1 −1 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other Loading
apps/decoder.c +107 −71 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other Loading Loading @@ -196,10 +196,9 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; #endif IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; Loading Loading @@ -456,9 +455,14 @@ int main( *------------------------------------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_LCLD_5MS asked_frame_size = arg.renderFramesize; #endif if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifndef SPLIT_REND_LCLD_5MS asked_frame_size = arg.renderFramesize; #endif if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading @@ -471,11 +475,12 @@ int main( goto cleanup; } #ifndef SPLIT_REND_LCLD_5MS if ( arg.renderFramesize != asked_frame_size ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for split rendering!\n" ); } #endif arg.enableHeadRotation = true; } #endif Loading Loading @@ -629,6 +634,7 @@ int main( } #ifdef SPLIT_REND_WITH_HEAD_ROT #ifndef SPLIT_REND_LCLD_5MS if ( arg.renderFramesize == IVAS_RENDER_FRAMESIZE_5MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || renderConfig.split_rend_config.dof == 0 ) ) { Loading @@ -646,7 +652,7 @@ int main( } #endif #endif if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); Loading @@ -659,6 +665,30 @@ int main( goto cleanup; } #ifdef SPLIT_REND_LCLD_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || renderConfig.split_rend_config.dof == 0 ) ) { arg.renderFramesize = asked_frame_size; } else { arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; } if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK ) { return error; } if ( arg.renderFramesize != asked_frame_size ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } #endif #endif if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) Loading Loading @@ -712,16 +742,12 @@ int main( if ( arg.hrtfReaderEnabled ) { #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -734,43 +760,14 @@ int main( destroy_td_hrtf( hHrtfTD ); } } #else if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } #endif #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } } #else if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } #endif #endif #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -783,20 +780,14 @@ int main( destroy_SetOfHRTF( hSetOfHRTF ); } } #endif #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; #else IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -809,26 +800,14 @@ int main( destroy_fastconv_hrtf( hHrtfFastConv ); } } #else if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfFileName ); goto cleanup; } #endif #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; #else IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) Loading @@ -841,13 +820,24 @@ int main( destroy_parambin_hrtf( hHrtfParambin ); } } #else if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName ); fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif if ( ( error = load_reverb_binary( *hHrtfStatistics, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_hrtf_statistics( hHrtfStatistics ); } } } /*------------------------------------------------------------------------------------------* Loading Loading @@ -924,21 +914,14 @@ cleanup: #endif if ( arg.hrtfReaderEnabled ) { #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; #endif IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); #ifdef NONBE_FIX_BINARY_BINAURAL_READING destroy_td_hrtf( hHrtfTD ); #else dealloc_HRTF_binary( hHrtfTD ); #endif #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; #endif IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); destroy_SetOfHRTF( hSetOfHRTF ); IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); } IVAS_DEC_Close( &hIvasDec ); Loading Loading @@ -2031,6 +2014,7 @@ static ivas_error initOnFirstGoodFrame( { /* Duplicate good first frame metadata to fill the beginning of stream. */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading @@ -2039,7 +2023,12 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; Loading Loading @@ -2345,7 +2334,11 @@ static ivas_error decodeG192( { if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) { #ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) when reading TSM data from %s \n\n", arg.inputBitstreamFilename, TsmScaleFileReader_getFilePath( tsmScaleFileReader ) ); #else fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); #endif goto cleanup; } int16_t maxScaling; Loading Loading @@ -2437,7 +2430,6 @@ static ivas_error decodeG192( #endif } } } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); if ( error == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -2546,13 +2538,28 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading Loading @@ -2687,13 +2694,27 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading Loading @@ -3368,13 +3389,28 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; /* delayNumSamples_orig is fetched only for the first good frame, but here the delay can change between frames, so need to re-fetch */ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading