Loading apps/decoder.c +0 −26 Original line number Diff line number Diff line Loading @@ -1353,24 +1353,15 @@ static ivas_error initOnFirstGoodFrame( /* If outputting MASA, open output file and write metadata for initial bad frames */ else if ( *pBsFormat == IVAS_DEC_BS_MASA ) { #ifdef FIX_350_MASA_DELAY_COMP if ( ( error = MasaFileWriter_open( arg.outputWavFilename, arg.delayCompensationEnabled, ppMasaWriter ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_open( arg.outputWavFilename, ppMasaWriter ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError: Error opening MASA decoded metadata file %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; } /* Duplicate good first frame metadata to fill the beginning of stream. */ #ifdef FIX_350_MASA_DELAY_COMP MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else IVAS_MASA_QMETADATA_HANDLE qMetadata = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); return error; Loading @@ -1378,11 +1369,7 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { #ifdef FIX_350_MASA_DELAY_COMP if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; Loading Loading @@ -1429,11 +1416,7 @@ static ivas_error decodeG192( ivas_error error = IVAS_ERR_UNKNOWN; uint16_t numObj = 0; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; #ifdef FIX_406_IVAS_POSITION IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; #else IVAS_POSITION Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; #endif IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) Loading Loading @@ -1646,23 +1629,14 @@ static ivas_error decodeG192( } else if ( bsFormat == IVAS_DEC_BS_MASA ) { #ifdef FIX_350_MASA_DELAY_COMP MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else IVAS_MASA_QMETADATA_HANDLE qMetadata; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_350_MASA_DELAY_COMP if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading apps/renderer.c +0 −15 Original line number Diff line number Diff line Loading @@ -536,11 +536,7 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; #ifdef FIX_406_IVAS_POSITION IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; #else IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; #endif #ifdef WMOPS reset_wmops(); Loading Loading @@ -649,9 +645,6 @@ int main( fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" ); exit( -1 ); } #ifndef FIX_389_EXT_REND_PCM_SR args.sampleRate = inFileSampleRate; #endif break; default: fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -679,11 +672,7 @@ int main( } /* === Configure === */ #ifdef FIX_392_LATE_REVERB if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_REND_InitConfig( hIvasRend, ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Error in Renderer Config Init\n" ); exit( -1 ); Loading Loading @@ -975,12 +964,8 @@ int main( } else { #ifdef FIX_379_EXT_METADATA error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ); if ( ( error != IVAS_ERR_OK ) && ( error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC #else if ( ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) ) != IVAS_ERR_OK ) && ( IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC #endif { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); Loading ci/run_scheduled_sanitizer_test.py +18 −3 Original line number Diff line number Diff line Loading @@ -63,8 +63,7 @@ def main(args): assert all([t in SUPPORTED_TESTS for t in tests]) modes = get_modes(in_format) returncode = run_check(modes, out_formats, tests, run_fec=run_fec) returncode = run_check(in_format, out_formats, tests, run_fec=run_fec) collect_for_sanitizer_test(CONSOLE_OUT_FILE) Loading Loading @@ -92,7 +91,22 @@ def get_modes(in_format: str) -> list: return mode_list def run_check(modes: list, out_formats: list, tests: list, run_fec: bool = True): def get_md_file_command(in_format: str) -> list: cmd = list() if in_format.startswith("ISM"): cmd.append("--metadata_files") md_filename = "/usr/local/ltv/ltvISM{}.csv" n = int(in_format[-1]) cmd.extend([md_filename.format(i) for i in range(1, n + 1)]) return cmd def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): modes = get_modes(in_format) md_file_command = get_md_file_command(in_format) ### always run encoder and decoder with no frameloss cmd_no_fec = [ Loading @@ -107,6 +121,7 @@ def run_check(modes: list, out_formats: list, tests: list, run_fec: bool = True) *modes, "--oc", *out_formats, *md_file_command, ] print( Loading ci/smoke_test.sh +6 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ fi cfg=./scripts/config/ci_linux.json dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat ism_md_cmd="--metadata_files /usr/local/testv/stvISM1.csv /usr/local/testv/stvISM2.csv /usr/local/testv/stvISM3.csv /usr/local/testv/stvISM4.csv" if [ $BUILD -eq 1 ];then # Enable memory macros to find unbalanced memory allocations/deallocations Loading @@ -74,7 +75,11 @@ if [ $BUILD -eq 1 ];then fi # run all modes vanilla-fashion ./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt # treat ISM modes separately because passing the metadata files to MASA modes causes crashes ism_modes=$(./scripts/runIvasCodec.py -l | grep ISM) non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ISM) ./scripts/runIvasCodec.py -m $non_ism_modes -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt ./scripts/runIvasCodec.py -m $ism_modes -p $cfg -U 1 $WORKERS $ism_md_cmd | tee smoke_test_output.txt # run the decoding again, but with 15% frame loss ./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS -D="-fec 15" --decoder_only | tee smoke_test_output_plc.txt Loading lib_com/bits_alloc.c +26 −21 Original line number Diff line number Diff line Loading @@ -536,6 +536,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE const int16_t active_cnt, /* i : Active frame counter */ #endif const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -754,11 +757,12 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) { bits -= TDM_IC_LSF_PRED_BITS; } #endif /* gain Q bit-budget - part 1 */ if ( ( coder_type != UNVOICED && coder_type != AUDIO && coder_type != INACTIVE && !( core_brate <= ACELP_8k00 && coder_type != TRANSITION ) ) || ( coder_type == INACTIVE && total_brate > MAX_GSC_INACTIVE_BRATE ) ) { Loading Loading @@ -1323,6 +1327,7 @@ ivas_error config_acelp1( else { int16_t nb_prm = 4; if ( tdm_low_rate_mode == 1 ) { nb_prm = 2; Loading Loading
apps/decoder.c +0 −26 Original line number Diff line number Diff line Loading @@ -1353,24 +1353,15 @@ static ivas_error initOnFirstGoodFrame( /* If outputting MASA, open output file and write metadata for initial bad frames */ else if ( *pBsFormat == IVAS_DEC_BS_MASA ) { #ifdef FIX_350_MASA_DELAY_COMP if ( ( error = MasaFileWriter_open( arg.outputWavFilename, arg.delayCompensationEnabled, ppMasaWriter ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_open( arg.outputWavFilename, ppMasaWriter ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError: Error opening MASA decoded metadata file %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; } /* Duplicate good first frame metadata to fill the beginning of stream. */ #ifdef FIX_350_MASA_DELAY_COMP MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else IVAS_MASA_QMETADATA_HANDLE qMetadata = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); return error; Loading @@ -1378,11 +1369,7 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { #ifdef FIX_350_MASA_DELAY_COMP if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; Loading Loading @@ -1429,11 +1416,7 @@ static ivas_error decodeG192( ivas_error error = IVAS_ERR_UNKNOWN; uint16_t numObj = 0; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; #ifdef FIX_406_IVAS_POSITION IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; #else IVAS_POSITION Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; #endif IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) Loading Loading @@ -1646,23 +1629,14 @@ static ivas_error decodeG192( } else if ( bsFormat == IVAS_DEC_BS_MASA ) { #ifdef FIX_350_MASA_DELAY_COMP MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else IVAS_MASA_QMETADATA_HANDLE qMetadata; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_350_MASA_DELAY_COMP if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, qMetadata ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; Loading
apps/renderer.c +0 −15 Original line number Diff line number Diff line Loading @@ -536,11 +536,7 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; #ifdef FIX_406_IVAS_POSITION IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; #else IVAS_POSITION Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; #endif #ifdef WMOPS reset_wmops(); Loading Loading @@ -649,9 +645,6 @@ int main( fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" ); exit( -1 ); } #ifndef FIX_389_EXT_REND_PCM_SR args.sampleRate = inFileSampleRate; #endif break; default: fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -679,11 +672,7 @@ int main( } /* === Configure === */ #ifdef FIX_392_LATE_REVERB if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_REND_InitConfig( hIvasRend, ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Error in Renderer Config Init\n" ); exit( -1 ); Loading Loading @@ -975,12 +964,8 @@ int main( } else { #ifdef FIX_379_EXT_METADATA error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ); if ( ( error != IVAS_ERR_OK ) && ( error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC #else if ( ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) ) != IVAS_ERR_OK ) && ( IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ) != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC #endif { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); Loading
ci/run_scheduled_sanitizer_test.py +18 −3 Original line number Diff line number Diff line Loading @@ -63,8 +63,7 @@ def main(args): assert all([t in SUPPORTED_TESTS for t in tests]) modes = get_modes(in_format) returncode = run_check(modes, out_formats, tests, run_fec=run_fec) returncode = run_check(in_format, out_formats, tests, run_fec=run_fec) collect_for_sanitizer_test(CONSOLE_OUT_FILE) Loading Loading @@ -92,7 +91,22 @@ def get_modes(in_format: str) -> list: return mode_list def run_check(modes: list, out_formats: list, tests: list, run_fec: bool = True): def get_md_file_command(in_format: str) -> list: cmd = list() if in_format.startswith("ISM"): cmd.append("--metadata_files") md_filename = "/usr/local/ltv/ltvISM{}.csv" n = int(in_format[-1]) cmd.extend([md_filename.format(i) for i in range(1, n + 1)]) return cmd def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): modes = get_modes(in_format) md_file_command = get_md_file_command(in_format) ### always run encoder and decoder with no frameloss cmd_no_fec = [ Loading @@ -107,6 +121,7 @@ def run_check(modes: list, out_formats: list, tests: list, run_fec: bool = True) *modes, "--oc", *out_formats, *md_file_command, ] print( Loading
ci/smoke_test.sh +6 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ fi cfg=./scripts/config/ci_linux.json dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat ism_md_cmd="--metadata_files /usr/local/testv/stvISM1.csv /usr/local/testv/stvISM2.csv /usr/local/testv/stvISM3.csv /usr/local/testv/stvISM4.csv" if [ $BUILD -eq 1 ];then # Enable memory macros to find unbalanced memory allocations/deallocations Loading @@ -74,7 +75,11 @@ if [ $BUILD -eq 1 ];then fi # run all modes vanilla-fashion ./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt # treat ISM modes separately because passing the metadata files to MASA modes causes crashes ism_modes=$(./scripts/runIvasCodec.py -l | grep ISM) non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ISM) ./scripts/runIvasCodec.py -m $non_ism_modes -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt ./scripts/runIvasCodec.py -m $ism_modes -p $cfg -U 1 $WORKERS $ism_md_cmd | tee smoke_test_output.txt # run the decoding again, but with 15% frame loss ./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS -D="-fec 15" --decoder_only | tee smoke_test_output_plc.txt Loading
lib_com/bits_alloc.c +26 −21 Original line number Diff line number Diff line Loading @@ -536,6 +536,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE const int16_t active_cnt, /* i : Active frame counter */ #endif const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -754,11 +757,12 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) { bits -= TDM_IC_LSF_PRED_BITS; } #endif /* gain Q bit-budget - part 1 */ if ( ( coder_type != UNVOICED && coder_type != AUDIO && coder_type != INACTIVE && !( core_brate <= ACELP_8k00 && coder_type != TRANSITION ) ) || ( coder_type == INACTIVE && total_brate > MAX_GSC_INACTIVE_BRATE ) ) { Loading Loading @@ -1323,6 +1327,7 @@ ivas_error config_acelp1( else { int16_t nb_prm = 4; if ( tdm_low_rate_mode == 1 ) { nb_prm = 2; Loading