From cc8c2294b054eedecfe3b6ef248957554ce2e621 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 17 Nov 2023 07:21:23 +0100 Subject: [PATCH 001/498] fix #864, use correct information for the JBM control for all rendering sizes --- apps/decoder.c | 162 +++++++++++++++++++++++++++++++++++++++++++++- lib_com/options.h | 2 + lib_dec/lib_dec.c | 41 ++++++++++++ lib_dec/lib_dec.h | 6 ++ 4 files changed, 210 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index ca333d9572..84c36e67d5 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3208,6 +3208,13 @@ static ivas_error decodeVoIP( } #endif +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + if ( vec_pos_update == 0 ) + { + IVAS_DEC_VoIP_Set20msStart( hIvasDec ); + } +#endif + /* read all packets with a receive time smaller than the system time */ while ( nextPacketRcvTime_ms <= systemTime_ms ) { @@ -3399,7 +3406,14 @@ static ivas_error decodeVoIP( vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; #endif frame++; - systemTime_ms += systemTimeInc_ms; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + if ( vec_pos_update == 0 ) + { +#endif + systemTime_ms += vec_pos_len * systemTimeInc_ms; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + } +#endif #ifdef WMOPS update_mem(); @@ -3407,6 +3421,152 @@ static ivas_error decodeVoIP( #endif } + +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t nSamplesFlushed = 0; + + do + { + + + /* Feed into decoder */ + + /* reference vector */ + if ( arg.enableReferenceVectorTracking ) + { + IVAS_VECTOR3 listenerPosition, referencePosition; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading listener and reference positions from %s\n", IVAS_DEC_GetErrorMessage( error ), Vector3PairFileReader_getFilePath( referenceVectorReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedRefVectorData( hIvasDec, listenerPosition, referencePosition ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefVectorData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* Reference rotation */ + if ( arg.enableReferenceRotation ) + { + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) + { + IVAS_QUATERNION Quaternion; + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos[0] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos[0], 0, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos[0], 0 ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* decode and get samples */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* Write current frame */ + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + + /* Write ISm metadata to external file(s) */ + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM ) + { + if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + for ( i = 0; i < numObj; ++i ) + { + IVAS_ISM_METADATA IsmMetadata; + + if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); + goto cleanup; + } + } + } + + if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) + { + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + 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; + } + + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + goto cleanup; + } + } + } + +#ifdef NONBE_UNIFIED_DECODING_PATHS + vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; +#endif + frame++; + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); +#ifdef DEBUGGING + if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) ) + { + fprintf( stdout, "\n Decoding error: BER detected in frame %d !!!!!\n", frame - 1 ); + } +#endif + } + } while ( nSamplesFlushed > 0 ); +#endif + /*------------------------------------------------------------------------------------------* * Add zeros at the end to have equal length of synthesized signals *------------------------------------------------------------------------------------------*/ diff --git a/lib_com/options.h b/lib_com/options.h index f44ad78c49..540d8793b8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -128,6 +128,7 @@ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ +#define DISABLE_LIMITER /* disable the limiter */ /*Split Rendering Debug switches*/ /*#define DBG_WAV_WRITER*/ /* add debugging function dbgwrite_wav() */ @@ -165,6 +166,7 @@ #define NONBE_FIX_871_ACELP_CRASH_IN_OSBA /* FhG: isse 871: crash in ACELP core encoder with OSBA */ #define NONBE_FIX_225_MASA_EXT_REND /* Nokia: Resolve #225: Complete MASA external renderer implementation */ #define NONBE_FIX_897_USAN_WITH_MASA_RENDERING /* Nokia: issue #897: USAN null pointer in MASA external renderer to Ambisonics */ +#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5abb39cd86..ab2c618500 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -57,6 +57,9 @@ struct IVAS_DEC_VOIP uint16_t lastDecodedWasActive; JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ uint16_t *bs_conversion_buf; /* Buffer for bitstream conversion from packed to serial */ +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t nSamplesRendered20ms; /* how many samples have been rendered since the last 20ms render border*/ +#endif #ifdef SUPPORT_JBM_TRACEFILE IVAS_JBM_TRACE_DATA JbmTraceData; #endif @@ -2612,7 +2615,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + extBufferedSamples = hVoIP->nSamplesRendered20ms + nSamplesBuffered; +#else extBufferedSamples = nSamplesRendered + nSamplesBuffered; +#endif extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; dataUnit = NULL; @@ -2723,6 +2730,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesAvailableNext -= nSamplesToZero; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hVoIP->nSamplesRendered20ms += nSamplesToZero; +#endif } else { @@ -2741,6 +2751,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } nSamplesRendered += nSamplesRendered_loop; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hVoIP->nSamplesRendered20ms += nSamplesRendered_loop; +#endif } } @@ -2748,6 +2761,34 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE +/*---------------------------------------------------------------------* + * IVAS_DEC_VoIP_Set20msStart( ) + * + * Function to tell the API that a new 20ms rendered samples border has been reached + * needed for correct JBM packet buffer operations + *---------------------------------------------------------------------*/ +ivas_error IVAS_DEC_VoIP_Set20msStart( + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ +) +{ + ivas_error error; + + error = IVAS_ERR_OK; + + if ( hIvasDec->hVoIP == NULL ) + { + return IVAS_ERR_UNKNOWN; + } + + hIvasDec->hVoIP->nSamplesRendered20ms = 0; + + + return error; +} + +#endif + /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_Flush( ) * diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 11aa3917ef..5901afe4f4 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -283,6 +283,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE +ivas_error IVAS_DEC_VoIP_Set20msStart( + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ +); +#endif + ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ -- GitLab From 3d9a3ebfd7f5c00cd3bef64b81826589d7eda656 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 17 Nov 2023 07:51:15 +0100 Subject: [PATCH 002/498] move orientation reading if the JBM flush part to the correct place, unset #DISABLE_LIMITER --- apps/decoder.c | 180 +++++++++++++++++++++++++++++++--------------- lib_com/options.h | 2 +- 2 files changed, 123 insertions(+), 59 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 9cdcb140c2..b7a00f2c16 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3497,64 +3497,6 @@ static ivas_error decodeVoIP( do { - - /* Feed into decoder */ - - /* reference vector */ - if ( arg.enableReferenceVectorTracking ) - { - IVAS_VECTOR3 listenerPosition, referencePosition; - if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading listener and reference positions from %s\n", IVAS_DEC_GetErrorMessage( error ), Vector3PairFileReader_getFilePath( referenceVectorReader ) ); - goto cleanup; - } - - if ( ( error = IVAS_DEC_FeedRefVectorData( hIvasDec, listenerPosition, referencePosition ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedRefVectorData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - - /* Reference rotation */ - if ( arg.enableReferenceRotation ) - { - IVAS_QUATERNION quaternion; - if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); - goto cleanup; - } - - if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - - /* Head-tracking input simulation */ - if ( arg.enableHeadRotation ) - { - IVAS_QUATERNION Quaternion; - if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos[0] ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); - goto cleanup; - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos[0], 0, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos[0], 0 ) ) != IVAS_ERR_OK ) -#endif - { - fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) @@ -3633,6 +3575,128 @@ static ivas_error decodeVoIP( } #endif } + +#ifdef NONBE_UNIFIED_DECODING_PATHS + /* reference vector */ + if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) + { + IVAS_VECTOR3 listenerPosition, referencePosition; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading listener and reference positions from %s\n", IVAS_DEC_GetErrorMessage( error ), Vector3PairFileReader_getFilePath( referenceVectorReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedRefVectorData( hIvasDec, listenerPosition, referencePosition ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefVectorData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* Reference rotation */ + if ( arg.enableReferenceRotation && vec_pos_update == 0 ) + { + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + int16_t num_subframes; + if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetNumOrientationSubframes failed: \n" ); + goto cleanup; + } + + /* Head-tracking input simulation */ + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) + { + IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( headRotReader == NULL ) + { + for ( i = 0; i < num_subframes; i++ ) + { + Quaternions[i].w = -3.0f; + Quaternions[i].x = 0.0f; + Quaternions[i].y = 0.0f; + Quaternions[i].z = 0.0f; + Pos[i].x = 0.0f; + Pos[i].y = 0.0f; + Pos[i].z = 0.0f; + } + } + else + { +#endif + for ( i = 0; i < num_subframes; i++ ) + { + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + } +#ifdef SPLIT_REND_WITH_HEAD_ROT + } +#endif + + for ( i = 0; i < num_subframes; i++ ) + { + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + DEFAULT_AXIS +#endif + ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + } + + if ( arg.enableExternalOrientation ) + { + IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int8_t enableHeadRotation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + + for ( i = 0; i < num_subframes; i++ ) + { + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( externalOrientationFileReader ) ); + goto cleanup; + } + } + for ( i = 0; i < num_subframes; i++ ) + { + if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternions[i], enableHeadRotation[i], enableExternalOrientation[i], enableRotationInterpolation[i], numFramesToTargetOrientation[i], i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + } +#endif + } while ( nSamplesFlushed > 0 ); #endif diff --git a/lib_com/options.h b/lib_com/options.h index e00d4ec682..a4dc2bfd07 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -128,7 +128,7 @@ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ -#define DISABLE_LIMITER /* disable the limiter */ +/*#define DISABLE_LIMITER*/ /* disable the limiter */ /*Split Rendering Debug switches*/ /*#define DBG_WAV_WRITER*/ /* add debugging function dbgwrite_wav() */ -- GitLab From a0a21782d26e948222d0019bfcd848d93f4dadf4 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 17 Nov 2023 08:29:24 +0100 Subject: [PATCH 003/498] fix flush function, return immediately if there is nothing to flush. --- lib_dec/lib_dec.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 2c8bf04e3a..326bb2dac8 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2858,13 +2858,19 @@ ivas_error IVAS_DEC_Flush( nSamplesToRender = (uint16_t) *nSamplesFlushed; /* render IVAS frames */ - +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + error = IVAS_ERR_OK; + if ( nSamplesToRender > 0 ) + { +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT - error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmType, pcmBuf ); + error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmType, pcmBuf ); #else - error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); + error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); +#endif +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + } #endif - return error; } -- GitLab From 86a8926d86f267c7e7233bb9ccff6ebfd5d253eb Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 17 Nov 2023 09:05:35 +0100 Subject: [PATCH 004/498] do not flush EVS to ensure BE --- lib_dec/lib_dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 326bb2dac8..03126f2599 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2860,13 +2860,13 @@ ivas_error IVAS_DEC_Flush( /* render IVAS frames */ #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE error = IVAS_ERR_OK; - if ( nSamplesToRender > 0 ) + if ( nSamplesToRender > 0 && hIvasDec->st_ivas->ivas_format != MONO_FORMAT ) { #endif #ifdef SPLIT_REND_WITH_HEAD_ROT error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmType, pcmBuf ); #else - error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); + error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); #endif #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE } -- GitLab From 8c97318a61d3206cdf4369e18105cab24075985e Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 17 Nov 2023 09:30:00 +0100 Subject: [PATCH 005/498] fix flushing for EVS --- lib_dec/lib_dec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 03126f2599..4dd8f9412c 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2870,6 +2870,10 @@ ivas_error IVAS_DEC_Flush( #endif #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE } + else + { + *nSamplesFlushed = 0; + } #endif return error; } -- GitLab From d0d54aa786b9828f83ab203c6b5da3c07de7d1da Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 8 Dec 2023 09:36:15 +0100 Subject: [PATCH 006/498] keep the 20ms JBM householding inside the API, change ISM TD renderer to really render subframes and in case of combined orientation use the same MD logic as the TD binaural renderer --- apps/decoder.c | 7 -- lib_dec/ivas_ism_renderer.c | 144 +++++++++++++++++++++++++++--------- lib_dec/lib_dec.c | 42 +++++------ lib_dec/lib_dec.h | 6 -- 4 files changed, 128 insertions(+), 71 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index b7a00f2c16..d57f88af56 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3277,13 +3277,6 @@ static ivas_error decodeVoIP( } #endif -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - if ( vec_pos_update == 0 ) - { - IVAS_DEC_VoIP_Set20msStart( hIvasDec ); - } -#endif - /* read all packets with a receive time smaller than the system time */ while ( nextPacketRcvTime_ms <= systemTime_ms ) { diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 94060ae8ef..7d2c815386 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -254,87 +254,161 @@ void ivas_ism_render_sf( int16_t tc_offset; int16_t interp_offset; float gain, prev_gain; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; + int16_t n_samples_rendered_loop; +#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { num_objects = st_ivas->nchan_ism; } +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ + slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity ); + first_sf = st_ivas->hTcBuffer->subframes_rendered; + last_sf = first_sf; + n_samples_rendered_loop = 0; + while ( slots_to_render > 0 ) + { + slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; + last_sf++; + } + +#endif nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; tc_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + /* Number of subframes to delay metadata to sync with audio */ + if ( st_ivas->hDecoderConfig->Opt_delay_comp ) + { + ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 ); + } + else + { + ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; + } +#endif for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { set_f( output_f[i], 0.0f, n_samples_to_render ); } +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) + { + int16_t n_samples_in_subframe; + + n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; +#endif + #ifdef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) #else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) #endif - { + { +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); +#else ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); - interp_offset = 0; - } +#endif + interp_offset = 0; + } - for ( i = 0; i < num_objects; i++ ) - { - /* Combined rotation: rotate the object positions depending the head and external orientations */ + for ( i = 0; i < num_objects; i++ ) + { + /* Combined rotation: rotate the object positions depending the head and external orientations */ #ifdef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) #else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) #endif - { + { +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + if ( subframe_idx >= ism_md_subframe_update_jbm ) + { + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); + } + else + { + rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); + } +#else rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); +#endif - if ( st_ivas->hEFAPdata != NULL ) - { - efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); + if ( st_ivas->hEFAPdata != NULL ) + { + efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); + } } - } - lfe_index = 0; - for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) - { - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) + lfe_index = 0; + for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) { - ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; - } + if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) + { + ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; + } - gain = st_ivas->hIsmRendererData->gains[i][j]; - prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; - if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) - { - g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; - tc = &st_ivas->hTcBuffer->tc[i][tc_offset]; - for ( k = 0; k < n_samples_to_render; k++ ) + gain = st_ivas->hIsmRendererData->gains[i][j]; + prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; + if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) { - g2 = 1.0f - *g1; + g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; + tc = &st_ivas->hTcBuffer->tc[i][tc_offset]; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + for ( k = 0; k < n_samples_in_subframe; k++ ) +#else + for ( k = 0; k < n_samples_to_render; k++ ) +#endif + { + g2 = 1.0f - *g1; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); +#else output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); +#endif + } } - } - /* update here only in case of head rotation */ + /* update here only in case of head rotation */ #ifdef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) #else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) #endif - { - st_ivas->hIsmRendererData->prev_gains[i][j] = gain; + { + st_ivas->hIsmRendererData->prev_gains[i][j] = gain; + } } } - } #ifdef NONBE_UNIFIED_DECODING_PATHS - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); + /* update combined orientation access index */ +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); +#else + ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); +#endif +#endif +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + n_samples_rendered_loop += n_samples_in_subframe; + if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) + { + st_ivas->hTcBuffer->subframes_rendered += 1; + st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; + } + tc_offset += n_samples_in_subframe; + interp_offset += n_samples_in_subframe; + } #endif return; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4dd8f9412c..b99ef856e8 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -134,7 +134,9 @@ static ivas_error set_pcm_buffer_to_zero( void *buffer, const IVAS_DEC_PCM_TYPE #ifdef NONBE_UNIFIED_DECODING_PATHS static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); #endif - +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE +static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ); +#endif /*---------------------------------------------------------------------* * IVAS_DEC_Open() @@ -787,6 +789,9 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->lastDecodedWasActive = 0; hIvasDec->hVoIP->hCurrentDataUnit = NULL; hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hIvasDec->hVoIP->nSamplesRendered20ms = 0; +#endif #define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ @@ -1583,6 +1588,9 @@ static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( if ( hIvasDec->st_ivas->hTcBuffer != NULL ) { *nSamplesBuffered = hIvasDec->st_ivas->hTcBuffer->n_samples_buffered - hIvasDec->st_ivas->hTcBuffer->n_samples_rendered; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + *nSamplesBuffered += hIvasDec->hVoIP->nSamplesRendered20ms; +#endif } return IVAS_ERR_OK; @@ -2658,7 +2666,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - extBufferedSamples = hVoIP->nSamplesRendered20ms + nSamplesBuffered; + extBufferedSamples = nSamplesBuffered; #else extBufferedSamples = nSamplesRendered + nSamplesBuffered; #endif @@ -2773,7 +2781,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hIvasDec->nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesAvailableNext -= nSamplesToZero; #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - hVoIP->nSamplesRendered20ms += nSamplesToZero; + update_voip_rendered20ms( hIvasDec, nSamplesToZero ); #endif } else @@ -2794,7 +2802,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesRendered += nSamplesRendered_loop; #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - hVoIP->nSamplesRendered20ms += nSamplesRendered_loop; + update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); #endif } } @@ -2802,31 +2810,19 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return IVAS_ERR_OK; } - #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE /*---------------------------------------------------------------------* - * IVAS_DEC_VoIP_Set20msStart( ) + * update_voip_rendered20ms( ) * - * Function to tell the API that a new 20ms rendered samples border has been reached - * needed for correct JBM packet buffer operations + * Function to flush remaining audio in VoIP *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_Set20msStart( - IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ -) -{ - ivas_error error; - - error = IVAS_ERR_OK; - - if ( hIvasDec->hVoIP == NULL ) - { - return IVAS_ERR_UNKNOWN; - } - - hIvasDec->hVoIP->nSamplesRendered20ms = 0; +static void update_voip_rendered20ms( + IVAS_DEC_HANDLE hIvasDec, + const int16_t nSamplesRendered ) +{ - return error; + hIvasDec->hVoIP->nSamplesRendered20ms = ( hIvasDec->hVoIP->nSamplesRendered20ms + nSamplesRendered ) % hIvasDec->hVoIP->nSamplesFrame; } #endif diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 67315a121b..1b5e7e4fcc 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -290,12 +290,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif ); -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE -ivas_error IVAS_DEC_VoIP_Set20msStart( - IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ -); -#endif - ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ -- GitLab From 745f55ee87ec63ccb7cd85b070cfb17adacbce94 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 11 Dec 2023 09:32:06 +0100 Subject: [PATCH 007/498] fix TSM, time scaling done flag was not set correctly for non-20ms render frame size. --- lib_com/options.h | 3 ++- lib_dec/lib_dec.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a4dc2bfd07..4e24b8ad22 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ #ifdef DEBUG_MODE_INFO /*#define DEBUG_MODE_ACELP*/ /* output most important ACELP core parameters to the subdirectory "res/" */ /*#define DEBUG_MODE_TCX*/ /* output most important TCX core parameters to the subdirectory "res/" */ @@ -72,6 +72,7 @@ /*#define DEBUG_MODE_INFO_PLC */ /* define to output PLC related parameters */ /*#define DEBUG_MODE_INFO_ALLRAD*/ /* define to output generated HOA decoding mtx */ /*#define DEBUG_MODE_LFE */ /* define to output LFE relevant parameters */ +/*#define DEBUG_MODE_JBM */ /* define to output JBM relevant parameters */ #endif #ifdef DEBUG_MODE_MDCT diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b99ef856e8..8a2de056b9 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -81,6 +81,9 @@ struct IVAS_DEC bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ int16_t tsm_scale; /* scale for TSM operation */ int16_t tsm_max_scaling; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t timeScalingDone; /* have we done already one TSM in a 20ms frame? */ +#endif #ifdef FIX_899_VARIABLE_SPEED_DECODING float tsm_quality; #endif @@ -174,6 +177,9 @@ ivas_error IVAS_DEC_Open( #ifdef FIX_899_VARIABLE_SPEED_DECODING hIvasDec->tsm_max_scaling = 0; hIvasDec->tsm_quality = 1.0f; +#endif +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hIvasDec->timeScalingDone = 0; #endif hIvasDec->needNewFrame = false; hIvasDec->nTransportChannelsOld = 0; @@ -1134,19 +1140,26 @@ ivas_error IVAS_DEC_GetSamples( return IVAS_ERR_UNKNOWN; } assert( nTimeScalerOutSamples <= APA_BUF ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hIvasDec->timeScalingDone = 1; +#endif } else { nTimeScalerOutSamples = hIvasDec->nSamplesFrame * nTransportChannels; } nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; - +#ifdef DEBUG_MODE_JBM + dbgwrite( &nTimeScalerOutSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_nTimeScaleOutSamples.dat" ); +#endif /* render IVAS frames */ if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) { return error; } - +#ifdef DEBUG_MODE_JBM + dbgwrite( &nResidualSamples, sizeof( int16_t ), 1, 1, "./res/JBM_nResidualSamples.dat" ); +#endif if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { /* feed residual samples to TSM for the next call */ @@ -2632,7 +2645,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( uint32_t extBufferedTime_ms, scale, maxScaling; JB4_DATAUNIT_HANDLE dataUnit; uint16_t extBufferedSamples; +#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t timeScalingDone; +#endif int16_t result; ivas_error error; int16_t nSamplesRendered; @@ -2641,7 +2656,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; +#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE timeScalingDone = 0; +#endif nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; nSamplesRendered = 0; @@ -2673,6 +2690,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; dataUnit = NULL; + /* pop one access unit from the jitter buffer */ result = JB4_PopDataUnit( hVoIP->hJBM, systemTimestamp_ms, extBufferedTime_ms, &dataUnit, &scale, &maxScaling ); if ( result != 0 ) @@ -2681,17 +2699,30 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } maxScaling = maxScaling * hDecoderConfig->output_Fs / 1000; - /* avoid time scaling multiple times in one sound card slot */ +#ifdef DEBUG_MODE_JBM + dbgwrite( &extBufferedSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_extBufferedSamples.dat" ); + dbgwrite( &systemTimestamp_ms, sizeof( uint32_t ), 1, 1, "./res/JBM_systemTimestamp.dat" ); + dbgwrite( &scale, sizeof( uint32_t ), 1, 1, "./res/JBM_scale.dat" ); + dbgwrite( &maxScaling, sizeof( uint32_t ), 1, 1, "./res/JBM_maxScale.dat" ); +#endif + + /* avoid time scaling multiple times within one 20ms frame*/ if ( scale != 100U ) { +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + if ( hIvasDec->timeScalingDone ) +#else if ( timeScalingDone ) +#endif { scale = 100; } +#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE else { timeScalingDone = 1; } +#endif } /* limit scale to range supported by time scaler */ @@ -2821,8 +2852,14 @@ static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ) { - - hIvasDec->hVoIP->nSamplesRendered20ms = ( hIvasDec->hVoIP->nSamplesRendered20ms + nSamplesRendered ) % hIvasDec->hVoIP->nSamplesFrame; + int16_t nSamplesRenderedTotal; + nSamplesRenderedTotal = hIvasDec->hVoIP->nSamplesRendered20ms + nSamplesRendered; + /* we have crossed a 20ms border, reset the time scaling done flag */ + if ( nSamplesRenderedTotal >= hIvasDec->hVoIP->nSamplesFrame ) + { + hIvasDec->timeScalingDone = 0; + } + hIvasDec->hVoIP->nSamplesRendered20ms = nSamplesRenderedTotal % hIvasDec->hVoIP->nSamplesFrame; } #endif -- GitLab From 2abf597fe17ebdbb5940a8e67a37202c42cabcd6 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 18 Dec 2023 17:08:03 +0100 Subject: [PATCH 008/498] add bw switching to some testcases in self_test.prm --- scripts/config/self_test.prm | 100 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 0be62cefe6..bc90050fec 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -73,8 +73,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -stereo -dtx 13200 32 testv/stvST32n.wav bit ../IVAS_dec STEREO 32 bit testv/stvST32n.wav_stereo_13200_32-32_DTX.tst -// stereo at 13.2 kbps, 32kHz in, 32kHz out, DTX on, random FER at 5% -../IVAS_cod -stereo -dtx 13200 32 testv/stvST32n.wav bit +// stereo at 13.2 kbps, 32kHz in, 32kHz out, DTX on, random FER at 5%, bandwidth switching +../IVAS_cod -max_band scripts/testv/ivas_bws_20fr_start_WB.txt -stereo -dtx 13200 32 testv/stvST32n.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec STEREO 32 bit_error testv/stvST32n.wav_stereo_13200_32-32_DTX_FER5.tst @@ -187,8 +187,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec STEREO 32 bit_error testv/stvST48c.wav_stereo_32000_48-32_FER5.tst -// stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5% -../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit +// stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -stereo -dtx 32000 48 testv/stvST48n.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec STEREO 48 bit_error testv/stvST48n.wav_stereo_32000_48-48_DTX_FER5.tst @@ -225,8 +225,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec STEREO 32 bit_error testv/stvST32c.wav_stereo_48000_32-32_FER5.tst -// stereo at 64 kbps, 32kHz in, 32kHz out -../IVAS_cod -stereo 64000 32 testv/stvST32c.wav bit +// stereo at 64 kbps, 32kHz in, 32kHz out, bandwidth switching +../IVAS_co -max_band ivas_bws_20fr_start_FB.txtd -stereo 64000 32 testv/stvST32c.wav bit ../IVAS_dec STEREO 32 bit testv/stvST32c.wav_stereo_64000_32-32.tst // stereo at 96 kbps, 32kHz in, 32kHz out, random FER at 5% @@ -246,8 +246,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -stereo 128000 48 testv/stvST48c.wav bit ../IVAS_dec MONO 48 bit testv/stvST48c.wav_stereo_128000_48-48_MONO.tst -// stereo at 48 kbps, 48 kHz in, 48 kHz out, DTX on -../IVAS_cod -stereo -dtx 48000 48 testv/stvST48n.wav bit +// stereo at 48 kbps, 48 kHz in, 48 kHz out, DTX on, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -stereo -dtx 48000 48 testv/stvST48n.wav bit ../IVAS_dec STEREO 48 bit testv/stvST48n.wav_stereo_48000_48-48_DTX.tst // stereo at 48 kbps, 32 kHz in, 32 kHz out, DTX on @@ -295,8 +295,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stv48n.wav_1ISM_13200_48-48_DTX_FER5_BINAURAL.tst -// 1 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out -../IVAS_cod -ism 1 testv/stvISM1.csv 16400 48 testv/stv1ISM48s.wav bit +// 1 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -ism 1 testv/stvISM1.csv 16400 48 testv/stv1ISM48s.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv1ISM48s.wav_16400_48-48_binaural_room.tst // 1 ISM with metadata at 32 kbps, 32 kHz in, 32 kHz out, DTX on, MONO out @@ -328,8 +328,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR_EXOF.tst -// 1 ISM with metadata at 96 kbps, 48 kHz in, 16 kHz out, EXT out -../IVAS_cod -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit +// 1 ISM with metadata at 96 kbps, 48 kHz in, 16 kHz out, EXT out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_FB.txt -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit ../IVAS_dec EXT 16 bit testv/stv1ISM48s.wav_96000_48-16_EXT.tst // 1 ISM with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, EXT out, DTX on @@ -435,8 +435,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec FOA 48 bit testv/stv4ISM48s.wav_32000_48-48_FOA.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, STEREO out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, STEREO out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec STEREO 48 bit testv/stv4ISM48s.wav_32000_48-48_STEREO.tst // 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out @@ -477,8 +477,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 96000 48 testv/stv4ISM48s.wav bit ../IVAS_dec EXT 48 bit testv/stv4ISM48s.wav_96000_48-48_EXT.tst -// 4 ISM with metadata at 128 kbps, 48 kHz in, 48 kHz out, EXT out -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48s.wav bit +// 4 ISM with metadata at 128 kbps, 48 kHz in, 48 kHz out, EXT out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48s.wav bit ../IVAS_dec EXT 48 bit testv/stv4ISM48s.wav_128000_48-48_EXT.tst // 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, EXT out @@ -540,8 +540,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/stv+4ISM48n+non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst -// SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out -../IVAS_cod -sba 3 13200 32 testv/stv3OA32c.wav bit +// SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/stv3OA32c.wav bit ../IVAS_dec HOA3 32 bit testv/stv3OA32c.wav_SBA_13200_32-32_HOA3.tst // SBA at 13.2 kbps, 32kHz in, 32kHz out, STEREO out @@ -611,8 +611,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 32000 32 testv/stvFOA32c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_32000_32-32_BINAURAL_ROOM.tst -// SBA at 32 kbps, 48kHz in, 48kHz out, MONO out, DTX -../IVAS_cod -dtx -sba 1 32000 48 testv/stvFOA48c.wav bit +// SBA at 32 kbps, 48kHz in, 48kHz out, MONO out, DTX,bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_FB.txt -dtx -sba 1 32000 48 testv/stvFOA48c.wav bit ../IVAS_dec MONO 48 bit testv/stvFOA48c.wav_SBA_32000_48-48_DTX_MONO.tst // SBA at 48 kbps, 32kHz in, 32kHz out, MONO out, random FER at 5% @@ -786,12 +786,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 7_1 48 bit_error testv/stvFOA48c.wav_SBA_256000_48-48_7_1_FER5.tst -// SBA 2OA at 384 kbps, 32kHz in, 32kHz out, STEREO out -../IVAS_cod -sba 2 384000 32 testv/stv2OA32c.wav bit +// SBA 2OA at 384 kbps, 32kHz in, 32kHz out, STEREO out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -sba 2 384000 32 testv/stv2OA32c.wav bit ../IVAS_dec STEREO 32 bit testv/stv2OA32c.wav_SBA_384000_32-32_stereo.tst -// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out -../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit +// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_binaural.tst // SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation @@ -843,8 +843,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec FOA 48 bit testv/stvFOA48c.wav_sw_48-48_FOA.tst -// MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out -../IVAS_cod -masa 1 testv/stv1MASA1TC48c.met 13200 48 testv/stv1MASA1TC48c.wav bit +// MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -masa 1 testv/stv1MASA1TC48c.met 13200 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv1MASA1TC48c.wav_13200_48-48_BINAURAL.tst // MASA 1dir 1TC at 16.4 kbps, 48kHz in, 48kHz out, HOA3 out, random FER at 5% @@ -898,8 +898,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/stv2MASA1TC48c.met 128000 48 testv/stv2MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv2MASA1TC48c.wav_128000_48-48_BINAURAL_Headrot_EXOF.tst -// MASA 1dir 2TC at 13.2 kbps, 48kHz in, 48kHz out, 5_1 out, random FER at 5% -../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 13200 48 testv/stv1MASA2TC48c.wav bit +// MASA 1dir 2TC at 13.2 kbps, 48kHz in, 48kHz out, 5_1 out, random FER at 5%, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -masa 2 testv/stv1MASA2TC48c.met 13200 48 testv/stv1MASA2TC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 5_1 48 bit_error testv/stv1MASA2TC48c.wav_13200_48-48_5_1_FER5.tst @@ -953,8 +953,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 256000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv1MASA2TC48c.wav_256000_48-48_5_1.tst -// MASA 2dir 2TC at 48 kbps, 48kHz in, 48kHz out, 5_1 out -../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 48000 48 testv/stv2MASA2TC48c.wav bit +// MASA 2dir 2TC at 48 kbps, 48kHz in, 48kHz out, 5_1 out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_FB.txt -masa 2 testv/stv2MASA2TC48c.met 48000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv2MASA2TC48c.wav_48000_48-48_5_1.tst // MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, EXTERNAL out, random FER at 5% @@ -983,8 +983,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom.tst -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out -../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit +// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst // MASA 2dir 2TC at 512 kbps, 48kHz in, 48kHz out, 5_1 out @@ -1059,8 +1059,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_FER5.tst -// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out -../IVAS_cod -mc 5_1 24400 48 testv/stv51MC48c.wav bit +// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_Subframe.tst // Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation @@ -1096,8 +1096,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_room_Headrot_EXOF.tst -// Multi-channel 5_1 at 96 kbps, 48kHz in, 48kHz out, random FER at 5% -../IVAS_cod -mc 5_1 96000 48 testv/stv51MC48c.wav bit +// Multi-channel 5_1 at 96 kbps, 48kHz in, 48kHz out, random FER at 5%, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_FB.txt -mc 5_1 96000 48 testv/stv51MC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 5_1 48 bit_error testv/stv51MC48c.wav_MC51_96000_48-48_5_1_FER5.tst @@ -1162,8 +1162,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec MONO 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_MONO.tst -// Multi-channel 7_1_4 at 48 kbps, 48kHz in, 48kHz out, MONO out -../IVAS_cod -mc 7_1_4 48000 48 testv/stv714MC48c.wav bit +// Multi-channel 7_1_4 at 48 kbps, 48kHz in, 48kHz out, MONO out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -mc 7_1_4 48000 48 testv/stv714MC48c.wav bit ../IVAS_dec MONO 48 bit testv/stv714MC48c.wav_MC714_48000_48-48_Mono.tst // Multi-channel 7_1_4 at 64 kbps, 48kHz in, 48kHz out, MONO out, random FER at 5% @@ -1184,8 +1184,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 5_1 48 bit_error testv/stv714MC48c.wav_MC714_96000_48-48_5_1_FER5.tst -// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL out -../IVAS_cod -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit +// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv714MC48c.wav_MC714_160000_48-48_MC_binaural.tst // Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, 7_1_4 out @@ -1233,8 +1233,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1_2 512000 48 testv/stv512MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst -// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer -../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit +// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst // Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer @@ -1261,8 +1261,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit ../IVAS_dec 7_1_4 48 bit testv/stv51MC48c.wav_sw_48-48_7_1_4.tst -// Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10% -../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv51MC48c.wav bit +// Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv51MC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stv51MC48c.wav_sw_48-48_binaural_FER10.tst @@ -1424,8 +1424,8 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -ism_masa 1 2 NULL testv/stv2MASA2TC48c.met 13200 48 testv/stvOMASA_1ISM_2MASA2TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOMASA_1ISM_2MASA2TC48c.wav_BINAURAL_13200_48-48.tst -// OMASA 1Dir2TC 1ISM at 128 kbps, 48kHz in, 48kHz out, EXT out -../IVAS_cod -ism_masa 1 2 testv/stvISM1.csv testv/stv1MASA2TC48c.met 128000 48 testv/stvOMASA_1ISM_1MASA2TC48c.wav bit +// OMASA 1Dir2TC 1ISM at 128 kbps, 48kHz in, 48kHz out, EXT out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_SWB.txt -ism_masa 1 2 testv/stvISM1.csv testv/stv1MASA2TC48c.met 128000 48 testv/stvOMASA_1ISM_1MASA2TC48c.wav bit ../IVAS_dec EXT 48 bit testv/stvOMASA_1ISM_1MASA2TC48c.wav_EXT_128000_48-48.tst // OMASA 2Dir1TC 1ISM at 512 kbps, 32kHz in, 48kHz out, 7.1.4 out, FER at 5% @@ -1548,8 +1548,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 1 1 testv/stvISM1.csv 32000 48 testv/stvOSBA_1ISM_FOA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOSBA_1ISM_FOA48c.wav_BINAURAL_32000_48-48.tst -// OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out -../IVAS_cod -ism_sba 2 1 testv/stvISM1.csv testv/stvISM2.csv 64000 48 testv/stvOSBA_2ISM_FOA48c.wav bit +// OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_WB.txt -ism_sba 2 1 testv/stvISM1.csv testv/stvISM2.csv 64000 48 testv/stvOSBA_2ISM_FOA48c.wav bit ../IVAS_dec HOA3 48 bit testv/stvOSBA_2ISM_FOA48c.wav_HOA3_64000_48-48.tst // OSBA FOA 3ISM at 128 kbps, 48kHz in, 48kHz out, 7_1_4 out @@ -1616,8 +1616,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 32 testv/stvOSBA_4ISM_3OA32c.wav bit ../IVAS_dec EXT 48 bit testv/stvOSBA_4ISM_3OA32c.wav_EXT_sw_13k2_512k_32-48.tst -// OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5% -../IVAS_cod -ism_sba 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_FOA48c.wav bit +// OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5%, bandwidth switching +../IVAS_cod -max_band ivas_bws_20fr_start_FB.txt -ism_sba 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_FOA48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-48_FER5.tst -- GitLab From 6d8749c5ba33e50af63dfcaf15db9e899851d1c5 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Thu, 11 Jan 2024 13:25:49 +0100 Subject: [PATCH 009/498] fix difference between 5/10/20 ms frames in 13.2kbps McMASA binaural rendering. switch: NONBE_FIX_951_MCMASA_5MS_RENDERING --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index ebaa43a69d..1cc56b5c11 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ #define NONBE_FIX_944_FEC_OMASA_1SEP_OBJ_MASA /* Nokia: issue 944: fix FEC error in OMASA */ +#define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 30fe1142b0..8ff1823fd4 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1372,8 +1372,11 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { int16_t offset = hSpatParamRendCom->slots_rendered * hSpatParamRendCom->slot_size; +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + nchan_remapped = st_ivas->hTcBuffer->nchan_buffer_full; +#else nchan_remapped = st_ivas->nchan_transport; - +#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); -- GitLab From b56da9279ad0c3b575ce3b85059f2fab6f86e3bf Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Thu, 11 Jan 2024 13:53:29 +0100 Subject: [PATCH 010/498] adjust McMASA fix for BIN outputs --- lib_dec/ivas_jbm_dec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8ff1823fd4..ffa31a96fe 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1372,13 +1372,12 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { int16_t offset = hSpatParamRendCom->slots_rendered * hSpatParamRendCom->slot_size; -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - nchan_remapped = st_ivas->hTcBuffer->nchan_buffer_full; -#else nchan_remapped = st_ivas->nchan_transport; -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + nchan_remapped = st_ivas->hTcBuffer->nchan_buffer_full; +#endif ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */ -- GitLab From 4fbd8abcd4b3e379e9839f187c9dcbee762241fd Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 15 Jan 2024 22:31:29 +1100 Subject: [PATCH 011/498] LCLD 5ms changes --- apps/decoder.c | 34 ++ lib_com/options.h | 3 + lib_dec/ivas_init_dec.c | 13 +- lib_dec/ivas_mc_paramupmix_dec.c | 30 +- lib_dec/ivas_stat_dec.h | 4 +- lib_dec/lib_dec.c | 90 +++- lib_rend/ivas_MSPred.c | 93 ---- lib_rend/ivas_PredDecoder.c | 234 ++++++++- lib_rend/ivas_PredEncoder.c | 544 ++++++++++++++++++++- lib_rend/ivas_RMSEnvGrouping.c | 225 ++++++++- lib_rend/ivas_lcld_decoder.c | 171 +++---- lib_rend/ivas_lcld_encoder.c | 713 +++++++++++++++++++++++----- lib_rend/ivas_lcld_prot.h | 94 +++- lib_rend/ivas_lcld_rom_tables.c | 2 + lib_rend/ivas_lcld_rom_tables.h | 12 +- lib_rend/ivas_prot_rend.h | 64 +++ lib_rend/ivas_splitRend_lcld_dec.c | 94 +++- lib_rend/ivas_splitRend_lcld_enc.c | 127 +++-- lib_rend/ivas_splitRendererPLC.c | 165 +++++-- lib_rend/ivas_splitRendererPre.c | 64 ++- lib_rend/ivas_splitRenderer_utils.c | 25 + lib_rend/ivas_stat_rend.h | 8 + lib_rend/lib_rend.c | 68 ++- 23 files changed, 2434 insertions(+), 443 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 54879bb30e..3d961ae833 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -456,9 +456,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 ) ); @@ -471,10 +476,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; } @@ -629,6 +636,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 ) ) { @@ -645,6 +653,7 @@ int main( return error; } +#endif #endif if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) @@ -659,6 +668,31 @@ int main( goto cleanup; } +#ifdef SPLIT_REND_LCLD_5MS +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( asked_frame_size == IVAS_RENDER_FRAMESIZE_5MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || + renderConfig.split_rend_config.dof == 0 ) ) + { + arg.renderFramesize = IVAS_RENDER_FRAMESIZE_5MS; + } + 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 ) diff --git a/lib_com/options.h b/lib_com/options.h index fc6c6a06aa..b1215c8761 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -134,6 +134,8 @@ /*#define SPLIT_REND_WITH_HEAD_ROT_DEBUG*/ /* debugging switch for split rendering */ /*#define SPLIT_POSE_CORRECTION_DEBUG*/ /* debugging switch for split rendering pose correction */ /*#define SPLIT_MD_CODING_DEBUG*/ /* debugging switch for split rendering metadata coding */ +/*#define DEBUG_WRITE_PREDICTORS*/ /* debugging switch for LCDL predictors*/ +/*#define DEBUG_WRITE_MS_PRED*/ /* debugging switch for LCLD mid-side prediction*/ #endif /* DEBUGGING */ @@ -172,6 +174,7 @@ #define SPLIT_REND_HF_TUNING /* Dlb: issue 950: split rendering MD tuning change at high frequencies*/ #define SPLIT_REND_MC_FIX_LFE /* Dlb: issue 950: split rendering LFE fix for 7.1 and 5.1 MC mode*/ #define SPLIT_EXT_REND_FIX_LIMITER_POS /* Dlb: issue 950: fixing limiter position in split rendering mode in external renderer*/ +#define SPLIT_REND_LCLD_5MS /* Dlb: LCLD 5ms framing operation */ #endif /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d24e043648..2aea345c36 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -247,10 +247,18 @@ static ivas_error ivas_dec_init_split_rend( } } +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag ) ) != IVAS_ERR_OK ) { return error; } +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -2477,7 +2485,9 @@ void ivas_initialize_handles_dec( st_ivas->hSplitBinRend.hMultiBinCldfbData = NULL; st_ivas->hSplitBinRend.hSplitRendBits = NULL; st_ivas->hSplitBinRend.hCldfbDataOut = NULL; +#ifndef SPLIT_REND_LCLD_5MS st_ivas->hSplitBinRend.tdDataOut = NULL; +#endif st_ivas->hSplitBinRend.numTdSamplesPerChannelCached = 0; ivas_init_split_rend_handles( &st_ivas->hSplitBinRend.splitrend ); #endif @@ -2627,11 +2637,12 @@ void ivas_destroy_dec( free( st_ivas->hSplitBinRend.hCldfbDataOut ); st_ivas->hSplitBinRend.hCldfbDataOut = NULL; } - +#ifndef SPLIT_REND_LCLD_5MS if ( st_ivas->hSplitBinRend.tdDataOut != NULL ) { free( st_ivas->hSplitBinRend.tdDataOut ); } +#endif #endif /* Parametric binaural renderer handle */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index fdbca9f546..5fc36b9e61 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -66,11 +66,15 @@ const int16_t MC_PARAMUPMIX_CHIDX2[MC_PARAMUPMIX_COMBINATIONS] = { 2, 3, 6, 7 }; static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); +#ifndef SPLIT_REND_LCLD_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS], const int16_t slot_index_start ); #else static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); #endif +#else +static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); +#endif static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering ); @@ -208,8 +212,10 @@ void ivas_mc_paramupmix_dec_render( int16_t slots_to_render, first_sf, last_sf, subframe_idx; uint16_t slot_size, ch; float *output_f_local[MAX_OUTPUT_CHANNELS]; +#ifndef SPLIT_REND_LCLD_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t slot_index_start; +#endif #endif MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; @@ -251,18 +257,22 @@ void ivas_mc_paramupmix_dec_render( mvr2r( hMCParamUpmix->alpha_prev[ch], hMCParamUpmix->alpha_sf[ch], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); } - +#ifndef SPLIT_REND_LCLD_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT slot_index_start = 0; +#endif #endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; - +#ifndef SPLIT_REND_LCLD_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local, slot_index_start ); slot_index_start += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; +#else + ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); +#endif #else ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); #endif @@ -644,7 +654,7 @@ static void ps_pred_process_sf( return; } - +#ifndef SPLIT_REND_LCLD_5MS static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -654,6 +664,12 @@ static void ivas_mc_paramupmix_dec_sf( float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ #endif ) +#else +static void ivas_mc_paramupmix_dec_sf( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ +) +#endif { int16_t i, ch, slot_idx, k; float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ @@ -668,6 +684,9 @@ static void ivas_mc_paramupmix_dec_sf( #ifdef SPLIT_REND_WITH_HEAD_ROT float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_LCLD_5MS + int16_t slot_index_start; +#endif #else float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; @@ -677,6 +696,11 @@ static void ivas_mc_paramupmix_dec_sf( assert( hMCParamUpmix ); push_wmops( "ivas_mc_paramupmix_dec_sf" ); +#ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef SPLIT_REND_LCLD_5MS + slot_index_start = st_ivas->hTcBuffer->slots_rendered; +#endif +#endif for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { pPcm_temp[2 * i] = output_f[i + 4]; /* un-decorrelated */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 81427d9cfa..c3ea6c9c57 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -979,7 +979,9 @@ typedef struct IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ SPLIT_REND_WRAPPER splitrend; IVAS_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE hCldfbDataOut; /*buffer to store cldfb data before binauralization*/ - float *tdDataOut; /*buffer to store TD data before binauralization*/ +#ifndef SPLIT_REND_LCLD_5MS + float *tdDataOut; /*buffer to store TD data before binauralization*/ +#endif int16_t numTdSamplesPerChannelCached; } IVAS_DEC_SPLIT_REND_WRAPPER; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4bf943351e..c80c593d02 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1036,14 +1036,21 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( Decoder_Struct *st_ivas; AUDIO_CONFIG output_config; int32_t output_Fs; +#ifndef SPLIT_REND_LCLD_5MS float *writePtr; float *readPtr, *readEnd; +#endif float *pOutput[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES]; float output[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k]; float pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k]; +#ifdef SPLIT_REND_LCLD_5MS + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#else int16_t numSamplesPerChannelCacheSize; - int16_t numSamplesPerChannelToDecode; int16_t numSamplesPerChannelToSplitEncode; +#endif + int16_t numSamplesPerChannelToDecode; int16_t i, j; ivas_error error; IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend; @@ -1051,6 +1058,9 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( int16_t pcm_out_flag; int16_t td_input; int16_t numPoses; +#ifdef SPLIT_REND_LCLD_5MS + int16_t slots_rendered, slots_rendered_new; +#endif #ifdef SPLIT_REND_HF_TUNING int16_t ro_md_flag; #endif @@ -1071,6 +1081,14 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; +#ifdef SPLIT_REND_LCLD_5MS + if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS && + ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || + hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) + { + numSamplesPerChannelToDecode = (int16_t) ( output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); + } +#else if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS && hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) @@ -1092,12 +1110,29 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numSamplesPerChannelToSplitEncode = (int16_t) ( output_Fs / FRAMES_PER_SEC ); numSamplesPerChannelCacheSize = 0; } - +#endif if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { return IVAS_ERR_WRONG_PARAMS; } +#ifdef SPLIT_REND_LCLD_5MS + if ( st_ivas->hTcBuffer == NULL || hIvasDec->hasBeenFedFrame ) + { + slots_rendered = 0; + } + else + { + slots_rendered = st_ivas->hTcBuffer->n_samples_rendered / st_ivas->hTcBuffer->n_samples_granularity; + } + + + /* Decode and render */ + if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( numSamplesPerChannelToDecode == numSamplesPerChannelToSplitEncode || hSplitBinRend->numTdSamplesPerChannelCached == 0 ) { /* Decode and render */ @@ -1138,9 +1173,14 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( } hSplitBinRend->numTdSamplesPerChannelCached -= numSamplesPerChannelToSplitEncode; } +#endif - /* change buffer layout */ +/* change buffer layout */ +#ifdef SPLIT_REND_LCLD_5MS + for ( i = 0; i < numSamplesPerChannelToDecode; ++i ) +#else for ( i = 0; i < numSamplesPerChannelToSplitEncode; ++i ) +#endif { for ( j = 0; j < BINAURAL_CHANNELS * numPoses; ++j ) { @@ -1152,6 +1192,26 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( pOutput[i] = output[i]; } +#ifdef SPLIT_REND_LCLD_5MS + if ( st_ivas->hTcBuffer == NULL ) + { + slots_rendered_new = 0; + } + else + { + slots_rendered_new = st_ivas->hTcBuffer->n_samples_rendered / st_ivas->hTcBuffer->n_samples_granularity; + } + + for ( i = 0; i < BINAURAL_CHANNELS * numPoses; ++i ) + { + for ( j = slots_rendered; j < slots_rendered_new; ++j ) + { + mvr2r( hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[i][j], Cldfb_RealBuffer_Binaural[i][j - slots_rendered], CLDFB_NO_CHANNELS_MAX ); + mvr2r( hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[i][j], Cldfb_ImagBuffer_Binaural[i][j - slots_rendered], CLDFB_NO_CHANNELS_MAX ); + } + } +#endif + max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); pcm_out_flag = ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; td_input = st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC; @@ -1172,8 +1232,13 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( st_ivas->hRenderConfig->split_rend_config.codec, st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, hSplitBinRend->hSplitRendBits, +#ifdef SPLIT_REND_LCLD_5MS + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, +#else hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, +#endif max_band, pOutput, 1, !td_input, pcm_out_flag, ro_md_flag ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, @@ -1182,8 +1247,13 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( st_ivas->hRenderConfig->split_rend_config.codec, st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, hSplitBinRend->hSplitRendBits, +#ifdef SPLIT_REND_LCLD_5MS + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, +#else hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, +#endif max_band, pOutput, 1, !td_input, pcm_out_flag ) ) != IVAS_ERR_OK ) #endif { @@ -1196,18 +1266,30 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ) { #ifndef DISABLE_LIMITER +#ifdef SPLIT_REND_LCLD_5MS + ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToDecode, st_ivas->BER_detect ); +#else ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToSplitEncode, st_ivas->BER_detect ); +#endif #endif } else { +#ifdef SPLIT_REND_LCLD_5MS + ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToDecode, st_ivas->BER_detect ); +#else ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToSplitEncode, st_ivas->BER_detect ); +#endif } #ifdef DEBUGGING st_ivas->noClipping += #endif - ivas_syn_output( pOutput, numSamplesPerChannelToSplitEncode, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); +#ifdef SPLIT_REND_LCLD_5MS + ivas_syn_output( pOutput, numSamplesPerChannelToDecode, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); +#else + ivas_syn_output( pOutput, numSamplesPerChannelToSplitEncode, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); +#endif } free( st_ivas->hSplitBinRend.hMultiBinCldfbData ); diff --git a/lib_rend/ivas_MSPred.c b/lib_rend/ivas_MSPred.c index 4dcdbbb1cf..fcfb29a55c 100644 --- a/lib_rend/ivas_MSPred.c +++ b/lib_rend/ivas_MSPred.c @@ -61,15 +61,6 @@ static int32_t _round( int32_t quantPhase( float phase ) { -#ifdef SIMPLE_PHASE - int32_t phaseQ; - if ( phase < 0.0f ) - { - phase += 2.0f * _PI_; - } - phaseQ = _round( phase * SIMPLE_PHASE_QUANT_FACTOR ); - phaseQ = ( phaseQ > SIMPLE_PHASE_MAX_VAL ? SIMPLE_PHASE_MIN_VAL : phaseQ ); -#else int32_t phaseQ; phaseQ = _round( phase * PHASE_QUANT_FACTOR ); @@ -77,83 +68,9 @@ int32_t quantPhase( { phaseQ = PHASE_MIN_VAL; } -#endif return phaseQ; } -#ifdef SIMPLE_PHASE -/*-------------------------------------------------------------------* - * Function rot_pm_pi() - * - * - *-------------------------------------------------------------------*/ - -void rot_pm_pi( - float *pr, - float *pi ) -{ - /* (-1 + j0) */ - *pr = -( *pr ); - *pi = -( *pi ); - - return; -} - - -/*-------------------------------------------------------------------* - * Function ApplyInversePredictros() - * - * - *-------------------------------------------------------------------*/ - -void rot_p_pi_2( - float *pr, - float *pi ) -{ - /* (0 + j) */ - float r = *pr; - - *pr = -( *pi ); - *pi = r; - - return; -} - -/*-------------------------------------------------------------------* - * Function rot_zero() - * - * - *-------------------------------------------------------------------*/ - -void rot_zero( - float *pr, - float *pi ) -{ - *pr = *pr; - *pi = *pi; - - return; -} - -/*-------------------------------------------------------------------* - * Function rot_m_pi_2() - * - * - *-------------------------------------------------------------------*/ - -void rot_m_pi_2( - float *pr, - float *pi ) -{ - /* (0 - j) */ - float r = *pr; - - *pr = *pi; - *pi = -r; - - return; -} -#endif /*-------------------------------------------------------------------* * Function cplxmult() @@ -233,11 +150,7 @@ int32_t quantPred( float dequantPhase( const int32_t phaseQ ) { -#ifdef SIMPLE_PHASE - return (float) phaseQ / SIMPLE_PHASE_QUANT_FACTOR; -#else return (float) phaseQ / PHASE_QUANT_FACTOR; -#endif } @@ -468,9 +381,7 @@ int32_t CountMSBits( /* Differential Coding of Phase Data*/ PrepEncode( piPhaseCopy, piMSFlags, iNumBands ); PrepEncode( piPredCopy, piMSFlags, iNumBands ); -#ifndef SIMPLE_PHASE EncodePhase( piPhaseCopy, iNumMSBands, PHASE_DIFF_DIM ); -#endif EncodePredCoef( piPredCopy, iNumMSBands ); iBitsWritten += 1; /* iMSPredAll */ @@ -486,16 +397,12 @@ int32_t CountMSBits( iBitsWritten++; /*anyNonZero Phase*/ if ( anyNonZero ) { -#ifdef SIMPLE_PHASE - iBitsWritten += iNumMSBands * SIMPLE_PHASE_BITS; -#else iBitsWritten += PHASE_BAND0_BITS; for ( b = 1; b < iNumMSBands; b++ ) { int32_t tabIdx = piPhaseCopy[b] - ENV_DELTA_MIN; iBitsWritten += c_aaiRMSEnvHuffEnc[tabIdx][0]; } -#endif } anyNonZero = 0; /* prediction */ for ( b = 0; b < iNumMSBands; b++ ) diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index 914435e2fe..cc383160e2 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -40,6 +40,18 @@ #include "ivas_lcld_rom_tables.h" #include "wmc_auto.h" +#ifdef SPLIT_REND_LCLD_5MS +/*-------------------------------------------------------------------* + * Function get_bit() + * + * + *-------------------------------------------------------------------*/ + +static int get_bit( int state, int bit_id ) +{ + return ( state & ( 1 << bit_id ) ); +} +#endif /*-------------------------------------------------------------------* * Function CreatePredictionDecoder() @@ -53,6 +65,9 @@ ivas_error CreatePredictionDecoder( const int32_t iNumBlocks ) { int16_t n; +#ifdef SPLIT_REND_LCLD_5MS + int16_t m; +#endif PredictionDecoder *psPredictionDecoder = NULL; if ( ( psPredictionDecoder = (PredictionDecoder *) malloc( sizeof( PredictionDecoder ) ) ) == NULL ) @@ -62,11 +77,15 @@ ivas_error CreatePredictionDecoder( psPredictionDecoder->iChannels = iChannels; psPredictionDecoder->iNumBlocks = iNumBlocks; - +#ifdef SPLIT_REND_LCLD_5MS + psPredictionDecoder->iNumSubSets = LCLD_BLOCKS_PER_FRAME / psPredictionDecoder->iNumBlocks; + psPredictionDecoder->iSubSetId = 0; +#endif if ( ( psPredictionDecoder->piPredChanEnable = (int32_t *) malloc( sizeof( int32_t ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } +#ifndef SPLIT_REND_LCLD_5MS if ( ( psPredictionDecoder->piNumPredBands = (int32_t *) malloc( sizeof( int32_t ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -76,6 +95,7 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } +#endif if ( ( psPredictionDecoder->ppiPredBandEnable = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -96,17 +116,37 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } +#ifdef SPLIT_REND_LCLD_5MS + if ( ( psPredictionDecoder->ppfPredStateReal = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD decoder Module \n" ) ); + } + if ( ( psPredictionDecoder->ppfPredStateImag = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD decoder Module \n" ) ); + } +#endif for ( n = 0; n < psPredictionDecoder->iChannels; n++ ) { +#ifdef SPLIT_REND_LCLD_5MS + psPredictionDecoder->piPredChanEnable[n] = 0; +#else if ( ( psPredictionDecoder->ppfEstPredGain[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } - if ( ( psPredictionDecoder->ppiPredBandEnable[n] = (int32_t *) malloc( sizeof( int32_t ) * LCLD_BANDS ) ) == NULL ) +#endif + if ( ( psPredictionDecoder->ppiPredBandEnable[n] = (int32_t *) malloc( LCLD_BANDS * sizeof( int32_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } +#ifdef SPLIT_REND_LCLD_5MS + for ( m = 0; m < LCLD_BANDS; m++ ) + { + psPredictionDecoder->ppiPredBandEnable[n][m] = 0; + } +#endif if ( ( psPredictionDecoder->ppfA1Real[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -123,6 +163,23 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } +#ifdef SPLIT_REND_LCLD_5MS + if ( ( psPredictionDecoder->ppfPredStateReal[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionDecoder Module \n" ) ); + } + if ( ( psPredictionDecoder->ppfPredStateImag[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionDecoder Module \n" ) ); + } +#ifdef SPLIT_REND_LCLD_5MS + for ( m = 0; m < LCLD_BANDS; m++ ) + { + psPredictionDecoder->ppfPredStateReal[n][m] = 0; + psPredictionDecoder->ppfPredStateImag[n][m] = 0; + } +#endif +#endif } /* pre-define these tables? */ @@ -161,21 +218,33 @@ void DeletePredictionDecoder( for ( n = 0; n < psPredictionDecoder->iChannels; n++ ) { +#ifndef SPLIT_REND_LCLD_5MS free( psPredictionDecoder->ppfEstPredGain[n] ); +#endif free( psPredictionDecoder->ppiPredBandEnable[n] ); free( psPredictionDecoder->ppfA1Real[n] ); free( psPredictionDecoder->ppfA1Imag[n] ); free( psPredictionDecoder->ppiA1Mag[n] ); free( psPredictionDecoder->ppiA1Phase[n] ); +#ifdef SPLIT_REND_LCLD_5MS + free( psPredictionDecoder->ppfPredStateReal[n] ); + free( psPredictionDecoder->ppfPredStateImag[n] ); +#endif } free( psPredictionDecoder->piPredChanEnable ); +#ifndef SPLIT_REND_LCLD_5MS free( psPredictionDecoder->piNumPredBands ); free( psPredictionDecoder->ppfEstPredGain ); +#endif free( psPredictionDecoder->ppiPredBandEnable ); free( psPredictionDecoder->ppfA1Real ); free( psPredictionDecoder->ppfA1Imag ); free( psPredictionDecoder->ppiA1Mag ); free( psPredictionDecoder->ppiA1Phase ); +#ifdef SPLIT_REND_LCLD_5MS + free( psPredictionDecoder->ppfPredStateReal ); + free( psPredictionDecoder->ppfPredStateImag ); +#endif free( psPredictionDecoder ); psPredictionDecoder = NULL; @@ -183,7 +252,7 @@ void DeletePredictionDecoder( return; } - +#ifndef SPLIT_REND_LCLD_5MS #define USE_TABLE_LOOKUP /*-------------------------------------------------------------------* * Function ReadPredictors() @@ -286,7 +355,105 @@ int32_t ReadPredictors( return iBitsRead; } +#else +/*-------------------------------------------------------------------* + * Function ReadPredictors() + * + * + *-------------------------------------------------------------------*/ + +int32_t ReadPredictors( + PredictionDecoder *psPredictionDecoder, + IVAS_SPLIT_REND_BITS_HANDLE pBits ) +{ + int16_t iBitsRead = 0; + int32_t c; + int32_t b; + int16_t iNumPredBandBits = 6; + const int16_t iSubSetBits = ( LCLD_MAX_NUM_PRED_SUBSETS > 4 ? 3 : 2 ); + psPredictionDecoder->iNumSubSets = ivas_split_rend_bitstream_read_int32( pBits, iSubSetBits ) + 1; + iBitsRead += iSubSetBits; + + if ( psPredictionDecoder->iNumSubSets > 1 ) + { + psPredictionDecoder->iSubSetId = ivas_split_rend_bitstream_read_int32( pBits, iSubSetBits ); + iBitsRead += iSubSetBits; + iNumPredBandBits = ( psPredictionDecoder->iNumSubSets >= 4 ? 4 : 5 ); + } + else + { + psPredictionDecoder->iSubSetId = 0; + } + for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) + { + psPredictionDecoder->piPredChanEnable[c] = ivas_split_rend_bitstream_read_int32( pBits, psPredictionDecoder->iNumSubSets ); + iBitsRead += (int16_t) psPredictionDecoder->iNumSubSets; + + if ( get_bit( psPredictionDecoder->piPredChanEnable[c], psPredictionDecoder->iSubSetId ) ) + { + int32_t b0 = psPredictionDecoder->iSubSetId; + int32_t bstep = psPredictionDecoder->iNumSubSets; + int32_t iNumPredBands; + + for ( b = b0; b < LCLD_BANDS; b += bstep ) + { + psPredictionDecoder->ppiPredBandEnable[c][b] = 0; + } + iNumPredBands = ivas_split_rend_bitstream_read_int32( pBits, iNumPredBandBits ); + iBitsRead += iNumPredBandBits; + iNumPredBands = iNumPredBands * psPredictionDecoder->iNumSubSets + b0; + + for ( b = b0; b < iNumPredBands; b += bstep ) + { + psPredictionDecoder->ppiPredBandEnable[c][b] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( psPredictionDecoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t iA1Mag; + int32_t iA1Phase; + float fA1Real; + float fA1Imag; + iA1Mag = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUNAT_FILTER_MAG_BITS ); + iBitsRead += PRED_QUNAT_FILTER_MAG_BITS; + iA1Phase = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUANT_FILTER_PHASE_BITS ); + iBitsRead += PRED_QUANT_FILTER_PHASE_BITS; + + psPredictionDecoder->ppiA1Mag[c][b] = iA1Mag; + psPredictionDecoder->ppiA1Phase[c][b] = iA1Phase + PRED_QUANT_FILTER_PHASE_MIN; + + fA1Real = psPredictionDecoder->pfMagLUT[iA1Mag] * psPredictionDecoder->pfP2RRealLUT[iA1Phase]; + fA1Imag = psPredictionDecoder->pfMagLUT[iA1Mag] * psPredictionDecoder->pfP2RImagLUT[iA1Phase]; + + psPredictionDecoder->ppfA1Real[c][b] = fA1Real; + psPredictionDecoder->ppfA1Imag[c][b] = fA1Imag; + } + } + } + } + + /* disable any inactive prediction bands */ + for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) + { + int set; + for ( set = 0; set < psPredictionDecoder->iNumSubSets; set++ ) + { + if ( !get_bit( psPredictionDecoder->piPredChanEnable[c], set ) ) + { + for ( b = set; b < LCLD_BANDS; b += psPredictionDecoder->iNumSubSets ) + { + psPredictionDecoder->ppiPredBandEnable[c][b] = 0; + } + } + } + } + + return iBitsRead; +} +#endif + +#ifndef SPLIT_REND_LCLD_5MS /*-------------------------------------------------------------------* * Function ApplyInversePredictros() * @@ -332,4 +499,65 @@ void ApplyInversePredictros( return; } +#else +/*-------------------------------------------------------------------* + * Function ApplyInversePredictors() + * + * + *-------------------------------------------------------------------*/ + +void ApplyInversePredictors( + PredictionDecoder *psPredictionDecoder, + float ***pppfReal, + float ***pppfImag ) +{ + int32_t c; + for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) + { + if ( psPredictionDecoder->piPredChanEnable[c] > 0 ) + { + int32_t b; + for ( b = 0; b < LCLD_BANDS; b++ ) + { + if ( psPredictionDecoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t n; + float fA1Real; + float fA1Imag; + float fPrevReal = 0.0f; + float fPrevImag = 0.0f; + int32_t iSubset = b % psPredictionDecoder->iNumSubSets; + + if ( iSubset != psPredictionDecoder->iSubSetId ) + { + fPrevReal = psPredictionDecoder->ppfPredStateReal[c][b]; + fPrevImag = psPredictionDecoder->ppfPredStateImag[c][b]; + } + + fA1Real = psPredictionDecoder->ppfA1Real[c][b]; + fA1Imag = psPredictionDecoder->ppfA1Imag[c][b]; + for ( n = 0; n < psPredictionDecoder->iNumBlocks; n++ ) + { + float fReal; + float fImag; + + fReal = pppfReal[c][n][b] - fA1Real * fPrevReal + fA1Imag * fPrevImag; + fImag = pppfImag[c][n][b] - fA1Real * fPrevImag - fA1Imag * fPrevReal; + + pppfReal[c][n][b] = fReal; + pppfImag[c][n][b] = fImag; + + fPrevReal = fReal; + fPrevImag = fImag; + } + psPredictionDecoder->ppfPredStateReal[c][b] = fPrevReal; + psPredictionDecoder->ppfPredStateImag[c][b] = fPrevImag; + } + } + } + } + + return; +} +#endif #endif diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 804a00a6a1..b4fdc234af 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -40,6 +40,40 @@ #include "ivas_prot_rend.h" #include "wmc_auto.h" +#ifdef SPLIT_REND_LCLD_5MS + +/*-------------------------------------------------------------------* + * Function activate_bit() + * + * + *-------------------------------------------------------------------*/ +static void activate_bit( int *state, int bit_id ) +{ + ( *state ) |= ( 1 << bit_id ); +} + +/*-------------------------------------------------------------------* + * Function deactivate_bit() + * + * + *-------------------------------------------------------------------*/ + +static void deactivate_bit( int *state, int bit_id ) +{ + ( *state ) &= ( ~( 1 << bit_id ) ); +} + +/*-------------------------------------------------------------------* + * Function get_bit() + * + * + *-------------------------------------------------------------------*/ + +static int get_bit( int state, int bit_id ) +{ + return ( state & ( 1 << bit_id ) ); +} +#endif /*-------------------------------------------------------------------* * Function CreatePredictionEncoder() @@ -47,10 +81,19 @@ * *-------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +ivas_error CreatePredictionEncoder( + PredictionEncoder **psPredictionEncoder_out, + const int32_t iChannels, + const int32_t iNumBlocks, + const int32_t iNumSubSets, + const int32_t iMaxNumPredBands ) +#else ivas_error CreatePredictionEncoder( PredictionEncoder **psPredictionEncoder_out, const int32_t iChannels, const int32_t iNumBlocks ) +#endif { int32_t k, n; PredictionEncoder *psPredictionEncoder = NULL; @@ -62,15 +105,33 @@ ivas_error CreatePredictionEncoder( psPredictionEncoder->iChannels = iChannels; psPredictionEncoder->iNumBlocks = iNumBlocks; - +#ifdef SPLIT_REND_LCLD_5MS + psPredictionEncoder->iSubSetId = 0; + psPredictionEncoder->iMaxNumPredBands = iMaxNumPredBands; + psPredictionEncoder->iNumSubSets = iNumSubSets; + if ( ( psPredictionEncoder->pfWindow = (float *) malloc( sizeof( float ) * LCLD_PRED_WIN_LEN ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } +#else if ( ( psPredictionEncoder->pfWindow = (float *) malloc( sizeof( float ) * iNumBlocks ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } +#endif + +#ifdef SPLIT_REND_LCLD_5MS + for ( n = 0; n < LCLD_PRED_WIN_LEN; n++ ) + { + psPredictionEncoder->pfWindow[n] = 0.54f - 0.46f * cosf( 2.0f * M_PI * ( (float) n + 0.5f ) / (float) LCLD_PRED_WIN_LEN ); + } +#else for ( n = 0; n < iNumBlocks; n++ ) { psPredictionEncoder->pfWindow[n] = 0.54f - 0.46f * cosf( 2.0f * M_PI * ( (float) n + 0.5f ) / (float) iNumBlocks ); } +#endif + if ( ( psPredictionEncoder->piPredChanEnable = (int32_t *) malloc( sizeof( int32_t ) * iChannels ) ) == NULL ) { @@ -87,6 +148,60 @@ ivas_error CreatePredictionEncoder( psPredictionEncoder->piNumPredBands[n] = 40; // Will need to be set correctly } +#ifdef SPLIT_REND_LCLD_5MS + if ( ( psPredictionEncoder->ppiPredBandEnable = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfA1Real = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfA1Imag = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppiA1Mag = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppiA1Phase = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->pppfInpBufReal = (float ***) malloc( sizeof( float ** ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->pppfInpBufImag = (float ***) malloc( sizeof( float ** ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfInpPrevReal = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfInpPrevImag = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfPredStateReal = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfPredStateImag = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfPredStateRealTmp = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfPredStateImagTmp = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } +#else if ( ( psPredictionEncoder->ppfEstPredGain = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); @@ -116,8 +231,11 @@ ivas_error CreatePredictionEncoder( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } +#endif + for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) { +#ifndef SPLIT_REND_LCLD_5MS if ( ( psPredictionEncoder->ppfEstPredGain[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); @@ -126,6 +244,7 @@ ivas_error CreatePredictionEncoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } +#endif if ( ( psPredictionEncoder->ppiPredBandEnable[n] = (int32_t *) malloc( sizeof( int32_t ) * LCLD_BANDS ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); @@ -146,11 +265,72 @@ ivas_error CreatePredictionEncoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } +#ifdef SPLIT_REND_LCLD_5MS + if ( ( psPredictionEncoder->pppfInpBufReal[n] = (float **) malloc( sizeof( float * ) * LCLD_PRED_WIN_LEN ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->pppfInpBufImag[n] = (float **) malloc( sizeof( float * ) * LCLD_PRED_WIN_LEN ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + for ( k = 0; k < LCLD_PRED_WIN_LEN; k++ ) + { + if ( ( psPredictionEncoder->pppfInpBufReal[n][k] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->pppfInpBufImag[n][k] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + set_zero( psPredictionEncoder->pppfInpBufReal[n][k], LCLD_BANDS ); + set_zero( psPredictionEncoder->pppfInpBufImag[n][k], LCLD_BANDS ); + } + if ( ( psPredictionEncoder->ppfPredStateReal[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfPredStateImag[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + set_zero( psPredictionEncoder->ppfPredStateReal[n], LCLD_BANDS ); + set_zero( psPredictionEncoder->ppfPredStateImag[n], LCLD_BANDS ); + + if ( ( psPredictionEncoder->ppfInpPrevReal[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfInpPrevImag[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + + set_zero( psPredictionEncoder->ppfInpPrevReal[n], LCLD_BANDS ); + set_zero( psPredictionEncoder->ppfInpPrevImag[n], LCLD_BANDS ); + + if ( ( psPredictionEncoder->ppfPredStateRealTmp[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + if ( ( psPredictionEncoder->ppfPredStateImagTmp[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); + } + set_zero( psPredictionEncoder->ppfPredStateRealTmp[n], LCLD_BANDS ); + set_zero( psPredictionEncoder->ppfPredStateImagTmp[n], LCLD_BANDS ); +#endif for ( k = 0; k < LCLD_BANDS; k++ ) { psPredictionEncoder->ppiPredBandEnable[n][k] = 0; +#ifndef SPLIT_REND_LCLD_5MS psPredictionEncoder->ppfA1Real[n][k] = 0.0; psPredictionEncoder->ppfA1Imag[n][k] = 0.0; +#else + psPredictionEncoder->ppfA1Real[n][k] = 0.0f; + psPredictionEncoder->ppfA1Imag[n][k] = 0.0f; +#endif } } @@ -175,23 +355,55 @@ void DeletePredictionEncoder( for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) { +#ifdef SPLIT_REND_LCLD_5MS + int32_t k; +#else free( psPredictionEncoder->ppfEstPredGain[n] ); free( psPredictionEncoder->ppfEstPredBitGain[n] ); +#endif free( psPredictionEncoder->ppiPredBandEnable[n] ); free( psPredictionEncoder->ppfA1Real[n] ); free( psPredictionEncoder->ppfA1Imag[n] ); free( psPredictionEncoder->ppiA1Mag[n] ); free( psPredictionEncoder->ppiA1Phase[n] ); +#ifdef SPLIT_REND_LCLD_5MS + for ( k = 0; k < LCLD_PRED_WIN_LEN; k++ ) + { + free( psPredictionEncoder->pppfInpBufReal[n][k] ); + free( psPredictionEncoder->pppfInpBufImag[n][k] ); + } + free( psPredictionEncoder->pppfInpBufReal[n] ); + free( psPredictionEncoder->pppfInpBufImag[n] ); + free( psPredictionEncoder->ppfInpPrevReal[n] ); + free( psPredictionEncoder->ppfInpPrevImag[n] ); + free( psPredictionEncoder->ppfPredStateReal[n] ); + free( psPredictionEncoder->ppfPredStateImag[n] ); + free( psPredictionEncoder->ppfPredStateRealTmp[n] ); + free( psPredictionEncoder->ppfPredStateImagTmp[n] ); +#endif } free( psPredictionEncoder->piPredChanEnable ); free( psPredictionEncoder->piNumPredBands ); +#ifndef SPLIT_REND_LCLD_5MS free( psPredictionEncoder->ppfEstPredGain ); free( psPredictionEncoder->ppfEstPredBitGain ); +#endif free( psPredictionEncoder->ppiPredBandEnable ); free( psPredictionEncoder->ppfA1Real ); free( psPredictionEncoder->ppfA1Imag ); free( psPredictionEncoder->ppiA1Mag ); free( psPredictionEncoder->ppiA1Phase ); +#ifdef SPLIT_REND_LCLD_5MS + free( psPredictionEncoder->pppfInpBufReal ); + free( psPredictionEncoder->pppfInpBufImag ); + free( psPredictionEncoder->ppfInpPrevReal ); + free( psPredictionEncoder->ppfInpPrevImag ); + free( psPredictionEncoder->ppfPredStateReal ); + free( psPredictionEncoder->ppfPredStateImag ); + free( psPredictionEncoder->ppfPredStateRealTmp ); + free( psPredictionEncoder->ppfPredStateImagTmp ); +#endif + free( psPredictionEncoder ); @@ -206,7 +418,216 @@ void DeletePredictionEncoder( * * *-------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +void ComputePredictors( + PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag ) +{ + int32_t c; + + int32_t b0 = psPredictionEncoder->iSubSetId; + int32_t bstep = psPredictionEncoder->iNumSubSets; + int32_t iNumBlocks = psPredictionEncoder->iNumBlocks; + float ***pppfRealBuf; + float ***pppfImagBuf; + float pfEstPredBitGain[LCLD_BANDS] = { 0 }; + + if ( iNumBlocks < LCLD_PRED_WIN_LEN ) + { + pppfRealBuf = psPredictionEncoder->pppfInpBufReal; + pppfImagBuf = psPredictionEncoder->pppfInpBufImag; + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int n; + for ( n = 0; n < LCLD_PRED_WIN_LEN - iNumBlocks; n++ ) + { + mvr2r( pppfRealBuf[c][n + iNumBlocks], pppfRealBuf[c][n], LCLD_BANDS ); + mvr2r( pppfImagBuf[c][n + iNumBlocks], pppfImagBuf[c][n], LCLD_BANDS ); + } + for ( n = 0; n < iNumBlocks; n++ ) + { + mvr2r( pppfReal[c][n], pppfRealBuf[c][n + LCLD_PRED_WIN_LEN - iNumBlocks], LCLD_BANDS ); + mvr2r( pppfImag[c][n], pppfImagBuf[c][n + LCLD_PRED_WIN_LEN - iNumBlocks], LCLD_BANDS ); + } + } + } + else + { + pppfRealBuf = pppfReal; + pppfImagBuf = pppfImag; + } + + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int32_t b; + psPredictionEncoder->piNumPredBands[c] = min( 50, psPredictionEncoder->iMaxNumPredBands ); + for ( b = b0; b < psPredictionEncoder->piNumPredBands[c]; b += bstep ) + { + int32_t n; + float fGain = 0.0; + float fBitGain = 0.0; + float *pfRxxReal; + float *pfRxxImag; + float fA1Real; + float fA1Imag; + int32_t iA1Mag; + int32_t iA1Phase; + + pfRxxReal = psPredictionEncoder->pfRxxReal; + pfRxxImag = psPredictionEncoder->pfRxxImag; + + pfRxxReal[0] = 0.0; + pfRxxImag[0] = 0.0; + for ( n = 0; n < LCLD_PRED_WIN_LEN; n++ ) + { +#ifdef USE_RXX_WINDOW + float fReal; + float fImag; + fReal = psPredictionEncoder->pfWindow[n] * pppfRealBuf[c][n][b]; + fImag = psPredictionEncoder->pfWindow[n] * pppfImagBuf[c][n][b]; + pfRxxReal[0] += ( fReal * fReal + fImag * fImag ); +#else + pfRxxReal[0] += ( pppfRealBuf[c][n][b] * pppfRealBuf[c][n][b] + pppfImagBuf[c][n][b] * pppfImagBuf[c][n][b] ); +#endif + } + + pfRxxReal[1] = 0.0; + pfRxxImag[1] = 0.0; + for ( n = 1; n < LCLD_PRED_WIN_LEN; n++ ) + { +#ifdef USE_RXX_WINDOW + float fReal1; + float fImag1; + float fReal2; + float fImag2; + fReal1 = psPredictionEncoder->pfWindow[n] * pppfRealBuf[c][n][b]; + fImag1 = psPredictionEncoder->pfWindow[n] * pppfImagBuf[c][n][b]; + fReal2 = psPredictionEncoder->pfWindow[n - 1] * pppfRealBuf[c][n - 1][b]; + fImag2 = psPredictionEncoder->pfWindow[n - 1] * pppfImagBuf[c][n - 1][b]; + pfRxxReal[1] += ( fReal1 * fReal2 + fImag1 * fImag2 ); + pfRxxImag[1] += ( fImag1 * fReal2 - fReal1 * fImag2 ); +#else + pfRxxReal[1] += ( pppfRealBuf[c][n][b] * pppfRealBuf[c][n - 1][b] + pppfImagBuf[c][n][b] * pppfImagBuf[c][n - 1][b] ); + pfRxxImag[1] += ( pppfImagBuf[c][n][b] * pppfRealBuf[c][n - 1][b] - pppfRealBuf[c][n][b] * pppfImagBuf[c][n - 1][b] ); +#endif + } + + if ( pfRxxReal[0] > 1e-12f ) + { + float fA1Mag; + float fA1Phase; + float fGain2; + float fBitGain2; + int iNumBlocksPerPredCoef = min( iNumBlocks * psPredictionEncoder->iNumSubSets, LCLD_PRED_WIN_LEN ); + + const float fMagScale = ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ) / M_PI; + const float fInvMagScale = M_PI / ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ); + const float fPhaseScale = (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ) / M_PI; + const float fInvPhaseScale = M_PI / (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ); + + /* Compute filter coefficeints */ + fA1Real = -pfRxxReal[1] / pfRxxReal[0]; + fA1Imag = -pfRxxImag[1] / pfRxxReal[0]; + + /* compute these before quant */ + /* Compute est coding gain based on quantized filter coefficients */ + fGain = 1.0f / ( 1.0f - fA1Real * fA1Real - fA1Imag * fA1Imag ); + fBitGain = 0.65f * log2f( fGain ) * (float) ( iNumBlocksPerPredCoef ) - (float) ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); // Wrong fix (iNumBlocks-1) + fA1Mag = sqrtf( fA1Real * fA1Real + fA1Imag * fA1Imag ); + fA1Mag = fMagScale * asinf( fA1Mag ); + iA1Mag = (int32_t) ( fA1Mag + 0.5f ); + iA1Mag = ( iA1Mag > PRED_QUANT_FILTER_MAG_MIN ) ? iA1Mag : PRED_QUANT_FILTER_MAG_MIN; + iA1Mag = ( iA1Mag < PRED_QUANT_FILTER_MAG_MAX ) ? iA1Mag : PRED_QUANT_FILTER_MAG_MAX; + fA1Mag = sinf( fInvMagScale * (float) iA1Mag ); + + fA1Phase = atan2f( fA1Imag, fA1Real ); + fA1Phase = fPhaseScale * fA1Phase; + iA1Phase = ( fA1Phase > 0.0f ) ? (int32_t) ( fA1Phase + 0.5f ) : (int32_t) ( fA1Phase - 0.5f ); + iA1Phase = ( iA1Phase > PRED_QUANT_FILTER_PHASE_MIN ) ? iA1Phase : PRED_QUANT_FILTER_PHASE_MIN; + iA1Phase = ( iA1Phase < PRED_QUANT_FILTER_PHASE_MAX ) ? iA1Phase : PRED_QUANT_FILTER_PHASE_MAX; // Is this the correct way to deal with this? should wrap? + fA1Phase = fInvPhaseScale * (float) iA1Phase; + + fA1Real = fA1Mag * cosf( fA1Phase ); + fA1Imag = fA1Mag * sinf( fA1Phase ); + fGain2 = 1.0f / ( 1.0f - fA1Real * fA1Real - fA1Imag * fA1Imag ); + fBitGain2 = 0.65f * log2f( fGain ) * (float) ( iNumBlocksPerPredCoef ) - (float) ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); // Wrong fix (iNumBlocks-1) + fGain = ( fGain < fGain2 ) ? fGain : fGain2; + fBitGain = ( fBitGain < fBitGain2 ) ? fBitGain : fBitGain2; + } + else + { + fA1Real = 0.0f; + fA1Imag = 0.0f; + iA1Mag = 0; + iA1Phase = 0; + fGain = -10.0f; // Fix this + } + + pfEstPredBitGain[b] = fBitGain; + psPredictionEncoder->ppiPredBandEnable[c][b] = ( fBitGain > 0.0f ); // Initial prediction enable + psPredictionEncoder->ppfA1Real[c][b] = fA1Real; + psPredictionEncoder->ppfA1Imag[c][b] = fA1Imag; + psPredictionEncoder->ppiA1Mag[c][b] = iA1Mag; + psPredictionEncoder->ppiA1Phase[c][b] = iA1Phase; + } + + { + float fBestCost; + int32_t iPredBands; + float fBitGain; + int32_t iPredChanEnable = 0; + + fBestCost = 0.0; + iPredBands = 0; + fBitGain = -7.0; + for ( b = b0; b < 50; b += bstep ) + { // still getting this decision wrong! + fBitGain -= 1.0; + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + fBitGain += pfEstPredBitGain[b]; + } + if ( fBitGain > fBestCost ) + { + fBestCost = fBitGain; + iPredBands = b; + iPredChanEnable = 1; + } + } + + if ( iPredChanEnable == 1 ) + { + for ( b = iPredBands + bstep; b < LCLD_BANDS; b += bstep ) + { + psPredictionEncoder->ppiPredBandEnable[c][b] = 0; + } + activate_bit( &psPredictionEncoder->piPredChanEnable[c], psPredictionEncoder->iSubSetId ); + psPredictionEncoder->piNumPredBands[c] = iPredBands + bstep; + } + else if ( iPredBands > 0 ) + { + for ( b = iPredBands; b < LCLD_BANDS; b += bstep ) + { + psPredictionEncoder->ppiPredBandEnable[c][b] = 0; + } + activate_bit( &psPredictionEncoder->piPredChanEnable[c], psPredictionEncoder->iSubSetId ); + psPredictionEncoder->piNumPredBands[c] = iPredBands; + } + else + { + for ( b = b0; b < LCLD_BANDS; b += bstep ) + { + psPredictionEncoder->ppiPredBandEnable[c][b] = 0; + } + deactivate_bit( &psPredictionEncoder->piPredChanEnable[c], psPredictionEncoder->iSubSetId ); + psPredictionEncoder->piNumPredBands[c] = 0; + } + } + } +} +#else int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, @@ -425,6 +846,7 @@ int32_t ComputePredictors( return iPredictionBits; } +#endif /*-------------------------------------------------------------------* @@ -432,7 +854,61 @@ int32_t ComputePredictors( * * *-------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +void ApplyForwardPredictors( + PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag ) +{ + int32_t c; + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int32_t b; + if ( psPredictionEncoder->piPredChanEnable[c] > 0 ) + { + for ( b = 0; b < LCLD_BANDS; b++ ) + { + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t n; + float fOldReal = 0.0f; + float fOldImag = 0.0f; + float fA1Real; + float fA1Imag; + int32_t iSubset = b % psPredictionEncoder->iNumSubSets; + if ( iSubset != psPredictionEncoder->iSubSetId ) + { + fOldReal = psPredictionEncoder->ppfInpPrevReal[c][b]; + fOldImag = psPredictionEncoder->ppfInpPrevImag[c][b]; + } + psPredictionEncoder->ppfInpPrevReal[c][b] = pppfReal[c][psPredictionEncoder->iNumBlocks - 1][b]; + psPredictionEncoder->ppfInpPrevImag[c][b] = pppfImag[c][psPredictionEncoder->iNumBlocks - 1][b]; + + fA1Real = psPredictionEncoder->ppfA1Real[c][b]; + fA1Imag = psPredictionEncoder->ppfA1Imag[c][b]; + for ( n = 0; n < psPredictionEncoder->iNumBlocks; n++ ) + { + float fReal; + float fImag; + + fReal = pppfReal[c][n][b] + fA1Real * fOldReal - fA1Imag * fOldImag; + fImag = pppfImag[c][n][b] + fA1Real * fOldImag + fA1Imag * fOldReal; + + fOldReal = pppfReal[c][n][b]; + fOldImag = pppfImag[c][n][b]; + + pppfReal[c][n][b] = fReal; + pppfImag[c][n][b] = fImag; + } + } + } + } + } + + return; +} +#else void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, @@ -479,6 +955,7 @@ void ApplyForwardPredictors( return; } +#endif /*-------------------------------------------------------------------* @@ -486,7 +963,71 @@ void ApplyForwardPredictors( * * *-------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +int32_t WritePredictors( + PredictionEncoder *psPredictionEncoder, + IVAS_SPLIT_REND_BITS_HANDLE pBits ) +{ + int32_t iBitsWritten = 0; + int32_t c; + int32_t iNumSubSets = psPredictionEncoder->iNumSubSets; + int32_t iSubSetId = psPredictionEncoder->iSubSetId; + int32_t iNumPredBandBits = 6; + const int16_t iSubSetBits = ( LCLD_MAX_NUM_PRED_SUBSETS > 4 ? 3 : 2 ); + + /* number of subsets */ + ivas_split_rend_bitstream_write_int32( pBits, iNumSubSets - 1, iSubSetBits ); /* otherwise use default */ + iBitsWritten += iSubSetBits; + + if ( iNumSubSets > 1 ) + { + /* write current subset */ + ivas_split_rend_bitstream_write_int32( pBits, iSubSetId, iSubSetBits ); + iBitsWritten += iSubSetBits; + iNumPredBandBits = ( iNumSubSets >= 4 ? 4 : 5 ); + } + + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int32_t b; + int32_t b0 = iSubSetId; + + ivas_split_rend_bitstream_write_int32( pBits, psPredictionEncoder->piPredChanEnable[c], iNumSubSets ); + iBitsWritten += iNumSubSets; + if ( get_bit( psPredictionEncoder->piPredChanEnable[c], iSubSetId ) ) + { + int32_t iNumPredBands = ( psPredictionEncoder->piNumPredBands[c] - b0 ) / iNumSubSets; + + ivas_split_rend_bitstream_write_int32( pBits, iNumPredBands, iNumPredBandBits ); + iBitsWritten += iNumPredBandBits; + + for ( b = b0; b < psPredictionEncoder->piNumPredBands[c]; b += iNumSubSets ) + { + ivas_split_rend_bitstream_write_int32( pBits, psPredictionEncoder->ppiPredBandEnable[c][b], 1 ); + iBitsWritten += 1; + + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t iA1Mag; + int32_t iA1Phase; + + iA1Mag = psPredictionEncoder->ppiA1Mag[c][b]; + iA1Phase = psPredictionEncoder->ppiA1Phase[c][b] - PRED_QUANT_FILTER_PHASE_MIN; + + ivas_split_rend_bitstream_write_int32( pBits, iA1Mag, PRED_QUNAT_FILTER_MAG_BITS ); + iBitsWritten += PRED_QUNAT_FILTER_MAG_BITS; + + ivas_split_rend_bitstream_write_int32( pBits, iA1Phase, PRED_QUANT_FILTER_PHASE_BITS ); + iBitsWritten += PRED_QUANT_FILTER_PHASE_BITS; + } + } + } + } + + return iBitsWritten; +} +#else int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, IVAS_SPLIT_REND_BITS_HANDLE pBits ) @@ -529,3 +1070,4 @@ int32_t WritePredictors( return iBitsWritten; } #endif +#endif diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index edbde3cb01..1d8ef2593f 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -276,6 +276,108 @@ static void ComputeBandEnergy( } +#ifdef SPLIT_REND_LCLD_5MS +/*-------------------------------------------------------------------* + * Function TryMerge() + * + * + *-------------------------------------------------------------------*/ + +/* THis is temporary cost function */ +static float TryMerge( + const int32_t iNumBands, + const int32_t iStartBlock, + const int32_t iGroupLength, + const float fMaxAllowedDiffdB, + float **ppfBandEnergy, + float **ppfBandEnergydB, +#ifdef APPLY_WEIGHT + float **ppfWeight, +#endif + float *pfMegredEnergydB ) +{ + int32_t b; + int32_t n; + float fMeanCost; + float fMaxCost; + float fMinDiffCost; + float fMaxDiffCost; + float fInvGroupSize = 1.0f / (float) iGroupLength; + float fInvNumBands = 1.0f / (float) iNumBands; + + for ( b = 0; b < iNumBands; b++ ) + { + float fGroupEnergy; + + + fGroupEnergy = 0.0; + for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) + { + fGroupEnergy += ppfBandEnergy[n][b]; + } + fGroupEnergy *= fInvGroupSize; + fGroupEnergy = 10.0f * log10f( fGroupEnergy ); // Note epsolon was added when computing BandEnergy; + + pfMegredEnergydB[b] = fGroupEnergy; + } + + fMeanCost = 0.0; + fMaxCost = 0.0; + fMinDiffCost = 0.0; + fMaxDiffCost = 0.0; + for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) + { + float fMeanAbsDiff; + float fMaxAbsDiff; + float fMaxDiff; + float fMinDiff; + + fMeanAbsDiff = 0.0; + fMaxAbsDiff = 0.0; + fMaxDiff = 0.0; + fMinDiff = 0.0; + for ( b = 0; b < iNumBands; b++ ) + { + float fDiff; + float fAbsDiff; + + fDiff = pfMegredEnergydB[b] - ppfBandEnergydB[n][b]; // Changed the order of this + fAbsDiff = fabsf( fDiff ); +#ifdef APPLY_WEIGHT + fAbsDiff *= ppfWeight[n][b]; +#endif + + fMeanAbsDiff += fAbsDiff; + fMaxAbsDiff = ( fMaxAbsDiff > fAbsDiff ) ? fMaxAbsDiff : fAbsDiff; + + + fMaxDiff = ( fMaxDiff > fDiff ) ? fMaxDiff : fDiff; + fMinDiff = ( fMinDiff < fDiff ) ? fMinDiff : fDiff; + } + fMeanAbsDiff *= fInvNumBands; + + fMeanCost = ( fMeanCost > fMeanAbsDiff ) ? fMeanCost : fMeanAbsDiff; + fMaxCost = ( fMaxCost > fMaxAbsDiff ) ? fMaxCost : fMaxAbsDiff; + + fMaxDiffCost = ( fMaxDiffCost > fMaxDiff ) ? fMaxDiffCost : fMaxDiff; + fMinDiffCost = ( fMinDiffCost < fMinDiff ) ? fMinDiffCost : fMinDiff; + } + + // printf("%f\t%f\t%f\t%f\n",fMeanCost,fMaxCost,fMaxDiffCost,fMinDiffCost); + + /*if(fMinDiffCost < -9.0){ // This prevents cliping + fMeanCost = 1e12; //Some large value + }*/ + + if ( fMaxCost > fMaxAllowedDiffdB ) + { + fMeanCost = 1e12f; // Some large value + } + + return fMeanCost; +} +#endif + /*-------------------------------------------------------------------* * Function ComputeMergeRMS() * @@ -487,6 +589,121 @@ static float TryMerge2( return fMergedCost; } +#ifdef SPLIT_REND_LCLD_5MS +/*-------------------------------------------------------------------* + * Function ComputeGreedyGroups() + * + * + *-------------------------------------------------------------------*/ + +static void ComputeGreedyGroups( + RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB ) +{ + float fBestMeanCost; + + fBestMeanCost = 0.0; + while ( fBestMeanCost < fMeanAllowedDiffdB ) + { + GMNode *psGMNode; + GMNode *psBestGMNode; + + fBestMeanCost = fMeanAllowedDiffdB; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + psBestGMNode = NULL; + while ( psGMNode->psNext != NULL ) + { + float fMeanCost; + int32_t iGroupLength; + + iGroupLength = psGMNode->iGroupLength + psGMNode->psNext->iGroupLength; + + fMeanCost = TryMerge( iNumBands * iChannels, + psGMNode->iGroupStart, + iGroupLength, // psGMNode->iGroupLength, //Fix this bug + fMaxAllowedDiffdB, + psRMSEnvelopeGrouping->ppfBandEnergy, + psRMSEnvelopeGrouping->ppfBandEnergydB, +#ifdef APPLY_WEIGHT + psRMSEnvelopeGrouping->ppfWeight, +#endif + psGMNode->pfMergedEnergydB ); + + + if ( fMeanCost < fBestMeanCost ) + { + fBestMeanCost = fMeanCost; + psBestGMNode = psGMNode; + } + + psGMNode = psGMNode->psNext; + } + + if ( fBestMeanCost < fMeanAllowedDiffdB && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) + { + psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; + psBestGMNode->psNext = psBestGMNode->psNext->psNext; + } + } + + return; +} + + +/*-------------------------------------------------------------------* + * Function ComputeGreedyGroups2() + * + * + *-------------------------------------------------------------------*/ + +static void ComputeGreedyGroups2( + RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths ) +{ + float fBestMergeCost; + // int32_t iDone = 0; + fBestMergeCost = -1.0; + + while ( fBestMergeCost < 0.0 ) + { + GMNode *psGMNode; + GMNode *psBestGMNode; + + fBestMergeCost = 0.0; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + psBestGMNode = NULL; + while ( psGMNode->psNext != NULL ) + { + float fMergeCost; + + fMergeCost = TryMerge2( iChannels, iNumBands, piBandwidths, psRMSEnvelopeGrouping->ppfBandEnergy, psRMSEnvelopeGrouping->ppfBandEnergydB, psGMNode, psGMNode->psNext ); + + if ( fMergeCost < fBestMergeCost ) + { + fBestMergeCost = fMergeCost; + psBestGMNode = psGMNode; + } + + psGMNode = psGMNode->psNext; + } + + if ( fBestMergeCost < 0.0 && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) + { + psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; + psBestGMNode->iGroupRMSEnvelopeCost = -1; + psBestGMNode->fGroupSNRPenalty = -1.0; + psBestGMNode->psNext = psBestGMNode->psNext->psNext; + } + } + + return; +} +#endif /*-------------------------------------------------------------------* * Function ComputeGreedyGroups3() @@ -700,9 +917,13 @@ void ComputeEnvelopeGrouping( psRMSEnvelopeGrouping->psGMNodes[n].psNext = NULL; } - /* Perform grouping via Greedy Merge */ - /* Allows control over max groups can call using 16 if want same as previous call */ +/* Perform grouping via Greedy Merge */ +/* Allows control over max groups can call using 16 if want same as previous call */ +#ifdef SPLIT_REND_LCLD_5MS + ComputeGreedyGroups3( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths, psRMSEnvelopeGrouping->iNumBlocks ); +#else ComputeGreedyGroups3( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths, LCLD_BLOCKS_PER_FRAME ); +#endif /* Calc Groups from Merge Results */ *piNumGroups = 0; diff --git a/lib_rend/ivas_lcld_decoder.c b/lib_rend/ivas_lcld_decoder.c index 8aafcb1fa8..d989797a29 100644 --- a/lib_rend/ivas_lcld_decoder.c +++ b/lib_rend/ivas_lcld_decoder.c @@ -83,9 +83,6 @@ struct LCLD_DECODER uint32_t num_decode_table[2 * ALLOC_TABLE_SIZE]; int32_t piMSPredCoefs[MAX_BANDS]; int32_t piLRPhaseDiffs[MAX_BANDS]; -#ifdef ENABLE_PMOD_ADJUST - int32_t **ppiHiSMRFlags; -#endif int32_t iCommonGrouping; int32_t *piNumGroups; int32_t **ppiGroupLengths; @@ -344,10 +341,18 @@ static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, int32_t num, const ui * *------------------------------------------------------------------------------------------*/ +#ifndef SPLIT_REND_LCLD_5MS ivas_error CreateLCLDDecoder( LCLDDecoder **psLCLDDecoder_out, const int32_t iSampleRate, const int32_t iChannels ) +#else +ivas_error CreateLCLDDecoder( + LCLDDecoder **psLCLDDecoder_out, + const int32_t iSampleRate, + const int32_t iChannels, + const int32_t iNumBlocks ) +#endif { int32_t n; int32_t read_length; @@ -355,17 +360,27 @@ ivas_error CreateLCLDDecoder( LCLDDecoder *psLCLDDecoder = NULL; assert( iSampleRate == 48000 ); // Fix - +#ifdef SPLIT_REND_LCLD_5MS + assert( iNumBlocks == 16 || iNumBlocks == 8 || iNumBlocks == 4 ); +#endif if ( ( psLCLDDecoder = (LCLDDecoder *) malloc( sizeof( LCLDDecoder ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } psLCLDDecoder->iSampleRate = iSampleRate; psLCLDDecoder->iChannels = iChannels; +#ifdef SPLIT_REND_LCLD_5MS + psLCLDDecoder->iNumBlocks = iNumBlocks; +#else psLCLDDecoder->iNumBlocks = LCLD_BLOCKS_PER_FRAME; +#endif psLCLDDecoder->iAllocOffset = 0; - psLCLDDecoder->iNumBands = MAX_BANDS_48; // Fix +#ifdef SPLIT_REND_LCLD_5MS + psLCLDDecoder->iNumBands = 0; // read from bitstream +#else + psLCLDDecoder->iNumBands = MAX_BANDS_48; // Fix +#endif psLCLDDecoder->piBandwidths = c_aiBandwidths48; // Fix psLCLDDecoder->iMSMode = 0; @@ -378,10 +393,6 @@ ivas_error CreateLCLDDecoder( psLCLDDecoder->piLRPhaseDiffs[n] = 0; psLCLDDecoder->piMSPredCoefs[n] = 0; } -#ifdef ENABLE_PMOD_ADJUST - psLCLDDecoder->ppiHiSMRFlags = - (int32_t **) malloc( psLCLDDecoder->iChannels * sizeof( int32_t * ) ); -#endif psLCLDDecoder->iCommonGrouping = 1; /* Common grouping always on only impacts stereo */ if ( ( psLCLDDecoder->piNumGroups = (int32_t *) malloc( psLCLDDecoder->iChannels * sizeof( int32_t ) ) ) == NULL ) @@ -429,11 +440,6 @@ ivas_error CreateLCLDDecoder( for ( n = 0; n < iChannels; n++ ) { int16_t k; -#ifdef ENABLE_PMOD_ADJUST - psLCLDDecoder->ppiHiSMRFlags[n] = - (int32_t *) malloc( MAX_BANDS * sizeof( int32_t ) ); - ; -#endif if ( ( psLCLDDecoder->ppiGroupLengths[n] = (int32_t *) malloc( LCLD_BLOCKS_PER_FRAME * sizeof( int32_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -606,16 +612,6 @@ void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder ) free( psLCLDDecoder->pppiExcitation ); } -#ifdef ENABLE_PMOD_ADJUST - if ( psLCLDDecoder->ppiHiSMRFlags != NULL ) - { - for ( n = 0; n < psLCLDDecoder->iChannels; n++ ) - { - free( psLCLDDecoder->ppiHiSMRFlags[n] ); - } - free( psLCLDDecoder->ppiHiSMRFlags ); - } -#endif if ( psLCLDDecoder->pppiAlloc != NULL ) { @@ -768,9 +764,6 @@ int32_t DecodeLCLDFrame( ReadRMSEnvelope( psLCLDDecoder->iChannels, (const int32_t *) psLCLDDecoder->piNumGroups, psLCLDDecoder->iNumBands, psLCLDDecoder->pppiRMSEnvelope, pBits ); -#ifdef ENABLE_PMOD_ADJUST - ReadPmodInformation( psLCLDDecoder->ppiHiSMRFlags, pBits, psLCLDDecoder->iChannels, psLCLDDecoder->iNumBands ); -#endif ReadAllocInformation( &psLCLDDecoder->iAllocOffset, pBits ); @@ -831,8 +824,26 @@ int32_t DecodeLCLDFrame( psLCLDDecoder->pppiLCLDSignImag[n], pppfLCLDReal[n], pppfLCLDImag[n] ); } +#ifdef DEBUG_WRITE_PREDICTORS + { + static FILE *fid; + if ( !fid ) + fid = fopen( "pred_dec.txt", "wt" ); + for ( n = 0; n < psLCLDDecoder->iChannels; n++ ) + { + int b; + for ( b = 0; b < 60; b++ ) + fprintf( fid, "%.5f ", (float) psLCLDDecoder->psPredictionDecoder->ppiPredBandEnable[n][b] * psLCLDDecoder->psPredictionDecoder->ppfA1Imag[n][b] ); + } + fprintf( fid, "%d %d\n", psLCLDDecoder->psPredictionDecoder->iSubSetId, psLCLDDecoder->psPredictionDecoder->piPredChanEnable[n] ); + } +#endif +#ifdef SPLIT_REND_LCLD_5MS + ApplyInversePredictors( psLCLDDecoder->psPredictionDecoder, pppfLCLDReal, pppfLCLDImag ); +#else ApplyInversePredictros( psLCLDDecoder->psPredictionDecoder, pppfLCLDReal, pppfLCLDImag ); +#endif for ( n = 0; n < psLCLDDecoder->iChannels; n++ ) { @@ -1020,9 +1031,10 @@ static void InvMSCoding( { int32_t b; int32_t iFBOffset; +#ifdef SPLIT_REND_LCLD_5MS + int32_t bMSPred = 0; +#else int32_t bms = 0; -#if defined SIMPLE_PHASE - void( *pFuncPhaseRotateOptions[4] ) = { &rot_zero, &rot_m_pi_2, &rot_pm_pi, &rot_p_pi_2 }; #endif iFBOffset = 0; @@ -1031,9 +1043,11 @@ static void InvMSCoding( if ( piMSFlags[b] == 1 ) { int32_t n; -#if defined SIMPLE_PHASE - void ( *pFuncPhaseRotate )( float *, float * ) = - pFuncPhaseRotateOptions[piLRPhaseDiffs[bms]]; +#ifdef SPLIT_REND_LCLD_5MS + int32_t phaseIdx; + float fPred; + phaseIdx = piLRPhaseDiffs[bMSPred] - PHASE_MIN_VAL; + fPred = dequantPred( piMSPredCoefs[bMSPred] ); #endif for ( n = 0; n < piBandwidths[b]; n++ ) { @@ -1047,8 +1061,10 @@ static void InvMSCoding( if ( iMSMode == 3 ) { +#ifndef SPLIT_REND_LCLD_5MS float fPred; fPred = dequantPred( piMSPredCoefs[bms] ); +#endif pppfReal[1][k][iFBOffset] += fPred * pppfReal[0][k][iFBOffset]; pppfImag[1][k][iFBOffset] += fPred * pppfImag[0][k][iFBOffset]; } @@ -1060,13 +1076,11 @@ static void InvMSCoding( if ( iMSMode == 3 ) { -#ifdef SIMPLE_PHASE - ( *pFuncPhaseRotate )( &fRightReal, &fRightImag ); -#else +#ifndef SPLIT_REND_LCLD_5MS int32_t phaseIdx; phaseIdx = piLRPhaseDiffs[bms] - PHASE_MIN_VAL; - cplxmult( &fRightReal, &fRightImag, c_afRotRealImag[phaseIdx][0], -c_afRotRealImag[phaseIdx][1] ); #endif + cplxmult( &fRightReal, &fRightImag, c_afRotRealImag[phaseIdx][0], -c_afRotRealImag[phaseIdx][1] ); } pppfReal[0][k][iFBOffset] = fLeftReal; @@ -1076,8 +1090,11 @@ static void InvMSCoding( } iFBOffset++; } - +#ifdef SPLIT_REND_LCLD_5MS + bMSPred++; +#else bms++; +#endif } else { @@ -1175,13 +1192,6 @@ static int32_t ReadMSInformation( anyNonZero = ivas_split_rend_bitstream_read_int32( pBits, 1 ); if ( anyNonZero ) { -#ifdef SIMPLE_PHASE - for ( n = 0; n < iNumMSPredBands; n++ ) - { - piLRPhaseDiffs[n] = ivas_split_rend_bitstream_read_int32( pBits, SIMPLE_PHASE_BITS ); - iBitsRead += SIMPLE_PHASE_BITS; - } -#else piLRPhaseDiffs[0] = ivas_split_rend_bitstream_read_int32( pBits, PHASE_BAND0_BITS ); piLRPhaseDiffs[0] += PHASE_MIN_VAL; iBitsRead += PHASE_BAND0_BITS; @@ -1192,7 +1202,6 @@ static int32_t ReadMSInformation( piLRPhaseDiffs[n] = tabIdx + ENV_DELTA_MIN; } DecodePhase( piLRPhaseDiffs, iNumMSPredBands, PHASE_DIFF_DIM ); -#endif } else { @@ -1224,11 +1233,9 @@ static int32_t ReadMSInformation( } #ifdef DEBUG_WRITE_MS_PRED { - static FILE *fid = 0; + static FILE *fid; if ( !fid ) - { - fid = fopen( "ms_mode_dec.txt", "wt" ); - } + fid = fopen( "ms_pred_dec.txt", "wt" ); writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSPredBands, iNumBands, fid, piMSFlags ); } #endif @@ -1241,6 +1248,12 @@ static int32_t ReadMSInformation( return iBitsRead; } +#ifdef SPLIT_REND_LCLD_5MS +int32_t GetNumPredSubSets( LCLDDecoder *psLCLDDecoder ) +{ + return psLCLDDecoder->psPredictionDecoder->iNumSubSets; +} +#endif static int32_t ReadGroupInformation( const int32_t iChannels, @@ -1430,66 +1443,6 @@ static int32_t ReadRMSEnvelope( } -#ifdef ENABLE_PMOD_ADJUST -static int32_t ReadPmodInformation( - int32_t **ppiHiSMRFlags, - IVAS_SPLIT_REND_BITS_HANDLE pBits, - int32_t iChannels, - int32_t iNumBands ) -{ - int32_t iBitsRead; - int32_t c; - iBitsRead = 0; - for ( c = 0; c < iChannels; c++ ) - { - int32_t b; - int32_t iFlags = ivas_split_rend_bitstream_read_int32( pBits, 1 ); - iBitsRead += 1; - if ( iFlags ) - { - for ( b = 0; b < iNumBands; b++ ) - { - ppiHiSMRFlags[c][b] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); - iBitsRead += 1; - } - } - else - { - for ( b = 0; b < iNumBands; b++ ) - { - ppiHiSMRFlags[c][b] = 0; - } - } - } -#ifdef WRITE_HISMR_FLAGS - { - static FILE *fid = 0; - if ( !fid ) - { - fid = fopen( "hismr_dec.txt", "wt" ); - } - for ( c = 0; c < iChannels; c++ ) - { - int32_t b; - for ( b = 0; b < iNumBands; b++ ) - { - if ( c == iChannels - 1 && b == iNumBands - 1 ) - { - fprintf( fid, "%d\n", ppiHiSMRFlags[c][b] ); - } - else - { - fprintf( fid, "%d ", ppiHiSMRFlags[c][b] ); - } - } - } - } -#endif - return iBitsRead; -} -#endif - - static int32_t ReadAllocInformation( int32_t *piAllocOffset, IVAS_SPLIT_REND_BITS_HANDLE pBits ) diff --git a/lib_rend/ivas_lcld_encoder.c b/lib_rend/ivas_lcld_encoder.c index 8052edee4a..3d64e6012e 100644 --- a/lib_rend/ivas_lcld_encoder.c +++ b/lib_rend/ivas_lcld_encoder.c @@ -39,9 +39,6 @@ #include "ivas_lcld_rom_tables.h" #include "prot.h" #include "ivas_prot_rend.h" -#ifdef ENABLE_PMOD_ADJUST -#include "ton_corr.h" -#endif #include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -55,7 +52,9 @@ struct LCLD_ENCODER int32_t iNumBlocks; int32_t iTargetBitRate; +#ifndef SPLIT_REND_LCLD_5MS int32_t iTargetBitsPerFrame; +#endif int32_t iNumBands; const int32_t *piBandwidths; @@ -66,9 +65,6 @@ struct LCLD_ENCODER int32_t piLRPhaseDiffs[MAX_BANDS]; int32_t iAllowSidePred; -#ifdef ENABLE_PMOD_ADJUST - int32_t **ppiHiSMRFlags; -#endif RMSEnvelopeGrouping *psRMSEnvelopeGrouping; @@ -92,6 +88,38 @@ struct LCLD_ENCODER PredictionEncoder *psPredictionEncoder; }; +#ifdef SPLIT_REND_LCLD_5MS +static int Quantize( float fVal, float fScale, int *iSign, int iMaxVal ) +{ + int iVal; + if ( fVal > 0.0f ) + { + iVal = (int) ( fScale * fVal + 0.5f ); + *iSign = 0; + } + else + { + iVal = (int) ( -fScale * fVal + 0.5f ); + *iSign = 1; + } + iVal = ( iVal < iMaxVal ) ? iVal : iMaxVal; + + return iVal; +} +static float UnQuantize( int iVal, float fScale, int iSign ) +{ + float fVal; + if ( iSign == 0 ) + { + fVal = fScale * (float) iVal; + } + else + { + fVal = -fScale * (float) iVal; + } + return fVal; +} +#endif /*------------------------------------------------------------------------------------------* * Function CreateLCLDEncoder() @@ -99,18 +127,36 @@ struct LCLD_ENCODER * *------------------------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +ivas_error CreateLCLDEncoder( + LCLDEncoder **psLCLDEncoder_out, + const int32_t iSampleRate, + const int32_t iChannels, + const int32_t iTargetBitRate, + const int32_t iAllowSidePred, + const int32_t iNumBlocks, + const int32_t iNumSubSets ) +#else ivas_error CreateLCLDEncoder( LCLDEncoder **psLCLDEncoder_out, const int32_t iSampleRate, const int32_t iChannels, const int32_t iTargetBitRate, const int32_t iAllowSidePred ) +#endif { int32_t n; LCLDEncoder *psLCLDEncoder; ivas_error error; +#ifdef SPLIT_REND_LCLD_5MS + int32_t iMaxNumPredBands = 0; +#endif assert( iSampleRate == 48000 ); // Fix +#ifdef SPLIT_REND_LCLD_5MS + assert( iNumBlocks == 16 || iNumBlocks == 8 || iNumBlocks == 4 ); + assert( iNumSubSets > 0 && iNumSubSets <= LCLD_MAX_NUM_PRED_SUBSETS ); +#endif if ( ( psLCLDEncoder = (LCLDEncoder *) malloc( sizeof( LCLDEncoder ) ) ) == NULL ) { @@ -119,14 +165,29 @@ ivas_error CreateLCLDEncoder( psLCLDEncoder->iSampleRate = iSampleRate; psLCLDEncoder->iChannels = iChannels; +#ifdef SPLIT_REND_LCLD_5MS + psLCLDEncoder->iNumBlocks = iNumBlocks; +#else psLCLDEncoder->iNumBlocks = LCLD_BLOCKS_PER_FRAME; +#endif psLCLDEncoder->iAllocOffset = 0; psLCLDEncoder->iTargetBitRate = iTargetBitRate; +#ifndef SPLIT_REND_LCLD_5MS psLCLDEncoder->iTargetBitsPerFrame = iTargetBitRate * LCLD_BLOCKS_PER_FRAME * LCLD_BANDS / iSampleRate; +#endif + + psLCLDEncoder->piBandwidths = c_aiBandwidths48; +#ifdef SPLIT_REND_LCLD_5MS + psLCLDEncoder->iNumBands = DEF_BANDS_48; /* 22 bands = 50 CLDFB bands (rather than 23 bands) */ + for ( n = 0; n < psLCLDEncoder->iNumBands; n++ ) + { + iMaxNumPredBands += psLCLDEncoder->piBandwidths[n]; + } +#else + psLCLDEncoder->iNumBands = MAX_BANDS_48; +#endif - psLCLDEncoder->iNumBands = MAX_BANDS_48; // Fix - psLCLDEncoder->piBandwidths = c_aiBandwidths48; // Fix psLCLDEncoder->iMSMode = 0; if ( ( psLCLDEncoder->piMSFlags = (int32_t *) malloc( MAX_BANDS * sizeof( int32_t ) ) ) == NULL ) @@ -194,23 +255,11 @@ ivas_error CreateLCLDEncoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } -#ifdef ENABLE_PMOD_ADJUST - if ( ( psLCLDEncoder->ppiHiSMRFlags = (int32_t **) malloc( psLCLDEncoder->iChannels * sizeof( int32_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); - } -#endif for ( n = 0; n < iChannels; n++ ) { int32_t k; -#ifdef ENABLE_PMOD_ADJUST - if ( ( psLCLDEncoder->ppiHiSMRFlags[n] = (int32_t *) malloc( MAX_BANDS * sizeof( int32_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); - } -#endif if ( ( psLCLDEncoder->ppiGroupLengths[n] = (int32_t *) malloc( LCLD_BLOCKS_PER_FRAME * sizeof( int32_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -302,10 +351,17 @@ ivas_error CreateLCLDEncoder( } } +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = CreatePredictionEncoder( &( psLCLDEncoder->psPredictionEncoder ), iChannels, psLCLDEncoder->iNumBlocks, iNumSubSets, iMaxNumPredBands ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = CreatePredictionEncoder( &( psLCLDEncoder->psPredictionEncoder ), iChannels, psLCLDEncoder->iNumBlocks ) ) != IVAS_ERR_OK ) { return error; } +#endif *psLCLDEncoder_out = psLCLDEncoder; @@ -350,16 +406,6 @@ void DeleteLCLDEncoder( } free( psLCLDEncoder->ppiGroupLengths ); } -#ifdef ENABLE_PMOD_ADJUST - if ( psLCLDEncoder->ppiHiSMRFlags != NULL ) - { - for ( n = 0; n < psLCLDEncoder->iChannels; n++ ) - { - free( psLCLDEncoder->ppiHiSMRFlags[n] ); - } - free( psLCLDEncoder->ppiHiSMRFlags ); - } -#endif if ( psLCLDEncoder->pppiRMSEnvelope != NULL ) { for ( n = 0; n < psLCLDEncoder->iChannels; n++ ) @@ -483,10 +529,6 @@ static int32_t CountLCLDBits( const int32_t iNumGroups, const int32_t *piGroupLe static int32_t WriteHeaderInformation( const int32_t iNumBands, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -#ifdef ENABLE_PMOD_ADJUST -static int32_t WritePmodInformation( const int32_t **ppiHiSMRFlags, IVAS_SPLIT_REND_BITS_HANDLE pBits, int32_t iChannels, int32_t iNumBands ); -#endif - static int32_t WriteMSInformation( const int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, int32_t iNumMSPredBands, IVAS_SPLIT_REND_BITS_HANDLE pBits ); static int32_t WriteGroupInformation( const int32_t iChannels, const int32_t iCommonGrouping, const int32_t *piNumGroups, int32_t **ppiGroupLengths, IVAS_SPLIT_REND_BITS_HANDLE pBits ); @@ -497,8 +539,11 @@ static int32_t WriteAllocInformation( const int32_t iAllocOffset, IVAS_SPLIT_REN static int32_t WriteLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, IVAS_SPLIT_REND_BITS_HANDLE pBits ); +#ifdef SPLIT_REND_LCLD_5MS +static int32_t ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, float ***pppfReal, float ***pppfImag, int32_t ***pppiSMR, const int32_t iAvailableBits, int32_t *piAllocOffset, int32_t ***pppiAlloc, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, PredictionEncoder *psPredictionEncoder ); +#else static int32_t ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, float ***pppfReal, float ***pppfImag, int32_t ***pppiSMR, const int32_t iAvailableBits, int32_t *piAllocOffset, int32_t ***pppiAlloc, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, int32_t **ppiPredEnable, float **ppfA1Real, float **ppfA1Imag ); - +#endif /*------------------------------------------------------------------------------------------* * Function EncodeLCLDFrame() @@ -519,6 +564,9 @@ int32_t EncodeLCLDFrame( int32_t iNumMSBands = 0; iAvailableBits = available_bits; // HCBR for now iBitsWritten = 0; +#ifdef SPLIT_REND_LCLD_5MS + assert( available_bits <= pBits->buf_len * 8 ); +#endif /* Do MS calc here */ if ( psLCLDEncoder->iChannels == 2 ) @@ -540,9 +588,6 @@ int32_t EncodeLCLDFrame( } } -#ifdef ENABLE_PMOD_ADJUST - CalcTonQuotas( psLCLDEncoder->iChannels, psLCLDEncoder->iNumBands, psLCLDEncoder->piBandwidths, pppfLCLDReal, pppfLCLDImag, psLCLDEncoder->ppiHiSMRFlags ); -#endif /* Compute Grouping and RMS Envelopes */ if ( psLCLDEncoder->iChannels == 2 && psLCLDEncoder->iCommonGrouping == 1 ) @@ -612,12 +657,6 @@ int32_t EncodeLCLDFrame( iBitsWritten += WriteRMSEnvelope( psLCLDEncoder->iChannels, (const int32_t *) psLCLDEncoder->piNumGroups, psLCLDEncoder->iNumBands, psLCLDEncoder->pppiRMSEnvelope, pBits ); -#ifdef ENABLE_PMOD_ADJUST - iBitsWritten += WritePmodInformation( psLCLDEncoder->ppiHiSMRFlags, - pBits, - psLCLDEncoder->iChannels, - psLCLDEncoder->iNumBands ); -#endif if ( psLCLDEncoder->iChannels == 2 && psLCLDEncoder->iCommonGrouping == 1 ) { @@ -648,7 +687,20 @@ int32_t EncodeLCLDFrame( } } } - +#ifdef DEBUG_WRITE_PREDICTORS + { + static FILE *fid; + if ( !fid ) + fid = fopen( "pred_enc.txt", "wt" ); + for ( n = 0; n < psLCLDEncoder->iChannels; n++ ) + { + int b; + for ( b = 0; b < 60; b++ ) + fprintf( fid, "%.5f ", (float) psLCLDEncoder->psPredictionEncoder->ppiPredBandEnable[n][b] * psLCLDEncoder->psPredictionEncoder->ppfA1Imag[n][b] ); + } + fprintf( fid, "%d %d\n", psLCLDEncoder->psPredictionEncoder->iSubSetId, psLCLDEncoder->psPredictionEncoder->piPredChanEnable[n] ); + } +#endif iAvailableBits -= iBitsWritten; ComputeAllocation( psLCLDEncoder->iChannels, (const int32_t *) psLCLDEncoder->piNumGroups, @@ -665,10 +717,15 @@ int32_t EncodeLCLDFrame( psLCLDEncoder->pppiQLCLDImag, psLCLDEncoder->pppiLCLDSignReal, psLCLDEncoder->pppiLCLDSignImag, +#ifdef SPLIT_REND_LCLD_5MS + psLCLDEncoder->psPredictionEncoder ); +#else psLCLDEncoder->psPredictionEncoder->ppiPredBandEnable, psLCLDEncoder->psPredictionEncoder->ppfA1Real, psLCLDEncoder->psPredictionEncoder->ppfA1Imag ); +#endif + iBitsWritten += WriteAllocInformation( psLCLDEncoder->iAllocOffset, pBits ); @@ -710,6 +767,344 @@ int32_t GetNumGroups( LCLDEncoder *psLCLDEncoder ) * *------------------------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +enum MSPred_Types +{ + MS_PHASE_AND_PRED = 0, /* LR phase alignment + real-valued M/S prediction */ + MS_PRED_ONLY = 1, /* real-valued M/S prediction */ + MS_PHASE_ONLY = 2 /* LR phase alignment + M/S */ +}; + +enum MS_BS_TYPES +{ + MS_OFF = 0, + MS_ALL = 1, + MS_SOME = 2, + MS_PRED = 3 +}; + +static int32_t MSModeCalculation( + const int32_t iNumBlocks, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int32_t *piMSMode, + int32_t *piLRPhaseDiffs, + int32_t *piMSPredCoefs, + const int32_t iAllowSidePred, + int32_t *piMSFlags ) +{ + int32_t b; + int32_t iFBOffset; + int32_t iNumMSBands; + int32_t iMSPredType; + float fMSBitGain = 0.0f; + float pfMSPredBitGain[3] = { 0.0f }; + float fPred; + int32_t piMSPredFlags0[MAX_BANDS] = { 0 }; + int32_t piMSPredFlags1[MAX_BANDS] = { 0 }; + int32_t piMSPredFlags2[MAX_BANDS] = { 0 }; + int32_t *ppiMSPredFlags[3]; + int32_t piMSPredCoefs0[MAX_BANDS] = { 0 }; + int32_t piMSPredCoefs1[MAX_BANDS] = { 0 }; + int32_t piMSPredCoefs2[MAX_BANDS] = { 0 }; + int32_t *ppiMSPredCoefs[3]; + int32_t piMSPredPhase0[MAX_BANDS] = { 0 }; + int32_t piMSPredPhase1[MAX_BANDS] = { 0 }; + int32_t piMSPredPhase2[MAX_BANDS] = { 0 }; + int32_t *ppiMSPredPhase[3]; + int32_t iMsInfoBits; + int32_t piMsPredInfoBits[3] = { 0 }; + + const float feps = 1e-12f; + float fBitsFactor = 3.32192809488736f; /* = 1/log10(2), from dB/10 to bits assuming 1 bit per log2(SNR) or 1 bit per 3dB SNR */ + if ( iNumBlocks < LCLD_BLOCKS_PER_FRAME ) + { + fBitsFactor *= ( 0.7f + (float) ( iNumBlocks - 4 ) / (float) ( LCLD_BLOCKS_PER_FRAME - 4 ) * ( 1.0f - 0.7f ) ); /* Tuning for relatively higher side rate due to shorter frame length */ + } + + ppiMSPredFlags[0] = piMSPredFlags0; + ppiMSPredFlags[1] = piMSPredFlags1; + ppiMSPredFlags[2] = piMSPredFlags2; + + ppiMSPredCoefs[0] = piMSPredCoefs0; + ppiMSPredCoefs[1] = piMSPredCoefs1; + ppiMSPredCoefs[2] = piMSPredCoefs2; + + ppiMSPredPhase[0] = piMSPredPhase0; + ppiMSPredPhase[1] = piMSPredPhase1; + ppiMSPredPhase[2] = piMSPredPhase2; + + *piMSMode = MS_OFF; + iFBOffset = 0; + iNumMSBands = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t n; + float fLeftEnergy; + float fRightEnergy; + float fMidEnergy; + float fSideEnergy; + float fLRRatio; + float fMSRatio; + float pfMSPredRatio[3] = { 0.0f }; + float fMidEnergyPred; + float fSideEnergyPred; + float fLRCovReal = 0.0f; + float fLRCovImag = 0.0f; + int32_t iPhase; + int32_t iPred; + int32_t tabIdx = 0; + float fNumLines = (float) ( iNumBlocks * piBandwidths[b] * 2 ); /* per band per channel */ + float fLevelToSMRdBFactor = (float) c_aiDefaultTheta48[b] / (float) ( 1 << PERCEPTUAL_MODEL_SLGAIN_SHIFT ); /* frequency dependent SMR slope in psy model */ +#ifndef SPLIT_REND_LCLD_5MS + fLevelToSMRdBFactor = (float) c_aiDefaultTheta48[b] / 16.0f; /* this is a bug due to a change of PERCEPTUAL_MODEL_SLGAIN_SHIFT */ +#endif + fLeftEnergy = 0.0f; + fRightEnergy = 0.0f; + fMidEnergy = 0.0f; + fSideEnergy = 0.0f; + + for ( n = 0; n < piBandwidths[b]; n++ ) + { + int32_t k; + for ( k = 0; k < iNumBlocks; k++ ) + { + float fMidReal; + float fMidImag; + float fSideReal; + float fSideImag; + + fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); + + fLeftEnergy += ( pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset] ); + fRightEnergy += ( pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); + fMidEnergy += ( fMidReal * fMidReal + fMidImag * fMidImag ); + fSideEnergy += ( fSideReal * fSideReal + fSideImag * fSideImag ); + + fLRCovReal += ( pppfReal[0][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); + fLRCovImag += ( pppfImag[0][k][iFBOffset] * pppfReal[1][k][iFBOffset] - pppfImag[1][k][iFBOffset] * pppfReal[0][k][iFBOffset] ); + } + + iFBOffset++; + } + + /* M/S prediction without phase alignment*/ + fPred = 0.25f * ( fLeftEnergy - fRightEnergy ) / ( fMidEnergy + feps ); + iPred = quantPred( fPred ); + fPred = dequantPred( iPred ); + fSideEnergyPred = fSideEnergy + ( fPred * fPred * fMidEnergy - 2.0f * fPred * 0.25f * ( fLeftEnergy - fRightEnergy ) ); + + ppiMSPredCoefs[MS_PRED_ONLY][b] = iPred; + ppiMSPredPhase[MS_PRED_ONLY][b] = 0; + pfMSPredRatio[MS_PRED_ONLY] = log10f( ( fMidEnergy + feps ) / ( fSideEnergyPred + feps ) ); + + /* Phase alignment*/ + iPhase = 0; + if ( fLRCovReal * fLRCovReal + fLRCovImag * fLRCovImag > 0.5f * fLeftEnergy * fRightEnergy ) + { + float fPhase = atan2f( fLRCovImag, fLRCovReal ); + iPhase = quantPhase( fPhase ); + } + + /* adjust covariance */ + tabIdx = iPhase - PHASE_MIN_VAL; + cplxmult( &fLRCovReal, &fLRCovImag, c_afRotRealImag[tabIdx][0], -c_afRotRealImag[tabIdx][1] ); + + /* compute MS prediction coefficient based on adjusted covariance */ + fMidEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy + 2.0f * fLRCovReal ); + fSideEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy - 2.0f * fLRCovReal ); + + /* M/S with LR phase alignment but without prediction */ + ppiMSPredCoefs[MS_PHASE_ONLY][b] = 0; + ppiMSPredPhase[MS_PHASE_ONLY][b] = iPhase; + pfMSPredRatio[MS_PHASE_ONLY] = log10f( ( fMidEnergyPred + feps ) / ( fSideEnergyPred + feps ) ); + + /* M/S with LR phase alignment and prediction */ + fPred = fMidEnergyPred == 0.0f ? 0.0f : 0.25f * ( fLeftEnergy - fRightEnergy ) / fMidEnergyPred; + iPred = quantPred( fPred ); + fPred = dequantPred( iPred ); + fSideEnergyPred += ( fPred * fPred * fMidEnergyPred - 2.0f * fPred * 0.25f * ( fLeftEnergy - fRightEnergy ) ); + /* -= fPred * fPred * fMidEnergyPred doesn't work because fPred is quantized and does not match MS/MM exactly */ + ppiMSPredCoefs[MS_PHASE_AND_PRED][b] = iPred; + ppiMSPredPhase[MS_PHASE_AND_PRED][b] = iPhase; + pfMSPredRatio[MS_PHASE_AND_PRED] = log10f( ( fMidEnergyPred + feps ) / ( fSideEnergyPred + feps ) ); + + /* Plain M/S */ + fLeftEnergy = log10f( fLeftEnergy + feps ); + fRightEnergy = log10f( fRightEnergy + feps ); + fMidEnergy = log10f( fMidEnergy + feps ); + fSideEnergy = log10f( fSideEnergy + feps ); + + fLRRatio = ( fLeftEnergy > fRightEnergy ? fLeftEnergy - fRightEnergy : fRightEnergy - fLeftEnergy ); + fMSRatio = ( fMidEnergy > fSideEnergy ? fMidEnergy - fSideEnergy : fSideEnergy - fMidEnergy ); + + if ( fMSRatio > fLRRatio ) + { + iNumMSBands++; + piMSFlags[b] = 1; + fMSBitGain += fNumLines * ( fMSRatio - fLRRatio ) * fLevelToSMRdBFactor * fBitsFactor; + } + else + { + piMSFlags[b] = 0; + } + piLRPhaseDiffs[b] = 0; + piMSPredCoefs[b] = 0; + + /* MSPred bit gains based on increase of level ratio compared to L/R ratio and the level dependent psy-model */ + for ( iMSPredType = 0; iMSPredType < 3; iMSPredType++ ) + { + if ( pfMSPredRatio[iMSPredType] > fLRRatio ) + { + ppiMSPredFlags[iMSPredType][b] = 1; + pfMSPredBitGain[iMSPredType] += fNumLines * ( pfMSPredRatio[iMSPredType] - fLRRatio ) * fLevelToSMRdBFactor * fBitsFactor; + } + } + } + + /* remove signalling cost from bit gains */ + for ( iMSPredType = 0; iMSPredType < 3; iMSPredType++ ) + { + piMsPredInfoBits[iMSPredType] = CountMSBits( iNumBands, MS_PRED, ppiMSPredFlags[iMSPredType], ppiMSPredPhase[iMSPredType], ppiMSPredCoefs[iMSPredType] ); + pfMSPredBitGain[iMSPredType] = max( pfMSPredBitGain[iMSPredType] - piMsPredInfoBits[iMSPredType], 0.0f ); + } + + /* find the best M/S Pred type */ + iMSPredType = MS_PHASE_AND_PRED; +#ifdef SPLIT_REND_LCLD_5MS + iMSPredType = ( pfMSPredBitGain[MS_PRED_ONLY] > pfMSPredBitGain[iMSPredType] ? MS_PRED_ONLY : iMSPredType ); + iMSPredType = ( pfMSPredBitGain[MS_PHASE_ONLY] > pfMSPredBitGain[iMSPredType] ? MS_PHASE_ONLY : iMSPredType ); +#endif + + /* plain M/S */ + iMsInfoBits = CountMSBits( iNumBands, MS_SOME, piMSFlags, NULL, NULL ); + fMSBitGain = max( fMSBitGain - iMsInfoBits, 0.0f ); + if ( iAllowSidePred && pfMSPredBitGain[iMSPredType] > 1.1f * fMSBitGain ) + { + *piMSMode = MS_PRED; + iNumMSBands = 0; + for ( b = 0; b < iNumBands; b++ ) + { + piMSFlags[b] = ppiMSPredFlags[iMSPredType][b]; + if ( piMSFlags[b] == 1 ) + { + piMSPredCoefs[b] = ppiMSPredCoefs[iMSPredType][b]; + piLRPhaseDiffs[b] = ppiMSPredPhase[iMSPredType][b]; + iNumMSBands++; + } + else + { + piMSPredCoefs[b] = 0; + piLRPhaseDiffs[b] = 0; + } + } + } + else if ( iNumMSBands == iNumBands ) + { + *piMSMode = MS_ALL; + } + else if ( iNumMSBands > 0 ) + { + *piMSMode = MS_SOME; + } + else + { + *piMSMode = MS_OFF; + } +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid; + int32_t iActualInfoBits = CountMSBits( iNumBands, *piMSMode, piMSFlags, piLRPhaseDiffs, piMSPredCoefs ); + if ( !fid ) + fid = fopen( "ms_info_bits.txt", "wt" ); + fprintf( fid, "%d %d %d %d %d\n", iMsInfoBits, piMsPredInfoBits[MS_PHASE_AND_PRED], piMsPredInfoBits[MS_PRED_ONLY], piMsPredInfoBits[MS_PHASE_ONLY], iActualInfoBits ); + } +#endif + if ( *piMSMode != MS_OFF ) + { + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + if ( piMSFlags[b] == 1 ) + { + int32_t n; + int32_t phaseIdx; + phaseIdx = piLRPhaseDiffs[b] - PHASE_MIN_VAL; + fPred = dequantPred( piMSPredCoefs[b] ); + for ( n = 0; n < piBandwidths[b]; n++ ) + { + int32_t k; + for ( k = 0; k < iNumBlocks; k++ ) + { + float fMidReal; + float fMidImag; + float fSideReal; + float fSideImag; + + if ( *piMSMode == MS_PRED ) + { + cplxmult( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset], c_afRotRealImag[phaseIdx][0], c_afRotRealImag[phaseIdx][1] ); + } + + fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); + + if ( *piMSMode == MS_PRED ) + { + fSideReal -= fPred * fMidReal; + fSideImag -= fPred * fMidImag; + } + + pppfReal[0][k][iFBOffset] = fMidReal; + pppfReal[1][k][iFBOffset] = fSideReal; + pppfImag[0][k][iFBOffset] = fMidImag; + pppfImag[1][k][iFBOffset] = fSideImag; + } + iFBOffset++; + } + } + else + { + iFBOffset += piBandwidths[b]; + } + } + } +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid; + if ( !fid ) + fid = fopen( "ms_enc.txt", "wt" ); + writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSBands, iNumBands, fid, piMSFlags ); + } +#endif + if ( *piMSMode == MS_PRED ) + { + /* Differential Coding of Phase Data*/ + PrepEncode( piLRPhaseDiffs, piMSFlags, iNumBands ); + PrepEncode( piMSPredCoefs, piMSFlags, iNumBands ); +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid; + if ( !fid ) + fid = fopen( "ms_pred_enc.txt", "wt" ); + writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSBands, iNumBands, fid, piMSFlags ); + } +#endif + /* Differential Coding*/ + EncodePhase( piLRPhaseDiffs, iNumMSBands, PHASE_DIFF_DIM ); + EncodePredCoef( piMSPredCoefs, iNumMSBands ); + } + + return iNumMSBands; +} +#else static int32_t MSModeCalculation( const int32_t iNumBlocks, const int32_t iNumBands, @@ -1018,6 +1413,7 @@ static int32_t MSModeCalculation( return iNumMSBands; } +#endif static void RemoveRMSEnvelope( @@ -1057,7 +1453,119 @@ static void RemoveRMSEnvelope( return; } +#ifdef SPLIT_REND_LCLD_5MS +static void QuantizeSpectrumDPCM_Opt( + const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + int32_t **ppiAlloc, + float **ppfReal, + float **ppfImag, + int32_t **ppiQReal, + int32_t **ppiQImag, + int32_t **ppiSignReal, + int32_t **ppiSignImag, + int32_t iNumSubSets, + int32_t iSubSetId, + int32_t *piPredEnable, + float *pfA1Real, + float *pfA1Imag, + float *pfPredStateReal, + float *pfPredStateImag ) +{ + int32_t b, n; + int32_t iFBOffset; + int32_t k, iAlloc, iMaxQuantVal; + float fSCFGain, fInvSCFGain; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t iBlockOffset = 0; + if ( piPredEnable[iFBOffset] == 1 ) + { + float fReal; + float fImag; + int32_t iSubset = iFBOffset % iNumSubSets; + float fPrevReal = 0.0f; + float fPrevImag = 0.0f; + if ( iSubset != iSubSetId ) + { + /* run predictors across sub-frames */ + fPrevReal = pfPredStateReal[iFBOffset]; + fPrevImag = pfPredStateImag[iFBOffset]; + } + for ( n = 0; n < iNumGroups; n++ ) + { + iAlloc = ppiAlloc[n][b]; + iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; + fSCFGain = c_afScaleFactor[iAlloc]; + fInvSCFGain = c_afInvScaleFactor[iAlloc]; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + /* prediction */ + fReal = pfA1Real[iFBOffset] * fPrevReal - pfA1Imag[iFBOffset] * fPrevImag; + fImag = pfA1Real[iFBOffset] * fPrevImag + pfA1Imag[iFBOffset] * fPrevReal; + + ppiQReal[iBlockOffset][iFBOffset] = Quantize( ppfReal[iBlockOffset][iFBOffset] + fReal, /* quantize residual */ + fSCFGain, + &ppiSignReal[iBlockOffset][iFBOffset], + iMaxQuantVal ); + + ppiQImag[iBlockOffset][iFBOffset] = Quantize( ppfImag[iBlockOffset][iFBOffset] + fImag, + fSCFGain, + &ppiSignImag[iBlockOffset][iFBOffset], + iMaxQuantVal ); + + fPrevReal = UnQuantize( ppiQReal[iBlockOffset][iFBOffset], + fInvSCFGain, + ppiSignReal[iBlockOffset][iFBOffset] ) - + fReal; /* add prediction to quantized residual = reconstructed sample */ + + fPrevImag = UnQuantize( ppiQImag[iBlockOffset][iFBOffset], + fInvSCFGain, + ppiSignImag[iBlockOffset][iFBOffset] ) - + fImag; + + iBlockOffset++; + } /* group length */ + } /* groups */ + pfPredStateReal[iFBOffset] = fPrevReal; + pfPredStateImag[iFBOffset] = fPrevImag; + } /* predEnable */ + else + { /* no prediction */ + for ( n = 0; n < iNumGroups; n++ ) + { + iAlloc = ppiAlloc[n][b]; + iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; + fSCFGain = c_afScaleFactor[iAlloc]; + fInvSCFGain = c_afInvScaleFactor[iAlloc]; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + ppiQReal[iBlockOffset][iFBOffset] = Quantize( ppfReal[iBlockOffset][iFBOffset], + fSCFGain, + &ppiSignReal[iBlockOffset][iFBOffset], + iMaxQuantVal ); + ppiQImag[iBlockOffset][iFBOffset] = Quantize( ppfImag[iBlockOffset][iFBOffset], + fSCFGain, + &ppiSignImag[iBlockOffset][iFBOffset], + iMaxQuantVal ); + + iBlockOffset++; + } /* group length */ + } /* groups */ + } /* predEnable */ + iFBOffset++; + } /* bandwidth */ + } /* bands */ +} +#else static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, const int32_t *piGroupLengths, @@ -1199,7 +1707,7 @@ static void QuantizeSpectrumDPCM_Opt( return; } - +#endif static int32_t CountLCLDBits( const int32_t iNumGroups, @@ -1362,13 +1870,6 @@ static int32_t WriteMSInformation( if ( anyNonZero ) { -#ifdef SIMPLE_PHASE - for ( b = 0; b < iNumMSPredBands; b++ ) - { - ivas_split_rend_bitstream_write_int32( pBits, piLRPhaseDiff[b], SIMPLE_PHASE_BITS ); - iBitsWritten += SIMPLE_PHASE_BITS; - } -#else ivas_split_rend_bitstream_write_int32( pBits, piLRPhaseDiff[0] - PHASE_MIN_VAL, PHASE_BAND0_BITS ); iBitsWritten += PHASE_BAND0_BITS; for ( b = 1; b < iNumMSPredBands; b++ ) @@ -1377,7 +1878,6 @@ static int32_t WriteMSInformation( ivas_split_rend_bitstream_write_int32( pBits, c_aaiRMSEnvHuffEnc[tabIdx][1], c_aaiRMSEnvHuffEnc[tabIdx][0] ); iBitsWritten += c_aaiRMSEnvHuffEnc[tabIdx][0]; } -#endif } anyNonZero = 0; @@ -1540,70 +2040,6 @@ static int32_t WriteRMSEnvelope( } -#ifdef ENABLE_PMOD_ADJUST -static int32_t WritePmodInformation( - const int32_t **ppiHiSMRFlags, - IVAS_SPLIT_REND_BITS_HANDLE pBits, - int32_t iChannels, - int32_t iNumBands ) -{ - int32_t iBitsWritten, c, b; - - iBitsWritten = 0; - - for ( c = 0; c < iChannels; c++ ) - { - int32_t anyNonZero = 0; - const int32_t *flags = ppiHiSMRFlags[c]; - for ( b = 0; b < iNumBands; b++ ) - { - if ( flags[b] ) - { - anyNonZero = 1; - break; - } - } - ivas_split_rend_bitstream_write_int32( pBits, anyNonZero, 1 ); - iBitsWritten += 1; - if ( anyNonZero ) - { - for ( b = 0; b < iNumBands; b++ ) - { - ivas_split_rend_bitstream_write_int32( pBits, flags[b], 1 ); - iBitsWritten += 1; - } - } - } -#ifdef WRITE_HISMR_FLAGS - { - static FILE *fid = 0; - if ( !fid ) - { - fid = fopen( "hismr_enc.txt", "wt" ); - } - for ( c = 0; c < iChannels; c++ ) - { - int32_t b; - for ( b = 0; b < iNumBands; b++ ) - { - if ( c == iChannels - 1 && b == iNumBands - 1 ) - { - fprintf( fid, "%d\n", ppiHiSMRFlags[c][b] ); - } - else - { - fprintf( fid, "%d ", ppiHiSMRFlags[c][b] ); - } - } - } - } -#endif - - return iBitsWritten; -} -#endif - - static int32_t WriteAllocInformation( const int32_t iAllocOffset, IVAS_SPLIT_REND_BITS_HANDLE pBits ) @@ -1764,9 +2200,13 @@ static int32_t ComputeAllocation( int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, +#ifdef SPLIT_REND_LCLD_5MS + PredictionEncoder *psPredictionEncoder ) +#else int32_t **ppiPredEnable, float **ppfA1Real, float **ppfA1Imag ) +#endif { int32_t iBitsUsed, iDone, iDelta; int32_t b, k, n; @@ -1800,6 +2240,14 @@ static int32_t ComputeAllocation( } } +#ifdef SPLIT_REND_LCLD_5MS + if ( psPredictionEncoder->iNumSubSets > 1 ) + { + mvr2r( psPredictionEncoder->ppfPredStateReal[n], psPredictionEncoder->ppfPredStateRealTmp[n], LCLD_BANDS ); + mvr2r( psPredictionEncoder->ppfPredStateImag[n], psPredictionEncoder->ppfPredStateImagTmp[n], LCLD_BANDS ); + } +#endif + QuantizeSpectrumDPCM_Opt( piNumGroups[n], (const int32_t *) ppiGroupLengths[n], iNumBands, @@ -1811,15 +2259,29 @@ static int32_t ComputeAllocation( pppiQImag[n], pppiSignReal[n], pppiSignImag[n], +#ifdef SPLIT_REND_LCLD_5MS + psPredictionEncoder->iNumSubSets, + psPredictionEncoder->iSubSetId, + psPredictionEncoder->ppiPredBandEnable[n], + psPredictionEncoder->ppfA1Real[n], + psPredictionEncoder->ppfA1Imag[n], + psPredictionEncoder->ppfPredStateRealTmp[n], + psPredictionEncoder->ppfPredStateImagTmp[n] ); +#else ppiPredEnable[n], ppfA1Real[n], ppfA1Imag[n] ); +#endif iBitsUsed += CountLCLDBits( piNumGroups[n], (const int32_t *) ppiGroupLengths[n], iNumBands, piBandwidths, +#ifdef SPLIT_REND_LCLD_5MS + (const int32_t *) psPredictionEncoder->ppiPredBandEnable[n], +#else (const int32_t *) ppiPredEnable[n], +#endif pppiAlloc[n], pppiQReal[n], pppiQImag[n] ); @@ -1866,6 +2328,21 @@ static int32_t ComputeAllocation( } } +#ifdef SPLIT_REND_LCLD_5MS + if ( psPredictionEncoder->iNumSubSets > 1 ) + { + for ( n = 0; n < iChannels; n++ ) + { + mvr2r( psPredictionEncoder->ppfPredStateRealTmp[n], psPredictionEncoder->ppfPredStateReal[n], LCLD_BANDS ); + mvr2r( psPredictionEncoder->ppfPredStateImagTmp[n], psPredictionEncoder->ppfPredStateImag[n], LCLD_BANDS ); + } + if ( ++psPredictionEncoder->iSubSetId == psPredictionEncoder->iNumSubSets ) + { + psPredictionEncoder->iSubSetId = 0; + } + } +#endif + // printf("%d\n",*piAllocOffset); // printf("%d\t%d\t%d\n",pppiAlloc[0][0][0],pppiAlloc[0][0][1],pppiAlloc[0][0][22]); diff --git a/lib_rend/ivas_lcld_prot.h b/lib_rend/ivas_lcld_prot.h index 2af8355c97..08daf79c05 100644 --- a/lib_rend/ivas_lcld_prot.h +++ b/lib_rend/ivas_lcld_prot.h @@ -42,12 +42,23 @@ typedef struct LCLD_ENCODER LCLDEncoder; +#ifdef SPLIT_REND_LCLD_5MS +ivas_error CreateLCLDEncoder( + LCLDEncoder **psLCLDEncoder_out, + const int32_t iSampleRate, + const int32_t iChannels, + const int32_t iTargetBitRate, + const int32_t iAllowSidePred, + const int32_t iNumBlocks, + const int32_t iNumSubSets ); +#else ivas_error CreateLCLDEncoder( LCLDEncoder **psLCLDEncoder, const int32_t iSampleRate, const int32_t iChannels, const int32_t iTargetBitRate, const int32_t iAllowSidePred ); +#endif void DeleteLCLDEncoder( LCLDEncoder *psLCLDEncoder @@ -68,10 +79,22 @@ int32_t GetNumGroups( typedef struct LCLD_DECODER LCLDDecoder; +#ifndef SPLIT_REND_LCLD_5MS ivas_error CreateLCLDDecoder( LCLDDecoder **psLCLDDecoder_out, const int32_t iSampleRate, const int32_t iChannels ); +#else +int32_t GetNumPredSubSets( + LCLDDecoder *psLCLDDecoder +); + +ivas_error CreateLCLDDecoder( + LCLDDecoder **psLCLDDecoder_out, + const int32_t iSampleRate, + const int32_t iChannels, + const int32_t iNumBlocks ); +#endif void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder @@ -100,25 +123,6 @@ void cplxmult( float i2 ); -#ifdef SIMPLE_PHASE -void rot_pm_pi( - float *pr, - float *pi ); - -void rot_p_pi_2( - float *pr, - float *pi -); - -void rot_m_pi_2( - float *pr, - float *pi ); - -void rot_zero( - float *pr, - float *pi -); -#endif int32_t requantPhase( int32_t phaseQ @@ -195,6 +199,11 @@ typedef struct NOISE_GEN float *pfNoiseBuffer; } NoiseGen; +#ifdef SPLIT_REND_LCLD_5MS +NoiseGen *CreateNoiseGen( + void +); +#endif void DeleteNoiseGen( NoiseGen *psNoiseGen @@ -244,15 +253,30 @@ typedef struct PREDICTION_ENCODER int32_t iChannels; int32_t iNumBlocks; +#ifdef SPLIT_REND_LCLD_5MS + int32_t iSubSetId; + int32_t iNumSubSets; + int32_t iMaxNumPredBands; + float ***pppfInpBufReal; /* channels, LCLD_PRED_WIN_LEN, bands */ + float ***pppfInpBufImag; + float **ppfPredStateReal; /* channels, bands */ + float **ppfPredStateImag; + float **ppfPredStateRealTmp; + float **ppfPredStateImagTmp; + float **ppfInpPrevReal; /* channels, bands */ + float **ppfInpPrevImag; +#endif + float *pfWindow; float pfRxxReal[2]; float pfRxxImag[2]; int32_t *piPredChanEnable; int32_t *piNumPredBands; - +#ifndef SPLIT_REND_LCLD_5MS float **ppfEstPredGain; float **ppfEstPredBitGain; +#endif int32_t **ppiPredBandEnable; float **ppfA1Real; @@ -262,21 +286,39 @@ typedef struct PREDICTION_ENCODER int32_t **ppiA1Phase; } PredictionEncoder; +#ifdef SPLIT_REND_LCLD_5MS +ivas_error CreatePredictionEncoder( + PredictionEncoder **psPredictionEncoder_out, + const int32_t iChannels, + const int32_t iNumBlocks, + const int32_t iNumSubSets, + const int32_t iMaxNumPredBands +); +#else ivas_error CreatePredictionEncoder( PredictionEncoder **psPredictionEncoder_out, const int32_t iChannels, const int32_t iNumBlocks ); +#endif void DeletePredictionEncoder( PredictionEncoder *psPredictionEncoder ); +#ifdef SPLIT_REND_LCLD_5MS +void ComputePredictors( + PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag +); +#else int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, float ***pppfImag ); +#endif void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, @@ -293,11 +335,19 @@ typedef struct PREDICTION_DECODER { int32_t iChannels; int32_t iNumBlocks; + #ifdef SPLIT_REND_LCLD_5MS + int32_t iSubSetId; + int32_t iNumSubSets; + float **ppfPredStateReal; + float **ppfPredStateImag; + #endif int32_t *piPredChanEnable; + #ifndef SPLIT_REND_LCLD_5MS int32_t *piNumPredBands; float **ppfEstPredGain; + #endif int32_t **ppiPredBandEnable; float **ppfA1Real; @@ -327,7 +377,11 @@ int32_t ReadPredictors( IVAS_SPLIT_REND_BITS_HANDLE pBits ); +#ifdef SPLIT_REND_LCLD_5MS +void ApplyInversePredictors( +#else void ApplyInversePredictros( +#endif PredictionDecoder *psPredictionDecoder, float ***pppfReal, float ***pppfImag diff --git a/lib_rend/ivas_lcld_rom_tables.c b/lib_rend/ivas_lcld_rom_tables.c index 144c44718d..58fd22ff5c 100644 --- a/lib_rend/ivas_lcld_rom_tables.c +++ b/lib_rend/ivas_lcld_rom_tables.c @@ -39,12 +39,14 @@ /* clang-format off */ +#ifndef SPLIT_REND_LCLD_5MS const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2] = { { 1.0f, 0.0f }, /* zero */ { 0.0f, 1.0f }, /* pi/2 */ { -1.0f, 0.0f }, /* pi */ { 0.0f, -1.0f }, /* 3*pi/2 */ }; +#endif /* phi = (-12:12)'/12 *pi; tmp = [cos(phi),sin(phi)]; tmp = tmp';sprintf('{%.8ff, %.8ff},\n',tmp(:)) */ const float c_afRotRealImag[PHASE_MAX_VAL - PHASE_MIN_VAL + 1][2] = diff --git a/lib_rend/ivas_lcld_rom_tables.h b/lib_rend/ivas_lcld_rom_tables.h index 132f52addf..8e9de87606 100644 --- a/lib_rend/ivas_lcld_rom_tables.h +++ b/lib_rend/ivas_lcld_rom_tables.h @@ -45,9 +45,16 @@ #define LCLD_BLOCKS_PER_FRAME ( 16 ) #define LCLD_MAX_BLOCKS_PER_FRAME ( 16 ) #define LCLD_BANDS ( 60 ) +#ifdef SPLIT_REND_LCLD_5MS +#define LCLD_PRED_WIN_LEN ( 16 ) +#define LCLD_MAX_NUM_PRED_SUBSETS ( 8 ) +#endif #define MAX_BANDS ( 23 ) #define MAX_BANDS_48 ( 23 ) +#ifdef SPLIT_REND_LCLD_5MS +#define DEF_BANDS_48 ( 22 ) +#endif #define ENV_MIN ( -64 ) #define ENV_MAX ( 64 ) @@ -88,6 +95,7 @@ #define PHASE_DIFF_DIM ( 2 ) #define PHASE_BAND0_BITS ( 5 ) +#ifndef SPLIT_REND_LCLD_5MS #define SIMPLE_PHASE_MAX_VAL ( 3 ) #define SIMPLE_PHASE_MIN_VAL ( 0 ) #define SIMPLE_PHASE_BITS ( 2 ) @@ -95,7 +103,7 @@ #define TON_QUOTA_ABS_THRESHOLD ( 8.0f ) #define TON_QUOTA_INC_THRESHOLD ( 4.0f ) - +#endif #define PERCEPTUAL_MODEL_SLGAIN_SHIFT ( 8 ) //#define USE_DEMOD_TABLES @@ -103,7 +111,9 @@ #define HUFF_DEC_TABLE_SIZE ( 16 ) extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; +#ifndef SPLIT_REND_LCLD_5MS extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; +#endif extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index bb120dcafa..3438c693d0 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1486,12 +1486,23 @@ void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend ); +#ifdef SPLIT_REND_LCLD_5MS +ivas_error ivas_splitBinLCLDEncOpen( + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, + const int32_t iSampleRate, + const int16_t iChannels, + const int32_t iDataRate, + const int32_t iNumBlocks, + const int32_t iNumIterations +); +#else ivas_error ivas_splitBinLCLDEncOpen( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, const int32_t iSampleRate, const int16_t iChannels, const int32_t iDataRate ); +#endif void ivas_splitBinLCLDEncClose( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc @@ -1505,11 +1516,21 @@ void ivas_splitBinLCLDEncProcess( IVAS_SPLIT_REND_BITS_HANDLE pBits ); +#ifdef SPLIT_REND_LCLD_5MS +ivas_error ivas_splitBinLCLDDecOpen( + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, + const int32_t iSampleRate, + const int16_t iChannels, + const int16_t iNumBlocks, + const int16_t iNumIterations +); +#else ivas_error ivas_splitBinLCLDDecOpen( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, const int32_t iSampleRate, const int16_t iChannels ); +#endif void ivas_splitBinLCLDDecClose( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec @@ -1650,26 +1671,59 @@ void ivas_splitBinRendPLCClose( SPLIT_REND_PLC_HANDLE* phSplitRendPLC ); +#ifdef SPLIT_REND_LCLD_5MS +void ivas_splitBinRendPLCsaveState( + SPLIT_REND_PLC_HANDLE hSplitRendPLC, + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t num_chs, + const int16_t iNumBlocks, + const int16_t iNumIterations +); +#else void ivas_splitBinRendPLCsaveState( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t num_chs ); +#endif +#ifdef SPLIT_REND_LCLD_5MS +void ivas_splitBinRendPLC_xf( + SPLIT_REND_PLC_HANDLE hSplitRendPLC, + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t num_chs, + const int16_t iNumBlocks, + const int16_t iNumIterations +); +#else void ivas_splitBinRendPLC_xf( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t num_chs ); +#endif +#ifdef SPLIT_REND_LCLD_5MS +void ivas_splitBinRendPLC( + SPLIT_REND_PLC_HANDLE hSplitRendPLC, + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t num_chs, + const int16_t iNumBlocks, + const int16_t iNumIterations +); +#else void ivas_splitBinRendPLC( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t num_chs ); +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG void ivas_log_cldfb2wav_data( @@ -2011,12 +2065,22 @@ void ivas_split_rend_get_quant_params( int16_t *num_complex_bands ); +#ifdef SPLIT_REND_LCLD_5MS +ivas_error ivas_split_rend_choose_default_codec( + IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ + int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ + const int16_t cldfb_in_flag, /* i : flag indicating rendering in TD */ + const int16_t pcm_out_flag, /* i : flag to indicate PCM output */ + const int16_t is_5ms_frame /* i : flag to indicate 5ms framing */ +); +#else ivas_error ivas_split_rend_choose_default_codec( IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ const int16_t cldfb_in_flag, /* i : flag indicating rendering in CLDFB */ const int16_t pcm_out_flag /* i : flag to indicate PCM output */ ); +#endif #endif diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index 1d81dfebc9..3ca53e513d 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -47,11 +47,19 @@ * * *------------------------------------------------------------------------*/ - +#ifdef SPLIT_REND_LCLD_5MS +ivas_error ivas_splitBinLCLDDecOpen( + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, + const int32_t iSampleRate, + const int16_t iChannels, + const int16_t iNumBlocks, + const int16_t iNumIterations ) +#else ivas_error ivas_splitBinLCLDDecOpen( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, const int32_t iSampleRate, const int16_t iChannels ) +#endif { int16_t n; BIN_HR_SPLIT_LCLD_DEC_HANDLE splitBinLCLDDec; @@ -65,10 +73,17 @@ ivas_error ivas_splitBinLCLDDecOpen( splitBinLCLDDec->pLcld_dec = NULL; /* place holder for CLDFB decoder handle */ splitBinLCLDDec->iChannels = iChannels; +#ifndef SPLIT_REND_LCLD_5MS if ( ( error = CreateLCLDDecoder( &splitBinLCLDDec->psLCLDDecoder, iSampleRate, iChannels ) ) != IVAS_ERR_OK ) { return error; } +#else + if ( ( error = CreateLCLDDecoder( &splitBinLCLDDec->psLCLDDecoder, iSampleRate, iChannels, iNumBlocks ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif if ( ( splitBinLCLDDec->pppfDecLCLDReal = (float ***) malloc( iChannels * sizeof( float ** ) ) ) == NULL ) { @@ -108,6 +123,10 @@ ivas_error ivas_splitBinLCLDDecOpen( { return error; } +#ifdef SPLIT_REND_LCLD_5MS + splitBinLCLDDec->iNumBlocks = iNumBlocks; + splitBinLCLDDec->iNumIterations = iNumIterations; +#endif *hSplitBinLCLDDec = splitBinLCLDDec; @@ -171,7 +190,9 @@ void ivas_splitBinLCLDDecProcess( const int16_t bfi ) { int16_t k, n; - +#ifdef SPLIT_REND_LCLD_5MS + int16_t itr; +#endif push_wmops( "ivas_splitBinLCLDDecProcess" ); assert( hSplitBinLCLDDec != NULL ); @@ -184,9 +205,22 @@ void ivas_splitBinLCLDDecProcess( #endif if ( !bfi ) { - /* Initialized with zeros....... */ - for ( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) +#ifdef SPLIT_REND_LCLD_5MS + for ( itr = 0; itr < hSplitBinLCLDDec->iNumIterations; itr++ ) { +#endif + /* Initialized with zeros....... */ + for ( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) + { +#ifdef SPLIT_REND_LCLD_5MS + for ( k = 0; k < hSplitBinLCLDDec->iNumBlocks; k++ ) + { + hSplitBinLCLDDec->pppfDecLCLDReal[n][k] = Cldfb_Out_Real[n][hSplitBinLCLDDec->iNumBlocks * itr + k]; + hSplitBinLCLDDec->pppfDecLCLDImag[n][k] = Cldfb_Out_Imag[n][hSplitBinLCLDDec->iNumBlocks * itr + k]; + set_f( hSplitBinLCLDDec->pppfDecLCLDReal[n][k], 0, CLDFB_NO_CHANNELS_MAX ); + set_f( hSplitBinLCLDDec->pppfDecLCLDImag[n][k], 0, CLDFB_NO_CHANNELS_MAX ); + } +#else for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) { hSplitBinLCLDDec->pppfDecLCLDReal[n][k] = Cldfb_Out_Real[n][k]; @@ -194,43 +228,59 @@ void ivas_splitBinLCLDDecProcess( set_f( hSplitBinLCLDDec->pppfDecLCLDReal[n][k], 0, CLDFB_NO_CHANNELS_MAX ); set_f( hSplitBinLCLDDec->pppfDecLCLDImag[n][k], 0, CLDFB_NO_CHANNELS_MAX ); } - } +#endif + } - DecodeLCLDFrame( hSplitBinLCLDDec->psLCLDDecoder, pBits, hSplitBinLCLDDec->pppfDecLCLDReal, hSplitBinLCLDDec->pppfDecLCLDImag ); + DecodeLCLDFrame( hSplitBinLCLDDec->psLCLDDecoder, pBits, hSplitBinLCLDDec->pppfDecLCLDReal, hSplitBinLCLDDec->pppfDecLCLDImag ); #ifdef CLDFB_DEBUG - printf( "Frame Decoded = %d\n", ++hSplitBinLCLDDec->numFrame ); - int16_t writeByte = 0; - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) - { - for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + printf( "Frame Decoded = %d\n", ++hSplitBinLCLDDec->numFrame ); + int16_t writeByte = 0; + for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) { - for ( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) + for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { - writeByte = fwrite( &hSplitBinLCLDDec->pppfDecLCLDReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); - if ( writeByte != 1 ) - exit( -1 ); - writeByte = fwrite( &hSplitBinLCLDDec->pppfDecLCLDImag[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); - if ( writeByte != 1 ) - exit( -1 ); + for ( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) + { + writeByte = fwrite( &hSplitBinLCLDDec->pppfDecLCLDReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); + if ( writeByte != 1 ) + exit( -1 ); + writeByte = fwrite( &hSplitBinLCLDDec->pppfDecLCLDImag[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); + if ( writeByte != 1 ) + exit( -1 ); + } } } - } #endif - if ( hSplitBinLCLDDec->hSplitRendPLC->prev_bfi != 0 ) - { - /* cross-fade recovered frame into good frame */ + if ( hSplitBinLCLDDec->hSplitRendPLC->prev_bfi != 0 ) + { + /* cross-fade recovered frame into good frame */ +#ifdef SPLIT_REND_LCLD_5MS + ivas_splitBinRendPLC_xf( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations ); +#else ivas_splitBinRendPLC_xf( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); +#endif + } +#ifdef SPLIT_REND_LCLD_5MS } +#endif } else { /* do PLC for lost split renderer frame */ +#ifdef SPLIT_REND_LCLD_5MS + ivas_splitBinRendPLC( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations ); +#else ivas_splitBinRendPLC( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); +#endif } /* save PLC state */ +#ifdef SPLIT_REND_LCLD_5MS + ivas_splitBinRendPLCsaveState( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations ); +#else ivas_splitBinRendPLCsaveState( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); +#endif pop_wmops(); diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index a0789d63a8..83a60a8710 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -47,11 +47,21 @@ * *------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +ivas_error ivas_splitBinLCLDEncOpen( + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, + const int32_t iSampleRate, + const int16_t iChannels, + const int32_t iDataRate, + const int32_t iNumBlocks, + const int32_t iNumIterations ) +#else ivas_error ivas_splitBinLCLDEncOpen( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, const int32_t iSampleRate, const int16_t iChannels, const int32_t iDataRate ) +#endif { BIN_HR_SPLIT_LCLD_ENC_HANDLE splitBinLCLDEnc; ivas_error error; @@ -64,10 +74,17 @@ ivas_error ivas_splitBinLCLDEncOpen( splitBinLCLDEnc->pLcld_enc = NULL; // place holder for CLDFB encoder handle splitBinLCLDEnc->iChannels = iChannels; +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = CreateLCLDEncoder( &( splitBinLCLDEnc->psLCLDEncoder ), iSampleRate, iChannels, iDataRate, 1, iNumBlocks, CLDFB_NO_COL_MAX / iNumBlocks ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = CreateLCLDEncoder( &( splitBinLCLDEnc->psLCLDEncoder ), iSampleRate, iChannels, iDataRate, 1 ) ) != IVAS_ERR_OK ) { return error; } +#endif if ( ( splitBinLCLDEnc->pppfLCLDReal = (float ***) malloc( iChannels * sizeof( float ** ) ) ) == NULL ) { @@ -90,6 +107,11 @@ ivas_error ivas_splitBinLCLDEncOpen( } } +#ifdef SPLIT_REND_LCLD_5MS + splitBinLCLDEnc->iNumIterations = iNumIterations; + splitBinLCLDEnc->iNumBlocks = iNumBlocks; +#endif + #ifdef CLDFB_DEBUG splitBinLCLDEnc->numFrame = 0; char cldfbFilename[50] = "cldfb_in_ref.qmf"; @@ -158,16 +180,37 @@ void ivas_splitBinLCLDEncProcess( const int32_t available_bits, IVAS_SPLIT_REND_BITS_HANDLE pBits ) { +#ifdef SPLIT_REND_LCLD_5MS + int32_t iBitsWritten, itr, available_bits_itr, rem_itr, available_bits_local; +#else int32_t iBitsWritten; - +#endif push_wmops( "ivas_splitBinLCLDEncProcess" ); assert( hSplitBinLCLDEnc != NULL ); assert( Cldfb_In_Real != NULL ); assert( Cldfb_In_Imag != NULL ); assert( pBits != NULL ); - +#ifdef SPLIT_REND_LCLD_5MS + available_bits_local = available_bits; +#endif /* A conversion is needed for the 3d pointer interface here ........ */ +#ifdef SPLIT_REND_LCLD_5MS + for ( itr = 0; itr < hSplitBinLCLDEnc->iNumIterations; itr++ ) + { + + rem_itr = hSplitBinLCLDEnc->iNumIterations - itr; + available_bits_itr = available_bits_local / rem_itr; + + for ( int32_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + { + for ( int32_t k = 0; k < hSplitBinLCLDEnc->iNumBlocks; k++ ) + { + hSplitBinLCLDEnc->pppfLCLDReal[n][k] = Cldfb_In_Real[n][hSplitBinLCLDEnc->iNumBlocks * itr + k]; + hSplitBinLCLDEnc->pppfLCLDImag[n][k] = Cldfb_In_Imag[n][hSplitBinLCLDEnc->iNumBlocks * itr + k]; + } + } +#else for ( int32_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) { for ( int32_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) @@ -176,55 +219,83 @@ void ivas_splitBinLCLDEncProcess( hSplitBinLCLDEnc->pppfLCLDImag[n][k] = Cldfb_In_Imag[n][k]; } } +#endif #ifdef CLDFB_DEBUG - int16_t readByte = 0; - for ( int16_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) - { - for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + int16_t readByte = 0; +#ifdef SPLIT_REND_LCLD_5MS + for ( int16_t k = 0; k < hSplitBinLCLDEnc->iNumBlocks; k++ ) +#else + for ( int16_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) +#endif { - for ( int16_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { - readByte = fread( &Cldfb_In_Real[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); - if ( readByte != 1 ) - break; - readByte = fread( &Cldfb_In_Imag[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); + for ( int16_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + { +#ifdef SPLIT_REND_LCLD_5MS + readByte = fread( &hSplitBinLCLDEnc->pppfLCLDReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); + if ( readByte != 1 ) + break; + readByte = fread( &hSplitBinLCLDEnc->pppfLCLDReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); +#else + readByte = fread( &Cldfb_In_Real[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); + if ( readByte != 1 ) + break; + readByte = fread( &Cldfb_In_Imag[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); +#endif + } } } - } - if ( readByte == 1 ) - { - printf( "Frame Read = %d\n", ++hSplitBinLCLDEnc->numFrame ); - } - else - { - printf( "Writing zeroes...\n" ); - for ( int16_T k = 0; k < CLDFB_NO_COL_MAX; k++ ) + if ( readByte == 1 ) { - for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + printf( "Frame Read = %d\n", ++hSplitBinLCLDEnc->numFrame ); + } + else + { + printf( "Writing zeroes...\n" ); +#ifdef SPLIT_REND_LCLD_5MS + for ( int16_T k = 0; k < hSplitBinLCLDEnc->iNumBlocks; k++ ) +#else + for ( int16_T k = 0; k < CLDFB_NO_COL_MAX; k++ ) +#endif { - for ( int16_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { - hSplitBinLCLDEnc->pppfLCLDReal[n][k][b] = 0.f; - hSplitBinLCLDEnc->pppfLCLDImag[n][k][b] = 0.f; + for ( int16_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + { + hSplitBinLCLDEnc->pppfLCLDReal[n][k][b] = 0.f; + hSplitBinLCLDEnc->pppfLCLDImag[n][k][b] = 0.f; + } } } } - } #endif - +#ifdef SPLIT_REND_LCLD_5MS + EncodeLCLDFrame( hSplitBinLCLDEnc->psLCLDEncoder, hSplitBinLCLDEnc->pppfLCLDReal, hSplitBinLCLDEnc->pppfLCLDImag, &iBitsWritten, available_bits_itr, pBits ); +#else EncodeLCLDFrame( hSplitBinLCLDEnc->psLCLDEncoder, hSplitBinLCLDEnc->pppfLCLDReal, hSplitBinLCLDEnc->pppfLCLDImag, &iBitsWritten, available_bits, pBits ); +#endif +#ifdef SPLIT_REND_LCLD_5MS + available_bits_local -= iBitsWritten; +#ifdef DEBUGGING + assert( available_bits_local >= 0 ); +#endif +#else #ifdef DEBUGGING if ( iBitsWritten > available_bits ) assert( iBitsWritten <= available_bits ); #endif +#endif #ifdef CLDFB_DEBUG - printf( "Bits written = %d\n", iBitsWritten ); + printf( "Bits written = %d\n", iBitsWritten ); +#endif +#ifdef SPLIT_REND_LCLD_5MS + } #endif - pop_wmops(); return; diff --git a/lib_rend/ivas_splitRendererPLC.c b/lib_rend/ivas_splitRendererPLC.c index 0c75b55eb6..459827bd56 100644 --- a/lib_rend/ivas_splitRendererPLC.c +++ b/lib_rend/ivas_splitRendererPLC.c @@ -74,6 +74,10 @@ static void adaptive_polar_ext_plc( float xf_alp[CLDFB_PLC_XF], float xf_bet[CLDFB_PLC_XF] #endif +#ifdef SPLIT_REND_LCLD_5MS + , + const int16_t iNumCols +#endif ) { float uth[CLDFB_NO_COL_MAX], uthu[CLDFB_NO_COL_MAX], urh[CLDFB_NO_COL_MAX]; @@ -82,6 +86,10 @@ static void adaptive_polar_ext_plc( float start_real, start_imag, abs_fac, abs_fac_powj, comp_fac, fac_powj_real, fac_powj_imag, temp, abs2inv; float fac_ph_real, fac_ph_imag, rat_real, rat_imag, abs_temp; int32_t k, j; +#ifndef SPLIT_REND_LCLD_5MS + int16_t iNumCols; + iNumCols = CLDFB_NO_COL_MAX; +#endif /* reset of accumulators */ ph_adj = 0.0f; @@ -91,7 +99,7 @@ static void adaptive_polar_ext_plc( sth = 0.0f; /* calculate per-sample phase and magnitude evolution in preceding frame */ - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) + for ( k = 0; k < iNumCols; k++ ) { urh[k] = sqrtf( prev_imag[k] * prev_imag[k] + prev_real[k] * prev_real[k] ); if ( urh[k] < EPSILON ) @@ -134,14 +142,14 @@ static void adaptive_polar_ext_plc( } } - if ( k == CLDFB_NO_COL_MAX ) + if ( k == iNumCols ) { /* mean and stdev of per-sample magnitude ratios */ - drho *= 1.0f / ( CLDFB_NO_COL_MAX - 1 ); - temp = srho - ( CLDFB_NO_COL_MAX - 1 ) * SQR( drho ); + drho *= 1.0f / ( iNumCols - 1 ); + temp = srho - ( iNumCols - 1 ) * SQR( drho ); if ( temp > 0 ) { - srho = sqrtf( temp * ( 1.0f / ( CLDFB_NO_COL_MAX - 2 ) ) ); + srho = sqrtf( temp * ( 1.0f / ( iNumCols - 2 ) ) ); } else { @@ -149,11 +157,11 @@ static void adaptive_polar_ext_plc( } /* mean and stdev of per-sample phase differences */ - dth *= 1.0f / ( CLDFB_NO_COL_MAX - 1 ); - temp = sth - ( CLDFB_NO_COL_MAX - 1 ) * SQR( dth ); + dth *= 1.0f / ( iNumCols - 1 ); + temp = sth - ( iNumCols - 1 ) * SQR( dth ); if ( temp > 0 ) { - sth = sqrtf( temp * ( 1.0f / ( CLDFB_NO_COL_MAX - 2 ) ) ); + sth = sqrtf( temp * ( 1.0f / ( iNumCols - 2 ) ) ); } else { @@ -173,12 +181,12 @@ static void adaptive_polar_ext_plc( /* Calculate start value for evolution from last samples of previous frame */ fac_powj_real = fac_real; fac_powj_imag = fac_imag; - start_real = prev_real[CLDFB_NO_COL_MAX - 1]; - start_imag = prev_imag[CLDFB_NO_COL_MAX - 1]; + start_real = prev_real[iNumCols - 1]; + start_imag = prev_imag[iNumCols - 1]; for ( j = 1; j < START_VAL_AVG_LEN; j++ ) { - start_real += fac_powj_real * prev_real[CLDFB_NO_COL_MAX - j - 1] - fac_powj_imag * prev_imag[CLDFB_NO_COL_MAX - j - 1]; - start_imag += fac_powj_imag * prev_real[CLDFB_NO_COL_MAX - j - 1] + fac_powj_real * prev_imag[CLDFB_NO_COL_MAX - j - 1]; + start_real += fac_powj_real * prev_real[iNumCols - j - 1] - fac_powj_imag * prev_imag[iNumCols - j - 1]; + start_imag += fac_powj_imag * prev_real[iNumCols - j - 1] + fac_powj_real * prev_imag[iNumCols - j - 1]; temp = fac_powj_real * fac_real - fac_powj_imag * fac_imag; fac_powj_imag = fac_powj_imag * fac_real + fac_powj_real * fac_imag; fac_powj_real = temp; @@ -187,8 +195,8 @@ static void adaptive_polar_ext_plc( start_imag *= 1.0f / START_VAL_AVG_LEN; #else /* take last sample of previous frame as start value */ - start_real = prev_real[CLDFB_NO_COL_MAX - 1]; - start_imag = prev_imag[CLDFB_NO_COL_MAX - 1]; + start_real = prev_real[iNumCols - 1]; + start_imag = prev_imag[iNumCols - 1]; #endif #if DO_PERTURB != 0 @@ -211,7 +219,7 @@ static void adaptive_polar_ext_plc( /* apply complex evolution for first substitution sample */ rec_real[0] = rat_real * start_real - rat_imag * start_imag; rec_imag[0] = rat_imag * start_real + rat_real * start_imag; - for ( j = 2; j < CLDFB_NO_COL_MAX; j++ ) + for ( j = 2; j < iNumCols; j++ ) { /* make evolution less static: apply per samples differences as in preceding frame */ rat_real = ( prev_real[j] * prev_real[j - 1] + prev_imag[j] * prev_imag[j - 1] ); @@ -244,13 +252,13 @@ static void adaptive_polar_ext_plc( #endif rat_real *= abs2inv; rat_imag *= abs2inv; - rec_real[j + CLDFB_NO_COL_MAX - 2] = rat_real * rec_real[j + CLDFB_NO_COL_MAX - 3] - rat_imag * rec_imag[j + CLDFB_NO_COL_MAX - 3]; - rec_imag[j + CLDFB_NO_COL_MAX - 2] = rat_imag * rec_real[j + CLDFB_NO_COL_MAX - 3] + rat_real * rec_imag[j + CLDFB_NO_COL_MAX - 3]; + rec_real[j + iNumCols - 2] = rat_real * rec_real[j + iNumCols - 3] - rat_imag * rec_imag[j + iNumCols - 3]; + rec_imag[j + iNumCols - 2] = rat_imag * rec_real[j + iNumCols - 3] + rat_real * rec_imag[j + iNumCols - 3]; } #else rec_real[0] = fac_real * start_real - fac_imag * start_imag; rec_imag[0] = fac_imag * start_real + fac_real * start_imag; - for ( j = 1; j < CLDFB_NO_COL_MAX + CLDFB_PLC_XF; j++ ) + for ( j = 1; j < iNumCols + CLDFB_PLC_XF; j++ ) { rec_real[j] = fac_real * rec_real[j - 1] - fac_imag * rec_imag[j - 1]; rec_imag[j] = fac_imag * rec_real[j - 1] + fac_real * rec_imag[j - 1]; @@ -261,8 +269,8 @@ static void adaptive_polar_ext_plc( /* apply crossfade */ for ( j = 0; j < CLDFB_PLC_XF; j++ ) { - rec_real[CLDFB_NO_COL_MAX + j] *= xf_alp[j]; - rec_imag[CLDFB_NO_COL_MAX + j] *= xf_alp[j]; + rec_real[iNumCols + j] *= xf_alp[j]; + rec_imag[iNumCols + j] *= xf_alp[j]; xf_bet[j] = 1 - xf_alp[j]; } #endif @@ -273,7 +281,7 @@ static void adaptive_polar_ext_plc( Ruu_real[0] = SQR( prev_real[0] ) + SQR( prev_imag[0] ); Ruu_real[1] = 0; Ruu_imag[1] = 0; - for ( j = 1; j < CLDFB_NO_COL_MAX; j++ ) + for ( j = 1; j < iNumCols; j++ ) { Ruu_real[0] += SQR( prev_real[j] ) + SQR( prev_imag[j] ); Ruu_real[1] += prev_real[j] * prev_real[j - 1] + prev_imag[j] * prev_imag[j - 1]; @@ -296,12 +304,12 @@ static void adaptive_polar_ext_plc( fac_powj_imag = fac_imag; abs_fac = sqrtf( SQR( fac_real ) + SQR( fac_imag ) ); abs_fac_powj = abs_fac; - for ( j = 0; j < CLDFB_NO_COL_MAX; j++ ) + for ( j = 0; j < iNumCols; j++ ) { comp_fac = 1 - abs_fac_powj; - rec_real[j] = prev_real[CLDFB_NO_COL_MAX - 1] * fac_powj_real - prev_imag[CLDFB_NO_COL_MAX - 1] * fac_powj_imag + + rec_real[j] = prev_real[iNumCols - 1] * fac_powj_real - prev_imag[iNumCols - 1] * fac_powj_imag + prev_real[j] * comp_fac; - rec_imag[j] = prev_real[CLDFB_NO_COL_MAX - 1] * fac_powj_imag + prev_imag[CLDFB_NO_COL_MAX - 1] * fac_powj_real + + rec_imag[j] = prev_real[iNumCols - 1] * fac_powj_imag + prev_imag[iNumCols - 1] * fac_powj_real + prev_imag[j] * comp_fac; abs_fac_powj = abs_fac_powj * abs_fac; temp = fac_powj_real * fac_real - fac_powj_imag * fac_imag; @@ -317,8 +325,8 @@ static void adaptive_polar_ext_plc( for ( j = 0; j < CLDFB_PLC_XF; j++ ) { xf_bet[j] = 1 - abs_fac_powj; - rec_real[j + CLDFB_NO_COL_MAX] = rec_real[CLDFB_NO_COL_MAX - 1] * fac_powj_real - rec_imag[CLDFB_NO_COL_MAX - 1] * fac_powj_imag; - rec_imag[j + CLDFB_NO_COL_MAX] = rec_real[CLDFB_NO_COL_MAX - 1] * fac_powj_imag + rec_imag[CLDFB_NO_COL_MAX - 1] * fac_powj_real; + rec_real[j + iNumCols] = rec_real[iNumCols - 1] * fac_powj_real - rec_imag[iNumCols - 1] * fac_powj_imag; + rec_imag[j + iNumCols] = rec_real[iNumCols - 1] * fac_powj_imag + rec_imag[iNumCols - 1] * fac_powj_real; abs_fac_powj = abs_fac_powj * abs_fac; temp = fac_powj_real * fac_real - fac_powj_imag * fac_imag; fac_powj_imag = fac_powj_real * fac_imag + fac_powj_imag * fac_real; @@ -329,7 +337,7 @@ static void adaptive_polar_ext_plc( } else { - for ( j = 0; j < CLDFB_NO_COL_MAX; j++ ) + for ( j = 0; j < iNumCols; j++ ) { rec_real[j] = prev_real[j]; rec_imag[j] = prev_imag[j]; @@ -338,8 +346,8 @@ static void adaptive_polar_ext_plc( for ( j = 0; j < CLDFB_PLC_XF; j++ ) { xf_bet[j] = 1; - rec_real[j + CLDFB_NO_COL_MAX] = 0; - rec_imag[j + CLDFB_NO_COL_MAX] = 0; + rec_real[j + iNumCols] = 0; + rec_imag[j + iNumCols] = 0; } #endif } @@ -401,16 +409,30 @@ void ivas_splitBinRendPLCClose( * *------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +void ivas_splitBinRendPLCsaveState( + SPLIT_REND_PLC_HANDLE hSplitRendPLC, + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t num_chs, + const int16_t iNumBlocks, + const int16_t iNumIterations ) +#else void ivas_splitBinRendPLCsaveState( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t num_chs ) +#endif { int16_t k, n; - /* Save Cldfb frame */ +/* Save Cldfb frame */ +#ifdef SPLIT_REND_LCLD_5MS + for ( k = 0; k < ( iNumBlocks * iNumIterations ); k++ ) +#else for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) +#endif { for ( n = 0; n < num_chs; n++ ) { @@ -429,11 +451,21 @@ void ivas_splitBinRendPLCsaveState( * Cross-fade of preceding bad frame into good frame *------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +void ivas_splitBinRendPLC_xf( + SPLIT_REND_PLC_HANDLE hSplitRendPLC, + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t num_chs, + const int16_t iNumBlocks, + const int16_t iNumIterations ) +#else void ivas_splitBinRendPLC_xf( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t num_chs ) +#endif { int16_t n, i, k; @@ -452,8 +484,13 @@ void ivas_splitBinRendPLC_xf( #if CLDFB_PLC_XF > 0 for ( k = 0; k < CLDFB_PLC_XF; k++ ) { +#ifdef SPLIT_REND_LCLD_5MS + Cldfb_RealBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_RealBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k + ( iNumBlocks * iNumIterations )][i]; + Cldfb_ImagBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_ImagBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k + ( iNumBlocks * iNumIterations )][i]; +#else Cldfb_RealBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_RealBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k + CLDFB_NO_COL_MAX][i]; Cldfb_ImagBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_ImagBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k + CLDFB_NO_COL_MAX][i]; +#endif } #endif } @@ -469,11 +506,21 @@ void ivas_splitBinRendPLC_xf( * Conceal bad frame *------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +void ivas_splitBinRendPLC( + SPLIT_REND_PLC_HANDLE hSplitRendPLC, + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t num_chs, + const int16_t iNumBlocks, + const int16_t iNumIterations ) +#else void ivas_splitBinRendPLC( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t num_chs ) +#endif { int32_t i, n, k; float fade_fac; @@ -481,6 +528,11 @@ void ivas_splitBinRendPLC( #if CLDFB_PLC_XF > 0 float xf_alp[CLDFB_PLC_XF]; #endif +#ifdef SPLIT_REND_LCLD_5MS + int16_t iNumCols, fade_start_cntr, mute_cntr, fade_val; + + iNumCols = iNumBlocks * iNumIterations; +#endif /* Indicate that next transition will be from a bad frame */ hSplitRendPLC->prev_bfi = 1; @@ -497,7 +549,11 @@ void ivas_splitBinRendPLC( { for ( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) { +#ifdef SPLIT_REND_LCLD_5MS + for ( k = 0; k < iNumCols; k++ ) +#else for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) +#endif { prev_real[k] = hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k][i]; prev_imag[k] = hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k][i]; @@ -507,10 +563,18 @@ void ivas_splitBinRendPLC( #if CLDFB_PLC_XF > 0 , xf_alp, hSplitRendPLC->CldfbPLC_state.xf_bet[n][i] +#endif +#ifdef SPLIT_REND_LCLD_5MS + , + iNumCols #endif ); +#ifdef SPLIT_REND_LCLD_5MS + for ( k = 0; k < iNumCols; k++ ) +#else for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) +#endif { Cldfb_RealBuffer_Binaural[n][k][i] = rec_real[k]; hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k][i] = rec_real[k]; @@ -519,7 +583,11 @@ void ivas_splitBinRendPLC( } #if CLDFB_PLC_XF > 0 +#ifdef SPLIT_REND_LCLD_5MS + for ( k = iNumCols; k < iNumCols + CLDFB_PLC_XF; k++ ) +#else for ( k = CLDFB_NO_COL_MAX; k < CLDFB_NO_COL_MAX + CLDFB_PLC_XF; k++ ) +#endif { hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k][i] = rec_real[k]; hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k][i] = rec_imag[k]; @@ -529,7 +597,41 @@ void ivas_splitBinRendPLC( } - /* Check bf counter */ +/* Check bf counter */ +#ifdef SPLIT_REND_LCLD_5MS + fade_start_cntr = SR_PLC_FADE_START * CLDFB_NO_COL_MAX / iNumCols; + mute_cntr = SR_PLC_MUTE * CLDFB_NO_COL_MAX / iNumCols; + + if ( hSplitRendPLC->bf_count++ >= fade_start_cntr ) + { + if ( hSplitRendPLC->bf_count < mute_cntr ) + { + fade_val = ( ( hSplitRendPLC->bf_count - fade_start_cntr ) * iNumCols ) / CLDFB_NO_COL_MAX; + fade_fac = powf( 10, ( hSplitRendPLC->bf_count - fade_start_cntr ) * SR_PLC_FADE_DEGREE / 20.0f ); + + for ( n = 0; n < num_chs; n++ ) + { + for ( k = 0; k < iNumCols; k++ ) + { + v_multc( &Cldfb_RealBuffer_Binaural[n][k][0], fade_fac, &Cldfb_RealBuffer_Binaural[n][k][0], (int16_t) CLDFB_NO_CHANNELS_MAX ); + v_multc( &Cldfb_ImagBuffer_Binaural[n][k][0], fade_fac, &Cldfb_ImagBuffer_Binaural[n][k][0], (int16_t) CLDFB_NO_CHANNELS_MAX ); + } + } + } + else + { + for ( n = 0; n < num_chs; n++ ) + { + for ( k = 0; k < iNumCols; k++ ) + { + set_zero( &Cldfb_RealBuffer_Binaural[n][k][0], (int16_t) CLDFB_NO_CHANNELS_MAX ); + set_zero( &Cldfb_ImagBuffer_Binaural[n][k][0], (int16_t) CLDFB_NO_CHANNELS_MAX ); + } + } + hSplitRendPLC->bf_count = mute_cntr; + } + } +#else if ( hSplitRendPLC->bf_count++ >= SR_PLC_FADE_START ) { if ( hSplitRendPLC->bf_count < SR_PLC_MUTE ) @@ -545,6 +647,7 @@ void ivas_splitBinRendPLC( hSplitRendPLC->bf_count = SR_PLC_MUTE; } } +#endif return; } diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index 973432ec50..e25e7fc5de 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -2025,10 +2025,20 @@ ivas_error ivas_split_renderer_open( } else { +#ifdef SPLIT_REND_LCLD_5MS + int16_t iNumBlocksPerFrame; + iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; + + if ( ( error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ) ) ) != IVAS_ERR_OK ) { return error; } +#endif } } @@ -2233,10 +2243,12 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( actual_md_bits = pBits->bits_written; if ( ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) || ( !useLc3plus && !pcm_out_flag ) ) { +#ifndef SPLIT_REND_LCLD_5MS if ( !useLc3plus && codec_frame_size_ms != 20 && !pcm_out_flag ) { return IVAS_ERROR( IVAS_ERR_INVALID_INPUT_BUFFER_SIZE, "Unsupported framing for LCLD codec!" ); } +#endif num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; /* CLDFB Analysis*/ @@ -2260,7 +2272,11 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( #endif for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { +#ifdef SPLIT_REND_LCLD_5MS + for ( slot_idx = 0; slot_idx < hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations; slot_idx++ ) +#else for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) +#endif { cldfbAnalysis_ts( &( in_delayed[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), Cldfb_In_BinReal[pos_idx * BINAURAL_CHANNELS + ch][slot_idx], Cldfb_In_BinImag[pos_idx * BINAURAL_CHANNELS + ch][slot_idx], @@ -2289,10 +2305,17 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( if ( !useLc3plus ) { +#ifdef SPLIT_REND_LCLD_5MS + available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); + actual_md_bits = pBits->bits_written - actual_md_bits; + available_bits -= actual_md_bits; + pBits->codec_frame_size_ms = codec_frame_size_ms; +#else available_bits = SplitRendBitRate * L_FRAME48k / 48000; actual_md_bits = pBits->bits_written - actual_md_bits; available_bits -= actual_md_bits; pBits->codec_frame_size_ms = 20; +#endif ivas_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits ); } @@ -2319,7 +2342,11 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( { if ( !useLc3plus ) { +#ifdef SPLIT_REND_LCLD_5MS + bit_len = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); +#else bit_len = SplitRendBitRate / FRAMES_PER_SEC; +#endif } else { @@ -2455,10 +2482,18 @@ ivas_error ivas_renderMultiBinToSplitBinaural( /* Needs to be done at runtime. If this was in another API function, * there would be no guarantee that the user did not change * the split rendering config before calling the main rendering function */ +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = ivas_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, cldfb_in_flag, pcm_out_flag ) ) != IVAS_ERR_OK ) { return error; } +#endif + if ( cldfb_in_flag == 0 ) { @@ -2500,31 +2535,49 @@ ivas_error ivas_renderMultiBinToSplitBinaural( if ( splitCodec == IVAS_SPLIT_REND_CODEC_LCLD ) { +#ifdef SPLIT_REND_LCLD_5MS + available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); + actual_md_bits = pBits->bits_written - actual_md_bits; + available_bits -= actual_md_bits; + pBits->codec_frame_size_ms = codec_frame_size_ms; +#else available_bits = SplitRendBitRate * L_FRAME48k / 48000; actual_md_bits = pBits->bits_written - actual_md_bits; available_bits -= actual_md_bits; - +#endif ivas_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits ); } else { +#ifdef SPLIT_REND_LCLD_5MS + int16_t ch, slot_idx, num_slots, ivas_fs; + ivas_fs = (int16_t) hSplitBin->hLc3plusEnc->config.ivas_frame_duration_us / 1000; + num_slots = (int16_t) ( CLDFB_NO_COL_MAX * ivas_fs ) / 20; +#else int16_t ch, slot_idx; - +#endif /* CLDFB synthesis of main pose */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX]; float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX]; - +#ifdef SPLIT_REND_LCLD_5MS + for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) +#else for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) +#endif { Cldfb_In_BinReal_p[slot_idx] = Cldfb_In_BinReal[ch][slot_idx]; Cldfb_In_BinImag_p[slot_idx] = Cldfb_In_BinImag[ch][slot_idx]; } #ifndef SPLIT_REND_WITH_HEAD_ROT cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels * CLDFB_NO_COL_MAX, hSplitBin->hCldfbHandles->cldfbAna[ch] ); +#else +#ifdef SPLIT_REND_LCLD_5MS + cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); #else cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * CLDFB_NO_COL_MAX, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); +#endif #endif } @@ -2561,7 +2614,6 @@ ivas_error ivas_renderMultiBinToSplitBinaural( } /*zero pad*/ - /*TODO: do this inside the LCLD ENC codec */ if ( pcm_out_flag ) { bit_len = SplitRendBitRate / FRAMES_PER_SEC; @@ -2570,7 +2622,11 @@ ivas_error ivas_renderMultiBinToSplitBinaural( { if ( splitCodec == IVAS_SPLIT_REND_CODEC_LCLD ) { +#ifdef SPLIT_REND_LCLD_5MS + bit_len = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); +#else bit_len = SplitRendBitRate / FRAMES_PER_SEC; +#endif } else { diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index daf6eb6f28..f3f3cad2a3 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -724,7 +724,11 @@ ivas_error ivas_split_rend_validate_config( if ( pSplitRendConfig->codec_frame_size_ms != 0 ) /* 0 means "default for current codec", will be set to actual value at a later stage */ { +#ifdef SPLIT_REND_LCLD_5MS + if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD && pSplitRendConfig->codec_frame_size_ms != 5 && pSplitRendConfig->codec_frame_size_ms != 10 && pSplitRendConfig->codec_frame_size_ms != 20 ) +#else if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD && pSplitRendConfig->codec_frame_size_ms != 20 ) +#endif { return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Invalid framing for LCLD codec" ); } @@ -1049,12 +1053,22 @@ void ivas_init_multi_bin_pose_data( * *------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LCLD_5MS +ivas_error ivas_split_rend_choose_default_codec( + IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ + int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ + const int16_t cldfb_in_flag, /* i : flag indicating rendering in TD */ + const int16_t pcm_out_flag, /* i : flag to indicate PCM output */ + const int16_t is_5ms_frame /* i : flag to indicate 5ms framing */ +) +#else ivas_error ivas_split_rend_choose_default_codec( IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ const int16_t cldfb_in_flag, /* i : flag indicating rendering in TD */ const int16_t pcm_out_flag /* i : flag to indicate PCM output */ ) +#endif { if ( pcm_out_flag == 0 ) { @@ -1073,7 +1087,18 @@ ivas_error ivas_split_rend_choose_default_codec( switch ( *pCodec ) { case IVAS_SPLIT_REND_CODEC_LCLD: +#ifdef SPLIT_REND_LCLD_5MS + if ( is_5ms_frame ) + { + *pCodec_frame_size_ms = 5; + } + else + { + *pCodec_frame_size_ms = 20; + } +#else *pCodec_frame_size_ms = 20; +#endif break; case IVAS_SPLIT_REND_CODEC_LC3PLUS: case IVAS_SPLIT_REND_CODEC_NONE: diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index ec5d5efa4a..c4e042f429 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1438,6 +1438,10 @@ typedef struct ivas_binaural_head_rot_split_rendering_lcld_enc_struct FILE *cldfbIn; int16_t numFrame; #endif +#ifdef SPLIT_REND_LCLD_5MS + int32_t iNumIterations; + int32_t iNumBlocks; +#endif } BIN_HR_SPLIT_LCLD_ENC, *BIN_HR_SPLIT_LCLD_ENC_HANDLE; @@ -1471,6 +1475,10 @@ typedef struct ivas_binaural_head_rot_split_rendering_lcld_dec_struct int16_t numFrame; #endif SPLIT_REND_PLC_HANDLE hSplitRendPLC; +#ifdef SPLIT_REND_LCLD_5MS + int16_t iNumBlocks; + int16_t iNumIterations; +#endif } BIN_HR_SPLIT_LCLD_DEC, *BIN_HR_SPLIT_LCLD_DEC_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 947889e837..1bd89d4084 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3916,10 +3916,17 @@ ivas_error IVAS_REND_AddInput( int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, getAudioConfigType( inConfig ) ); +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK ) { return error; } +#endif if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { @@ -4797,10 +4804,17 @@ int16_t IVAS_REND_FeedRenderConfig( cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK ) { return error; } +#endif if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { @@ -6993,6 +7007,10 @@ static ivas_error renderSplitBinauralWithPostRot( int16_t outBufNumSamplesPerChannel, outBufNumColPerChannel; int16_t numSamplesPerChannelCacheSize, numColPerChannelCacheSize; float *readPtr, *writePtr; +#ifdef SPLIT_REND_LCLD_5MS + LC3PLUS_CONFIG config; + int16_t iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; +#endif isPostRendInputCldfb = 0; push_wmops( "renderSplitBinauralWithPostRot" ); @@ -7002,15 +7020,43 @@ static ivas_error renderSplitBinauralWithPostRot( hSplitBin = &splitBinInput->splitPostRendWrapper; convertBitsBufferToInternalBitsBuff( *splitBinInput->hBits, &bits ); +#ifdef SPLIT_REND_LCLD_5MS + config.lc3plus_frame_duration_us = bits.codec_frame_size_ms * 1000; + if ( pCombinedOrientationData->num_subframes == 1 ) + { + config.ivas_frame_duration_us = ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ? config.lc3plus_frame_duration_us : 20000; + iNumLCLDIterationsPerFrame = 1; + } + else + { + config.ivas_frame_duration_us = 20000; + } + + iNumLCLDIterationsPerFrame = (int16_t) config.ivas_frame_duration_us / ( 1000 * bits.codec_frame_size_ms ); + iNumLCLDIterationsPerFrame = max( 1, iNumLCLDIterationsPerFrame ); + iNumBlocksPerFrame = CLDFB_NO_COL_MAX * bits.codec_frame_size_ms / 20; + + config.channels = BINAURAL_CHANNELS; + config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; +#endif + if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD && splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec == NULL ) { +#ifdef SPLIT_REND_LCLD_5MS + if ( ( error = ivas_splitBinLCLDDecOpen( &splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec, *splitBinInput->base.ctx.pOutSampleRate, BINAURAL_CHANNELS, iNumBlocksPerFrame, iNumLCLDIterationsPerFrame ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_splitBinLCLDDecOpen( &splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec, *splitBinInput->base.ctx.pOutSampleRate, BINAURAL_CHANNELS ) ) != IVAS_ERR_OK ) { return error; } +#endif } else if ( bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && splitBinInput->splitPostRendWrapper.hLc3plusDec == NULL ) { +#ifndef SPLIT_REND_LCLD_5MS LC3PLUS_CONFIG config; if ( outAudio.config.numSamplesPerChannel == 240 ) @@ -7026,6 +7072,7 @@ static ivas_error renderSplitBinauralWithPostRot( config.channels = BINAURAL_CHANNELS; config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; +#endif if ( ( error = IVAS_LC3PLUS_DEC_Open( config, &splitBinInput->splitPostRendWrapper.hLc3plusDec ) ) != IVAS_ERR_OK ) { @@ -7069,13 +7116,20 @@ static ivas_error renderSplitBinauralWithPostRot( { isPostRendInputCldfb = 1; } - +#ifdef SPLIT_REND_LCLD_5MS + preRendFrameSize_ms = (int16_t) ( config.ivas_frame_duration_us ) / 1000; +#else preRendFrameSize_ms = bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ? (int16_t) ( hSplitBin->hLc3plusDec->config.ivas_frame_duration_us ) / 1000 : 20; +#endif numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * ( preRendFrameSize_ms - bits.codec_frame_size_ms ) / 1000 ); outBufNumColPerChannel = MAX_PARAM_SPATIAL_SUBFRAMES; +#ifdef SPLIT_REND_LCLD_5MS + numColPerChannelCacheSize = ( iNumBlocksPerFrame * iNumLCLDIterationsPerFrame ) - outBufNumColPerChannel; +#else numColPerChannelCacheSize = CLDFB_NO_COL_MAX - outBufNumColPerChannel; +#endif for ( sf_idx = 0; sf_idx < pCombinedOrientationData->num_subframes; sf_idx++ ) { @@ -7098,7 +7152,11 @@ static ivas_error renderSplitBinauralWithPostRot( /* cache the remaining 15ms */ splitBinInput->numCachedSamples = numColPerChannelCacheSize; writePtr = splitBinInput->bufferData; +#ifdef SPLIT_REND_LCLD_5MS + for ( slotIdx = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slotIdx < ( iNumBlocksPerFrame * iNumLCLDIterationsPerFrame ); ++slotIdx ) +#else for ( slotIdx = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx ) +#endif { for ( chnlIdx = 0; chnlIdx < BINAURAL_CHANNELS; ++chnlIdx ) { @@ -8549,12 +8607,18 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); hIvasRend->splitRendEncBuffer.config.is_cldfb = cldfb_in_flag; - +#ifdef SPLIT_REND_LCLD_5MS + if ( hIvasRend->hRendererConfig->split_rend_config.dof == 0 || hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) + { + hIvasRend->splitRendEncBuffer.config.numSamplesPerChannel = outAudio.config.numSamplesPerChannel; + } +#else if ( hIvasRend->hRendererConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && ( hIvasRend->hRendererConfig->split_rend_config.dof == 0 || hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) { hIvasRend->splitRendEncBuffer.config.numSamplesPerChannel = hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms * hIvasRend->num_subframes * (int16_t) ( hIvasRend->sampleRateOut / 1000 ); } +#endif else { hIvasRend->splitRendEncBuffer.config.numSamplesPerChannel = (int16_t) ( hIvasRend->sampleRateOut / FRAMES_PER_SEC ); -- GitLab From f00dd9a2363065f7bcfb924d7f9ca839e9493066 Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 15 Jan 2024 22:59:10 +1100 Subject: [PATCH 012/498] warning fixes --- lib_rend/ivas_RMSEnvGrouping.c | 2 +- lib_rend/ivas_splitRendererPLC.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index 1d8ef2593f..7dc34714bf 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -589,7 +589,7 @@ static float TryMerge2( return fMergedCost; } -#ifdef SPLIT_REND_LCLD_5MS +#ifndef SPLIT_REND_LCLD_5MS /*-------------------------------------------------------------------* * Function ComputeGreedyGroups() * diff --git a/lib_rend/ivas_splitRendererPLC.c b/lib_rend/ivas_splitRendererPLC.c index 459827bd56..c63715a230 100644 --- a/lib_rend/ivas_splitRendererPLC.c +++ b/lib_rend/ivas_splitRendererPLC.c @@ -607,7 +607,7 @@ void ivas_splitBinRendPLC( if ( hSplitRendPLC->bf_count < mute_cntr ) { fade_val = ( ( hSplitRendPLC->bf_count - fade_start_cntr ) * iNumCols ) / CLDFB_NO_COL_MAX; - fade_fac = powf( 10, ( hSplitRendPLC->bf_count - fade_start_cntr ) * SR_PLC_FADE_DEGREE / 20.0f ); + fade_fac = powf( 10, fade_val * SR_PLC_FADE_DEGREE / 20.0f ); for ( n = 0; n < num_chs; n++ ) { -- GitLab From 027ccdbcb2fc94d8a412b7df511016b7da0b615c Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 16 Jan 2024 09:44:06 +1100 Subject: [PATCH 013/498] remove unused functions --- lib_rend/ivas_RMSEnvGrouping.c | 219 --------------------------------- 1 file changed, 219 deletions(-) diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index 7dc34714bf..f7174b6526 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -275,109 +275,6 @@ static void ComputeBandEnergy( return; } - -#ifdef SPLIT_REND_LCLD_5MS -/*-------------------------------------------------------------------* - * Function TryMerge() - * - * - *-------------------------------------------------------------------*/ - -/* THis is temporary cost function */ -static float TryMerge( - const int32_t iNumBands, - const int32_t iStartBlock, - const int32_t iGroupLength, - const float fMaxAllowedDiffdB, - float **ppfBandEnergy, - float **ppfBandEnergydB, -#ifdef APPLY_WEIGHT - float **ppfWeight, -#endif - float *pfMegredEnergydB ) -{ - int32_t b; - int32_t n; - float fMeanCost; - float fMaxCost; - float fMinDiffCost; - float fMaxDiffCost; - float fInvGroupSize = 1.0f / (float) iGroupLength; - float fInvNumBands = 1.0f / (float) iNumBands; - - for ( b = 0; b < iNumBands; b++ ) - { - float fGroupEnergy; - - - fGroupEnergy = 0.0; - for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) - { - fGroupEnergy += ppfBandEnergy[n][b]; - } - fGroupEnergy *= fInvGroupSize; - fGroupEnergy = 10.0f * log10f( fGroupEnergy ); // Note epsolon was added when computing BandEnergy; - - pfMegredEnergydB[b] = fGroupEnergy; - } - - fMeanCost = 0.0; - fMaxCost = 0.0; - fMinDiffCost = 0.0; - fMaxDiffCost = 0.0; - for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) - { - float fMeanAbsDiff; - float fMaxAbsDiff; - float fMaxDiff; - float fMinDiff; - - fMeanAbsDiff = 0.0; - fMaxAbsDiff = 0.0; - fMaxDiff = 0.0; - fMinDiff = 0.0; - for ( b = 0; b < iNumBands; b++ ) - { - float fDiff; - float fAbsDiff; - - fDiff = pfMegredEnergydB[b] - ppfBandEnergydB[n][b]; // Changed the order of this - fAbsDiff = fabsf( fDiff ); -#ifdef APPLY_WEIGHT - fAbsDiff *= ppfWeight[n][b]; -#endif - - fMeanAbsDiff += fAbsDiff; - fMaxAbsDiff = ( fMaxAbsDiff > fAbsDiff ) ? fMaxAbsDiff : fAbsDiff; - - - fMaxDiff = ( fMaxDiff > fDiff ) ? fMaxDiff : fDiff; - fMinDiff = ( fMinDiff < fDiff ) ? fMinDiff : fDiff; - } - fMeanAbsDiff *= fInvNumBands; - - fMeanCost = ( fMeanCost > fMeanAbsDiff ) ? fMeanCost : fMeanAbsDiff; - fMaxCost = ( fMaxCost > fMaxAbsDiff ) ? fMaxCost : fMaxAbsDiff; - - fMaxDiffCost = ( fMaxDiffCost > fMaxDiff ) ? fMaxDiffCost : fMaxDiff; - fMinDiffCost = ( fMinDiffCost < fMinDiff ) ? fMinDiffCost : fMinDiff; - } - - // printf("%f\t%f\t%f\t%f\n",fMeanCost,fMaxCost,fMaxDiffCost,fMinDiffCost); - - /*if(fMinDiffCost < -9.0){ // This prevents cliping - fMeanCost = 1e12; //Some large value - }*/ - - if ( fMaxCost > fMaxAllowedDiffdB ) - { - fMeanCost = 1e12f; // Some large value - } - - return fMeanCost; -} -#endif - /*-------------------------------------------------------------------* * Function ComputeMergeRMS() * @@ -589,122 +486,6 @@ static float TryMerge2( return fMergedCost; } -#ifndef SPLIT_REND_LCLD_5MS -/*-------------------------------------------------------------------* - * Function ComputeGreedyGroups() - * - * - *-------------------------------------------------------------------*/ - -static void ComputeGreedyGroups( - RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int32_t iChannels, - const int32_t iNumBands, - const float fMeanAllowedDiffdB, - const float fMaxAllowedDiffdB ) -{ - float fBestMeanCost; - - fBestMeanCost = 0.0; - while ( fBestMeanCost < fMeanAllowedDiffdB ) - { - GMNode *psGMNode; - GMNode *psBestGMNode; - - fBestMeanCost = fMeanAllowedDiffdB; - psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; - psBestGMNode = NULL; - while ( psGMNode->psNext != NULL ) - { - float fMeanCost; - int32_t iGroupLength; - - iGroupLength = psGMNode->iGroupLength + psGMNode->psNext->iGroupLength; - - fMeanCost = TryMerge( iNumBands * iChannels, - psGMNode->iGroupStart, - iGroupLength, // psGMNode->iGroupLength, //Fix this bug - fMaxAllowedDiffdB, - psRMSEnvelopeGrouping->ppfBandEnergy, - psRMSEnvelopeGrouping->ppfBandEnergydB, -#ifdef APPLY_WEIGHT - psRMSEnvelopeGrouping->ppfWeight, -#endif - psGMNode->pfMergedEnergydB ); - - - if ( fMeanCost < fBestMeanCost ) - { - fBestMeanCost = fMeanCost; - psBestGMNode = psGMNode; - } - - psGMNode = psGMNode->psNext; - } - - if ( fBestMeanCost < fMeanAllowedDiffdB && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) - { - psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; - psBestGMNode->psNext = psBestGMNode->psNext->psNext; - } - } - - return; -} - - -/*-------------------------------------------------------------------* - * Function ComputeGreedyGroups2() - * - * - *-------------------------------------------------------------------*/ - -static void ComputeGreedyGroups2( - RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int32_t iChannels, - const int32_t iNumBands, - const int32_t *piBandwidths ) -{ - float fBestMergeCost; - // int32_t iDone = 0; - fBestMergeCost = -1.0; - - while ( fBestMergeCost < 0.0 ) - { - GMNode *psGMNode; - GMNode *psBestGMNode; - - fBestMergeCost = 0.0; - psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; - psBestGMNode = NULL; - while ( psGMNode->psNext != NULL ) - { - float fMergeCost; - - fMergeCost = TryMerge2( iChannels, iNumBands, piBandwidths, psRMSEnvelopeGrouping->ppfBandEnergy, psRMSEnvelopeGrouping->ppfBandEnergydB, psGMNode, psGMNode->psNext ); - - if ( fMergeCost < fBestMergeCost ) - { - fBestMergeCost = fMergeCost; - psBestGMNode = psGMNode; - } - - psGMNode = psGMNode->psNext; - } - - if ( fBestMergeCost < 0.0 && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) - { - psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; - psBestGMNode->iGroupRMSEnvelopeCost = -1; - psBestGMNode->fGroupSNRPenalty = -1.0; - psBestGMNode->psNext = psBestGMNode->psNext->psNext; - } - } - - return; -} -#endif - /*-------------------------------------------------------------------* * Function ComputeGreedyGroups3() * -- GitLab From 61e1be5ba6ef498184c8039be361407d7d5c4614 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 16 Jan 2024 10:45:16 +1100 Subject: [PATCH 014/498] avoid division by 0 --- lib_rend/lib_rend.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1bd89d4084..28fd9850f3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7032,9 +7032,17 @@ static ivas_error renderSplitBinauralWithPostRot( config.ivas_frame_duration_us = 20000; } - iNumLCLDIterationsPerFrame = (int16_t) config.ivas_frame_duration_us / ( 1000 * bits.codec_frame_size_ms ); - iNumLCLDIterationsPerFrame = max( 1, iNumLCLDIterationsPerFrame ); - iNumBlocksPerFrame = CLDFB_NO_COL_MAX * bits.codec_frame_size_ms / 20; + if ( bits.codec_frame_size_ms > 0 ) + { + iNumLCLDIterationsPerFrame = (int16_t) config.ivas_frame_duration_us / ( 1000 * bits.codec_frame_size_ms ); + iNumLCLDIterationsPerFrame = max( 1, iNumLCLDIterationsPerFrame ); + iNumBlocksPerFrame = CLDFB_NO_COL_MAX * bits.codec_frame_size_ms / 20; + } + else + { + iNumLCLDIterationsPerFrame = 1; + iNumBlocksPerFrame = CLDFB_NO_COL_MAX; + } config.channels = BINAURAL_CHANNELS; config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; -- GitLab From 5604d3b788574be75aefb9def2763fae7eb416cf Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 16 Jan 2024 12:11:42 +1100 Subject: [PATCH 015/498] crash fix with TD to CLDFB conversion in pre renderer --- lib_rend/ivas_splitRendererPre.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index e25e7fc5de..d0c5ca4e76 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -2211,6 +2211,9 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( uint8_t useLc3plus; float *in_delayed[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; int16_t i; +#ifdef SPLIT_REND_LCLD_5MS + int32_t num_slots; +#endif push_wmops( "ivas_renderMultiTDBinToSplitBinaural" ); @@ -2248,6 +2251,8 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( { return IVAS_ERROR( IVAS_ERR_INVALID_INPUT_BUFFER_SIZE, "Unsupported framing for LCLD codec!" ); } +#else + num_slots = ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) ? CLDFB_NO_COL_MAX : ( hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ); #endif num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; @@ -2273,7 +2278,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { #ifdef SPLIT_REND_LCLD_5MS - for ( slot_idx = 0; slot_idx < hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations; slot_idx++ ) + for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) #else for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) #endif -- GitLab From 3fd1d68470a4d9e4514537b2678b43f7f4f35164 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 16 Jan 2024 08:22:59 +0100 Subject: [PATCH 016/498] adhoc change to p_output for getting same output in different rendering frame lengths --- lib_dec/ivas_jbm_dec.c | 13 +++++++++---- lib_rend/lib_rend.c | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 0963261f5c..e472eea9b2 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -950,6 +950,9 @@ ivas_error ivas_jbm_dec_render( #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t nchan_out_syn_output; #endif +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + float tmp_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; +#endif push_wmops( "ivas_dec_render" ); /*----------------------------------------------------------------* @@ -987,7 +990,12 @@ ivas_error ivas_jbm_dec_render( p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; } } - +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + for ( n = 0; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) + { + p_output[n] = tmp_output[n]; + } +#endif /*----------------------------------------------------------------* * Update combined orientation access index *----------------------------------------------------------------*/ @@ -1381,9 +1389,6 @@ ivas_error ivas_jbm_dec_render( nchan_remapped = st_ivas->nchan_transport; if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - nchan_remapped = st_ivas->hTcBuffer->nchan_buffer_full; -#endif ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 947889e837..a169f9fed9 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -517,6 +517,7 @@ static void accumulate2dArrayToBuffer( * In-place saturation control for multichannel buffers with adaptive release time *-------------------------------------------------------------------*/ +#ifndef DISABLE_LIMITER /*! r: number of clipped output samples */ static int32_t limitRendererOutput( IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */ @@ -561,7 +562,7 @@ static int32_t limitRendererOutput( return numClipping; } - +#endif /*-------------------------------------------------------------------* * validateOutputAudioConfig() -- GitLab From 664b872b650506e2e3f7f450567fca4f8f8a3ea7 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 22 Jan 2024 07:21:32 +0100 Subject: [PATCH 017/498] added initial version of 5ms decoding BE test --- .gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++ scripts/self_test.py | 8 ++++++++ tests/conftest.py | 18 ++++++++++++++++-- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27212c8646..8cb358e006 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -159,6 +159,10 @@ stages: - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h - sed -i.bak -e "s/\/\/[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)/\1/g" ./lib_com/options.h +.disable-limiter: &disable-limiter +# automatically enable #define DISABLE_LIMITER in options.h, handling both /**/-comment and //-comment + - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*DISABLE_LIMITER\)[[:space:]]*\*\//\1/g" ./lib_com/options.h + .get-commits-behind-count: &get-commits-behind-count - echo $CI_COMMIT_SHA - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME @@ -505,6 +509,34 @@ codec-usan: - scripts/ref/logs/ expose_as: "usan selftest results" +# compare bit-exactness between 5ms and 20 on the branch +codec-5ms: + extends: + - .test-job-linux + - .rules-merge-request + stage: test + needs: ["build-codec-linux"] + script: + - *print-common-info + - *disable-limiter + - make clean + - make -j + ### prepare pytest + # create short test vectors + - python3 tests/create_short_testvectors.py + ### 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 --update_ref 2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec --dut_fr5 || exit_code=$? + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + - *merge-request-comparison-check + 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/ + expose_as: "pytest IVAS 5ms results" + # test renderer executable renderer-smoke-test: extends: diff --git a/scripts/self_test.py b/scripts/self_test.py index 418f19b27d..7e7a7ae760 100755 --- a/scripts/self_test.py +++ b/scripts/self_test.py @@ -193,6 +193,12 @@ class SelfTest(IvasScriptsCommon.IvasScript): action="store_true", default=False, ) + self.parser.add_argument( + "--dut_fr5", + help="Run the decoder under test with 5ms rendering", + action="store_true", + default=False, + ) if shutil.which("valgrind"): self.valgrind = [ "valgrind", @@ -1502,6 +1508,8 @@ class SelfTest(IvasScriptsCommon.IvasScript): enable_logging=True, logger_name="{}.testrunner".format(self.logger.name), ) + if self.args["dut_fr5"] is True: + test_runner.decoder_cmdline_options.extend(["-fr","5"]) test_runner.set_flat_mode_list(run_dict) test_runner.run() self.logger.console(" ") diff --git a/tests/conftest.py b/tests/conftest.py index 5f7ed04a82..8410f1f47b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -158,6 +158,11 @@ def pytest_addoption(parser): help="Run the MLD tool instead of just comparing for bitexactness", ) + parser.addoption( + "--dut_fr5", + action="store_true", + help="5ms rendering for the DUT output.", + ) @pytest.fixture(scope="session", autouse=True) def update_ref(request): @@ -393,13 +398,14 @@ def dut_decoder_path(request) -> str: class DecoderFrontend: - def __init__(self, path, dec_type, timeout=None) -> None: + def __init__(self, path, dec_type, timeout=None, fr5=None) -> None: self._path = path self._type = dec_type self.returncode = None self.stdout = None self.stderr = None self.timeout = timeout + self.fr5 = fr5 def run( self, @@ -417,6 +423,9 @@ class DecoderFrontend: if quiet_mode: command.extend(["-q"]) + if self.fr5 is not None: + command.extend(["-fr", "5"]) + if plc_file is not None: system = platform.system() @@ -503,8 +512,13 @@ def dut_decoder_frontend(dut_decoder_path, request) -> DecoderFrontend: """ Return a :class:`conftest.DecoderFrontend` instance as DUT for the test session. """ + + fr5 = None + if request.config.option.dut_fr5 is True: + fr5 = True + decoder = DecoderFrontend( - dut_decoder_path, "DUT", timeout=request.config.getoption("--testcase_timeout") + dut_decoder_path, "DUT", timeout=request.config.getoption("--testcase_timeout"), fr5=fr5 ) yield decoder -- GitLab From 4a843c11738cf22c77de2845bc654b9d2c8d0f45 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 22 Jan 2024 08:57:10 +0100 Subject: [PATCH 018/498] add disabled switch DISABLE_LIMITER, needed for 5ms BE tests --- lib_com/options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_com/options.h b/lib_com/options.h index 743d9db9d2..77c27cbd7a 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -142,6 +142,7 @@ /* keep as part of options.h */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ +/*#define DISABLE_LIMITER */ /* test switch for testing BE between 5ms and 20ms rendering */ /* ################## Start DEVELOPMENT switches ######################### */ -- GitLab From c26c2f3b5b65d116086657577efc5eb4508e4bbb Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 22 Jan 2024 23:49:22 +1100 Subject: [PATCH 019/498] fixes for 5ms PCM modes --- apps/renderer.c | 19 +++++++++++++++++++ lib_rend/lib_rend.c | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/apps/renderer.c b/apps/renderer.c index 449df94dca..968cee37f2 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1928,8 +1928,26 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < args.inConfig.numBinBuses; ++i ) { +#ifdef SPLIT_REND_LCLD_5MS + if ( numSamplesRead > 0 ) + { + if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels ); + + if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } +#endif if ( splitBinNeedsNewFrame ) { +#ifndef SPLIT_REND_LCLD_5MS if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); @@ -1942,6 +1960,7 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif if ( ( error = IVAS_REND_FeedSplitBinauralBitstream( hIvasRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 28fd9850f3..09872dcbae 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4413,6 +4413,12 @@ ivas_error IVAS_REND_GetDelay( { latency_ns += IVAS_FB_DEC_DELAY_NS; } +#ifdef SPLIT_REND_LCLD_5MS + else if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hSplitBinLCLDDec != NULL ) + { + latency_ns += IVAS_FB_DEC_DELAY_NS; + } +#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -7232,6 +7238,19 @@ static ivas_error renderSplitBinauralWithPostRot( else { copyBufferTo2dArray( splitBinInput->base.inputBuffer, tmpCrendBuffer ); +#ifdef SPLIT_REND_LCLD_5MS + if ( splitBinInput->numCachedSamples == 0 ) + { + preRendFrameSize_ms = (int16_t) ( config.ivas_frame_duration_us ) / 1000; + numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * preRendFrameSize_ms / 1000 ); + numSamplesPerChannelCacheSize -= outAudio.config.numSamplesPerChannel; + splitBinInput->numCachedSamples = numSamplesPerChannelCacheSize; + } + else + { + splitBinInput->numCachedSamples -= outAudio.config.numSamplesPerChannel; + } +#endif } /* apply pose correction if enabled */ -- GitLab From 33fca880d10c46d74746961d7434bcb2708bcd42 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 09:32:24 +0100 Subject: [PATCH 020/498] Add ivas-conformance job --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27212c8646..2104d12c7b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,7 @@ variables: - 'default' - 'test-be-release' - 'test-long-self-test' + - 'ivas-conformance' default: @@ -50,6 +51,9 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test' variables: IVAS_PIPELINE_NAME: 'Test long self-test against main pipeline: $CI_COMMIT_BRANCH' + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' + variables: + IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'trigger' stages: @@ -201,6 +205,8 @@ stages: when: never - if: $MANUAL_PIPELINE_TYPE == 'test-long-self-test' # Skip all the normal jobs when testing manually against release codec when: never + - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance' + when: never - when: on_success .rules-merge-request: @@ -1187,6 +1193,43 @@ test-be-to-release: expose_as: "test-be-to-release results" +ivas-conformance: + tags: + - ivas-linux-fast + stage: test + timeout: "60 minutes" + rules: + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test' + allow_failure: + exit_codes: + - 123 + script: + - *print-common-info + # Prepare reference exec, TBD + - make -j + - cp IVAS_cod IVAS_cod_ref + - cp IVAS_dec IVAS_dec_ref + - cp IVAS_rend IVAS_rend_ref + + # Reference creation + - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref + - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 + - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref + + # Output creation + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html + + artifacts: + name: "ivas-conformance-$CI_COMMIT_SHORT_SHA" + expire_in: 1 week + when: always + paths: + - report-junit.xml + - report.html + expose_as: "Draft IVAS conformance" + reports: + junit: report-junit.xml + test-long-self-test: tags: - ivas-linux-fast -- GitLab From 3d3579ca2328dec58035d1062608156397a4f493 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 09:37:07 +0100 Subject: [PATCH 021/498] Fix manual trigger --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2104d12c7b..9257028c1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1199,7 +1199,7 @@ ivas-conformance: stage: test timeout: "60 minutes" rules: - - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test' + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' allow_failure: exit_codes: - 123 -- GitLab From 6b17a174b277db0924862d25408b67571ae2a049 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 23 Jan 2024 09:46:22 +0100 Subject: [PATCH 022/498] fix 5ms problem with low band CNA generation for the DirAC and param binaural rendering --- lib_com/ivas_prot.h | 3 ++ lib_dec/fd_cng_dec.c | 38 +++++++++++++++++++- lib_dec/ivas_dirac_dec.c | 8 +++++ lib_dec/ivas_jbm_dec.c | 10 +----- lib_dec/ivas_sba_dec.c | 4 +++ lib_rend/ivas_dirac_dec_binaural_functions.c | 16 +++++++++ 6 files changed, 69 insertions(+), 10 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 2eacf811b0..c7b59b8c42 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3683,6 +3683,9 @@ void generate_masking_noise_lb_dirac( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, +#endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ); diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 69d007825c..7e4eb83500 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1805,7 +1805,10 @@ void generate_masking_noise_lb_dirac( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ - const int16_t cna_flag /* i : CNA flag for LB and HB */ +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, +#endif + const int16_t cna_flag /* i : CNA flag for LB and HB */ ) { int16_t i; @@ -1940,8 +1943,41 @@ void generate_masking_noise_lb_dirac( n_samples_out -= hFdCngCom->frameSize; n_samples_start += hFdCngCom->frameSize; } +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + { + /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid + overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ + int16_t cur_subframe; + int16_t cur_subframe_start_outfs; + int16_t cur_subframe_start_cngfs; + int16_t slot_size_cng; + + cur_subframe_start_outfs = 0; + cur_subframe_start_cngfs = 0; + slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; + /* move start indices forward to the last subframe */ + for ( cur_subframe = 0; cur_subframe < hSpatParamRendCom->nb_subframes - 1; cur_subframe++ ) + { + cur_subframe_start_outfs += hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; + cur_subframe_start_cngfs += hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng; + } + + /* go from the last subframe back and move the LB noise */ + for ( cur_subframe = cur_subframe < hSpatParamRendCom->nb_subframes; cur_subframe >= 0; cur_subframe-- ) + { + int16_t move_size, subframe_size_outfs; + move_size = slot_size_cng * hSpatParamRendCom->subframe_nbslots[cur_subframe]; + subframe_size_outfs = hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; + /* move cna */ + mvr2r( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size ); + /* set everything else to zero */ + set_zero( tdBuffer + cur_subframe_start_outfs + move_size, subframe_size_outfs - move_size ); + } + } +#endif } + pop_wmops(); return; diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 804c1e8522..b1ad6767a6 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1943,10 +1943,18 @@ void ivas_dirac_dec_render_sf( generate_masking_noise_dirac( st->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + &st_ivas->hTcBuffer->tc[1][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], +#else st_ivas->hTcBuffer->tc[1], +#endif Cldfb_RealBuffer[1][0], Cldfb_ImagBuffer[1][0], +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + slot_idx, +#else index_slot, +#endif st->cna_dirac_flag && st->flag_cna, ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) && st->cng_type == FD_CNG && st->cng_sba_flag ); } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index af14d23682..99878657cd 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -950,9 +950,6 @@ ivas_error ivas_jbm_dec_render( #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t nchan_out_syn_output; #endif -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - float tmp_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; -#endif push_wmops( "ivas_dec_render" ); /*----------------------------------------------------------------* @@ -990,12 +987,7 @@ ivas_error ivas_jbm_dec_render( p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; } } -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - for ( n = 0; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) - { - p_output[n] = tmp_output[n]; - } -#endif + /*----------------------------------------------------------------* * Update combined orientation access index *----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 6ddcb37778..8aada05929 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -759,7 +759,11 @@ void ivas_sba_dec_digest_tc( ( ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) && ( nchan_transport == 1 && st_ivas->nchan_transport != 2 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) ) ) { Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st_ivas->hSpatParamRendCom, st->cna_dirac_flag && st->flag_cna ); +#else generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st->cna_dirac_flag && st->flag_cna ); +#endif } return; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 936d68b404..7f50ced6d0 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -669,16 +669,28 @@ static void ivas_dirac_dec_binaural_internal( if ( st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) { int16_t numCoreBands, b; +#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING int16_t slotInFrame; +#endif numCoreBands = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->numCoreBands; +#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING slotInFrame = hSpatParamRendCom->slots_rendered + slot; +#endif generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + &st_ivas->hTcBuffer->tc[nchan_transport][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], +#else st_ivas->hTcBuffer->tc[nchan_transport], +#endif Cldfb_RealBuffer_in[2][slot], Cldfb_ImagBuffer_in[2][slot], +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + slot, +#else slotInFrame, +#endif st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); @@ -686,7 +698,11 @@ static void ivas_dirac_dec_binaural_internal( st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ NULL, Cldfb_RealBuffer_in[1][slot], Cldfb_ImagBuffer_in[1][slot], +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + slot, +#else slotInFrame, +#endif st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); -- GitLab From 3ce5512096396418fb3b596b4913ec176142db38 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 10:14:45 +0100 Subject: [PATCH 023/498] Add create_cut for renderer test --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9257028c1a..41c831885b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,7 +1217,7 @@ ivas-conformance: - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html artifacts: name: "ivas-conformance-$CI_COMMIT_SHORT_SHA" -- GitLab From 29bf5319ab298b2afbf2ec0f921213600fc41af5 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 10:25:51 +0100 Subject: [PATCH 024/498] Revert the create_cut for renderer, since it seemed to reduce the number of tests run --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41c831885b..9257028c1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,7 +1217,7 @@ ivas-conformance: - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html artifacts: name: "ivas-conformance-$CI_COMMIT_SHORT_SHA" -- GitLab From ebfd0a22301e07f3ae1ea8f34aa993b5e9bed7c1 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 23 Jan 2024 10:28:54 +0100 Subject: [PATCH 025/498] fix copying of cna to corresponding subframes, copy pointers were not updated correctly --- lib_dec/fd_cng_dec.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 7e4eb83500..31a8a1727d 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1952,22 +1952,20 @@ void generate_masking_noise_lb_dirac( int16_t cur_subframe_start_cngfs; int16_t slot_size_cng; - cur_subframe_start_outfs = 0; - cur_subframe_start_cngfs = 0; + slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; - /* move start indices forward to the last subframe */ - for ( cur_subframe = 0; cur_subframe < hSpatParamRendCom->nb_subframes - 1; cur_subframe++ ) - { - cur_subframe_start_outfs += hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; - cur_subframe_start_cngfs += hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng; - } + /* move start indices forward to the end of the last subframe */ + cur_subframe_start_outfs = nCldfbTs * hSpatParamRendCom->slot_size; + cur_subframe_start_cngfs = nCldfbTs * slot_size_cng; /* go from the last subframe back and move the LB noise */ - for ( cur_subframe = cur_subframe < hSpatParamRendCom->nb_subframes; cur_subframe >= 0; cur_subframe-- ) + for ( cur_subframe = hSpatParamRendCom->nb_subframes - 1; cur_subframe >= 0; cur_subframe-- ) { int16_t move_size, subframe_size_outfs; move_size = slot_size_cng * hSpatParamRendCom->subframe_nbslots[cur_subframe]; subframe_size_outfs = hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; + cur_subframe_start_outfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; + cur_subframe_start_cngfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng; /* move cna */ mvr2r( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size ); /* set everything else to zero */ -- GitLab From 40f4b16cbaff9046746a55cf7fb84db0acfeee47 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 11:13:32 +0100 Subject: [PATCH 026/498] Added command line extraction script --- dec_header.txt | 20 +++++++++ enc_header.txt | 21 ++++++++++ parse_commands.py | 104 ++++++++++++++++++++++++++++++++++++++++++++++ rend_header.txt | 19 +++++++++ 4 files changed, 164 insertions(+) create mode 100644 dec_header.txt create mode 100644 enc_header.txt create mode 100644 parse_commands.py create mode 100644 rend_header.txt diff --git a/dec_header.txt b/dec_header.txt new file mode 100644 index 0000000000..729186d351 --- /dev/null +++ b/dec_header.txt @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit -1 +fi + +CUT_DEC_BIN=$1 +DIFF_BIN="diff" + +REF_PATH="./tests" +CUT_PATH="./TMP_DEC" + +rm -rf $CUT_PATH +mkdir -p $CUT_PATH +mkdir -p $CUT_PATH/ref/masa_test/dec_output +mkdir -p $CUT_PATH/ref/param_file/dec +mkdir -p $CUT_PATH/ref/sba_bs/raw + diff --git a/enc_header.txt b/enc_header.txt new file mode 100644 index 0000000000..5208a95a6e --- /dev/null +++ b/enc_header.txt @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -e + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit -1 +fi + +CUT_ENC_BIN=$1 +DIFF_BIN="diff" + +TESTV_PATH="./scripts" +REF_PATH="./tests" +CUT_PATH="./TMP_ENC" + +rm -rf $CUT_PATH +mkdir -p $CUT_PATH +mkdir -p $CUT_PATH/ref/masa_test/bitstreams +mkdir -p $CUT_PATH/ref/param_file/enc +mkdir -p $CUT_PATH/ref/sba_bs/pkt + diff --git a/parse_commands.py b/parse_commands.py new file mode 100644 index 0000000000..30d8d27a13 --- /dev/null +++ b/parse_commands.py @@ -0,0 +1,104 @@ +#!/usr/bin/python3 + +import argparse +import re +from os import path +from pathlib import Path + +# Main routine +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Parse HTML reports to extract commands') + parser.add_argument('input',type=str,help='Path to HTML report or directory') + parser.add_argument('txt_file',type=str,help='Output txt file, e.g. output.txt') + args = parser.parse_args() + input = args.input + txt_file = args.txt_file + + TESTV_PATH='$TESTV_PATH/' + REF_PATH='$REF_PATH/' + CUT_PATH='$CUT_PATH/' + + cmds_enc=[] + cmds_dec=[] + cmds_rend=[] + + + if path.isdir(input): + input = Path(input).rglob('*.html') + else: + input = [input] + for html_report in input: + + with open(html_report,'r') as infile: + for line in infile.readlines(): + cmds_enc.extend(re.findall(r"DUT encoder command:\\n\\t(.*?)\\n", line)) + cmds_dec.extend(re.findall(r"DUT decoder command:\\n\\t(.*?)\\n", line)) + cmds_rend.extend(re.findall(r"Running command\\n(.*?)\\n", line)) + + with open(txt_file.replace('.','_enc.'),'w', newline='\n') as outfile: + with open('enc_header.txt','r') as header: + outfile.write(header.read()) + for cmd in cmds_enc: + arg1 = cmd.split()[0] + root_folder = arg1[0:arg1.find("ivas-codec/")+10] + cmd = cmd.replace(root_folder + r'/IVAS_cod', '$CUT_ENC_BIN') + cmd = cmd.replace(r'\\', '/') + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + cmd = cmd.replace(root_folder + r'/tests/',CUT_PATH) + + + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/scripts/', TESTV_PATH) + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/',CUT_PATH) + #cmd = cmd.replace('/home/ejatoma/ivas-codec/scripts', TESTV_PATH) + #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref',CUT_PATH) + outfile.write(cmd+'\n') + bts = re.search(r"\s(([\S]+)(.bts|.192))$", cmd) + if bts: + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH,REF_PATH)+' '+bts.group(1)+'\n') + outfile.write('\n') + + with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile: + with open('dec_header.txt','r') as header: + outfile.write(header.read()) + for cmd in cmds_dec: + arg1 = cmd.split()[0] + root_folder = arg1[0:arg1.find("ivas-codec/")+10] + cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') + cmd = cmd.replace(r'\\', '/') + cmd = cmd.replace(root_folder + r'/tests/', REF_PATH) + cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) + + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/', REF_PATH, 1) + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/', CUT_PATH) + #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', REF_PATH, 1) + #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', CUT_PATH) + outfile.write(cmd+'\n') + out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) + if out: + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH,REF_PATH)+' '+out.group(1)+'\n') + outfile.write('\n') + + with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile: + with open('rend_header.txt','r') as header: + outfile.write(header.read()) + for cmd in cmds_rend: + arg1 = cmd.split()[0] + root_folder = arg1[0:arg1.find("ivas-codec/")+10] + + cmd = cmd.replace(r'\\', '/') + + cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH, 1) + cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) + + + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/IVAS_rend_ref', '$CUT_REND_BIN') + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/scripts/', TESTV_PATH, 1) + #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/', CUT_PATH) + #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', REF_PATH, 1) + #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', CUT_PATH) + outfile.write(cmd+'\n') + out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) + if out: + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH,REF_PATH)+' '+out.group(1)+'\n') + outfile.write('\n') \ No newline at end of file diff --git a/rend_header.txt b/rend_header.txt new file mode 100644 index 0000000000..9102429eed --- /dev/null +++ b/rend_header.txt @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit -1 +fi + +CUT_REND_BIN=$1 +DIFF_BIN="diff" + +TESTV_PATH="./scripts" +REF_PATH="./tests" +CUT_PATH="./TMP_REND" + +rm -rf $CUT_PATH +mkdir -p $CUT_PATH/renderer/ref + + -- GitLab From de94331fd7c1cf3e6ef05066617937f002eb0bbe Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 11:15:19 +0100 Subject: [PATCH 027/498] Added parsing of command lines in job --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9257028c1a..9b4769b687 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1218,6 +1218,7 @@ ivas-conformance: # Output creation - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html + - python3 parse_commands.py report.html Readme_IVAS.txt artifacts: name: "ivas-conformance-$CI_COMMIT_SHORT_SHA" @@ -1226,6 +1227,9 @@ ivas-conformance: paths: - report-junit.xml - report.html + - Readme_IVAS_dec.txt + - Readme_IVAS_enc.txt + - Readme_IVAS_rend.txt expose_as: "Draft IVAS conformance" reports: junit: report-junit.xml -- GitLab From 939a1e10a8c9d71786a299c539c261724233e5b0 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 12:12:45 +0100 Subject: [PATCH 028/498] Change ref to 20230815_RC02_SA4#125_delivery --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b4769b687..186fe88bc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1206,10 +1206,12 @@ ivas-conformance: script: - *print-common-info # Prepare reference exec, TBD + - git checkout 20230815_RC02_SA4#125_delivery - make -j - cp IVAS_cod IVAS_cod_ref - cp IVAS_dec IVAS_dec_ref - cp IVAS_rend IVAS_rend_ref + - git restore . # Reference creation - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref -- GitLab From 8e66f5428f368f001da6f5d10b5c4a5c8d60a2d3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 12:26:20 +0100 Subject: [PATCH 029/498] Fix restoring source branch --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 186fe88bc2..cdf5157068 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1206,12 +1206,14 @@ ivas-conformance: script: - *print-common-info # Prepare reference exec, TBD + - source_branch_commit_sha=$(git rev-parse HEAD) - git checkout 20230815_RC02_SA4#125_delivery - make -j - cp IVAS_cod IVAS_cod_ref - cp IVAS_dec IVAS_dec_ref - cp IVAS_rend IVAS_rend_ref - - git restore . + - git restore . + - git checkout $source_branch_commit_sha # Reference creation - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref -- GitLab From dcb5371749380aa85c645991d763c22dc90edab1 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 12:40:21 +0100 Subject: [PATCH 030/498] Fix for failing for errors --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cdf5157068..88711eeb89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1221,8 +1221,11 @@ ivas-conformance: - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + + - *merge-request-comparison-check artifacts: name: "ivas-conformance-$CI_COMMIT_SHORT_SHA" -- GitLab From d4149f147b8dc7775123eadb8e496f23474a7698 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 12:47:23 +0100 Subject: [PATCH 031/498] Fix for failing for errors --- .gitlab-ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88711eeb89..f2add62447 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1216,11 +1216,13 @@ ivas-conformance: - git checkout $source_branch_commit_sha # Reference creation - - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref - - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 - - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref + - exit_code=0 + - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? + - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation + - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From 88b659bd5f02f2874edc827a733b0800fd682345 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 13:14:33 +0100 Subject: [PATCH 032/498] Remove unsupported test cases from prm file --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2add62447..43ef442a43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1215,6 +1215,17 @@ ivas-conformance: - git restore . - git checkout $source_branch_commit_sha + # remove unsupported testcases, in reverse row order + - sed -i '1623,1625d' scripts/config/self_test.prm + - sed -i '1307,1321d' scripts/config/self_test.prm + - sed -i '1205,1213d' scripts/config/self_test.prm + - sed -i '849,851d' scripts/config/self_test.prm + - sed -i '805,807d' scripts/config/self_test.prm + - sed -i '684,686d' scripts/config/self_test.prm + - sed -i '420,422d' scripts/config/self_test.prm + - sed -i '377,383d' scripts/config/self_test.prm + - sed -i '321,329d' scripts/config/self_test.prm + # Reference creation - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? -- GitLab From 8b9984c148a22ebfc7558d0c2a121c458c5ea39f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 13:30:23 +0100 Subject: [PATCH 033/498] Remove unsupported -fr option from renderer tests --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43ef442a43..9c5eaebe4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1225,6 +1225,8 @@ ivas-conformance: - sed -i '420,422d' scripts/config/self_test.prm - sed -i '377,383d' scripts/config/self_test.prm - sed -i '321,329d' scripts/config/self_test.prm + # Remove unsupported -fr option from renderer tests + - sed -i '206,207d' tests/renderer/utils.py # Reference creation - exit_code=0 -- GitLab From 59bd040e49a9af71b72a51d42b4efb7f772beaec Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 13:49:34 +0100 Subject: [PATCH 034/498] Revert to -tf for IVAS_rend --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c5eaebe4f..55ef9b209f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1227,6 +1227,8 @@ ivas-conformance: - sed -i '321,329d' scripts/config/self_test.prm # Remove unsupported -fr option from renderer tests - sed -i '206,207d' tests/renderer/utils.py + # Revert to -tf option used in old IVAS_rend + - sed -i '187s/-T/-tf/' tests/renderer/utils.py # Reference creation - exit_code=0 -- GitLab From d89f012278069362e97c196f8bca9fa76512bb4a Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 14:03:40 +0100 Subject: [PATCH 035/498] Use scripts and tests from reference --- .gitlab-ci.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55ef9b209f..ca751cc9d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1205,39 +1205,28 @@ ivas-conformance: - 123 script: - *print-common-info - # Prepare reference exec, TBD + # Prepare reference exec, use tests and scripts from reference - source_branch_commit_sha=$(git rev-parse HEAD) - git checkout 20230815_RC02_SA4#125_delivery - make -j - cp IVAS_cod IVAS_cod_ref - cp IVAS_dec IVAS_dec_ref - cp IVAS_rend IVAS_rend_ref + - cp -r tests tests_ref + - cp -r scripts scripts_ref - git restore . - git checkout $source_branch_commit_sha - - # remove unsupported testcases, in reverse row order - - sed -i '1623,1625d' scripts/config/self_test.prm - - sed -i '1307,1321d' scripts/config/self_test.prm - - sed -i '1205,1213d' scripts/config/self_test.prm - - sed -i '849,851d' scripts/config/self_test.prm - - sed -i '805,807d' scripts/config/self_test.prm - - sed -i '684,686d' scripts/config/self_test.prm - - sed -i '420,422d' scripts/config/self_test.prm - - sed -i '377,383d' scripts/config/self_test.prm - - sed -i '321,329d' scripts/config/self_test.prm - # Remove unsupported -fr option from renderer tests - - sed -i '206,207d' tests/renderer/utils.py - # Revert to -tf option used in old IVAS_rend - - sed -i '187s/-T/-tf/' tests/renderer/utils.py + - mv tests_ref tests + - mv scripts_ref scripts # Reference creation + - non_be_flag=0 - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation - - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From 82998040f0e94c682475c8f00360bdec92906e75 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 14:09:53 +0100 Subject: [PATCH 036/498] Use scripts and tests from reference --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca751cc9d9..c3bd63e386 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1213,11 +1213,10 @@ ivas-conformance: - cp IVAS_dec IVAS_dec_ref - cp IVAS_rend IVAS_rend_ref - cp -r tests tests_ref - - cp -r scripts scripts_ref - git restore . - git checkout $source_branch_commit_sha + - rm -r tests - mv tests_ref tests - - mv scripts_ref scripts # Reference creation - non_be_flag=0 -- GitLab From 318e2b489ed9e7b918441f7dff10d9755ca70161 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 14:17:54 +0100 Subject: [PATCH 037/498] Revert to old renderer test --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3bd63e386..774d4496d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1223,10 +1223,9 @@ ivas-conformance: - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From db0207a9103542d8f537c6c92693ab935723ae16 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 14:24:10 +0100 Subject: [PATCH 038/498] Revert to old self_test.prm --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 774d4496d9..d915c6a8cc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1213,10 +1213,12 @@ ivas-conformance: - cp IVAS_dec IVAS_dec_ref - cp IVAS_rend IVAS_rend_ref - cp -r tests tests_ref + - cp scripts/config/self_test.prm scripts/config/self_test_ref.prm - git restore . - git checkout $source_branch_commit_sha - - rm -r tests + - rm -r tests scripts - mv tests_ref tests + - cp scripts/config/self_test_ref.prm scripts/config/self_test.prm # Reference creation - non_be_flag=0 -- GitLab From 8af2db12ea4cef335070bef6a40983f47c5f381d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 14:26:33 +0100 Subject: [PATCH 039/498] Revert to old self_test.prm --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d915c6a8cc..0fe4413259 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1216,7 +1216,7 @@ ivas-conformance: - cp scripts/config/self_test.prm scripts/config/self_test_ref.prm - git restore . - git checkout $source_branch_commit_sha - - rm -r tests scripts + - rm -r tests - mv tests_ref tests - cp scripts/config/self_test_ref.prm scripts/config/self_test.prm -- GitLab From b30db7142f73e48183ca24a744340668b15229d9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 14:30:57 +0100 Subject: [PATCH 040/498] Revert to old scripts folder --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0fe4413259..8b5489d0d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1213,12 +1213,12 @@ ivas-conformance: - cp IVAS_dec IVAS_dec_ref - cp IVAS_rend IVAS_rend_ref - cp -r tests tests_ref - - cp scripts/config/self_test.prm scripts/config/self_test_ref.prm + - cp -r scripts scripts_ref - git restore . - git checkout $source_branch_commit_sha - - rm -r tests + - rm -r tests scripts - mv tests_ref tests - - cp scripts/config/self_test_ref.prm scripts/config/self_test.prm + - mv scripts_ref scripts # Reference creation - non_be_flag=0 -- GitLab From 3d73bd4cfa5968f2d75d39813421956b40bd0c16 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 16:19:42 +0100 Subject: [PATCH 041/498] Correct script generation --- .gitlab-ci.yml | 2 ++ parse_commands.py | 32 +++++++++----------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b5489d0d2..4ba8acb476 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1225,6 +1225,8 @@ ivas-conformance: - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? + - python3 -m test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored + - rm -r tests/renderer/cut # Output creation - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? diff --git a/parse_commands.py b/parse_commands.py index 30d8d27a13..a93c7a5e1a 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -44,17 +44,12 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/IVAS_cod', '$CUT_ENC_BIN') cmd = cmd.replace(r'\\', '/') cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace(root_folder + r'/tests/',CUT_PATH) + cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH ) - - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/scripts/', TESTV_PATH) - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/',CUT_PATH) - #cmd = cmd.replace('/home/ejatoma/ivas-codec/scripts', TESTV_PATH) - #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref',CUT_PATH) outfile.write(cmd+'\n') bts = re.search(r"\s(([\S]+)(.bts|.192))$", cmd) if bts: - outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH,REF_PATH)+' '+bts.group(1)+'\n') + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n') outfile.write('\n') with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile: @@ -65,17 +60,13 @@ if __name__ == '__main__': root_folder = arg1[0:arg1.find("ivas-codec/")+10] cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') cmd = cmd.replace(r'\\', '/') - cmd = cmd.replace(root_folder + r'/tests/', REF_PATH) + cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', 1) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/', REF_PATH, 1) - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/', CUT_PATH) - #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', REF_PATH, 1) - #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', CUT_PATH) outfile.write(cmd+'\n') out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) if out: - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH,REF_PATH)+' '+out.group(1)+'\n') + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+out.group(1)+'\n') outfile.write('\n') with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile: @@ -91,14 +82,9 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH, 1) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) - - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/IVAS_rend_ref', '$CUT_REND_BIN') - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/scripts/', TESTV_PATH, 1) - #cmd = cmd.replace(r'C:/listen/ivas-codec_temp/tests/', CUT_PATH) - #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', REF_PATH, 1) - #cmd = cmd.replace('/home/ejatoma/ivas-codec/tests/ref', CUT_PATH) - outfile.write(cmd+'\n') + if "cut" in cmd: + outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) - if out: - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH,REF_PATH)+' '+out.group(1)+'\n') - outfile.write('\n') \ No newline at end of file + if out and "cut" in out.group(1): + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'renderer/cut',REF_PATH + r'renderer/ref')+' '+out.group(1)+'\n') + outfile.write('\n') \ No newline at end of file -- GitLab From 639036a67674fb71795c2c0340bd73db27f97298 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 16:27:29 +0100 Subject: [PATCH 042/498] Fix renderer ref creation --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ba8acb476..229ea31708 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1225,7 +1225,7 @@ ivas-conformance: - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - - python3 -m test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored + - python3 -m tests/renderer/test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored - rm -r tests/renderer/cut # Output creation -- GitLab From f08c585c7fb174f524bf7efe6b7ae5f7b354ce85 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 16:53:53 +0100 Subject: [PATCH 043/498] Fixes --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 229ea31708..d6f155e513 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1225,11 +1225,11 @@ ivas-conformance: - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - - python3 -m tests/renderer/test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored + - python3 -m tests/renderer/test_renderer_be_comparison # This run is needed for reference creation. renderer/cut/ can be ignored - rm -r tests/renderer/cut # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From 7022cf4ef0553af4545f7f2b848f12fcfa9d43d1 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 16:55:41 +0100 Subject: [PATCH 044/498] Fixes --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6f155e513..2f9b14a128 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1225,11 +1225,11 @@ ivas-conformance: - exit_code=0 - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - - python3 -m tests/renderer/test_renderer_be_comparison # This run is needed for reference creation. renderer/cut/ can be ignored + - python3 -m pytest tests/renderer/test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored - rm -r tests/renderer/cut # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From 83c51156651bbad53ae1abedcf8049b788c0ccf8 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 17:20:06 +0100 Subject: [PATCH 045/498] Fixes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f9b14a128..6c4925e56f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1226,7 +1226,6 @@ ivas-conformance: - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - python3 -m pytest tests/renderer/test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored - - rm -r tests/renderer/cut # Output creation - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? @@ -2089,3 +2088,4 @@ pull-from-3gpp-forge: # Push to mirror, include tags. Option `-o ci.skip` tells GitLab to skip CI for the pushed commits (assumed already tested upstream) - git push --tags -o ci.skip "https://${GITLAB_USER_LOGIN}:${MIRROR_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}" + \ No newline at end of file -- GitLab From aa556ad34633b9854daab11ba4124f0f321b1919 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 17:25:28 +0100 Subject: [PATCH 046/498] Fix strange character in .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c4925e56f..1f0e4b231d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2088,4 +2088,3 @@ pull-from-3gpp-forge: # Push to mirror, include tags. Option `-o ci.skip` tells GitLab to skip CI for the pushed commits (assumed already tested upstream) - git push --tags -o ci.skip "https://${GITLAB_USER_LOGIN}:${MIRROR_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}" - \ No newline at end of file -- GitLab From 5cc223590980ac98fafef85d6f5fd4ddf5e6e8b1 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 17:56:41 +0100 Subject: [PATCH 047/498] Use Nokia runner which has a later pytest version --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f0e4b231d..9ab99ee86c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1196,6 +1196,7 @@ test-be-to-release: ivas-conformance: tags: - ivas-linux-fast + - test-nokia-linux-runner stage: test timeout: "60 minutes" rules: -- GitLab From d678a90bce7f746f40d3a7750c7be8cd68f48015 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:10:18 +0100 Subject: [PATCH 048/498] Add 26252 test --- dec_header.txt | 6 +-- enc_header.txt | 6 +-- rend_header.txt | 2 +- tests/test_26252.py | 128 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 7 deletions(-) create mode 100644 tests/test_26252.py diff --git a/dec_header.txt b/dec_header.txt index 729186d351..bc7cf89a33 100644 --- a/dec_header.txt +++ b/dec_header.txt @@ -14,7 +14,7 @@ CUT_PATH="./TMP_DEC" rm -rf $CUT_PATH mkdir -p $CUT_PATH -mkdir -p $CUT_PATH/ref/masa_test/dec_output -mkdir -p $CUT_PATH/ref/param_file/dec -mkdir -p $CUT_PATH/ref/sba_bs/raw +mkdir -p $CUT_PATH/dut/masa_test/dec_output +mkdir -p $CUT_PATH/dut/param_file/dec +mkdir -p $CUT_PATH/dut/sba_bs/raw diff --git a/enc_header.txt b/enc_header.txt index 5208a95a6e..efd391d1bc 100644 --- a/enc_header.txt +++ b/enc_header.txt @@ -15,7 +15,7 @@ CUT_PATH="./TMP_ENC" rm -rf $CUT_PATH mkdir -p $CUT_PATH -mkdir -p $CUT_PATH/ref/masa_test/bitstreams -mkdir -p $CUT_PATH/ref/param_file/enc -mkdir -p $CUT_PATH/ref/sba_bs/pkt +mkdir -p $CUT_PATH/dut/masa_test/bitstreams +mkdir -p $CUT_PATH/dut/param_file/enc +mkdir -p $CUT_PATH/dut/sba_bs/pkt diff --git a/rend_header.txt b/rend_header.txt index 9102429eed..9e31939a5f 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -14,6 +14,6 @@ REF_PATH="./tests" CUT_PATH="./TMP_REND" rm -rf $CUT_PATH -mkdir -p $CUT_PATH/renderer/ref +mkdir -p $CUT_PATH/renderer/cut diff --git a/tests/test_26252.py b/tests/test_26252.py new file mode 100644 index 0000000000..603793c900 --- /dev/null +++ b/tests/test_26252.py @@ -0,0 +1,128 @@ +__copyright__ = """ +(C) 2022-2023 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 +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of 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 +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +__doc__ = """ +Execute tests specified via a parameter file. +""" + +import os +from pathlib import Path +import filecmp +import subprocess +import pytest + +def replace_paths(instr, testv_path, ref_path, cut_path): + outstr = instr + tmp = testv_path.split('=') + if len(tmp)>1: + outstr = instr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) + tmp = ref_path.split('=') + if len(tmp)>1: + outstr = outstr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) + tmp = cut_path.split('=') + if len(tmp)>1: + outstr = outstr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) + return outstr + +test_dict = {} +TEST_DIR = "." +scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt"] + +for s in scripts: + with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: + tag = "" + enc_opts = "" + dec_opts = "" + diff_opts = "" + rend_opts = "" + testv_path = "" + ref_path = "" + cut_path = "" + preproc = [] + for line in fp.readlines(): + if line.startswith("rm") or line.startswith("mkdir"): + preproc.append(line.strip()) + if line.startswith("TESTV_PATH"): + testv_path = line + if line.startswith("REF_PATH"): + ref_path = line + if line.startswith("CUT_PATH"): + cut_path = line + if line.startswith("$CUT_ENC_BIN"): + enc_opts = line + if line.startswith("$CUT_DEC_BIN"): + dec_opts = line + if line.startswith("$CUT_REND_BIN"): + rend_opts = line + if line.startswith("$DIFF_BIN"): + diff_opts = line[9:] + tag = s + "--" + diff_opts.split()[1].split('/')[-1] + if tag in test_dict: + print("non-unique tag found - ignoring new entry") + continue + test_dict[tag] = (enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path) + tag = "" + enc_opts = "" + dec_opts = "" + rend_opts = "" + diff_opts = "" + for proc in preproc: + proc = replace_paths(proc, testv_path, ref_path, cut_path) + subprocess.run(proc.split()) + +@pytest.mark.parametrize("test_tag", list(test_dict.keys())) +def test_26252(test_tag): + + enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path = test_dict[test_tag] + + if enc_opts: + enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) + subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:]) + if dec_opts: + dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) + subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:]) + if rend_opts: + rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) + subprocess.run(["./IVAS_rend","-q"] + rend_opts.split()[1:]) + + diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) + if ';' in diff_opts: + cmd1, cmd2 = diff_opts.split(';') + cmd1 = cmd1.split() + cmd2 = cmd2.split() + result1 = filecmp.cmp(cmd1[0], cmd1[1]) + result2 = filecmp.cmp(cmd2[2], cmd2[3]) + else: + cmd1 = diff_opts.split() + result1 = filecmp.cmp(cmd1[0], cmd1[1]) + result2 = True + if not (result1 and result2): + assert False, "Output differs" + -- GitLab From 16b10e2bd0469618c21f4a6f8b8947ab36ffc29f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:12:36 +0100 Subject: [PATCH 049/498] Activate 26.252-test in job --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ab99ee86c..6d28be77c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1232,6 +1232,9 @@ ivas-conformance: - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer_be_comparison.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + + # Test run generated scripts + - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - *merge-request-comparison-check -- GitLab From a41236be24df5c19a751ba6edb721d6f5eefb64f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:29:30 +0100 Subject: [PATCH 050/498] Check failure in 26.252 --- .gitlab-ci.yml | 5 +++-- parse_commands.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d28be77c9..9d628be9b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1224,6 +1224,7 @@ ivas-conformance: # Reference creation - non_be_flag=0 - exit_code=0 + - python3 tests/create_short_testvectors.py - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - python3 -m pytest tests/renderer/test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored @@ -1234,8 +1235,8 @@ ivas-conformance: - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true # Test run generated scripts - - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - + #- python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/test_26252.py - *merge-request-comparison-check artifacts: diff --git a/parse_commands.py b/parse_commands.py index a93c7a5e1a..a670bd7c69 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -47,7 +47,7 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH ) outfile.write(cmd+'\n') - bts = re.search(r"\s(([\S]+)(.bts|.192))$", cmd) + bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt))$", cmd) if bts: outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n') outfile.write('\n') -- GitLab From a59aae17483ecec22a4ef016772d5b09e7b6d6d2 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:43:22 +0100 Subject: [PATCH 051/498] Debug output --- tests/test_26252.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_26252.py b/tests/test_26252.py index 603793c900..5f21260245 100644 --- a/tests/test_26252.py +++ b/tests/test_26252.py @@ -67,6 +67,7 @@ for s in scripts: cut_path = "" preproc = [] for line in fp.readlines(): + print(line) if line.startswith("rm") or line.startswith("mkdir"): preproc.append(line.strip()) if line.startswith("TESTV_PATH"): -- GitLab From 92d5e9872da478a87a09b7a4744a1bba3cd1bd9e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:45:42 +0100 Subject: [PATCH 052/498] Debug output --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d628be9b0..52c5e31c90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1236,6 +1236,7 @@ ivas-conformance: # Test run generated scripts #- python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 tests/test_26252.py - python3 -m pytest tests/test_26252.py - *merge-request-comparison-check -- GitLab From e3918c05d54d2d2293b80ce13434dbe0c78988b5 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:52:29 +0100 Subject: [PATCH 053/498] Remove Nokia tag --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52c5e31c90..8684f22862 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1196,7 +1196,6 @@ test-be-to-release: ivas-conformance: tags: - ivas-linux-fast - - test-nokia-linux-runner stage: test timeout: "60 minutes" rules: -- GitLab From 51f3dfaaca170516140449ed1b5edc6a273df038 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:56:21 +0100 Subject: [PATCH 054/498] Hack to keep 26.252-test --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8684f22862..8dfbe3c647 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1216,6 +1216,7 @@ ivas-conformance: - cp -r scripts scripts_ref - git restore . - git checkout $source_branch_commit_sha + - cp tests/test_26252.py tests_ref/test_26252.py - rm -r tests scripts - mv tests_ref tests - mv scripts_ref scripts -- GitLab From 097f64881ead733c560638f85fcbb294d2aada9f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 18:57:00 +0100 Subject: [PATCH 055/498] Enable 26.252-test --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8dfbe3c647..a14aae28a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1235,9 +1235,7 @@ ivas-conformance: - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true # Test run generated scripts - #- python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - - python3 tests/test_26252.py - - python3 -m pytest tests/test_26252.py + - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - *merge-request-comparison-check artifacts: -- GitLab From 6914ef5a59ab8abcc9df7934a8c31371ca968275 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 19:23:49 +0100 Subject: [PATCH 056/498] Remove double -q --- tests/test_26252.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_26252.py b/tests/test_26252.py index 5f21260245..d284cc4343 100644 --- a/tests/test_26252.py +++ b/tests/test_26252.py @@ -67,7 +67,6 @@ for s in scripts: cut_path = "" preproc = [] for line in fp.readlines(): - print(line) if line.startswith("rm") or line.startswith("mkdir"): preproc.append(line.strip()) if line.startswith("TESTV_PATH"): @@ -105,13 +104,13 @@ def test_26252(test_tag): if enc_opts: enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:]) + subprocess.run(["./IVAS_cod"] + enc_opts.split()[1:]) if dec_opts: dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:]) + subprocess.run(["./IVAS_dec"] + dec_opts.split()[1:]) if rend_opts: rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_rend","-q"] + rend_opts.split()[1:]) + subprocess.run(["./IVAS_rend"] + rend_opts.split()[1:]) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) if ';' in diff_opts: -- GitLab From 16f0088c00b65209cfe7d399606eb27d688e0c89 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 19:46:54 +0100 Subject: [PATCH 057/498] Use new SBA tests --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a14aae28a2..eb8e28571d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,6 +1217,7 @@ ivas-conformance: - git restore . - git checkout $source_branch_commit_sha - cp tests/test_26252.py tests_ref/test_26252.py + - cp tests/codec_be_on_mr_nonselection/test_sba_bs_* tests_ref/codec_be_on_mr_nonselection - rm -r tests scripts - mv tests_ref tests - mv scripts_ref scripts -- GitLab From 61605ad458b2bf1795c607040032dfd46ce854b3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 19:52:31 +0100 Subject: [PATCH 058/498] Exclude sba plc --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb8e28571d..d9d753b94a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,7 +1217,7 @@ ivas-conformance: - git restore . - git checkout $source_branch_commit_sha - cp tests/test_26252.py tests_ref/test_26252.py - - cp tests/codec_be_on_mr_nonselection/test_sba_bs_* tests_ref/codec_be_on_mr_nonselection + - cp tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py tests_ref/codec_be_on_mr_nonselection - rm -r tests scripts - mv tests_ref tests - mv scripts_ref scripts -- GitLab From 5f0c306322748b8de05967207d1371dc45d3485c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 19:56:51 +0100 Subject: [PATCH 059/498] Exclude pca cases --- .gitlab-ci.yml | 1 - parse_commands.py | 13 +++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9d753b94a..a14aae28a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,7 +1217,6 @@ ivas-conformance: - git restore . - git checkout $source_branch_commit_sha - cp tests/test_26252.py tests_ref/test_26252.py - - cp tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py tests_ref/codec_be_on_mr_nonselection - rm -r tests scripts - mv tests_ref tests - mv scripts_ref scripts diff --git a/parse_commands.py b/parse_commands.py index a670bd7c69..a4e9ffe017 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -45,12 +45,13 @@ if __name__ == '__main__': cmd = cmd.replace(r'\\', '/') cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH ) - - outfile.write(cmd+'\n') - bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt))$", cmd) - if bts: - outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n') - outfile.write('\n') + + if not "pca" in cmd: + outfile.write(cmd+'\n') + bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt))$", cmd) + if bts: + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n') + outfile.write('\n') with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile: with open('dec_header.txt','r') as header: -- GitLab From c182b60a803a2922af67d4fce00bb8e828dfc8f8 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 20:00:07 +0100 Subject: [PATCH 060/498] Use Ericsson runner --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a14aae28a2..6dcbd877e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1196,6 +1196,7 @@ test-be-to-release: ivas-conformance: tags: - ivas-linux-fast + - test-ericsson-linux-runner stage: test timeout: "60 minutes" rules: -- GitLab From d5cc28ce4c406f42a19967795203a322a128612c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 20:24:40 +0100 Subject: [PATCH 061/498] Fix renderer input --- parse_commands.py | 14 ++++++++------ rend_header.txt | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/parse_commands.py b/parse_commands.py index a4e9ffe017..5d7b33fb3c 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -63,12 +63,13 @@ if __name__ == '__main__': cmd = cmd.replace(r'\\', '/') cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', 1) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) - - outfile.write(cmd+'\n') - out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) - if out: - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+out.group(1)+'\n') - outfile.write('\n') + + if not "pca" in cmd: + outfile.write(cmd+'\n') + out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) + if out: + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+out.group(1)+'\n') + outfile.write('\n') with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile: with open('rend_header.txt','r') as header: @@ -81,6 +82,7 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH, 1) + cmd = cmd.replace(root_folder + r'/tests/renderer/', REF_PATH + r'renderer/') cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) if "cut" in cmd: diff --git a/rend_header.txt b/rend_header.txt index 9e31939a5f..fb72f4ddd8 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -14,6 +14,6 @@ REF_PATH="./tests" CUT_PATH="./TMP_REND" rm -rf $CUT_PATH -mkdir -p $CUT_PATH/renderer/cut +mkdir -p $CUT_PATH/renderer/cut $CUT_PATH/renderer/data -- GitLab From 5aed9f25c18043705d8fc0f4c91aeb1c0d0740ec Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 20:46:20 +0100 Subject: [PATCH 062/498] Fixes --- dec_header.txt | 1 + parse_commands.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dec_header.txt b/dec_header.txt index bc7cf89a33..bf91c72817 100644 --- a/dec_header.txt +++ b/dec_header.txt @@ -11,6 +11,7 @@ DIFF_BIN="diff" REF_PATH="./tests" CUT_PATH="./TMP_DEC" +TESTV_PATH="./scripts" rm -rf $CUT_PATH mkdir -p $CUT_PATH diff --git a/parse_commands.py b/parse_commands.py index 5d7b33fb3c..e9d4de8e6b 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -61,8 +61,10 @@ if __name__ == '__main__': root_folder = arg1[0:arg1.find("ivas-codec/")+10] cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') cmd = cmd.replace(r'\\', '/') - cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', 1) + inputs = cmd.count(root_folder) - 1 + cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) if not "pca" in cmd: outfile.write(cmd+'\n') -- GitLab From f03e890c927f2ba64671b30b667545825cde8f4e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 21:14:24 +0100 Subject: [PATCH 063/498] Move output files. Exclude 2 failing cases --- .gitlab-ci.yml | 5 +++++ dec_header.txt | 4 ++-- enc_header.txt | 4 ++-- parse_commands.py | 2 +- rend_header.txt | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6dcbd877e7..da2c524bb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1218,6 +1218,7 @@ ivas-conformance: - git restore . - git checkout $source_branch_commit_sha - cp tests/test_26252.py tests_ref/test_26252.py + - rm -r tests scripts - mv tests_ref tests - mv scripts_ref scripts @@ -1235,6 +1236,10 @@ ivas-conformance: - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + # Move output data + - mv scripts/testv . + - mv tests/ref tests/renderer/data tests/renderer/ref testv + # Test run generated scripts - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - *merge-request-comparison-check diff --git a/dec_header.txt b/dec_header.txt index bf91c72817..8469dd4bfb 100644 --- a/dec_header.txt +++ b/dec_header.txt @@ -9,9 +9,9 @@ fi CUT_DEC_BIN=$1 DIFF_BIN="diff" -REF_PATH="./tests" +TESTV_PATH="." +REF_PATH="./testv" CUT_PATH="./TMP_DEC" -TESTV_PATH="./scripts" rm -rf $CUT_PATH mkdir -p $CUT_PATH diff --git a/enc_header.txt b/enc_header.txt index efd391d1bc..32e78419cc 100644 --- a/enc_header.txt +++ b/enc_header.txt @@ -9,8 +9,8 @@ fi CUT_ENC_BIN=$1 DIFF_BIN="diff" -TESTV_PATH="./scripts" -REF_PATH="./tests" +TESTV_PATH="." +REF_PATH="./testv" CUT_PATH="./TMP_ENC" rm -rf $CUT_PATH diff --git a/parse_commands.py b/parse_commands.py index e9d4de8e6b..2b1d01cafe 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -66,7 +66,7 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - if not "pca" in cmd: + if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: outfile.write(cmd+'\n') out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) if out: diff --git a/rend_header.txt b/rend_header.txt index fb72f4ddd8..9e4adefc15 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -9,8 +9,8 @@ fi CUT_REND_BIN=$1 DIFF_BIN="diff" -TESTV_PATH="./scripts" -REF_PATH="./tests" +TESTV_PATH="." +REF_PATH="./testv" CUT_PATH="./TMP_REND" rm -rf $CUT_PATH -- GitLab From e0699d5c0655309643b210d501ca44833ea66a35 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 21:34:22 +0100 Subject: [PATCH 064/498] Fix move of files --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da2c524bb8..78ac6f3572 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1238,7 +1238,10 @@ ivas-conformance: # Move output data - mv scripts/testv . - - mv tests/ref tests/renderer/data tests/renderer/ref testv + - mv tests/ref testv/ref + - mkdir testv/renderer + - mv tests/renderer/data testv/renderer/data + - mv tests/renderer/ref testv/renderer/ref # Test run generated scripts - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? -- GitLab From 6b554b48968a4bdbfcbe511ca5219aec1939df45 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 21:50:25 +0100 Subject: [PATCH 065/498] Fix move of data --- parse_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_commands.py b/parse_commands.py index 2b1d01cafe..142942a9a4 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -84,7 +84,7 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH, 1) - cmd = cmd.replace(root_folder + r'/tests/renderer/', REF_PATH + r'renderer/') + cmd = cmd.replace(root_folder + r'/tests/renderer/data/', REF_PATH + r'renderer/data/') cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) if "cut" in cmd: -- GitLab From 98f8da440704b4b231f112bbb6ed0d78c198c0dc Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 23 Jan 2024 22:10:02 +0100 Subject: [PATCH 066/498] Fix renderer script --- .gitlab-ci.yml | 1 + parse_commands.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78ac6f3572..1ed831091e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1238,6 +1238,7 @@ ivas-conformance: # Move output data - mv scripts/testv . + - mv scripts/ls_layouts . - mv tests/ref testv/ref - mkdir testv/renderer - mv tests/renderer/data testv/renderer/data diff --git a/parse_commands.py b/parse_commands.py index 142942a9a4..7f85313883 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -83,7 +83,7 @@ if __name__ == '__main__': cmd = cmd.replace(r'\\', '/') cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH, 1) + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) cmd = cmd.replace(root_folder + r'/tests/renderer/data/', REF_PATH + r'renderer/data/') cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) -- GitLab From b533d7eb3c08097ed58f19d213efdb5bed393e01 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 24 Jan 2024 07:12:07 +0100 Subject: [PATCH 067/498] added missing function parameter description comment --- lib_com/ivas_prot.h | 2 +- lib_dec/fd_cng_dec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c7b59b8c42..147b85092b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3684,7 +3684,7 @@ void generate_masking_noise_lb_dirac( float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ #ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, + SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ #endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ); diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 31a8a1727d..06a478b3ac 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1806,7 +1806,7 @@ void generate_masking_noise_lb_dirac( float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ #ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, + SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ #endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ) -- GitLab From bbe9444fbf616b9a881e2c59f673e3cf451466c0 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 24 Jan 2024 07:31:50 +0100 Subject: [PATCH 068/498] moved changes for the ISM BRIR rendering to explixit MR, connected to #968 --- lib_dec/ivas_ism_renderer.c | 144 +++++++++--------------------------- 1 file changed, 35 insertions(+), 109 deletions(-) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 7d2c815386..94060ae8ef 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -254,161 +254,87 @@ void ivas_ism_render_sf( int16_t tc_offset; int16_t interp_offset; float gain, prev_gain; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; - int16_t n_samples_rendered_loop; -#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { num_objects = st_ivas->nchan_ism; } -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ - slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity ); - first_sf = st_ivas->hTcBuffer->subframes_rendered; - last_sf = first_sf; - n_samples_rendered_loop = 0; - while ( slots_to_render > 0 ) - { - slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; - last_sf++; - } - -#endif nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; tc_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - /* Number of subframes to delay metadata to sync with audio */ - if ( st_ivas->hDecoderConfig->Opt_delay_comp ) - { - ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 ); - } - else - { - ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; - } -#endif for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { set_f( output_f[i], 0.0f, n_samples_to_render ); } -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) - { - int16_t n_samples_in_subframe; - - n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#endif - #ifdef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) #else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) #endif - { -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); -#else + { ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); -#endif - interp_offset = 0; - } + interp_offset = 0; + } - for ( i = 0; i < num_objects; i++ ) - { - /* Combined rotation: rotate the object positions depending the head and external orientations */ + for ( i = 0; i < num_objects; i++ ) + { + /* Combined rotation: rotate the object positions depending the head and external orientations */ #ifdef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) #else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) #endif - { -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - if ( subframe_idx >= ism_md_subframe_update_jbm ) - { - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); - } - else - { - rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); - } -#else + { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); -#endif - if ( st_ivas->hEFAPdata != NULL ) - { - efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); - } + if ( st_ivas->hEFAPdata != NULL ) + { + efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); } + } - lfe_index = 0; - for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) + lfe_index = 0; + for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) + { + if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) { - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) - { - ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; - } + ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; + } - gain = st_ivas->hIsmRendererData->gains[i][j]; - prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; - if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) - { - g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; - tc = &st_ivas->hTcBuffer->tc[i][tc_offset]; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - for ( k = 0; k < n_samples_in_subframe; k++ ) -#else + gain = st_ivas->hIsmRendererData->gains[i][j]; + prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; + if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) + { + g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; + tc = &st_ivas->hTcBuffer->tc[i][tc_offset]; for ( k = 0; k < n_samples_to_render; k++ ) -#endif - { - g2 = 1.0f - *g1; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#else + { + g2 = 1.0f - *g1; output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#endif - } } + } - /* update here only in case of head rotation */ + /* update here only in case of head rotation */ #ifdef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) #else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) #endif - { - st_ivas->hIsmRendererData->prev_gains[i][j] = gain; - } + { + st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } + } #ifdef NONBE_UNIFIED_DECODING_PATHS - /* update combined orientation access index */ -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); -#else - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); -#endif -#endif -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - n_samples_rendered_loop += n_samples_in_subframe; - if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) - { - st_ivas->hTcBuffer->subframes_rendered += 1; - st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; - } - tc_offset += n_samples_in_subframe; - interp_offset += n_samples_in_subframe; - } + /* update combined orientation access index */ + ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); #endif return; -- GitLab From 6d0f076ecc948448bc061c912c96abc10a4aa861 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 09:18:19 +0100 Subject: [PATCH 069/498] Disable DEBUGGING in reference --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55ef9b209f..f6d8aa0a37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1208,6 +1208,7 @@ ivas-conformance: # Prepare reference exec, TBD - source_branch_commit_sha=$(git rev-parse HEAD) - git checkout 20230815_RC02_SA4#125_delivery + - sed -i".bak" "s/\(#define DEBUGGING\)/\/\/\1/" lib_com/options.h - make -j - cp IVAS_cod IVAS_cod_ref - cp IVAS_dec IVAS_dec_ref @@ -1225,7 +1226,7 @@ ivas-conformance: - sed -i '420,422d' scripts/config/self_test.prm - sed -i '377,383d' scripts/config/self_test.prm - sed -i '321,329d' scripts/config/self_test.prm - # Remove unsupported -fr option from renderer tests + # Remove -fr option - sed -i '206,207d' tests/renderer/utils.py # Revert to -tf option used in old IVAS_rend - sed -i '187s/-T/-tf/' tests/renderer/utils.py -- GitLab From 91fa408a9a2b16252b6a1b26cc7d1485953529d8 Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Wed, 24 Jan 2024 08:33:15 +0000 Subject: [PATCH 070/498] Adding trigger as pipeline source for ivas-conformance pipeline. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ed831091e..05255157c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1200,7 +1200,7 @@ ivas-conformance: stage: test timeout: "60 minutes" rules: - - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' + - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' allow_failure: exit_codes: - 123 -- GitLab From 2cb61418208c4a4b22b80502a11fb81d31a2c541 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 09:41:03 +0100 Subject: [PATCH 071/498] Remove test case from self_test.prm --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f6d8aa0a37..b5199556ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,6 +1217,7 @@ ivas-conformance: - git checkout $source_branch_commit_sha # remove unsupported testcases, in reverse row order + - sed -i '1644,1647d' scripts/config/self_test.prm - sed -i '1623,1625d' scripts/config/self_test.prm - sed -i '1307,1321d' scripts/config/self_test.prm - sed -i '1205,1213d' scripts/config/self_test.prm -- GitLab From 362e66cff88648c550407c9850e0acbb5060c8aa Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 09:44:24 +0100 Subject: [PATCH 072/498] Added trigger source for ivas-conformance --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5199556ea..725b3760a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1199,7 +1199,7 @@ ivas-conformance: stage: test timeout: "60 minutes" rules: - - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' + - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' allow_failure: exit_codes: - 123 -- GitLab From f0c1f13de1672858b61b8c65f70cf68f7781170c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 10:47:38 +0100 Subject: [PATCH 073/498] Exclude tests from self_test.prm --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 725b3760a2..bdad57211f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1217,8 +1217,10 @@ ivas-conformance: - git checkout $source_branch_commit_sha # remove unsupported testcases, in reverse row order - - sed -i '1644,1647d' scripts/config/self_test.prm + - sed -i '1657,1659d' scripts/config/self_test.prm + - sed -i '1644,1655d' scripts/config/self_test.prm - sed -i '1623,1625d' scripts/config/self_test.prm + - sed -i '1350,1353d' scripts/config/self_test.prm - sed -i '1307,1321d' scripts/config/self_test.prm - sed -i '1205,1213d' scripts/config/self_test.prm - sed -i '849,851d' scripts/config/self_test.prm -- GitLab From 0bf479c73e3e152286420d6d2d93fec2adecd0ba Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 11:13:10 +0100 Subject: [PATCH 074/498] Exclude MASA1 from renderer tests --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bdad57211f..4ce9c8a90d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1233,6 +1233,8 @@ ivas-conformance: - sed -i '206,207d' tests/renderer/utils.py # Revert to -tf option used in old IVAS_rend - sed -i '187s/-T/-tf/' tests/renderer/utils.py + # Exclude MASA1 + - sed -i '195s/"MASA1", //' tests/renderer/constants.py # Reference creation - exit_code=0 -- GitLab From a049945acc5f4682e277e0b1381db3bea40f0f35 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 12:50:13 +0100 Subject: [PATCH 075/498] Change pca to old bypass 2 --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ce9c8a90d..d264f70ce0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1235,6 +1235,8 @@ ivas-conformance: - sed -i '187s/-T/-tf/' tests/renderer/utils.py # Exclude MASA1 - sed -i '195s/"MASA1", //' tests/renderer/constants.py + # Change -pca to -bypass 2 + - sed -i '258s/-pca/-bypass 2/' tests/conftest.py # Reference creation - exit_code=0 -- GitLab From a09f0fa6ad890fd440c1afec1e5f19f52f3fa623 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 13:00:56 +0100 Subject: [PATCH 076/498] Remove masa prerenderer test --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d264f70ce0..01128623f9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1237,6 +1237,8 @@ ivas-conformance: - sed -i '195s/"MASA1", //' tests/renderer/constants.py # Change -pca to -bypass 2 - sed -i '258s/-pca/-bypass 2/' tests/conftest.py + # Remove tests/renderer/test_renderer::test_masa_prerend + - sed -i '239,246d' tests/renderer/test_renderer.py # Reference creation - exit_code=0 -- GitLab From 1f5aedca86a3781cf9375a08d92e655e7ef4fe46 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 13:37:17 +0100 Subject: [PATCH 077/498] Remove test_pca_enc --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01128623f9..1248103513 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1239,6 +1239,9 @@ ivas-conformance: - sed -i '258s/-pca/-bypass 2/' tests/conftest.py # Remove tests/renderer/test_renderer::test_masa_prerend - sed -i '239,246d' tests/renderer/test_renderer.py + # Remove test_sba_pca + - sed -i '88,153d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + # Reference creation - exit_code=0 -- GitLab From a10ef42050dcfdc047ac3c29724e1555c51171fd Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 14:13:22 +0100 Subject: [PATCH 078/498] Fix renderer test --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec18aa990c..557b038786 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1249,10 +1249,10 @@ ivas-conformance: - python3 tests/create_short_testvectors.py - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - - python3 -m pytest tests/renderer/test_renderer_be_comparison.py # This run is needed for reference creation. renderer/cut/ can be ignored + - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From eaf749be33380097f0e81d80174214434a63c1f4 Mon Sep 17 00:00:00 2001 From: norvell Date: Wed, 24 Jan 2024 13:34:59 +0000 Subject: [PATCH 079/498] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 557b038786..54c021ffc1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1265,7 +1265,7 @@ ivas-conformance: - mv tests/renderer/ref testv/renderer/ref # Test run generated scripts - - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + #- python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - *merge-request-comparison-check artifacts: -- GitLab From 2fd6d18a1626724c15b2f2e5034d29e964bd6784 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 24 Jan 2024 14:51:09 +0100 Subject: [PATCH 080/498] remove needs for 5ms test job --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8cb358e006..f39a619606 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -515,7 +515,6 @@ codec-5ms: - .test-job-linux - .rules-merge-request stage: test - needs: ["build-codec-linux"] script: - *print-common-info - *disable-limiter -- GitLab From 3c3ef09352c8fc665a6e8bc774c6486c382f79f0 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 24 Jan 2024 15:03:50 +0100 Subject: [PATCH 081/498] fix artifacts and pytest usage --- .gitlab-ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f39a619606..33bb177e0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -510,7 +510,7 @@ codec-usan: expose_as: "usan selftest results" # compare bit-exactness between 5ms and 20 on the branch -codec-5ms: +pytest-compare-20ms-and-5ms-rendering: extends: - .test-job-linux - .rules-merge-request @@ -521,20 +521,29 @@ codec-5ms: - make clean - make -j ### prepare pytest + - cp IVAS_cod IVAS_cod_ref + - cp IVAS_dec IVAS_dec_ref # create short test vectors - python3 tests/create_short_testvectors.py + # create references + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 ### 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 --update_ref 2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec --dut_fr5 || exit_code=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --dut_fr5 || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always + expose_as: "pytest 5ms vs 20ms results" paths: - - scripts/ref/logs/ - expose_as: "pytest IVAS 5ms results" + - report-junit.xml + - report.html + reports: + junit: + - report-junit.xml # test renderer executable renderer-smoke-test: -- GitLab From 42ab720d63d003a4bb35c3d47a2c7f8e7b2aa2c3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 15:59:11 +0100 Subject: [PATCH 082/498] Debug file location --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54c021ffc1..d4e2d0f2cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1249,17 +1249,22 @@ ivas-conformance: - python3 tests/create_short_testvectors.py - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? + - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? + - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt # Output creation - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - python3 parse_commands.py report.html Readme_IVAS.txt + - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true # Move output data - mv scripts/testv . - mv scripts/ls_layouts . - mv tests/ref testv/ref + - ls ./testv/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - mkdir testv/renderer - mv tests/renderer/data testv/renderer/data - mv tests/renderer/ref testv/renderer/ref -- GitLab From ae380fee109f8279c4854cb3a9d27f56733710eb Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 24 Jan 2024 16:30:44 +0100 Subject: [PATCH 083/498] define needed variable for using the comparison anchor --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a931c459a2..987b13772b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -530,6 +530,8 @@ pytest-compare-20ms-and-5ms-rendering: - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 ### run pytest - exit_code=0 + # dummy, is needed for using the comparison anchor later + - non_be_flag=0 - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --dut_fr5 || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check -- GitLab From bc614546bd7ce7bf640744bd1889471b00bc0eba Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 17:17:26 +0100 Subject: [PATCH 084/498] Use dut output as ref output --- .gitlab-ci.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4e2d0f2cf..c8a59697ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1249,28 +1249,23 @@ ivas-conformance: - python3 tests/create_short_testvectors.py - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? - - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt # Output creation - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - python3 parse_commands.py report.html Readme_IVAS.txt - - ls ./tests/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - # Move output data - - mv scripts/testv . - - mv scripts/ls_layouts . - - mv tests/ref testv/ref - - ls ./testv/ref/sba_bs/pkt/stvFOA48c_ivasbr13k_DTX1_Gain0_SID.pkt + # Copy output data + - cp scripts/testv . + - cp scripts/ls_layouts . + - cp tests/dut testv/ref - mkdir testv/renderer - - mv tests/renderer/data testv/renderer/data - - mv tests/renderer/ref testv/renderer/ref + - cp tests/renderer/data testv/renderer/data + - cp tests/renderer/ref testv/renderer/ref # Test run generated scripts - #- python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - *merge-request-comparison-check artifacts: -- GitLab From f8eec29b38523eff9bade34c49255041fa68b349 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 17:25:56 +0100 Subject: [PATCH 085/498] Fix copying --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c8a59697ab..fb6c2616ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1257,12 +1257,12 @@ ivas-conformance: - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true # Copy output data - - cp scripts/testv . - - cp scripts/ls_layouts . - - cp tests/dut testv/ref + - cp -r scripts/testv . + - cp -r scripts/ls_layouts . + - cp -r tests/dut testv/ref - mkdir testv/renderer - - cp tests/renderer/data testv/renderer/data - - cp tests/renderer/ref testv/renderer/ref + - cp -r tests/renderer/data testv/renderer/data + - cp -r tests/renderer/ref testv/renderer/ref # Test run generated scripts - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? -- GitLab From c96df1785c1dd1795a6de0b0bc1209c1b9d6af66 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 17:31:59 +0100 Subject: [PATCH 086/498] Keep files for DUT run --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb6c2616ab..fd7dbb7f1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1252,7 +1252,7 @@ ivas-conformance: - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true -- GitLab From 7110b1662f97c79c2b72e2c02479f51ecca988dd Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 18:10:19 +0100 Subject: [PATCH 087/498] Use cut output for renderer ref --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd7dbb7f1c..6a8cea0e29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1262,7 +1262,7 @@ ivas-conformance: - cp -r tests/dut testv/ref - mkdir testv/renderer - cp -r tests/renderer/data testv/renderer/data - - cp -r tests/renderer/ref testv/renderer/ref + - cp -r tests/renderer/ref testv/renderer/cut # Test run generated scripts - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? -- GitLab From 80a4da0423b33854ad4bfb3017d9ec2a118b6b1d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 18:36:26 +0100 Subject: [PATCH 088/498] Fix renderer refs --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a8cea0e29..26dfb5e411 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1262,7 +1262,7 @@ ivas-conformance: - cp -r tests/dut testv/ref - mkdir testv/renderer - cp -r tests/renderer/data testv/renderer/data - - cp -r tests/renderer/ref testv/renderer/cut + - cp -r tests/renderer/cut testv/renderer/ref # Test run generated scripts - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? -- GitLab From 43d667349b87fdee459ba2d5d035bed084c55120 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 19:08:32 +0100 Subject: [PATCH 089/498] Add checking for errors in test_26252.py --- tests/test_26252.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_26252.py b/tests/test_26252.py index d284cc4343..ce38943862 100644 --- a/tests/test_26252.py +++ b/tests/test_26252.py @@ -104,13 +104,13 @@ def test_26252(test_tag): if enc_opts: enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_cod"] + enc_opts.split()[1:]) + subprocess.run(["./IVAS_cod"] + enc_opts.split()[1:], check = True) if dec_opts: dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_dec"] + dec_opts.split()[1:]) + subprocess.run(["./IVAS_dec"] + dec_opts.split()[1:], check = True) if rend_opts: rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_rend"] + rend_opts.split()[1:]) + subprocess.run(["./IVAS_rend"] + rend_opts.split()[1:], check = True) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) if ';' in diff_opts: -- GitLab From 5ce34b4fb3758b5fd12f70a2c1832a59c7d74b13 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 19:13:33 +0100 Subject: [PATCH 090/498] Add copying of necessary input data --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26dfb5e411..90618af996 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1256,9 +1256,11 @@ ivas-conformance: - python3 parse_commands.py report.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - # Copy output data + # Copy input data and output ref data - cp -r scripts/testv . - cp -r scripts/ls_layouts . + - cp -r scripts/switchPaths . + - cp -r scripts/trajectories . - cp -r tests/dut testv/ref - mkdir testv/renderer - cp -r tests/renderer/data testv/renderer/data -- GitLab From d77bc75343ec73cb17b158fe8090f92769d6abd9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 19:26:36 +0100 Subject: [PATCH 091/498] Fix in parse_commands.py --- parse_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_commands.py b/parse_commands.py index 7f85313883..31bab4dbaa 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -48,7 +48,7 @@ if __name__ == '__main__': if not "pca" in cmd: outfile.write(cmd+'\n') - bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt))$", cmd) + bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd) if bts: outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n') outfile.write('\n') -- GitLab From 8187bf6e83adad4c4ad480cb5fc40547f483c5ab Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 21:31:14 +0100 Subject: [PATCH 092/498] Add artifact of report_cmd.html --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90618af996..91212c2427 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1252,8 +1252,8 @@ ivas-conformance: - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - - python3 parse_commands.py report.html Readme_IVAS.txt + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --junit-xml=report-junit.xml --html=report_cmd.html --self-contained-html || exit_code=$? + - python3 parse_commands.py report_cmd.html Readme_IVAS.txt - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true # Copy input data and output ref data @@ -1276,6 +1276,7 @@ ivas-conformance: when: always paths: - report-junit.xml + - report_cmd.html - report.html - Readme_IVAS_dec.txt - Readme_IVAS_enc.txt -- GitLab From e532c86e983479d957af9c237685c8a0fa016c79 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 22:26:29 +0100 Subject: [PATCH 093/498] Fix parse_commands.py --- parse_commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parse_commands.py b/parse_commands.py index 31bab4dbaa..a46b806eed 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -62,7 +62,10 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') cmd = cmd.replace(r'\\', '/') inputs = cmd.count(root_folder) - 1 - cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) + if ".fer " in cmd: + cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) + else: + cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) -- GitLab From c63262f931f725b9948ec405917c93e90154448b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 24 Jan 2024 23:01:54 +0100 Subject: [PATCH 094/498] Fix of references --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91212c2427..a7ae07dee2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1261,7 +1261,7 @@ ivas-conformance: - cp -r scripts/ls_layouts . - cp -r scripts/switchPaths . - cp -r scripts/trajectories . - - cp -r tests/dut testv/ref + - cp -r tests/ref testv/ref - mkdir testv/renderer - cp -r tests/renderer/data testv/renderer/data - cp -r tests/renderer/cut testv/renderer/ref -- GitLab From 454febfc823d616b0917d9d364c750e520bfda09 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Thu, 25 Jan 2024 08:00:14 +0100 Subject: [PATCH 095/498] remove extra inner scope from CNA buffer adjustment --- lib_dec/fd_cng_dec.c | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 06a478b3ac..6d772f2a86 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1860,6 +1860,13 @@ void generate_masking_noise_lb_dirac( /* LB CLDFB - CNA from STFT: CNA applied only in channel 0*/ if ( cna_flag && tdBuffer != NULL ) { +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + int16_t cur_subframe; + int16_t cur_subframe_start_outfs; + int16_t cur_subframe_start_cngfs; + int16_t slot_size_cng; +#endif + while ( n_samples_out > 0 ) { n_samples_out_loop = min( hFdCngCom->frameSize, n_samples_out ); @@ -1943,34 +1950,27 @@ void generate_masking_noise_lb_dirac( n_samples_out -= hFdCngCom->frameSize; n_samples_start += hFdCngCom->frameSize; } -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING - { - /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid - overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ - int16_t cur_subframe; - int16_t cur_subframe_start_outfs; - int16_t cur_subframe_start_cngfs; - int16_t slot_size_cng; - - slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; - /* move start indices forward to the end of the last subframe */ - cur_subframe_start_outfs = nCldfbTs * hSpatParamRendCom->slot_size; - cur_subframe_start_cngfs = nCldfbTs * slot_size_cng; - - /* go from the last subframe back and move the LB noise */ - for ( cur_subframe = hSpatParamRendCom->nb_subframes - 1; cur_subframe >= 0; cur_subframe-- ) - { - int16_t move_size, subframe_size_outfs; - move_size = slot_size_cng * hSpatParamRendCom->subframe_nbslots[cur_subframe]; - subframe_size_outfs = hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; - cur_subframe_start_outfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; - cur_subframe_start_cngfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng; - /* move cna */ - mvr2r( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size ); - /* set everything else to zero */ - set_zero( tdBuffer + cur_subframe_start_outfs + move_size, subframe_size_outfs - move_size ); - } +#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING + /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid + overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ + slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; + /* move start indices forward to the end of the last subframe */ + cur_subframe_start_outfs = nCldfbTs * hSpatParamRendCom->slot_size; + cur_subframe_start_cngfs = nCldfbTs * slot_size_cng; + + /* go from the last subframe back and move the LB noise */ + for ( cur_subframe = hSpatParamRendCom->nb_subframes - 1; cur_subframe >= 0; cur_subframe-- ) + { + int16_t move_size, subframe_size_outfs; + move_size = slot_size_cng * hSpatParamRendCom->subframe_nbslots[cur_subframe]; + subframe_size_outfs = hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; + cur_subframe_start_outfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size; + cur_subframe_start_cngfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng; + /* move cna */ + mvr2r( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size ); + /* set everything else to zero */ + set_zero( tdBuffer + cur_subframe_start_outfs + move_size, subframe_size_outfs - move_size ); } #endif } -- GitLab From 84d01ccf0fae1cbfe9a4820ed3dc9ebd83cb4f85 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 09:17:20 +0100 Subject: [PATCH 096/498] Disable removal of bitstreams in SBA tests --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7ae07dee2..20d57ee8cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1242,6 +1242,8 @@ ivas-conformance: - sed -i '239,246d' tests/renderer/test_renderer.py # Remove test_sba_pca - sed -i '88,153d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + # Disable removal of output bitstreams + - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Reference creation - non_be_flag=0 -- GitLab From 6e0c54a284ffc6fdcb7f8849b5e5c5bfe200bb90 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 09:38:55 +0100 Subject: [PATCH 097/498] Fix report --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20d57ee8cb..f4fe35c512 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1256,7 +1256,7 @@ ivas-conformance: # Output creation - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --junit-xml=report-junit.xml --html=report_cmd.html --self-contained-html || exit_code=$? - python3 parse_commands.py report_cmd.html Readme_IVAS.txt - - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + # Copy input data and output ref data - cp -r scripts/testv . @@ -1269,7 +1269,9 @@ ivas-conformance: - cp -r tests/renderer/cut testv/renderer/ref # Test run generated scripts + - exit_code=0 - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check artifacts: -- GitLab From 25fe9395ed3068ec5579f219f17cb2fa09a9442d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 11:55:51 +0100 Subject: [PATCH 098/498] Remove one case failing in Windows. Create testvec folder for test package --- .gitlab-ci.yml | 25 ++++++++++++++++--------- tests/test_26252.py | 6 +++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4fe35c512..edd3a581c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1227,6 +1227,7 @@ ivas-conformance: - sed -i '849,851d' scripts/config/self_test.prm - sed -i '805,807d' scripts/config/self_test.prm - sed -i '684,686d' scripts/config/self_test.prm + - sed -i '505,508d' scripts/config/self_test.prm - sed -i '420,422d' scripts/config/self_test.prm - sed -i '377,383d' scripts/config/self_test.prm - sed -i '321,329d' scripts/config/self_test.prm @@ -1259,16 +1260,22 @@ ivas-conformance: # Copy input data and output ref data - - cp -r scripts/testv . - - cp -r scripts/ls_layouts . - - cp -r scripts/switchPaths . - - cp -r scripts/trajectories . - - cp -r tests/ref testv/ref - - mkdir testv/renderer - - cp -r tests/renderer/data testv/renderer/data - - cp -r tests/renderer/cut testv/renderer/ref + - mkdir testvec + - cp -r scripts/testv testvec + - cp -r scripts/ls_layouts testvec + - cp -r scripts/switchPaths testvec + - cp -r scripts/trajectories testvec + - cp -r tests/ref testvec/testv/ref + - mkdir testvec/testv/renderer + - mkdir testvec/bin + - cp -r tests/renderer/data testvec/testv/renderer/data + - cp -r tests/renderer/cut testvec/testv/renderer/ref + - cp tests/test_26252.py testvec + - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt testvec + - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin - # Test run generated scripts + # Test run generated scripts in testvec + - cd testvec - exit_code=0 - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true diff --git a/tests/test_26252.py b/tests/test_26252.py index ce38943862..f91da1bbb2 100644 --- a/tests/test_26252.py +++ b/tests/test_26252.py @@ -104,13 +104,13 @@ def test_26252(test_tag): if enc_opts: enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_cod"] + enc_opts.split()[1:], check = True) + subprocess.run(["./bin/IVAS_cod"] + enc_opts.split()[1:], check = True) if dec_opts: dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_dec"] + dec_opts.split()[1:], check = True) + subprocess.run(["./bin/IVAS_dec"] + dec_opts.split()[1:], check = True) if rend_opts: rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) - subprocess.run(["./IVAS_rend"] + rend_opts.split()[1:], check = True) + subprocess.run(["./bin/IVAS_rend"] + rend_opts.split()[1:], check = True) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) if ';' in diff_opts: -- GitLab From a36f8f1958197adfa8737c9a85baee942cb09941 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 13:25:09 +0100 Subject: [PATCH 099/498] Remove section on file cleanup which became empty --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edd3a581c4..b08b56733a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1245,6 +1245,7 @@ ivas-conformance: - sed -i '88,153d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Disable removal of output bitstreams - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + - sed -i '605,608d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Reference creation - non_be_flag=0 -- GitLab From c843e92a1aeab2c9ad24fad4010bcd4460b2be29 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 13:49:06 +0100 Subject: [PATCH 100/498] Correct xml report to only be output on the last test --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b08b56733a..8331ae9de6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1256,7 +1256,7 @@ ivas-conformance: - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --junit-xml=report-junit.xml --html=report_cmd.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html || exit_code=$? - python3 parse_commands.py report_cmd.html Readme_IVAS.txt -- GitLab From 52a297682e1b206a41940da4dcbb1b97268e5ffb Mon Sep 17 00:00:00 2001 From: Jonas Sv Date: Thu, 25 Jan 2024 14:02:13 +0100 Subject: [PATCH 101/498] FIX_976_USAN_PVQ_DEC_OMASA , corrected premature cast --- lib_com/options.h | 4 ++++ lib_dec/pvq_core_dec.c | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 820383e905..4d6953c941 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,6 +163,10 @@ #define FIX_956_DECODER_COMMAND_LINE_FIX /* VA: Output correct error message when the decoder command-line has too many mandatory arguments. */ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ + +#define FIX_976_USAN_PVQ_DEC_OMASA /* Ericsson: premature cast to unsigned detected by USAN corrected */ + + /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index 115d53ac57..1ef2bb0e59 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -415,11 +415,16 @@ static void densitySymbolIndexDecode( #undef WMC_TOOL_SKIP res_c = res - c; + if ( c == 0 ) { tot = res * ( res + 1 ) + 1; dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); - alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1; +#ifdef FIX_976_USAN_PVQ_DEC_OMASA + alpha = (int16_t) floor_sqrt_exact( ( uint32_t )(( res + 1 ) * ( res + 1 ) - dec_freq )) + res + 1; +#else + alpha = (int16_t) floor_sqrt_exact( ( uint32_t )( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1; +#endif sym_freq = 2 * ( res - alpha ) + 1; cum_freq = alpha * ( 2 * ( res + 1 ) - alpha ); } @@ -437,7 +442,12 @@ static void densitySymbolIndexDecode( dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); if ( dec_freq < tot - ( res + 1 ) - ( res - ( c + 1 ) ) * ( res - c ) * c + c + 1 ) { - alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c ); +#ifdef FIX_976_USAN_PVQ_DEC_OMASA + alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) ( res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) ) / ( 2 * res_c ); +#else + alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c ); +#endif + sym_freq = 2 * alpha * res_c + 1; cum_freq = alpha * ( ( alpha - 1 ) * res_c + 1 ); } @@ -485,7 +495,7 @@ static int16_t get_pvq_splits( int16_t Np; uint32_t flag; - Np = (int16_t) ( intLimCDivPos( band_bits, 67 ) >> 2 ); + Np = ( int16_t )( intLimCDivPos( band_bits, 67 ) >> 2 ); if ( band_bits - 268 * Np != 0 || Np == 0 ) /* L_msu */ { Np++; /* ceil */ @@ -501,7 +511,7 @@ static int16_t get_pvq_splits( } } - Np = max( Np, (int16_t) ( ceil( (float) sfmsize / PVQ_MAX_BAND_SIZE ) ) ); + Np = max( Np, ( int16_t )( ceil( (float) sfmsize / PVQ_MAX_BAND_SIZE ) ) ); Np = min( MAX_SPLITS, Np ); Np = min( (int16_t) floor( (float) sfmsize / MIN_BAND_SIZE ), Np ); -- GitLab From 95dd215d81075275d0bde18ea5f6e9a9ba8969f3 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 25 Jan 2024 14:02:31 +0100 Subject: [PATCH 102/498] move conformance test to separate folder --- {tests => conformance-test}/test_26252.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {tests => conformance-test}/test_26252.py (100%) diff --git a/tests/test_26252.py b/conformance-test/test_26252.py similarity index 100% rename from tests/test_26252.py rename to conformance-test/test_26252.py -- GitLab From 7e1f24719400eea1bf2adaa58733a2eaffc24572 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 25 Jan 2024 14:59:54 +0100 Subject: [PATCH 103/498] add command line args for test_26252.py --- conformance-test/conftest.py | 71 ++++++++++++++++++++++++++++++++++ conformance-test/test_26252.py | 8 ++-- 2 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 conformance-test/conftest.py diff --git a/conformance-test/conftest.py b/conformance-test/conftest.py new file mode 100644 index 0000000000..0c5ca76062 --- /dev/null +++ b/conformance-test/conftest.py @@ -0,0 +1,71 @@ +__copyright__ = """ +(C) 2022-2023 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 +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of 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 +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +import pytest +import pathlib + + +def pytest_addoption(parser): + parser.addoption( + "--encoder_path", + action="store", + help="path to encoder binary IVAS_cod(.exe)", + required=True, + type=pathlib.Path, + ) + parser.addoption( + "--decoder_path", + action="store", + help="path to decoder binary IVAS_dec(.exe)", + required=True, + type=pathlib.Path, + ) + parser.addoption( + "--renderer_path", + action="store", + help="path to renderer binary IVAS_rend(.exe)", + required=True, + type=pathlib.Path, + ) + + +@pytest.fixture(scope="session") +def encoder_path(request) -> str: + return str(request.config.option.encoder_path.absolute()) + + +@pytest.fixture(scope="session") +def decoder_path(request) -> str: + return str(request.config.option.decoder_path.absolute()) + + +@pytest.fixture(scope="session") +def renderer_path(request) -> str: + return str(request.config.option.renderer_path.absolute()) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index f91da1bbb2..a691aa7df9 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -98,19 +98,19 @@ for s in scripts: subprocess.run(proc.split()) @pytest.mark.parametrize("test_tag", list(test_dict.keys())) -def test_26252(test_tag): +def test_26252(test_tag, encoder_path, decoder_path, renderer_path): enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path = test_dict[test_tag] if enc_opts: enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) - subprocess.run(["./bin/IVAS_cod"] + enc_opts.split()[1:], check = True) + subprocess.run([encoder_path] + enc_opts.split()[1:], check = True) if dec_opts: dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) - subprocess.run(["./bin/IVAS_dec"] + dec_opts.split()[1:], check = True) + subprocess.run([decoder_path] + dec_opts.split()[1:], check = True) if rend_opts: rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) - subprocess.run(["./bin/IVAS_rend"] + rend_opts.split()[1:], check = True) + subprocess.run([renderer_path] + rend_opts.split()[1:], check = True) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) if ';' in diff_opts: -- GitLab From a8136b8329b9f970db755a0ac29338fb4c59dd1e Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 25 Jan 2024 15:14:03 +0100 Subject: [PATCH 104/498] adjust ci file to new folder structure --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8331ae9de6..e4e2ef27a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1271,14 +1271,14 @@ ivas-conformance: - mkdir testvec/bin - cp -r tests/renderer/data testvec/testv/renderer/data - cp -r tests/renderer/cut testvec/testv/renderer/ref - - cp tests/test_26252.py testvec + - cp -r conformance-test testvec/ - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin # Test run generated scripts in testvec - cd testvec - exit_code=0 - - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest conformance-test/test_26252.py --encoder_path bin/IVAS_cod --decoder_path bin/IVAS_dec --renderer_path bin/IVAS_rend --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check -- GitLab From 250353f494303b66049e99a15e1c09268667efec Mon Sep 17 00:00:00 2001 From: Jonas Sv Date: Thu, 25 Jan 2024 15:15:47 +0100 Subject: [PATCH 105/498] clang format --- lib_dec/pvq_core_dec.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index 1ef2bb0e59..fd212c3d49 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -420,10 +420,10 @@ static void densitySymbolIndexDecode( { tot = res * ( res + 1 ) + 1; dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); -#ifdef FIX_976_USAN_PVQ_DEC_OMASA - alpha = (int16_t) floor_sqrt_exact( ( uint32_t )(( res + 1 ) * ( res + 1 ) - dec_freq )) + res + 1; +#ifdef FIX_976_USAN_PVQ_DEC_OMASA + alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( ( res + 1 ) * ( res + 1 ) - dec_freq ) ) + res + 1; #else - alpha = (int16_t) floor_sqrt_exact( ( uint32_t )( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1; + alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1; #endif sym_freq = 2 * ( res - alpha ) + 1; cum_freq = alpha * ( 2 * ( res + 1 ) - alpha ); @@ -442,11 +442,11 @@ static void densitySymbolIndexDecode( dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); if ( dec_freq < tot - ( res + 1 ) - ( res - ( c + 1 ) ) * ( res - c ) * c + c + 1 ) { -#ifdef FIX_976_USAN_PVQ_DEC_OMASA - alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) ( res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) ) / ( 2 * res_c ); +#ifdef FIX_976_USAN_PVQ_DEC_OMASA + alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) ( res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) ) / ( 2 * res_c ); #else - alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c ); -#endif + alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c ); +#endif sym_freq = 2 * alpha * res_c + 1; cum_freq = alpha * ( ( alpha - 1 ) * res_c + 1 ); @@ -495,7 +495,7 @@ static int16_t get_pvq_splits( int16_t Np; uint32_t flag; - Np = ( int16_t )( intLimCDivPos( band_bits, 67 ) >> 2 ); + Np = (int16_t) ( intLimCDivPos( band_bits, 67 ) >> 2 ); if ( band_bits - 268 * Np != 0 || Np == 0 ) /* L_msu */ { Np++; /* ceil */ @@ -511,7 +511,7 @@ static int16_t get_pvq_splits( } } - Np = max( Np, ( int16_t )( ceil( (float) sfmsize / PVQ_MAX_BAND_SIZE ) ) ); + Np = max( Np, (int16_t) ( ceil( (float) sfmsize / PVQ_MAX_BAND_SIZE ) ) ); Np = min( MAX_SPLITS, Np ); Np = min( (int16_t) floor( (float) sfmsize / MIN_BAND_SIZE ), Np ); -- GitLab From 804695bac2b17f2d939e635a117c8f155711c47b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 15:31:41 +0100 Subject: [PATCH 106/498] Remove ivas-linux-fast tag from conf job --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8331ae9de6..3db54afcaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1195,7 +1195,6 @@ test-be-to-release: ivas-conformance: tags: - - ivas-linux-fast - test-ericsson-linux-runner stage: test timeout: "60 minutes" @@ -1278,7 +1277,7 @@ ivas-conformance: # Test run generated scripts in testvec - cd testvec - exit_code=0 - - python3 -m pytest tests/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest tests/test_26252.py --junitxml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check -- GitLab From 47cf599c27e4a80a193900e63a565d0d8ad1a42b Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 25 Jan 2024 15:46:08 +0100 Subject: [PATCH 107/498] add pytest.ini with report-related options for standalone conf test --- conformance-test/pytest.ini | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 conformance-test/pytest.ini diff --git a/conformance-test/pytest.ini b/conformance-test/pytest.ini new file mode 100644 index 0000000000..6d179f0724 --- /dev/null +++ b/conformance-test/pytest.ini @@ -0,0 +1,15 @@ +# pytest.ini +[pytest] +# TODO remove ignore after tests are harmonized +addopts = -ra --tb=short --basetemp=./tmp -n auto -v +# Write captured system-out log messages to JUnit report. +junit_logging = system-out +# Do not capture log information for passing tests to JUnit report. +junit_log_passing_tests = False +junit_duration_report = call +junit_family = xunit1 +log_file_level = DEBUG +log_format = %(asctime)s %(levelname)s %(message)s +log_date_format = %Y-%m-%d %H:%M:%S +# for pytest-html report: do not log environment variables from the runners +environment_table_redact_list = .* -- GitLab From 1a41bfdbdc76c3573d64020ec624bb1337e3af50 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 15:56:56 +0100 Subject: [PATCH 108/498] Catch parsing of relative paths --- parse_commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parse_commands.py b/parse_commands.py index a46b806eed..42e77141dc 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -44,6 +44,7 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/IVAS_cod', '$CUT_ENC_BIN') cmd = cmd.replace(r'\\', '/') cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH ) if not "pca" in cmd: @@ -68,6 +69,7 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: outfile.write(cmd+'\n') -- GitLab From 395a85ad2b64f569e5a4f13fb937e7763b9daec7 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 16:18:47 +0100 Subject: [PATCH 109/498] Move reports up such that they are found by gitlab --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 711c3c5284..051791924f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1278,6 +1278,8 @@ ivas-conformance: - cd testvec - exit_code=0 - python3 -m pytest conformance-test/test_26252.py --encoder_path bin/IVAS_cod --decoder_path bin/IVAS_dec --renderer_path bin/IVAS_rend --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - mv report.html .. + - mv report-junit.xml .. - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check -- GitLab From 6a84b0ddb12d9c78027ab57a00bb330323a44028 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 16:31:23 +0100 Subject: [PATCH 110/498] Fix zero_errors check --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 051791924f..e1a92d0c01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1278,9 +1278,9 @@ ivas-conformance: - cd testvec - exit_code=0 - python3 -m pytest conformance-test/test_26252.py --encoder_path bin/IVAS_cod --decoder_path bin/IVAS_dec --renderer_path bin/IVAS_rend --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - mv report.html .. - mv report-junit.xml .. - - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check artifacts: -- GitLab From 1b475a9db12a1929f61618750ce0ae3eb45c218c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 17:09:53 +0100 Subject: [PATCH 111/498] Remove 2 tests failing on Windows --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1a92d0c01..67672b551f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1226,6 +1226,7 @@ ivas-conformance: - sed -i '849,851d' scripts/config/self_test.prm - sed -i '805,807d' scripts/config/self_test.prm - sed -i '684,686d' scripts/config/self_test.prm + - sed -i '524,532d' scripts/config/self_test.prm - sed -i '505,508d' scripts/config/self_test.prm - sed -i '420,422d' scripts/config/self_test.prm - sed -i '377,383d' scripts/config/self_test.prm -- GitLab From 602a416958477bca8b4e784f56716cd59eabc475 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 25 Jan 2024 17:44:14 +0100 Subject: [PATCH 112/498] Remove binaural renderer tests --- .gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67672b551f..f2de4d27d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1246,7 +1246,13 @@ ivas-conformance: # Disable removal of output bitstreams - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py - sed -i '605,608d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py - + # Remove binaural renderer tests + - sed -i '276,301d' tests/renderer/test_renderer.py + - sed -i '205,236d' tests/renderer/test_renderer.py + - sed -i '151,186d' tests/renderer/test_renderer.py + - sed -i '101,132d' tests/renderer/test_renderer.py + - sed -i '58,83d' tests/renderer/test_renderer.py + # Reference creation - non_be_flag=0 - exit_code=0 -- GitLab From bd8afbc1afb8dfd9f37d0deb8a1534a4165676a2 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 07:38:56 +0100 Subject: [PATCH 113/498] Remove random tag in fer cases --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2de4d27d1..63e82f6367 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1251,7 +1251,9 @@ ivas-conformance: - sed -i '205,236d' tests/renderer/test_renderer.py - sed -i '151,186d' tests/renderer/test_renderer.py - sed -i '101,132d' tests/renderer/test_renderer.py - - sed -i '58,83d' tests/renderer/test_renderer.py + - sed -i '58,83d' tests/renderer/test_renderer.py + # Remove random tag in FER cases + - sed -i '438s/next(tempfile._get_candidate_names())/os.path.basename(plc_file)/' tests/conftest.py # Reference creation - non_be_flag=0 -- GitLab From 1a85dcb2857f4b427ff08618117c6a8eee2e0e52 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 07:59:26 +0100 Subject: [PATCH 114/498] Unify bitstream suffix to .192 --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63e82f6367..a8e2d08418 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1254,6 +1254,10 @@ ivas-conformance: - sed -i '58,83d' tests/renderer/test_renderer.py # Remove random tag in FER cases - sed -i '438s/next(tempfile._get_candidate_names())/os.path.basename(plc_file)/' tests/conftest.py + # Unify to use .192 as bitstream suffix + - sed -i 's/.pkt/.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py + - sed -i 's/.pkt/.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + - sed -i 's/.bts/.192/g' tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py # Reference creation - non_be_flag=0 -- GitLab From 1ac703c17d99753feafa65808033542d1d7aac2c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 08:28:52 +0100 Subject: [PATCH 115/498] Fix substitution of bitstream suffixes --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8e2d08418..9e5b27d455 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1255,9 +1255,9 @@ ivas-conformance: # Remove random tag in FER cases - sed -i '438s/next(tempfile._get_candidate_names())/os.path.basename(plc_file)/' tests/conftest.py # Unify to use .192 as bitstream suffix - - sed -i 's/.pkt/.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py - - sed -i 's/.pkt/.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py - - sed -i 's/.bts/.192/g' tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py + - sed -i 's/\.pkt/\.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py + - sed -i 's/\.pkt/\.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + - sed -i 's/\.bts/\.192/g' tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py # Reference creation - non_be_flag=0 -- GitLab From ad601fc59ea9d1fad309475809077af28d5cd750 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 08:33:22 +0100 Subject: [PATCH 116/498] Add default bin path for test_26252.py --- .gitlab-ci.yml | 2 +- conformance-test/conftest.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e5b27d455..0109682e02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1290,7 +1290,7 @@ ivas-conformance: # Test run generated scripts in testvec - cd testvec - exit_code=0 - - python3 -m pytest conformance-test/test_26252.py --encoder_path bin/IVAS_cod --decoder_path bin/IVAS_dec --renderer_path bin/IVAS_rend --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? + - python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - mv report.html .. - mv report-junit.xml .. diff --git a/conformance-test/conftest.py b/conformance-test/conftest.py index 0c5ca76062..7c37c3ad3f 100644 --- a/conformance-test/conftest.py +++ b/conformance-test/conftest.py @@ -39,6 +39,7 @@ def pytest_addoption(parser): help="path to encoder binary IVAS_cod(.exe)", required=True, type=pathlib.Path, + default='./bin/IVAS_cod', ) parser.addoption( "--decoder_path", @@ -46,6 +47,7 @@ def pytest_addoption(parser): help="path to decoder binary IVAS_dec(.exe)", required=True, type=pathlib.Path, + default='./bin/IVAS_dec', ) parser.addoption( "--renderer_path", @@ -53,6 +55,7 @@ def pytest_addoption(parser): help="path to renderer binary IVAS_rend(.exe)", required=True, type=pathlib.Path, + default='./bin/IVAS_rend', ) -- GitLab From 50a8493eb924f5138d597d9198f14e6f2ccaf7ef Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 08:41:28 +0100 Subject: [PATCH 117/498] Fix arguments in test_26252.py --- conformance-test/conftest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/conformance-test/conftest.py b/conformance-test/conftest.py index 7c37c3ad3f..5eea228c45 100644 --- a/conformance-test/conftest.py +++ b/conformance-test/conftest.py @@ -37,7 +37,6 @@ def pytest_addoption(parser): "--encoder_path", action="store", help="path to encoder binary IVAS_cod(.exe)", - required=True, type=pathlib.Path, default='./bin/IVAS_cod', ) @@ -45,7 +44,6 @@ def pytest_addoption(parser): "--decoder_path", action="store", help="path to decoder binary IVAS_dec(.exe)", - required=True, type=pathlib.Path, default='./bin/IVAS_dec', ) @@ -53,7 +51,6 @@ def pytest_addoption(parser): "--renderer_path", action="store", help="path to renderer binary IVAS_rend(.exe)", - required=True, type=pathlib.Path, default='./bin/IVAS_rend', ) -- GitLab From f4309524e1c77aa0e9db7ec338eceae14016bbde Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 08:58:42 +0100 Subject: [PATCH 118/498] Unify to .wav output --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0109682e02..c69e8885a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1258,6 +1258,10 @@ ivas-conformance: - sed -i 's/\.pkt/\.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py - sed -i 's/\.pkt/\.192/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py - sed -i 's/\.bts/\.192/g' tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py + # Unify to use .wav as output suffix + - sed -i 's/\.raw/\.wav/g' tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py + - sed -i 's/\.raw/\.wav/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + # Reference creation - non_be_flag=0 -- GitLab From 7774a9d284f1ef636a232370ee6b647b76872b2e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 10:00:38 +0100 Subject: [PATCH 119/498] Add diff on metadata output and log diffs --- conformance-test/test_26252.py | 15 ++++----------- dec_header.txt | 1 + enc_header.txt | 1 + parse_commands.py | 20 +++++++++++++++----- rend_header.txt | 1 + script_footer.txt | 10 ++++++++++ 6 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 script_footer.txt diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index a691aa7df9..01efa36195 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -113,16 +113,9 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path): subprocess.run([renderer_path] + rend_opts.split()[1:], check = True) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) - if ';' in diff_opts: - cmd1, cmd2 = diff_opts.split(';') - cmd1 = cmd1.split() - cmd2 = cmd2.split() - result1 = filecmp.cmp(cmd1[0], cmd1[1]) - result2 = filecmp.cmp(cmd2[2], cmd2[3]) - else: - cmd1 = diff_opts.split() - result1 = filecmp.cmp(cmd1[0], cmd1[1]) - result2 = True - if not (result1 and result2): + result = True + for cmd in diff_opts.split(';') + result = result and filecmp.cmp(cmd.split()[0], cmd.split()[1]) + if not result: assert False, "Output differs" diff --git a/dec_header.txt b/dec_header.txt index 8469dd4bfb..6d7efe2d83 100644 --- a/dec_header.txt +++ b/dec_header.txt @@ -12,6 +12,7 @@ DIFF_BIN="diff" TESTV_PATH="." REF_PATH="./testv" CUT_PATH="./TMP_DEC" +LOG_FILE=Readme_IVAS_dec_log.txt rm -rf $CUT_PATH mkdir -p $CUT_PATH diff --git a/enc_header.txt b/enc_header.txt index 32e78419cc..fba31ea826 100644 --- a/enc_header.txt +++ b/enc_header.txt @@ -12,6 +12,7 @@ DIFF_BIN="diff" TESTV_PATH="." REF_PATH="./testv" CUT_PATH="./TMP_ENC" +LOG_FILE=Readme_IVAS_enc_log.txt rm -rf $CUT_PATH mkdir -p $CUT_PATH diff --git a/parse_commands.py b/parse_commands.py index 42e77141dc..d379b2149c 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -4,6 +4,7 @@ import argparse import re from os import path from pathlib import Path +import glob # Main routine if __name__ == '__main__': @@ -51,8 +52,10 @@ if __name__ == '__main__': outfile.write(cmd+'\n') bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd) if bts: - outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n') + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'>> $LOG_FILE 2>&1\n') outfile.write('\n') + with open('script_footer.txt','r') as footer: + outfile.write(footer.read()) with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile: with open('dec_header.txt','r') as header: @@ -75,8 +78,13 @@ if __name__ == '__main__': outfile.write(cmd+'\n') out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) if out: - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+out.group(1)+'\n') - outfile.write('\n') + diff_cmds=[] + for output in glob.glob(out.group(1) + '*'): + diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') + outfile.write(diff_cmds.join('; ')) + outfile.write('\n\n') + with open('script_footer.txt','r') as footer: + outfile.write(footer.read()) with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile: with open('rend_header.txt','r') as header: @@ -96,5 +104,7 @@ if __name__ == '__main__': outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) if out and "cut" in out.group(1): - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'renderer/cut',REF_PATH + r'renderer/ref')+' '+out.group(1)+'\n') - outfile.write('\n') \ No newline at end of file + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'renderer/cut',REF_PATH + r'renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + outfile.write('\n') + with open('script_footer.txt','r') as footer: + outfile.write(footer.read()) \ No newline at end of file diff --git a/rend_header.txt b/rend_header.txt index 9e4adefc15..f95fb2e534 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -12,6 +12,7 @@ DIFF_BIN="diff" TESTV_PATH="." REF_PATH="./testv" CUT_PATH="./TMP_REND" +LOG_FILE=Readme_IVAS_rend_log.txt rm -rf $CUT_PATH mkdir -p $CUT_PATH/renderer/cut $CUT_PATH/renderer/data diff --git a/script_footer.txt b/script_footer.txt new file mode 100644 index 0000000000..ca6412e27c --- /dev/null +++ b/script_footer.txt @@ -0,0 +1,10 @@ +# test that log file is empty +if [ -s $LOG_FILE ] ; then + echo "TEST FAILED !!!" + echo "Please check the following conditions:" + cat $LOG_FILE + + echo "Summary: TEST FAILED !!!" +else + echo "TEST PASSED SUCCESSFULLY" +fi ; \ No newline at end of file -- GitLab From 31b53aa868d80281654840d8835d329a0846cd16 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 10:09:47 +0100 Subject: [PATCH 120/498] Fix diff cmds --- parse_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse_commands.py b/parse_commands.py index d379b2149c..e5b7ed477e 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -81,8 +81,8 @@ if __name__ == '__main__': diff_cmds=[] for output in glob.glob(out.group(1) + '*'): diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') - outfile.write(diff_cmds.join('; ')) - outfile.write('\n\n') + outfile.write(('; ').join(diff_cmds)) + outfile.write('\n') with open('script_footer.txt','r') as footer: outfile.write(footer.read()) -- GitLab From 0433beaeab21600b1b6d5fdc577d3faabc6fe21c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 10:15:48 +0100 Subject: [PATCH 121/498] Fix syntax error in test_26252.py --- conformance-test/test_26252.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 01efa36195..895525fc07 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -114,7 +114,7 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path): diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) result = True - for cmd in diff_opts.split(';') + for cmd in diff_opts.split(';'): result = result and filecmp.cmp(cmd.split()[0], cmd.split()[1]) if not result: assert False, "Output differs" -- GitLab From f8cba2da5f1145d627417d54b5837f5105a0c1b9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 10:32:18 +0100 Subject: [PATCH 122/498] Add separate file for jbm tests --- conformance-test/test_26252.py | 2 +- jbm_header.txt | 22 ++++++++++++++++++++++ parse_commands.py | 15 ++++++++++++--- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 jbm_header.txt diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 895525fc07..c0b8795e68 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -53,7 +53,7 @@ def replace_paths(instr, testv_path, ref_path, cut_path): test_dict = {} TEST_DIR = "." -scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt"] +scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_jbm.txt"] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: diff --git a/jbm_header.txt b/jbm_header.txt new file mode 100644 index 0000000000..466c82c654 --- /dev/null +++ b/jbm_header.txt @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -e + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit -1 +fi + +CUT_DEC_BIN=$1 +DIFF_BIN="diff" + +TESTV_PATH="." +REF_PATH="./testv" +CUT_PATH="./TMP_JBM" +LOG_FILE=Readme_IVAS_jbm_log.txt + +rm -rf $CUT_PATH +mkdir -p $CUT_PATH +mkdir -p $CUT_PATH/dut/masa_test/dec_output +mkdir -p $CUT_PATH/dut/param_file/dec +mkdir -p $CUT_PATH/dut/sba_bs/raw + diff --git a/parse_commands.py b/parse_commands.py index e5b7ed477e..aebfa30d06 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -57,9 +57,11 @@ if __name__ == '__main__': with open('script_footer.txt','r') as footer: outfile.write(footer.read()) - with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile: + with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_jbm.'),'w', newline='\n') as outfile_jbm: with open('dec_header.txt','r') as header: - outfile.write(header.read()) + outfile_dec.write(header.read()) + with open('jbm_header.txt','r') as header: + outfile_jbm.write(header.read()) for cmd in cmds_dec: arg1 = cmd.split()[0] root_folder = arg1[0:arg1.find("ivas-codec/")+10] @@ -74,6 +76,11 @@ if __name__ == '__main__': cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths + if 'VOIP' in cmd: + outfile = outfile_jbm + else: + outfile = outfile_dec + if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: outfile.write(cmd+'\n') out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) @@ -84,7 +91,9 @@ if __name__ == '__main__': outfile.write(('; ').join(diff_cmds)) outfile.write('\n') with open('script_footer.txt','r') as footer: - outfile.write(footer.read()) + outfile_dec.write(footer.read()) + footer.seek(0) + outfile_jbm.write(footer.read()) with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile: with open('rend_header.txt','r') as header: -- GitLab From 60c4bea2f525b8aa9d5421f0ede92fcb0a406c6d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 10:36:55 +0100 Subject: [PATCH 123/498] Add missing space --- parse_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_commands.py b/parse_commands.py index aebfa30d06..d82a087d29 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -52,7 +52,7 @@ if __name__ == '__main__': outfile.write(cmd+'\n') bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd) if bts: - outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'>> $LOG_FILE 2>&1\n') + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') with open('script_footer.txt','r') as footer: outfile.write(footer.read()) -- GitLab From 7e2d77db208dfaffc7fd3929a8620ca74d9c403e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 10:39:40 +0100 Subject: [PATCH 124/498] Move jbm script to test package --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c69e8885a3..4dc8510015 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1288,7 +1288,7 @@ ivas-conformance: - cp -r tests/renderer/data testvec/testv/renderer/data - cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r conformance-test testvec/ - - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt testvec + - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_jbm.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin # Test run generated scripts in testvec -- GitLab From 6ccf7aaf4e4cbfe22949c103bfd19f4e5281e19b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 11:19:48 +0100 Subject: [PATCH 125/498] Fix multiple diff --- parse_commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse_commands.py b/parse_commands.py index d82a087d29..4defd5faf4 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -63,6 +63,7 @@ if __name__ == '__main__': with open('jbm_header.txt','r') as header: outfile_jbm.write(header.read()) for cmd in cmds_dec: + absolute_out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) arg1 = cmd.split()[0] root_folder = arg1[0:arg1.find("ivas-codec/")+10] cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') @@ -86,7 +87,8 @@ if __name__ == '__main__': out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) if out: diff_cmds=[] - for output in glob.glob(out.group(1) + '*'): + for output in glob.glob(absolute_out.group(1) + '*'): + output = output.replace(root_folder + r'/tests/', CUT_PATH) diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) outfile.write('\n') -- GitLab From 404b2d9731826ec70198cdb660a6e8d8ca787677 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 11:31:27 +0100 Subject: [PATCH 126/498] Fix multiple diff 2 --- conformance-test/test_26252.py | 4 +- scripts/config/self_test.prm | 87 ---------- .../test_masa_enc_dec.py | 4 +- .../test_sba_bs_dec_plc.py | 12 +- .../test_sba_bs_enc.py | 96 ++--------- tests/conftest.py | 4 +- tests/renderer/constants.py | 2 +- tests/renderer/test_renderer.py | 160 ------------------ tests/renderer/utils.py | 4 +- 9 files changed, 27 insertions(+), 346 deletions(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index c0b8795e68..e338233034 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -82,7 +82,7 @@ for s in scripts: if line.startswith("$CUT_REND_BIN"): rend_opts = line if line.startswith("$DIFF_BIN"): - diff_opts = line[9:] + diff_opts = line tag = s + "--" + diff_opts.split()[1].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") @@ -115,7 +115,7 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path): diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) result = True for cmd in diff_opts.split(';'): - result = result and filecmp.cmp(cmd.split()[0], cmd.split()[1]) + result = result and filecmp.cmp(cmd.split()[1], cmd.split()[2]) if not result: assert False, "Output differs" diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 203c8dfc4d..839ae42b73 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -318,15 +318,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit_error testv/stv1ISM48s.wav_64000_48-48_FER5_binaural_room_HR_EXOF.tst -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, random FER at 5% -../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit -eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR.tst - -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, external orientation, random FER at 5% -../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit -eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR_EXOF.tst // 1 ISM with metadata at 96 kbps, 48 kHz in, 16 kHz out, EXT out ../IVAS_cod -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit @@ -374,13 +365,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 80000 48 testv/stvST48n.wav bit ../IVAS_dec STEREO 48 bit testv/stvST48n.wav_2ISM_80000_48-48_DTX_STEREO.tst -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit -../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR.tst - -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation, external orientation -../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit -../IVAS_dec -t testv/headrot_case01_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR_EXOF.tst // 2 ISM with metadata at 160 kbps, 48 kHz in, 32 kHz out, BINAURAL out ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 160000 48 testv/stv2ISM48s.wav bit @@ -417,9 +401,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec HOA3 32 bit_error testv/stv3ISM48s.wav_128000_48-32_HOA3_FER5.tst -// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file) -../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binauralfile.tst // 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FER at 5% ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit @@ -502,10 +483,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF.tst // 4 ISM with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit -../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst - -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, Orientation tracking ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 48 bit testv/stv4ISM48s.pcm_256000_48-48_TDHR_OtrAvg.tst @@ -521,15 +498,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit ../IVAS_dec HOA3 48 bit testv/stv4ISM48n.wav_brate_sw_48-48_DTX_hoa3.tst -// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, directivity configuration, random FER at 5% -../IVAS_cod -ism +4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit -eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst - -// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation, directivity configuration, random FER at 5% -../IVAS_cod -ism +4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit -eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst // 4 ISM with and without extended metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out ../IVAS_cod -dtx -ism +4 testv/stvISM1.csv NULL testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit @@ -681,9 +649,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit ../IVAS_dec 5_1_2 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_5_1_2.tst -// SBA at 48 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_binaural_ht_fr5.tst // SBA at 64 kbps, 32kHz in, 32kHz out, FOA out, DTX, random FER at 5% ../IVAS_cod -dtx -sba 1 64000 32 testv/stvFOA32c.wav bit @@ -802,9 +767,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst -// SBA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_binaural_ht_fr5.tst // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 48 testv/stvFOA48c.wav bit @@ -846,9 +808,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c.wav bit ../IVAS_dec HOA3 32 bit testv/stv3OA32c.wav_sw_32-32_DTX_HOA3.tst -// SBA FOA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, FOA out -../IVAS_cod -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvFOA48c.wav bit -../IVAS_dec FOA 48 bit testv/stvFOA48c.wav_sw_48-48_FOA.tst // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out @@ -1202,15 +1161,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, fr 5ms ../IVAS_cod -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit -../IVAS_dec -fr 5 BINAURAL_ROOM_IR 48 bit testv/stv714MC48c.wav_MC714_160000_48-48_MC_binaural_room_fr5.tst - -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, with headtracking, BINAURAL out, fr 5ms -../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_binaural_ht_fr5.tst - -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_binaural_ht_fr5.tst // Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5% ../IVAS_cod -mc 5_1_2 32000 48 testv/stv512MC48c.wav bit @@ -1304,21 +1254,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_sw_48-48_BINAURAL.tst -// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file) -../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_IR 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_binaural_room.tst - -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 32kHz out, BINAURAL out (Model from file) -../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv714MC48c.wav_MC714_512000_48-32_MC_binaural.tst - -// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out (Model from file) -../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_binaural.tst - -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out (Model from file) -../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_IR 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_binaural_room.tst @@ -1347,10 +1282,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP HOA3 32 netsimoutput testv/stv3OA32c.wav_SBA_80000_32-32_HOA3_JBM5.tst -// SBA at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, JBM Prof 5 -../IVAS_cod -sba 1 13200 48 testv/stvFOA48c.wav bit -networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 -../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 48 netsimoutput testv/stvFOA32c.wav_SBA_13200_48-48_BINAURAL_JBM5.tst // Multi-channel 5_1 at 384 kbps, 48kHz in, 48kHz out, 7_1_4 out, JBM Prof 5 ../IVAS_cod -mc 5_1 384000 48 testv/stv51MC48c.wav bit @@ -1620,9 +1551,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_3OA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOSBA_4ISM_3OA48c.wav_BINAURAL_sw_13k2_512k_48-48.tst -// OSBA 3OA 2ISM at 256 kbps, 32kHz in, 32kHz out, HOA3 out -../IVAS_cod -ism_sba 2 3 testv/stvISM1.csv testv/stvISM2.csv 256000 32 testv/stvOSBA_2ISM_3OA32c.wav bit -../IVAS_dec HOA3 32 bit testv/stvOSBA_2ISM_3OA32c.wav_HOA3_256000_32-32.tst // OSBA 2OA 3ISM at 384 kbps, 16kHz in, 16kHz out, MONO out ../IVAS_cod -ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 384000 16 testv/stvOSBA_3ISM_2OA16c.wav bit @@ -1641,19 +1569,4 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-48_FER5.tst -// OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% -../IVAS_cod -ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_3ISM_2OA48c.wav bit -eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error -../IVAS_dec STEREO 32 bit_error testv/stvOSBA_3ISM_2OA48c.wav_STEREO_sw_48-32_FER10.tst - -// OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism_sba 1 -1 testv/stvISM1.csv 256000 48 testv/stvOSBA_1ISM_FOA48c.wav bit -../IVAS_dec BINAURAL 48 bit testv/stvOSBA_1ISM_pFOA48c.wav_BINAURAL_256000_48-48.tst - -// OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism_sba 2 -1 testv/stvISM1.csv testv/stvISM2.csv 512000 48 testv/stvOSBA_2ISM_FOA48c.wav bit -../IVAS_dec BINAURAL 48 bit testv/stvOSBA_2ISM_pFOA48c.wav_BINAURAL_512000_48-48.tst -// OSBA planar 3OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism_sba 4 -3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stvOSBA_4ISM_3OA48c.wav bit -../IVAS_dec BINAURAL 48 bit testv/stvOSBA_4ISM_p3OA48c.wav_BINAURAL_512000_48-48.tst diff --git a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py index 0614651653..af6d9cb86e 100644 --- a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py @@ -139,8 +139,8 @@ def test_masa_enc_dec( check_and_makedir(out_dir_dec_output_dut) # To avoid conflicting names in case of parallel test execution, differentiate all cases - output_bitstream_ref = f"{out_dir_bs_ref}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.bts" - output_bitstream_dut = f"{out_dir_bs_dut}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.bts" + output_bitstream_ref = f"{out_dir_bs_ref}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.192" + output_bitstream_dut = f"{out_dir_bs_dut}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.192" dec_output_ref = f"{out_dir_dec_output_ref}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.wav" dec_output_dut = f"{out_dir_dec_output_dut}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.wav" if output_mode == "EXT": diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py index 422f87d9c7..528f6b5d2f 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py @@ -157,14 +157,14 @@ def sba_dec_plc( check_and_makedir(ref_out_dir) plc_file = f"{test_vector_path}/{plc_pattern}.g192" - ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}.pkt" - ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_dutenc.pkt" + ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}.192" + ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_dutenc.192" if SID == 1: - ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_cut.pkt" - ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_dutenc_cut.pkt" + ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_cut.192" + ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_dutenc_cut.192" - dut_out_raw = f"{dut_out_dir}/{plc_tag_out}.raw" - ref_out_raw = f"{ref_out_dir}/{plc_tag_out}.raw" + dut_out_raw = f"{dut_out_dir}/{plc_tag_out}.wav" + ref_out_raw = f"{ref_out_dir}/{plc_tag_out}.wav" output_config = "FOA" if ref_decoder_path: diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index 3e84e6b283..a75c1ed7e9 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -85,72 +85,6 @@ def check_and_makedir(dir_path): raise # raises the error again -@pytest.mark.create_ref -@pytest.mark.parametrize("tag", tag_list) -@pytest.mark.parametrize("fs", sample_rate_list) -def test_pca_enc( - dut_encoder_frontend: EncoderFrontend, - dut_decoder_frontend: DecoderFrontend, - test_vector_path, - reference_path, - dut_base_path, - ref_encoder_frontend, - ref_decoder_frontend, - update_ref, - keep_files, - tag, - fs, - get_mld, -): - pca = True - tag = tag + fs + "c" - ivas_br = "256000" - dtx = "0" - max_bw = "FB" - gain_flag = -1 - sba_order = "+1" - output_config = "FOA" - - # enc - sba_enc( - dut_encoder_frontend, - test_vector_path, - ref_encoder_frontend, - reference_path, - dut_base_path, - None, - tag, - fs, - ivas_br, - dtx, - None, - max_bw, - sba_order, - update_ref, - gain_flag, - cut_testv=True, - pca=pca, - ) - - # dec - sba_dec( - dut_decoder_frontend, - ref_decoder_frontend, - reference_path, - dut_base_path, - tag, - fs, - ivas_br, - dtx, - None, - max_bw, - output_config, - update_ref, - gain_flag, - keep_files, - get_mld=get_mld, - pca=pca, - ) @pytest.mark.create_ref @@ -504,14 +438,14 @@ def sba_enc( long_tag_ext += f"_Gain{gain_flag}" if SID == 1: long_tag_ext += f"_SID" - dut_pkt_file = f"{dut_out_dir}/{tag_out}{long_tag_ext}.pkt" - ref_pkt_file = f"{ref_out_dir}/{tag_out}{short_tag_ext}.pkt" - ref_pkt_file_dutenc = f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc.pkt" + dut_pkt_file = f"{dut_out_dir}/{tag_out}{long_tag_ext}.192" + ref_pkt_file = f"{ref_out_dir}/{tag_out}{short_tag_ext}.192" + ref_pkt_file_dutenc = f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc.192" if SID == 1: - dut_pkt_file_cut = f"{dut_out_dir}/{tag_out}{long_tag_ext}_cut.pkt" - ref_pkt_file_cut = f"{ref_out_dir}/{tag_out}{short_tag_ext}_cut.pkt" + dut_pkt_file_cut = f"{dut_out_dir}/{tag_out}{long_tag_ext}_cut.192" + ref_pkt_file_cut = f"{ref_out_dir}/{tag_out}{short_tag_ext}_cut.192" ref_pkt_file_dutenc_cut = ( - f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc_cut.pkt" + f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc_cut.192" ) input_path = f"{test_vector_path}/{tag_in}{in_extension}" dtx_mode = dtx == "1" @@ -584,13 +518,13 @@ def sba_enc( with open(ref_pkt_file_dutenc, "rb") as fp_in: with open(ref_pkt_file_dutenc_cut, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) - os.remove(ref_pkt_file) - os.remove(ref_pkt_file_dutenc) + #os.remove(ref_pkt_file) + #os.remove(ref_pkt_file_dutenc) if update_ref == 0: with open(dut_pkt_file, "rb") as fp_in: with open(dut_pkt_file_cut, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) - os.remove(dut_pkt_file) + #os.remove(dut_pkt_file) def sba_dec( @@ -635,11 +569,11 @@ def sba_dec( dut_out_dir = f"{dut_base_path}/sba_bs/raw" ref_out_dir = f"{reference_path}/sba_bs/raw" - dut_in_pkt = f"{dut_base_path}/sba_bs/pkt/{tag_out}{long_tag_ext}.pkt" - ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}{short_tag_ext}.pkt" + dut_in_pkt = f"{dut_base_path}/sba_bs/pkt/{tag_out}{long_tag_ext}.192" + ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}{short_tag_ext}.192" - dut_out_raw = f"{dut_out_dir}/{tag_out}{long_tag_ext}.raw" - ref_out_raw = f"{ref_out_dir}/{tag_out}{short_tag_ext}.raw" + dut_out_raw = f"{dut_out_dir}/{tag_out}{long_tag_ext}.wav" + ref_out_raw = f"{ref_out_dir}/{tag_out}{short_tag_ext}.wav" check_and_makedir(dut_out_dir) check_and_makedir(ref_out_dir) @@ -668,7 +602,3 @@ def sba_dec( # report compare result assert cmp_result == 0, reason - # remove DUT output files when test result is OK (to save disk space) - if not keep_files: - os.remove(dut_in_pkt) - os.remove(dut_out_raw) diff --git a/tests/conftest.py b/tests/conftest.py index 5f7ed04a82..a542b12ff1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -255,7 +255,7 @@ class EncoderFrontend: command.extend(["-max_band", max_band]) if pca: - command.extend(["-pca"]) + command.extend(["-bypass 2"]) if quiet_mode: command.extend(["-q"]) @@ -435,7 +435,7 @@ class DecoderFrontend: eid_command = [eid_path] eid_command.extend(["-fer", "-vbr", "-bs", "g192", "-ep", "g192"]) - eid_output_suffix = "." + next(tempfile._get_candidate_names()) + ".fer" + eid_output_suffix = "." + os.path.basename(plc_file) + ".fer" eid_command += [ str(input_bitstream_path), str(plc_file), diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 056242bd3c..09fc0d74bb 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -192,7 +192,7 @@ FORMAT_TO_METADATA_FILES = { INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"] INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"] -INPUT_FORMATS_MASA = ["MASA1", "MASA2"] +INPUT_FORMATS_MASA = ["MASA2"] """ Non binaural / parametric output formats """ OUTPUT_FORMATS = [ diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 1ddba22695..e481818045 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -55,32 +55,6 @@ def test_ambisonics(test_info, in_fmt, out_fmt, frame_size): ) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt, frame_size): - run_renderer( - test_info, - in_fmt, - out_fmt, - frame_size=frame_size, - ) - - -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ambisonics_binaural_headrotation( - test_info, in_fmt, out_fmt, trj_file, frame_size -): - run_renderer( - test_info, - in_fmt, - out_fmt, - trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - frame_size=frame_size, - ) """ Multichannel """ @@ -98,38 +72,6 @@ def test_multichannel(test_info, in_fmt, out_fmt, frame_size): ) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, frame_size): - if in_fmt in ["MONO", "STEREO"]: - pytest.skip("MONO or STEREO to Binaural rendering unsupported") - - run_renderer( - test_info, - in_fmt, - out_fmt, - frame_size=frame_size, - ) - - -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_multichannel_binaural_headrotation( - test_info, in_fmt, out_fmt, trj_file, frame_size -): - if in_fmt in ["MONO", "STEREO"]: - pytest.skip("MONO or STEREO to Binaural rendering unsupported") - - run_renderer( - test_info, - in_fmt, - out_fmt, - trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - frame_size=frame_size, - ) """ ISM """ @@ -148,42 +90,6 @@ def test_ism(test_info, in_fmt, out_fmt, frame_size): ) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_static(test_info, in_fmt, out_fmt, frame_size): - try: - in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] - except KeyError: - in_meta_files = None - - run_renderer( - test_info, - in_fmt, - out_fmt, - in_meta_files=in_meta_files, - frame_size=frame_size, - ) - - -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, frame_size): - try: - in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] - except KeyError: - in_meta_files = None - - run_renderer( - test_info, - in_fmt, - out_fmt, - trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - in_meta_files=in_meta_files, - frame_size=frame_size, - ) """ MASA """ @@ -202,48 +108,8 @@ def test_masa(test_info, in_fmt, out_fmt, frame_size): ) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_static(test_info, in_fmt, out_fmt, frame_size): - if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: - pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") - - run_renderer( - test_info, - in_fmt, - out_fmt, - in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], - frame_size=frame_size, - ) - - -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, frame_size): - if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: - pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") - - run_renderer( - test_info, - in_fmt, - out_fmt, - trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], - frame_size=frame_size, - ) -@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) -def test_masa_prerend(test_info, in_fmt): - run_renderer( - test_info, - "META", - "MASA2", - metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), - ) """ Custom loudspeaker layouts """ @@ -281,32 +147,6 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt): ) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_custom_ls_input_binaural(test_info, in_layout, out_fmt, frame_size): - run_renderer( - test_info, - CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), - out_fmt, - frame_size=frame_size, - ) - - -@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_custom_ls_input_binaural_headrotation( - test_info, in_layout, out_fmt, trj_file, frame_size -): - run_renderer( - test_info, - CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), - out_fmt, - trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), - frame_size=frame_size, - ) """ Metadata / scene description input """ diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 5f724e16de..e4ab74683b 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -184,7 +184,7 @@ def run_renderer( cmd[5:5] = ["-im", *in_meta_files] if trj_file is not None: - cmd.extend(["-T", str(trj_file)]) + cmd.extend(["-tf", str(trj_file)]) if non_diegetic_pan is not None: cmd.extend(["-non_diegetic_pan", str(non_diegetic_pan)]) @@ -203,8 +203,6 @@ def run_renderer( if config_file is not None: cmd.extend(["-render_config", str(config_file)]) - if frame_size: - cmd.extend(["-fr", str(frame_size.replace("ms", ""))]) # Set env variables for UBSAN env = os.environ.copy() -- GitLab From b918e5cd46d419d38b73d0bf472625e281481251 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 11:33:26 +0100 Subject: [PATCH 127/498] Fix multiple diff 3 --- conformance-test/test_26252.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index e338233034..1c148bcc72 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -83,7 +83,7 @@ for s in scripts: rend_opts = line if line.startswith("$DIFF_BIN"): diff_opts = line - tag = s + "--" + diff_opts.split()[1].split('/')[-1] + tag = s + "--" + diff_opts.split()[2].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") continue -- GitLab From b3224af2fb1dfddfb808cf85f727b9c3dc370a98 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 14:09:14 +0100 Subject: [PATCH 128/498] Revert "Fix multiple diff 3" This reverts commit b918e5cd46d419d38b73d0bf472625e281481251. --- conformance-test/test_26252.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 1c148bcc72..e338233034 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -83,7 +83,7 @@ for s in scripts: rend_opts = line if line.startswith("$DIFF_BIN"): diff_opts = line - tag = s + "--" + diff_opts.split()[2].split('/')[-1] + tag = s + "--" + diff_opts.split()[1].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") continue -- GitLab From c92e2ba6aadc956c65a49757ad8f5202217c3ae7 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 14:09:24 +0100 Subject: [PATCH 129/498] Revert "Fix multiple diff 2" This reverts commit 404b2d9731826ec70198cdb660a6e8d8ca787677. --- conformance-test/test_26252.py | 4 +- scripts/config/self_test.prm | 87 ++++++++++ .../test_masa_enc_dec.py | 4 +- .../test_sba_bs_dec_plc.py | 12 +- .../test_sba_bs_enc.py | 96 +++++++++-- tests/conftest.py | 4 +- tests/renderer/constants.py | 2 +- tests/renderer/test_renderer.py | 160 ++++++++++++++++++ tests/renderer/utils.py | 4 +- 9 files changed, 346 insertions(+), 27 deletions(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index e338233034..c0b8795e68 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -82,7 +82,7 @@ for s in scripts: if line.startswith("$CUT_REND_BIN"): rend_opts = line if line.startswith("$DIFF_BIN"): - diff_opts = line + diff_opts = line[9:] tag = s + "--" + diff_opts.split()[1].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") @@ -115,7 +115,7 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path): diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) result = True for cmd in diff_opts.split(';'): - result = result and filecmp.cmp(cmd.split()[1], cmd.split()[2]) + result = result and filecmp.cmp(cmd.split()[0], cmd.split()[1]) if not result: assert False, "Output differs" diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 839ae42b73..203c8dfc4d 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -318,6 +318,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit_error testv/stv1ISM48s.wav_64000_48-48_FER5_binaural_room_HR_EXOF.tst +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, random FER at 5% +../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error +../IVAS_dec -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR.tst + +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, external orientation, random FER at 5% +../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error +../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR_EXOF.tst // 1 ISM with metadata at 96 kbps, 48 kHz in, 16 kHz out, EXT out ../IVAS_cod -ism 1 testv/stvISM1.csv 96000 48 testv/stv1ISM48s.wav bit @@ -365,6 +374,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 80000 48 testv/stvST48n.wav bit ../IVAS_dec STEREO 48 bit testv/stvST48n.wav_2ISM_80000_48-48_DTX_STEREO.tst +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit +../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR.tst + +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation, external orientation +../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit +../IVAS_dec -t testv/headrot_case01_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR_EXOF.tst // 2 ISM with metadata at 160 kbps, 48 kHz in, 32 kHz out, BINAURAL out ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 160000 48 testv/stv2ISM48s.wav bit @@ -401,6 +417,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec HOA3 32 bit_error testv/stv3ISM48s.wav_128000_48-32_HOA3_FER5.tst +// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file) +../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binauralfile.tst // 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FER at 5% ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit @@ -483,6 +502,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF.tst // 4 ISM with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit +../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst + +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, Orientation tracking ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 48 bit testv/stv4ISM48s.pcm_256000_48-48_TDHR_OtrAvg.tst @@ -498,6 +521,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit ../IVAS_dec HOA3 48 bit testv/stv4ISM48n.wav_brate_sw_48-48_DTX_hoa3.tst +// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, directivity configuration, random FER at 5% +../IVAS_cod -ism +4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error +../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst + +// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation, directivity configuration, random FER at 5% +../IVAS_cod -ism +4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error +../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst // 4 ISM with and without extended metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out ../IVAS_cod -dtx -ism +4 testv/stvISM1.csv NULL testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit @@ -649,6 +681,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit ../IVAS_dec 5_1_2 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_5_1_2.tst +// SBA at 48 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms +../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_binaural_ht_fr5.tst // SBA at 64 kbps, 32kHz in, 32kHz out, FOA out, DTX, random FER at 5% ../IVAS_cod -dtx -sba 1 64000 32 testv/stvFOA32c.wav bit @@ -767,6 +802,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst +// SBA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms +../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_binaural_ht_fr5.tst // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 48 testv/stvFOA48c.wav bit @@ -808,6 +846,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c.wav bit ../IVAS_dec HOA3 32 bit testv/stv3OA32c.wav_sw_32-32_DTX_HOA3.tst +// SBA FOA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, FOA out +../IVAS_cod -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvFOA48c.wav bit +../IVAS_dec FOA 48 bit testv/stvFOA48c.wav_sw_48-48_FOA.tst // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out @@ -1161,6 +1202,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, fr 5ms ../IVAS_cod -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit +../IVAS_dec -fr 5 BINAURAL_ROOM_IR 48 bit testv/stv714MC48c.wav_MC714_160000_48-48_MC_binaural_room_fr5.tst + +// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, with headtracking, BINAURAL out, fr 5ms +../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_binaural_ht_fr5.tst + +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms +../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_binaural_ht_fr5.tst // Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5% ../IVAS_cod -mc 5_1_2 32000 48 testv/stv512MC48c.wav bit @@ -1254,6 +1304,21 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_sw_48-48_BINAURAL.tst +// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file) +../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_IR 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_binaural_room.tst + +// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 32kHz out, BINAURAL out (Model from file) +../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv714MC48c.wav_MC714_512000_48-32_MC_binaural.tst + +// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out (Model from file) +../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_binaural.tst + +// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out (Model from file) +../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_IR 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_binaural_room.tst @@ -1282,6 +1347,10 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP HOA3 32 netsimoutput testv/stv3OA32c.wav_SBA_80000_32-32_HOA3_JBM5.tst +// SBA at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, JBM Prof 5 +../IVAS_cod -sba 1 13200 48 testv/stvFOA48c.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 48 netsimoutput testv/stvFOA32c.wav_SBA_13200_48-48_BINAURAL_JBM5.tst // Multi-channel 5_1 at 384 kbps, 48kHz in, 48kHz out, 7_1_4 out, JBM Prof 5 ../IVAS_cod -mc 5_1 384000 48 testv/stv51MC48c.wav bit @@ -1551,6 +1620,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_3OA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOSBA_4ISM_3OA48c.wav_BINAURAL_sw_13k2_512k_48-48.tst +// OSBA 3OA 2ISM at 256 kbps, 32kHz in, 32kHz out, HOA3 out +../IVAS_cod -ism_sba 2 3 testv/stvISM1.csv testv/stvISM2.csv 256000 32 testv/stvOSBA_2ISM_3OA32c.wav bit +../IVAS_dec HOA3 32 bit testv/stvOSBA_2ISM_3OA32c.wav_HOA3_256000_32-32.tst // OSBA 2OA 3ISM at 384 kbps, 16kHz in, 16kHz out, MONO out ../IVAS_cod -ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv 384000 16 testv/stvOSBA_3ISM_2OA16c.wav bit @@ -1569,4 +1641,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-48_FER5.tst +// OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% +../IVAS_cod -ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_3ISM_2OA48c.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error +../IVAS_dec STEREO 32 bit_error testv/stvOSBA_3ISM_2OA48c.wav_STEREO_sw_48-32_FER10.tst + +// OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism_sba 1 -1 testv/stvISM1.csv 256000 48 testv/stvOSBA_1ISM_FOA48c.wav bit +../IVAS_dec BINAURAL 48 bit testv/stvOSBA_1ISM_pFOA48c.wav_BINAURAL_256000_48-48.tst + +// OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism_sba 2 -1 testv/stvISM1.csv testv/stvISM2.csv 512000 48 testv/stvOSBA_2ISM_FOA48c.wav bit +../IVAS_dec BINAURAL 48 bit testv/stvOSBA_2ISM_pFOA48c.wav_BINAURAL_512000_48-48.tst +// OSBA planar 3OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism_sba 4 -3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stvOSBA_4ISM_3OA48c.wav bit +../IVAS_dec BINAURAL 48 bit testv/stvOSBA_4ISM_p3OA48c.wav_BINAURAL_512000_48-48.tst diff --git a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py index af6d9cb86e..0614651653 100644 --- a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py @@ -139,8 +139,8 @@ def test_masa_enc_dec( check_and_makedir(out_dir_dec_output_dut) # To avoid conflicting names in case of parallel test execution, differentiate all cases - output_bitstream_ref = f"{out_dir_bs_ref}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.192" - output_bitstream_dut = f"{out_dir_bs_dut}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.192" + output_bitstream_ref = f"{out_dir_bs_ref}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.bts" + output_bitstream_dut = f"{out_dir_bs_dut}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.bts" dec_output_ref = f"{out_dir_dec_output_ref}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.wav" dec_output_dut = f"{out_dir_dec_output_dut}/masa{masa_channel_count}_ndirs{n_directions}_outputmode{output_mode}_ivasbr{ivas_br}k_DTX{dtx}.wav" if output_mode == "EXT": diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py index 528f6b5d2f..422f87d9c7 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py @@ -157,14 +157,14 @@ def sba_dec_plc( check_and_makedir(ref_out_dir) plc_file = f"{test_vector_path}/{plc_pattern}.g192" - ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}.192" - ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_dutenc.192" + ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}.pkt" + ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_dutenc.pkt" if SID == 1: - ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_cut.192" - ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_dutenc_cut.192" + ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_cut.pkt" + ref_in_pkt_dutenc = f"{reference_path}/sba_bs/pkt/{tag_out}_SID_dutenc_cut.pkt" - dut_out_raw = f"{dut_out_dir}/{plc_tag_out}.wav" - ref_out_raw = f"{ref_out_dir}/{plc_tag_out}.wav" + dut_out_raw = f"{dut_out_dir}/{plc_tag_out}.raw" + ref_out_raw = f"{ref_out_dir}/{plc_tag_out}.raw" output_config = "FOA" if ref_decoder_path: diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index a75c1ed7e9..3e84e6b283 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -85,6 +85,72 @@ def check_and_makedir(dir_path): raise # raises the error again +@pytest.mark.create_ref +@pytest.mark.parametrize("tag", tag_list) +@pytest.mark.parametrize("fs", sample_rate_list) +def test_pca_enc( + dut_encoder_frontend: EncoderFrontend, + dut_decoder_frontend: DecoderFrontend, + test_vector_path, + reference_path, + dut_base_path, + ref_encoder_frontend, + ref_decoder_frontend, + update_ref, + keep_files, + tag, + fs, + get_mld, +): + pca = True + tag = tag + fs + "c" + ivas_br = "256000" + dtx = "0" + max_bw = "FB" + gain_flag = -1 + sba_order = "+1" + output_config = "FOA" + + # enc + sba_enc( + dut_encoder_frontend, + test_vector_path, + ref_encoder_frontend, + reference_path, + dut_base_path, + None, + tag, + fs, + ivas_br, + dtx, + None, + max_bw, + sba_order, + update_ref, + gain_flag, + cut_testv=True, + pca=pca, + ) + + # dec + sba_dec( + dut_decoder_frontend, + ref_decoder_frontend, + reference_path, + dut_base_path, + tag, + fs, + ivas_br, + dtx, + None, + max_bw, + output_config, + update_ref, + gain_flag, + keep_files, + get_mld=get_mld, + pca=pca, + ) @pytest.mark.create_ref @@ -438,14 +504,14 @@ def sba_enc( long_tag_ext += f"_Gain{gain_flag}" if SID == 1: long_tag_ext += f"_SID" - dut_pkt_file = f"{dut_out_dir}/{tag_out}{long_tag_ext}.192" - ref_pkt_file = f"{ref_out_dir}/{tag_out}{short_tag_ext}.192" - ref_pkt_file_dutenc = f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc.192" + dut_pkt_file = f"{dut_out_dir}/{tag_out}{long_tag_ext}.pkt" + ref_pkt_file = f"{ref_out_dir}/{tag_out}{short_tag_ext}.pkt" + ref_pkt_file_dutenc = f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc.pkt" if SID == 1: - dut_pkt_file_cut = f"{dut_out_dir}/{tag_out}{long_tag_ext}_cut.192" - ref_pkt_file_cut = f"{ref_out_dir}/{tag_out}{short_tag_ext}_cut.192" + dut_pkt_file_cut = f"{dut_out_dir}/{tag_out}{long_tag_ext}_cut.pkt" + ref_pkt_file_cut = f"{ref_out_dir}/{tag_out}{short_tag_ext}_cut.pkt" ref_pkt_file_dutenc_cut = ( - f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc_cut.192" + f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc_cut.pkt" ) input_path = f"{test_vector_path}/{tag_in}{in_extension}" dtx_mode = dtx == "1" @@ -518,13 +584,13 @@ def sba_enc( with open(ref_pkt_file_dutenc, "rb") as fp_in: with open(ref_pkt_file_dutenc_cut, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) - #os.remove(ref_pkt_file) - #os.remove(ref_pkt_file_dutenc) + os.remove(ref_pkt_file) + os.remove(ref_pkt_file_dutenc) if update_ref == 0: with open(dut_pkt_file, "rb") as fp_in: with open(dut_pkt_file_cut, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) - #os.remove(dut_pkt_file) + os.remove(dut_pkt_file) def sba_dec( @@ -569,11 +635,11 @@ def sba_dec( dut_out_dir = f"{dut_base_path}/sba_bs/raw" ref_out_dir = f"{reference_path}/sba_bs/raw" - dut_in_pkt = f"{dut_base_path}/sba_bs/pkt/{tag_out}{long_tag_ext}.192" - ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}{short_tag_ext}.192" + dut_in_pkt = f"{dut_base_path}/sba_bs/pkt/{tag_out}{long_tag_ext}.pkt" + ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}{short_tag_ext}.pkt" - dut_out_raw = f"{dut_out_dir}/{tag_out}{long_tag_ext}.wav" - ref_out_raw = f"{ref_out_dir}/{tag_out}{short_tag_ext}.wav" + dut_out_raw = f"{dut_out_dir}/{tag_out}{long_tag_ext}.raw" + ref_out_raw = f"{ref_out_dir}/{tag_out}{short_tag_ext}.raw" check_and_makedir(dut_out_dir) check_and_makedir(ref_out_dir) @@ -602,3 +668,7 @@ def sba_dec( # report compare result assert cmp_result == 0, reason + # remove DUT output files when test result is OK (to save disk space) + if not keep_files: + os.remove(dut_in_pkt) + os.remove(dut_out_raw) diff --git a/tests/conftest.py b/tests/conftest.py index a542b12ff1..5f7ed04a82 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -255,7 +255,7 @@ class EncoderFrontend: command.extend(["-max_band", max_band]) if pca: - command.extend(["-bypass 2"]) + command.extend(["-pca"]) if quiet_mode: command.extend(["-q"]) @@ -435,7 +435,7 @@ class DecoderFrontend: eid_command = [eid_path] eid_command.extend(["-fer", "-vbr", "-bs", "g192", "-ep", "g192"]) - eid_output_suffix = "." + os.path.basename(plc_file) + ".fer" + eid_output_suffix = "." + next(tempfile._get_candidate_names()) + ".fer" eid_command += [ str(input_bitstream_path), str(plc_file), diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 09fc0d74bb..056242bd3c 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -192,7 +192,7 @@ FORMAT_TO_METADATA_FILES = { INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"] INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"] -INPUT_FORMATS_MASA = ["MASA2"] +INPUT_FORMATS_MASA = ["MASA1", "MASA2"] """ Non binaural / parametric output formats """ OUTPUT_FORMATS = [ diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index e481818045..1ddba22695 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -55,6 +55,32 @@ def test_ambisonics(test_info, in_fmt, out_fmt, frame_size): ) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt, frame_size): + run_renderer( + test_info, + in_fmt, + out_fmt, + frame_size=frame_size, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ambisonics_binaural_headrotation( + test_info, in_fmt, out_fmt, trj_file, frame_size +): + run_renderer( + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + frame_size=frame_size, + ) """ Multichannel """ @@ -72,6 +98,38 @@ def test_multichannel(test_info, in_fmt, out_fmt, frame_size): ) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, frame_size): + if in_fmt in ["MONO", "STEREO"]: + pytest.skip("MONO or STEREO to Binaural rendering unsupported") + + run_renderer( + test_info, + in_fmt, + out_fmt, + frame_size=frame_size, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_multichannel_binaural_headrotation( + test_info, in_fmt, out_fmt, trj_file, frame_size +): + if in_fmt in ["MONO", "STEREO"]: + pytest.skip("MONO or STEREO to Binaural rendering unsupported") + + run_renderer( + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + frame_size=frame_size, + ) """ ISM """ @@ -90,6 +148,42 @@ def test_ism(test_info, in_fmt, out_fmt, frame_size): ) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ism_binaural_static(test_info, in_fmt, out_fmt, frame_size): + try: + in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] + except KeyError: + in_meta_files = None + + run_renderer( + test_info, + in_fmt, + out_fmt, + in_meta_files=in_meta_files, + frame_size=frame_size, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, frame_size): + try: + in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] + except KeyError: + in_meta_files = None + + run_renderer( + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + in_meta_files=in_meta_files, + frame_size=frame_size, + ) """ MASA """ @@ -108,8 +202,48 @@ def test_masa(test_info, in_fmt, out_fmt, frame_size): ) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_masa_binaural_static(test_info, in_fmt, out_fmt, frame_size): + if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: + pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + + run_renderer( + test_info, + in_fmt, + out_fmt, + in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], + frame_size=frame_size, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_masa_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, frame_size): + if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: + pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + + run_renderer( + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], + frame_size=frame_size, + ) +@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) +def test_masa_prerend(test_info, in_fmt): + run_renderer( + test_info, + "META", + "MASA2", + metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + ) """ Custom loudspeaker layouts """ @@ -147,6 +281,32 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt): ) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_custom_ls_input_binaural(test_info, in_layout, out_fmt, frame_size): + run_renderer( + test_info, + CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), + out_fmt, + frame_size=frame_size, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_custom_ls_input_binaural_headrotation( + test_info, in_layout, out_fmt, trj_file, frame_size +): + run_renderer( + test_info, + CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + frame_size=frame_size, + ) """ Metadata / scene description input """ diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index e4ab74683b..5f724e16de 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -184,7 +184,7 @@ def run_renderer( cmd[5:5] = ["-im", *in_meta_files] if trj_file is not None: - cmd.extend(["-tf", str(trj_file)]) + cmd.extend(["-T", str(trj_file)]) if non_diegetic_pan is not None: cmd.extend(["-non_diegetic_pan", str(non_diegetic_pan)]) @@ -203,6 +203,8 @@ def run_renderer( if config_file is not None: cmd.extend(["-render_config", str(config_file)]) + if frame_size: + cmd.extend(["-fr", str(frame_size.replace("ms", ""))]) # Set env variables for UBSAN env = os.environ.copy() -- GitLab From 4f658bde6a8fcb1f77232ea2f5d2f284604b9562 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 14:16:44 +0100 Subject: [PATCH 130/498] Fixes --- conformance-test/test_26252.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index c0b8795e68..1c148bcc72 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -82,8 +82,8 @@ for s in scripts: if line.startswith("$CUT_REND_BIN"): rend_opts = line if line.startswith("$DIFF_BIN"): - diff_opts = line[9:] - tag = s + "--" + diff_opts.split()[1].split('/')[-1] + diff_opts = line + tag = s + "--" + diff_opts.split()[2].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") continue @@ -115,7 +115,7 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path): diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) result = True for cmd in diff_opts.split(';'): - result = result and filecmp.cmp(cmd.split()[0], cmd.split()[1]) + result = result and filecmp.cmp(cmd.split()[1], cmd.split()[2]) if not result: assert False, "Output differs" -- GitLab From 09659a8c6ed70432059326ee7516ed05a33a2c7d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 15:16:31 +0100 Subject: [PATCH 131/498] Fixes in parse_commands.py --- .gitlab-ci.yml | 3 ++- conformance-test/test_26252.py | 2 +- parse_commands.py | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dc8510015..d358f707e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1288,7 +1288,7 @@ ivas-conformance: - cp -r tests/renderer/data testvec/testv/renderer/data - cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r conformance-test testvec/ - - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_jbm.txt testvec + - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin # Test run generated scripts in testvec @@ -1311,6 +1311,7 @@ ivas-conformance: - Readme_IVAS_dec.txt - Readme_IVAS_enc.txt - Readme_IVAS_rend.txt + - Readme_IVAS_JBM_dec.txt expose_as: "Draft IVAS conformance" reports: junit: report-junit.xml diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 1c148bcc72..9e22ddf0a9 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -53,7 +53,7 @@ def replace_paths(instr, testv_path, ref_path, cut_path): test_dict = {} TEST_DIR = "." -scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_jbm.txt"] +scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_JBM_dec.txt"] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: diff --git a/parse_commands.py b/parse_commands.py index 4defd5faf4..fe3d165c1a 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -57,25 +57,25 @@ if __name__ == '__main__': with open('script_footer.txt','r') as footer: outfile.write(footer.read()) - with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_jbm.'),'w', newline='\n') as outfile_jbm: + with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_JBM_dec.'),'w', newline='\n') as outfile_jbm: with open('dec_header.txt','r') as header: outfile_dec.write(header.read()) with open('jbm_header.txt','r') as header: outfile_jbm.write(header.read()) for cmd in cmds_dec: - absolute_out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) + absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) arg1 = cmd.split()[0] root_folder = arg1[0:arg1.find("ivas-codec/")+10] cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') cmd = cmd.replace(r'\\', '/') + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths inputs = cmd.count(root_folder) - 1 if ".fer " in cmd: cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) else: cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths if 'VOIP' in cmd: outfile = outfile_jbm @@ -84,14 +84,14 @@ if __name__ == '__main__': if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: outfile.write(cmd+'\n') - out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) + out = re.search(r"\s(([\S]+)(.wav))$", cmd) if out: diff_cmds=[] for output in glob.glob(absolute_out.group(1) + '*'): output = output.replace(root_folder + r'/tests/', CUT_PATH) diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) - outfile.write('\n') + outfile.write('\n\n') with open('script_footer.txt','r') as footer: outfile_dec.write(footer.read()) footer.seek(0) -- GitLab From 98ecfc53f1f1bddbacaa35003cab1a49a40460e7 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 20:22:45 +0100 Subject: [PATCH 132/498] Use os.remove/os.mkdirs instead of bash rm/mkdir --- conformance-test/test_26252.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 9e22ddf0a9..3e6a30ff1e 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -95,7 +95,13 @@ for s in scripts: diff_opts = "" for proc in preproc: proc = replace_paths(proc, testv_path, ref_path, cut_path) - subprocess.run(proc.split()) + if 'rm' in proc: + path = proc.split()[-1] + if os.path.exists(path): os.remove(path) + if 'mkdir' in proc: + path = proc.split()[-1] + os.mkdirs(path) + @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_26252(test_tag, encoder_path, decoder_path, renderer_path): -- GitLab From 3ffdb45020fefc8db630126c16088490624a2953 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 20:29:53 +0100 Subject: [PATCH 133/498] Use os.remove/os.makedirs instead of bash rm/mkdir --- conformance-test/test_26252.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 3e6a30ff1e..4c6549186d 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -100,7 +100,7 @@ for s in scripts: if os.path.exists(path): os.remove(path) if 'mkdir' in proc: path = proc.split()[-1] - os.mkdirs(path) + os.makedirs(path) @pytest.mark.parametrize("test_tag", list(test_dict.keys())) -- GitLab From 8a3767a411a492c04bf9af8bd041d8e95b10ef23 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Jan 2024 20:40:32 +0100 Subject: [PATCH 134/498] Fix --- conformance-test/test_26252.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 4c6549186d..dffe565ebf 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -33,6 +33,7 @@ Execute tests specified via a parameter file. """ import os +import shutil from pathlib import Path import filecmp import subprocess @@ -97,7 +98,7 @@ for s in scripts: proc = replace_paths(proc, testv_path, ref_path, cut_path) if 'rm' in proc: path = proc.split()[-1] - if os.path.exists(path): os.remove(path) + if os.path.exists(path): shutil.rmtree(path) if 'mkdir' in proc: path = proc.split()[-1] os.makedirs(path) -- GitLab From 31d4ac312ea7d0df5fcac7c323bc75f7d40732bb Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Fri, 26 Jan 2024 19:50:11 +0000 Subject: [PATCH 135/498] Revert "Fixes in parse_commands.py" This reverts commit 09659a8c6ed70432059326ee7516ed05a33a2c7d --- .gitlab-ci.yml | 3 +-- conformance-test/test_26252.py | 2 +- parse_commands.py | 12 ++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d358f707e5..4dc8510015 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1288,7 +1288,7 @@ ivas-conformance: - cp -r tests/renderer/data testvec/testv/renderer/data - cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r conformance-test testvec/ - - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec + - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_jbm.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin # Test run generated scripts in testvec @@ -1311,7 +1311,6 @@ ivas-conformance: - Readme_IVAS_dec.txt - Readme_IVAS_enc.txt - Readme_IVAS_rend.txt - - Readme_IVAS_JBM_dec.txt expose_as: "Draft IVAS conformance" reports: junit: report-junit.xml diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index dffe565ebf..47c3e10b4c 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -54,7 +54,7 @@ def replace_paths(instr, testv_path, ref_path, cut_path): test_dict = {} TEST_DIR = "." -scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_JBM_dec.txt"] +scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_jbm.txt"] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: diff --git a/parse_commands.py b/parse_commands.py index fe3d165c1a..4defd5faf4 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -57,25 +57,25 @@ if __name__ == '__main__': with open('script_footer.txt','r') as footer: outfile.write(footer.read()) - with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_JBM_dec.'),'w', newline='\n') as outfile_jbm: + with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_jbm.'),'w', newline='\n') as outfile_jbm: with open('dec_header.txt','r') as header: outfile_dec.write(header.read()) with open('jbm_header.txt','r') as header: outfile_jbm.write(header.read()) for cmd in cmds_dec: - absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) + absolute_out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) arg1 = cmd.split()[0] root_folder = arg1[0:arg1.find("ivas-codec/")+10] cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') cmd = cmd.replace(r'\\', '/') - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths inputs = cmd.count(root_folder) - 1 if ".fer " in cmd: cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) else: cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths if 'VOIP' in cmd: outfile = outfile_jbm @@ -84,14 +84,14 @@ if __name__ == '__main__': if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: outfile.write(cmd+'\n') - out = re.search(r"\s(([\S]+)(.wav))$", cmd) + out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) if out: diff_cmds=[] for output in glob.glob(absolute_out.group(1) + '*'): output = output.replace(root_folder + r'/tests/', CUT_PATH) diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) - outfile.write('\n\n') + outfile.write('\n') with open('script_footer.txt','r') as footer: outfile_dec.write(footer.read()) footer.seek(0) -- GitLab From 2a5ffa69a7c7e1c0010a74a236becce72b0f9a82 Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Fri, 26 Jan 2024 19:54:00 +0000 Subject: [PATCH 136/498] Add report for first pytest reference creation. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dc8510015..5bad7bb4c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1267,7 +1267,7 @@ ivas-conformance: - non_be_flag=0 - exit_code=0 - python3 tests/create_short_testvectors.py - - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref || exit_code=$? + - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref --html=report1.html --self-contained-html || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 || exit_code=$? - python3 -m pytest tests/renderer/test_renderer.py --create_ref || exit_code=$? @@ -1306,6 +1306,7 @@ ivas-conformance: when: always paths: - report-junit.xml + - report1.html - report_cmd.html - report.html - Readme_IVAS_dec.txt -- GitLab From 55be30e053be87afd6a51dd1307413a39e07e2c5 Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Fri, 26 Jan 2024 20:08:34 +0000 Subject: [PATCH 137/498] Revert "Revert "Fixes in parse_commands.py"" This reverts commit 31d4ac312ea7d0df5fcac7c323bc75f7d40732bb --- .gitlab-ci.yml | 3 ++- conformance-test/test_26252.py | 2 +- parse_commands.py | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5bad7bb4c5..6863d34e18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1288,7 +1288,7 @@ ivas-conformance: - cp -r tests/renderer/data testvec/testv/renderer/data - cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r conformance-test testvec/ - - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_jbm.txt testvec + - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin # Test run generated scripts in testvec @@ -1312,6 +1312,7 @@ ivas-conformance: - Readme_IVAS_dec.txt - Readme_IVAS_enc.txt - Readme_IVAS_rend.txt + - Readme_IVAS_JBM_dec.txt expose_as: "Draft IVAS conformance" reports: junit: report-junit.xml diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 47c3e10b4c..dffe565ebf 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -54,7 +54,7 @@ def replace_paths(instr, testv_path, ref_path, cut_path): test_dict = {} TEST_DIR = "." -scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_jbm.txt"] +scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt", "Readme_IVAS_JBM_dec.txt"] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: diff --git a/parse_commands.py b/parse_commands.py index 4defd5faf4..fe3d165c1a 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -57,25 +57,25 @@ if __name__ == '__main__': with open('script_footer.txt','r') as footer: outfile.write(footer.read()) - with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_jbm.'),'w', newline='\n') as outfile_jbm: + with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_JBM_dec.'),'w', newline='\n') as outfile_jbm: with open('dec_header.txt','r') as header: outfile_dec.write(header.read()) with open('jbm_header.txt','r') as header: outfile_jbm.write(header.read()) for cmd in cmds_dec: - absolute_out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) + absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) arg1 = cmd.split()[0] root_folder = arg1[0:arg1.find("ivas-codec/")+10] cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') cmd = cmd.replace(r'\\', '/') + cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths inputs = cmd.count(root_folder) - 1 if ".fer " in cmd: cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) else: cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths if 'VOIP' in cmd: outfile = outfile_jbm @@ -84,14 +84,14 @@ if __name__ == '__main__': if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: outfile.write(cmd+'\n') - out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd) + out = re.search(r"\s(([\S]+)(.wav))$", cmd) if out: diff_cmds=[] for output in glob.glob(absolute_out.group(1) + '*'): output = output.replace(root_folder + r'/tests/', CUT_PATH) diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) - outfile.write('\n') + outfile.write('\n\n') with open('script_footer.txt','r') as footer: outfile_dec.write(footer.read()) footer.seek(0) -- GitLab From bb1b122a68df5b2a399bdd6aa5e8212d03f772b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Toftg=C3=A5rd?= Date: Fri, 26 Jan 2024 21:17:27 +0100 Subject: [PATCH 138/498] Revert 98ecfc53 --- conformance-test/test_26252.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index dffe565ebf..88e90b1c97 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -96,13 +96,7 @@ for s in scripts: diff_opts = "" for proc in preproc: proc = replace_paths(proc, testv_path, ref_path, cut_path) - if 'rm' in proc: - path = proc.split()[-1] - if os.path.exists(path): shutil.rmtree(path) - if 'mkdir' in proc: - path = proc.split()[-1] - os.makedirs(path) - + subprocess.run(proc.split()) @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_26252(test_tag, encoder_path, decoder_path, renderer_path): -- GitLab From 74ec28974932b2400d370d2e3205fbe4b19de80f Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Sat, 27 Jan 2024 00:33:23 +0000 Subject: [PATCH 139/498] Fix for testv_file parsing for linux --- tests/codec_be_on_mr_nonselection/test_param_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 1dfda043d7..2a796488f7 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -163,7 +163,7 @@ def test_param_file_tests( not bitrate.isdigit() and "-dtx" in enc_split and "-sba" in enc_split - and testv_file.split("/")[1].startswith("stv") + and testv_file.split("/")[test_vector_path.count("/")+1].startswith("stv") ): sba_br_switching_dtx = 1 cut_file = pre_proc_input(testv_file, fs) -- GitLab From 29179c1c03f3600bec67bf96761c5ce5d83d7655 Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Sat, 27 Jan 2024 00:59:30 +0000 Subject: [PATCH 140/498] Disable removal of files also for test_param_file.py --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6863d34e18..9b9ba87804 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1245,6 +1245,7 @@ ivas-conformance: - sed -i '88,153d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Disable removal of output bitstreams - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py + - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_param_file.py - sed -i '605,608d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Remove binaural renderer tests - sed -i '276,301d' tests/renderer/test_renderer.py -- GitLab From 3d38635e34df5219a9bf3c3072554050188a6c7b Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Sat, 27 Jan 2024 02:18:33 +0000 Subject: [PATCH 141/498] Update os.remove code --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b9ba87804..9980b981f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1245,7 +1245,7 @@ ivas-conformance: - sed -i '88,153d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Disable removal of output bitstreams - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py - - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_param_file.py + - sed -i 's/os.remove/#os.remove print()/g' tests/codec_be_on_mr_nonselection/test_param_file.py - sed -i '605,608d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Remove binaural renderer tests - sed -i '276,301d' tests/renderer/test_renderer.py -- GitLab From cc69760ba1b06f58481ea350fc23ca6768e796ab Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Sat, 27 Jan 2024 02:25:10 +0000 Subject: [PATCH 142/498] Change sed for os.remove --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9980b981f7..0e5bc3f00c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1245,7 +1245,7 @@ ivas-conformance: - sed -i '88,153d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Disable removal of output bitstreams - sed -i 's/os.remove/#os.remove/g' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py - - sed -i 's/os.remove/#os.remove print()/g' tests/codec_be_on_mr_nonselection/test_param_file.py + - sed -i 's/os.remove/print()#os.remove/g' tests/codec_be_on_mr_nonselection/test_param_file.py - sed -i '605,608d' tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py # Remove binaural renderer tests - sed -i '276,301d' tests/renderer/test_renderer.py -- GitLab From c5879a977f60b08fe140dd33a710a3a4bf36875c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 27 Jan 2024 10:17:11 +0100 Subject: [PATCH 143/498] New attempt: remove rm/mkdir --- conformance-test/test_26252.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index 88e90b1c97..ea69261a0c 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -96,7 +96,12 @@ for s in scripts: diff_opts = "" for proc in preproc: proc = replace_paths(proc, testv_path, ref_path, cut_path) - subprocess.run(proc.split()) + path_arg = proc.split()[-1] + if "rm" in proc: + if os.path.exists(path_arg) + shutil.rmtree(path_arg) + if "mkdir" in proc: + Path(path_arg).mkdir(parents=True, exist_ok=True) @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_26252(test_tag, encoder_path, decoder_path, renderer_path): -- GitLab From e27248624ac79bc8591eeba26847f7d5a8068f93 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 27 Jan 2024 10:22:46 +0100 Subject: [PATCH 144/498] Fix syntax error. Remove set -e from test scripts --- conformance-test/test_26252.py | 2 +- dec_header.txt | 1 - enc_header.txt | 1 - jbm_header.txt | 1 - rend_header.txt | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index ea69261a0c..b620f15209 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -98,7 +98,7 @@ for s in scripts: proc = replace_paths(proc, testv_path, ref_path, cut_path) path_arg = proc.split()[-1] if "rm" in proc: - if os.path.exists(path_arg) + if os.path.exists(path_arg): shutil.rmtree(path_arg) if "mkdir" in proc: Path(path_arg).mkdir(parents=True, exist_ok=True) diff --git a/dec_header.txt b/dec_header.txt index 6d7efe2d83..110d7429a7 100644 --- a/dec_header.txt +++ b/dec_header.txt @@ -1,5 +1,4 @@ #!/usr/bin/env bash -set -e if [ "$#" -ne 1 ]; then echo "Usage: $0 " diff --git a/enc_header.txt b/enc_header.txt index fba31ea826..4f193b17c8 100644 --- a/enc_header.txt +++ b/enc_header.txt @@ -1,5 +1,4 @@ #!/usr/bin/env bash -set -e if [ "$#" -ne 1 ]; then echo "Usage: $0 " diff --git a/jbm_header.txt b/jbm_header.txt index 466c82c654..e1c0168434 100644 --- a/jbm_header.txt +++ b/jbm_header.txt @@ -1,5 +1,4 @@ #!/usr/bin/env bash -set -e if [ "$#" -ne 1 ]; then echo "Usage: $0 " diff --git a/rend_header.txt b/rend_header.txt index f95fb2e534..4088ff0101 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -1,5 +1,4 @@ #!/usr/bin/env bash -set -e if [ "$#" -ne 1 ]; then echo "Usage: $0 " -- GitLab From fec68d5cd41c4bc31ab34c5c7bcc9ab7e0d9996b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 27 Jan 2024 10:44:41 +0100 Subject: [PATCH 145/498] Fix rend_header.txt --- rend_header.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rend_header.txt b/rend_header.txt index 4088ff0101..f6fe7cbe02 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -14,6 +14,7 @@ CUT_PATH="./TMP_REND" LOG_FILE=Readme_IVAS_rend_log.txt rm -rf $CUT_PATH -mkdir -p $CUT_PATH/renderer/cut $CUT_PATH/renderer/data +mkdir -p $CUT_PATH/renderer/cut +mkdir -p $CUT_PATH/renderer/data -- GitLab From 7047e552b12a4c1e342cf43f86572913002c3105 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 27 Jan 2024 11:08:26 +0100 Subject: [PATCH 146/498] Fixes for file removal on Windows --- conformance-test/test_26252.py | 7 ++++++- dec_header.txt | 1 + enc_header.txt | 1 + jbm_header.txt | 1 + rend_header.txt | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/conformance-test/test_26252.py b/conformance-test/test_26252.py index b620f15209..d8796b5ae7 100644 --- a/conformance-test/test_26252.py +++ b/conformance-test/test_26252.py @@ -34,11 +34,16 @@ Execute tests specified via a parameter file. import os import shutil +import stat from pathlib import Path import filecmp import subprocess import pytest +def remove_readonly(func, path, excinfo): + os.chmod(path, stat.S_IWRITE) + func(path) + def replace_paths(instr, testv_path, ref_path, cut_path): outstr = instr tmp = testv_path.split('=') @@ -99,7 +104,7 @@ for s in scripts: path_arg = proc.split()[-1] if "rm" in proc: if os.path.exists(path_arg): - shutil.rmtree(path_arg) + shutil.rmtree(path_arg, onerror=remove_readonly) # Needed for folder tree removal on Windows. if "mkdir" in proc: Path(path_arg).mkdir(parents=True, exist_ok=True) diff --git a/dec_header.txt b/dec_header.txt index 110d7429a7..599c7e73ed 100644 --- a/dec_header.txt +++ b/dec_header.txt @@ -13,6 +13,7 @@ REF_PATH="./testv" CUT_PATH="./TMP_DEC" LOG_FILE=Readme_IVAS_dec_log.txt +rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/dut/masa_test/dec_output diff --git a/enc_header.txt b/enc_header.txt index 4f193b17c8..18387a9326 100644 --- a/enc_header.txt +++ b/enc_header.txt @@ -13,6 +13,7 @@ REF_PATH="./testv" CUT_PATH="./TMP_ENC" LOG_FILE=Readme_IVAS_enc_log.txt +rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/dut/masa_test/bitstreams diff --git a/jbm_header.txt b/jbm_header.txt index e1c0168434..d244c83b3f 100644 --- a/jbm_header.txt +++ b/jbm_header.txt @@ -13,6 +13,7 @@ REF_PATH="./testv" CUT_PATH="./TMP_JBM" LOG_FILE=Readme_IVAS_jbm_log.txt +rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/dut/masa_test/dec_output diff --git a/rend_header.txt b/rend_header.txt index f6fe7cbe02..c56eb17cb0 100644 --- a/rend_header.txt +++ b/rend_header.txt @@ -13,6 +13,7 @@ REF_PATH="./testv" CUT_PATH="./TMP_REND" LOG_FILE=Readme_IVAS_rend_log.txt +rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH/renderer/cut mkdir -p $CUT_PATH/renderer/data -- GitLab From dc5cea9dffe26bf81dbcf3ec0c80679b6a7228ad Mon Sep 17 00:00:00 2001 From: janssontoftg Date: Sat, 27 Jan 2024 21:39:33 +0000 Subject: [PATCH 147/498] Changed version to 20230817_Final_Upd02_SA4#125_delivery --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e5bc3f00c..3719b74169 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1207,7 +1207,7 @@ ivas-conformance: - *print-common-info # Prepare reference exec, use tests and scripts from reference - source_branch_commit_sha=$(git rev-parse HEAD) - - git checkout 20230815_RC02_SA4#125_delivery + - git checkout 20230817_Final_Upd02_SA4#125_delivery - sed -i".bak" "s/\(#define DEBUGGING\)/\/\/\1/" lib_com/options.h - make -j - cp IVAS_cod IVAS_cod_ref -- GitLab From afc77096f4896d1996188b826421fb8ffd1ecd70 Mon Sep 17 00:00:00 2001 From: Jonas Sv Date: Mon, 29 Jan 2024 17:20:01 +0100 Subject: [PATCH 148/498] renamed define and aligned ivas-float negations to BASOP and ALT-BASOP --- lib_com/options.h | 2 +- lib_dec/pvq_core_dec.c | 25 +++++++++++++++++++++---- lib_enc/pvq_core_enc.c | 6 ++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8de27e096a..339c02c82e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ -#define FIX_976_USAN_PVQ_DEC_OMASA /* Ericsson: premature cast to unsigned detected by USAN corrected */ +#define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* Ericsson: premature cast to unsigned detected by USAN corrected */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index fd212c3d49..01fd496fd0 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -98,6 +98,7 @@ static void pvq_decode_band( } set_s( g_part_s, -32768, Np ); + if ( Np > 1 ) { decode_energies( st, hPVQ, Np, dim_part, bits_part, g_part_s, band_bits_tot, bits_left, sfmsize, strict_bits ); @@ -112,11 +113,27 @@ static void pvq_decode_band( for ( j = 0; j < Np; j++ ) { - g_part[j] = -( (float) g_part_s[j] ) / 32768; - g_part_s[j] = -g_part_s[j]; + g_part[j] = -( (float) g_part_s[j] ) / 32768; +#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR + /* note: here g_part_s needs to be become exactly 1.0(float) esp. for Np==1 , thus g_part_s was initilized to (int16_t) -32768 */ +#endif + + if ( g_part_s[j] == -32768 ) + { + printf( "\n Error negative mag negative int16_t . Np=%2d in split j=%2d \n", Np, j ); + } +#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR + /* aligned to BASOP to avoid ASAN undefined negation issue with -(-32768) */ + g_part_s[j] = negate(g_part_s[j]); +#else + g_part_s[j] = -g_part_s[j]; +#endif } + srt_vec_ind( g_part_s, sg_part, idx_sort, Np ); + + for ( j = 0; j < Np; j++ ) { js = idx_sort[Np - 1 - j]; @@ -420,7 +437,7 @@ static void densitySymbolIndexDecode( { tot = res * ( res + 1 ) + 1; dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); -#ifdef FIX_976_USAN_PVQ_DEC_OMASA +#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( ( res + 1 ) * ( res + 1 ) - dec_freq ) ) + res + 1; #else alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1; @@ -442,7 +459,7 @@ static void densitySymbolIndexDecode( dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); if ( dec_freq < tot - ( res + 1 ) - ( res - ( c + 1 ) ) * ( res - c ) * c + c + 1 ) { -#ifdef FIX_976_USAN_PVQ_DEC_OMASA +#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) ( res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) ) / ( 2 * res_c ); #else alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c ); diff --git a/lib_enc/pvq_core_enc.c b/lib_enc/pvq_core_enc.c index 5876c8b44a..7c90fb082f 100644 --- a/lib_enc/pvq_core_enc.c +++ b/lib_enc/pvq_core_enc.c @@ -124,7 +124,13 @@ static void pvq_encode_band( for ( j = 0; j < Np; j++ ) { g_part[j] = -( (float) g_part_s[j] ) / 32768; +#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR + /* aligned to BASOP to avoid ASAN undefined negation issue with -(-32768) */ + g_part_s[j] = negate( g_part_s[j] ); +#else g_part_s[j] = -g_part_s[j]; +#endif + } srt_vec_ind( g_part_s, sg_part, idx_sort, Np ); -- GitLab From 208717bac26fefcd47e51ae3d31417174bdc37d9 Mon Sep 17 00:00:00 2001 From: Jonas Sv Date: Mon, 29 Jan 2024 17:47:10 +0100 Subject: [PATCH 149/498] format fix --- lib_dec/pvq_core_dec.c | 12 ++++++------ lib_enc/pvq_core_enc.c | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index 01fd496fd0..96aa2aaf5c 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -113,10 +113,10 @@ static void pvq_decode_band( for ( j = 0; j < Np; j++ ) { - g_part[j] = -( (float) g_part_s[j] ) / 32768; + g_part[j] = -( (float) g_part_s[j] ) / 32768; #ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR - /* note: here g_part_s needs to be become exactly 1.0(float) esp. for Np==1 , thus g_part_s was initilized to (int16_t) -32768 */ -#endif + /* note: here g_part_s needs to be become exactly 1.0(float) esp. for Np==1 , thus g_part_s was initilized to (int16_t) -32768 */ +#endif if ( g_part_s[j] == -32768 ) { @@ -124,10 +124,10 @@ static void pvq_decode_band( } #ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* aligned to BASOP to avoid ASAN undefined negation issue with -(-32768) */ - g_part_s[j] = negate(g_part_s[j]); + g_part_s[j] = negate( g_part_s[j] ); #else - g_part_s[j] = -g_part_s[j]; -#endif + g_part_s[j] = -g_part_s[j]; +#endif } diff --git a/lib_enc/pvq_core_enc.c b/lib_enc/pvq_core_enc.c index 7c90fb082f..d6671c4c97 100644 --- a/lib_enc/pvq_core_enc.c +++ b/lib_enc/pvq_core_enc.c @@ -129,8 +129,7 @@ static void pvq_encode_band( g_part_s[j] = negate( g_part_s[j] ); #else g_part_s[j] = -g_part_s[j]; -#endif - +#endif } srt_vec_ind( g_part_s, sg_part, idx_sort, Np ); -- GitLab From 44ca1b3215f3bf0cd8f9f03c92a7c853a0a57386 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 29 Jan 2024 18:11:40 +0100 Subject: [PATCH 150/498] change file collection --- ci/collect_artifacts.py | 29 +++++------------------------ ci/run_scheduled_sanitizer_test.py | 4 +--- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/ci/collect_artifacts.py b/ci/collect_artifacts.py index d3228ba2e8..49cf3565cb 100755 --- a/ci/collect_artifacts.py +++ b/ci/collect_artifacts.py @@ -15,39 +15,20 @@ def main(args): collect_for_sanitizer_test(file) -def find_failed_files_for_sanitizer_test( - console_log: list, subfolder: str, which="LOGS" -) -> dict(): +def find_failed_files_for_sanitizer_test(console_log: list) -> dict(): - assert which in ["LOGS", "FILE_BASENAMES"] - - pattern_line = "(Encoding|Decoding) failed .*for \/.*(CLANG.|VALGRIND)\/(.*)" - pattern_file = "(.*_b[0-9]*_.*_rs|.*_b[0-9]*_.*_cbr).*" + pattern_line = r"(CLANG.) reports . error\(s\) for (.*)" files_found = dict() for line in console_log: m_line = re.match(pattern_line, line) if m_line is not None: - _, test, filename = m_line.groups() - filename = pathlib.Path(filename).name - m_file = re.match(pattern_file, filename) - if m_file is None: - print(f"Unexpected: no match on {filename} with {pattern_file} - skip") - continue - filename_start = m_file.groups()[0] - - if which == "LOGS": - folder = pathlib.Path(f"{test}/{subfolder}/") - files = [ - f for f in folder.iterdir() if f.name.startswith(filename_start) - ] - elif which == "FILE_BASENAMES": - files = [filename_start] + test, filename = m_line.groups() if test in files_found: - files_found[test].extend(files) + files_found[test].append(filename) else: - files_found[test] = files + files_found[test] = [filename] return files_found diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 33148897ca..84601b1708 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -179,9 +179,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # delete bitstream files for all failed modes to prevent follow-up errors in decoder-only run with open(CONSOLE_OUT_FILE) as f: console_log = f.readlines() - failed_files = find_failed_files_for_sanitizer_test( - console_log, "logs", "FILE_BASENAMES" - ) + failed_files = find_failed_files_for_sanitizer_test(console_log) for t in failed_files.keys(): bs_folder = pathlib.Path(f"{t}/enc") file_starts = failed_files[t] -- GitLab From b0a5ea1b2ce27863b386969f1c20932853025bd2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 31 Jan 2024 09:56:27 +0100 Subject: [PATCH 151/498] update year in IVAS PC copyright statement --- LICENSE.md | 2 +- apps/decoder.c | 2 +- apps/encoder.c | 2 +- apps/renderer.c | 2 +- ci/build_all_linux.sh | 2 +- ci/build_codec_instrumented_linux.sh | 2 +- ci/build_codec_sanitizers_linux.sh | 2 +- ci/combine_genpatt_and_jbm_profile.py | 2 +- ci/complexity_measurements/genWebpageData_Ram.csh | 2 +- ci/complexity_measurements/genWebpageData_Rom.csh | 2 +- ci/complexity_measurements/genWebpageData_WMOPS.csh | 2 +- .../genWebpageData_WmopPerOperatingpoint.csh | 2 +- ci/complexity_measurements/getWmops.sh | 2 +- ci/complexity_measurements/index_complexity.html | 2 +- ci/complexity_measurements/mergeNewsletterRam.py | 2 +- ci/complexity_measurements/mergeNewsletterRom.py | 2 +- ci/complexity_measurements/parseNewsletterRam.py | 2 +- ci/complexity_measurements/parseNewsletterRom.py | 2 +- ci/complexity_measurements/parseNewsletterWmops.py | 2 +- ci/get_id_of_last_job_occurence.py | 2 +- ci/ivas_voip_be_test.sh | 2 +- ci/run_evs_be_test.py | 2 +- ci/run_evs_be_win_test.py | 2 +- ci/run_scheduled_sanitizer_test.py | 2 +- ci/smoke_test.sh | 2 +- lib_com/ACcontextMapping.c | 2 +- lib_com/ari.c | 2 +- lib_com/ari_hm.c | 2 +- lib_com/arith_coder.c | 2 +- lib_com/basop32.c | 2 +- lib_com/basop32.h | 2 +- lib_com/basop_com_lpc.c | 2 +- lib_com/basop_lsf_tools.c | 2 +- lib_com/basop_mpy.c | 2 +- lib_com/basop_mpy.h | 2 +- lib_com/basop_proto_func.h | 2 +- lib_com/basop_settings.h | 2 +- lib_com/basop_tcx_utils.c | 2 +- lib_com/basop_util.c | 2 +- lib_com/basop_util.h | 2 +- lib_com/bitalloc.c | 2 +- lib_com/bitallocsum.c | 2 +- lib_com/bits_alloc.c | 2 +- lib_com/bitstream.c | 2 +- lib_com/calc_st_com.c | 2 +- lib_com/cb_shape.c | 2 +- lib_com/cldfb.c | 2 +- lib_com/cng_exc.c | 2 +- lib_com/cnst.h | 2 +- lib_com/codec_tcx_common.c | 2 +- lib_com/common_api_types.h | 2 +- lib_com/core_com_config.c | 2 +- lib_com/deemph.c | 2 +- lib_com/delay_comp.c | 2 +- lib_com/disclaimer.c | 2 +- lib_com/dlpc_bfi.c | 2 +- lib_com/edct.c | 2 +- lib_com/enh1632.c | 2 +- lib_com/enh1632.h | 2 +- lib_com/enh40.c | 2 +- lib_com/enh40.h | 2 +- lib_com/enhancer.c | 2 +- lib_com/enr_1_az.c | 2 +- lib_com/env_adj.c | 2 +- lib_com/env_stab.c | 2 +- lib_com/env_stab_trans.c | 2 +- lib_com/est_tilt.c | 2 +- lib_com/fd_cng_com.c | 2 +- lib_com/fft.c | 2 +- lib_com/fft_cldfb.c | 2 +- lib_com/fft_rel.c | 2 +- lib_com/fill_spectrum.c | 2 +- lib_com/findpulse.c | 2 +- lib_com/fine_gain_bits.c | 2 +- lib_com/frame_ener.c | 2 +- lib_com/get_gain.c | 2 +- lib_com/gs_bitallocation.c | 2 +- lib_com/gs_gains.c | 2 +- lib_com/gs_inact_switching.c | 2 +- lib_com/gs_noisefill.c | 2 +- lib_com/gs_preech.c | 2 +- lib_com/guided_plc_util.c | 2 +- lib_com/hp50.c | 2 +- lib_com/hq2_bit_alloc.c | 2 +- lib_com/hq2_core_com.c | 2 +- lib_com/hq2_noise_inject.c | 2 +- lib_com/hq_bit_allocation.c | 2 +- lib_com/hq_conf.c | 2 +- lib_com/hq_tools.c | 2 +- lib_com/hvq_pvq_bitalloc.c | 2 +- lib_com/ifft_rel.c | 2 +- lib_com/igf_base.c | 2 +- lib_com/index_pvq_opt.c | 2 +- lib_com/int_lsp.c | 2 +- lib_com/interleave_spectrum.c | 2 +- lib_com/interpol.c | 2 +- lib_com/isf_dec_amr_wb.c | 2 +- lib_com/ivas_agc_com.c | 2 +- lib_com/ivas_arith.c | 2 +- lib_com/ivas_avq_pos_reorder_com.c | 2 +- lib_com/ivas_cnst.h | 2 +- lib_com/ivas_cov_smooth.c | 2 +- lib_com/ivas_dirac_com.c | 2 +- lib_com/ivas_entropy_coder_common.c | 2 +- lib_com/ivas_error.h | 2 +- lib_com/ivas_error_utils.h | 2 +- lib_com/ivas_fb_mixer.c | 2 +- lib_com/ivas_filters.c | 2 +- lib_com/ivas_ism_com.c | 2 +- lib_com/ivas_lfe_com.c | 2 +- lib_com/ivas_masa_com.c | 2 +- lib_com/ivas_mc_com.c | 2 +- lib_com/ivas_mc_param_com.c | 2 +- lib_com/ivas_mcmasa_com.c | 2 +- lib_com/ivas_mct_com.c | 2 +- lib_com/ivas_mdct_core_com.c | 2 +- lib_com/ivas_mdct_imdct.c | 2 +- lib_com/ivas_mdft_imdft.c | 2 +- lib_com/ivas_omasa_com.c | 2 +- lib_com/ivas_pca_tools.c | 2 +- lib_com/ivas_prot.h | 2 +- lib_com/ivas_qmetadata_com.c | 2 +- lib_com/ivas_qspherical_com.c | 2 +- lib_com/ivas_rom_com.c | 2 +- lib_com/ivas_rom_com.h | 2 +- lib_com/ivas_sba_config.c | 2 +- lib_com/ivas_sns_com.c | 2 +- lib_com/ivas_spar_com.c | 2 +- lib_com/ivas_spar_com_quant_util.c | 2 +- lib_com/ivas_stat_com.h | 2 +- lib_com/ivas_stereo_dft_com.c | 2 +- lib_com/ivas_stereo_eclvq_com.c | 2 +- lib_com/ivas_stereo_ica_com.c | 2 +- lib_com/ivas_stereo_mdct_bands_com.c | 2 +- lib_com/ivas_stereo_mdct_stereo_com.c | 2 +- lib_com/ivas_stereo_psychlpc_com.c | 2 +- lib_com/ivas_stereo_td_bit_alloc.c | 2 +- lib_com/ivas_tools.c | 2 +- lib_com/ivas_transient_det.c | 2 +- lib_com/lag_wind.c | 2 +- lib_com/lerp.c | 2 +- lib_com/limit_t0.c | 2 +- lib_com/logqnorm.c | 2 +- lib_com/longarith.c | 2 +- lib_com/low_rate_band_att.c | 2 +- lib_com/lpc_tools.c | 2 +- lib_com/lsf_dec_bfi.c | 2 +- lib_com/lsf_msvq_ma.c | 2 +- lib_com/lsf_tools.c | 2 +- lib_com/lsp_conv_poly.c | 2 +- lib_com/mime.h | 2 +- lib_com/modif_fs.c | 2 +- lib_com/move.h | 2 +- lib_com/mslvq_com.c | 2 +- lib_com/nelp.c | 2 +- lib_com/options.h | 2 +- lib_com/parameter_bitmaping.c | 2 +- lib_com/phase_dispersion.c | 2 +- lib_com/ppp.c | 2 +- lib_com/pred_lt4.c | 2 +- lib_com/preemph.c | 2 +- lib_com/prot.h | 2 +- lib_com/pvq_com.c | 2 +- lib_com/range_com.c | 2 +- lib_com/re8_ppv.c | 2 +- lib_com/re8_util.c | 2 +- lib_com/realft.c | 2 +- lib_com/recovernorm.c | 2 +- lib_com/reordvct.c | 2 +- lib_com/residu.c | 2 +- lib_com/rom_com.c | 2 +- lib_com/rom_com.h | 2 +- lib_com/stab_est.c | 2 +- lib_com/stat_com.h | 2 +- lib_com/stat_noise_uv_mod.c | 2 +- lib_com/stl.h | 2 +- lib_com/swb_bwe_com.c | 2 +- lib_com/swb_bwe_com_hr.c | 2 +- lib_com/swb_bwe_com_lr.c | 2 +- lib_com/swb_tbe_com.c | 2 +- lib_com/syn_12k8.c | 2 +- lib_com/syn_filt.c | 2 +- lib_com/tcq_position_arith.c | 2 +- lib_com/tcx_ltp.c | 2 +- lib_com/tcx_mdct.c | 2 +- lib_com/tcx_mdct_window.c | 2 +- lib_com/tcx_utils.c | 2 +- lib_com/tec_com.c | 2 +- lib_com/tns_base.c | 2 +- lib_com/tools.c | 2 +- lib_com/trans_direct.c | 2 +- lib_com/trans_inv.c | 2 +- lib_com/typedef.h | 2 +- lib_com/vlpc_2st_com.c | 2 +- lib_com/weight.c | 2 +- lib_com/weight_a.c | 2 +- lib_com/wi.c | 2 +- lib_com/window.c | 2 +- lib_com/window_ola.c | 2 +- lib_com/wtda.c | 2 +- lib_debug/debug.c | 2 +- lib_debug/debug.h | 2 +- lib_debug/sba_debug.c | 2 +- lib_debug/sba_debug.h | 2 +- lib_debug/snr.c | 2 +- lib_dec/ACcontextMapping_dec.c | 2 +- lib_dec/FEC.c | 2 +- lib_dec/FEC_HQ_core.c | 2 +- lib_dec/FEC_HQ_phase_ecu.c | 2 +- lib_dec/FEC_adapt_codebook.c | 2 +- lib_dec/FEC_clas_estim.c | 2 +- lib_dec/FEC_lsf_estim.c | 2 +- lib_dec/FEC_pitch_estim.c | 2 +- lib_dec/FEC_scale_syn.c | 2 +- lib_dec/LD_music_post_filter.c | 2 +- lib_dec/TonalComponentDetection.c | 2 +- lib_dec/acelp_core_dec.c | 2 +- lib_dec/acelp_core_switch_dec.c | 2 +- lib_dec/amr_wb_dec.c | 2 +- lib_dec/ari_dec.c | 2 +- lib_dec/ari_hm_dec.c | 2 +- lib_dec/arith_coder_dec.c | 2 +- lib_dec/avq_dec.c | 2 +- lib_dec/bass_psfilter.c | 2 +- lib_dec/cng_dec.c | 2 +- lib_dec/core_dec_init.c | 2 +- lib_dec/core_dec_reconf.c | 2 +- lib_dec/core_dec_switch.c | 2 +- lib_dec/core_switching_dec.c | 2 +- lib_dec/d_gain2p.c | 2 +- lib_dec/dec2t32.c | 2 +- lib_dec/dec4t64.c | 2 +- lib_dec/dec_LPD.c | 2 +- lib_dec/dec_ace.c | 2 +- lib_dec/dec_acelp.c | 2 +- lib_dec/dec_acelp_tcx_main.c | 2 +- lib_dec/dec_amr_wb.c | 2 +- lib_dec/dec_gen_voic.c | 2 +- lib_dec/dec_higher_acelp.c | 2 +- lib_dec/dec_nelp.c | 2 +- lib_dec/dec_pit_exc.c | 2 +- lib_dec/dec_post.c | 2 +- lib_dec/dec_ppp.c | 2 +- lib_dec/dec_prm.c | 2 +- lib_dec/dec_tcx.c | 2 +- lib_dec/dec_tran.c | 2 +- lib_dec/dec_uv.c | 2 +- lib_dec/decision_matrix_dec.c | 2 +- lib_dec/dlpc_avq.c | 2 +- lib_dec/dlpc_stoch.c | 2 +- lib_dec/er_dec_acelp.c | 2 +- lib_dec/er_dec_tcx.c | 2 +- lib_dec/er_scale_syn.c | 2 +- lib_dec/er_sync_exc.c | 2 +- lib_dec/er_util.c | 2 +- lib_dec/evs_dec.c | 2 +- lib_dec/fd_cng_dec.c | 2 +- lib_dec/gain_dec.c | 2 +- lib_dec/gaus_dec.c | 2 +- lib_dec/gs_dec.c | 2 +- lib_dec/gs_dec_amr_wb.c | 2 +- lib_dec/hdecnrm.c | 2 +- lib_dec/hf_synth.c | 2 +- lib_dec/hq_classifier_dec.c | 2 +- lib_dec/hq_conf_fec.c | 2 +- lib_dec/hq_core_dec.c | 2 +- lib_dec/hq_env_dec.c | 2 +- lib_dec/hq_hr_dec.c | 2 +- lib_dec/hq_lr_dec.c | 2 +- lib_dec/igf_dec.c | 2 +- lib_dec/igf_scf_dec.c | 2 +- lib_dec/init_dec.c | 2 +- lib_dec/inov_dec.c | 2 +- lib_dec/ivas_agc_dec.c | 2 +- lib_dec/ivas_binRenderer_internal.c | 2 +- lib_dec/ivas_core_dec.c | 2 +- lib_dec/ivas_corecoder_dec_reconfig.c | 2 +- lib_dec/ivas_cpe_dec.c | 2 +- lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_decision_matrix_dec.c | 2 +- lib_dec/ivas_dirac_dec.c | 2 +- lib_dec/ivas_dirac_output_synthesis_cov.c | 2 +- lib_dec/ivas_entropy_decoder.c | 2 +- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_ism_dec.c | 2 +- lib_dec/ivas_ism_dtx_dec.c | 2 +- lib_dec/ivas_ism_metadata_dec.c | 2 +- lib_dec/ivas_ism_param_dec.c | 2 +- lib_dec/ivas_ism_renderer.c | 2 +- lib_dec/ivas_jbm_dec.c | 2 +- lib_dec/ivas_lfe_dec.c | 2 +- lib_dec/ivas_lfe_plc.c | 2 +- lib_dec/ivas_ls_custom_dec.c | 2 +- lib_dec/ivas_masa_dec.c | 2 +- lib_dec/ivas_mc_param_dec.c | 2 +- lib_dec/ivas_mc_paramupmix_dec.c | 2 +- lib_dec/ivas_mcmasa_dec.c | 2 +- lib_dec/ivas_mct_core_dec.c | 2 +- lib_dec/ivas_mct_dec.c | 2 +- lib_dec/ivas_mct_dec_mct.c | 2 +- lib_dec/ivas_mdct_core_dec.c | 2 +- lib_dec/ivas_mono_dmx_renderer.c | 2 +- lib_dec/ivas_objectRenderer_internal.c | 2 +- lib_dec/ivas_omasa_dec.c | 2 +- lib_dec/ivas_osba_dec.c | 2 +- lib_dec/ivas_out_setup_conversion.c | 2 +- lib_dec/ivas_output_config.c | 2 +- lib_dec/ivas_pca_dec.c | 2 +- lib_dec/ivas_post_proc.c | 2 +- lib_dec/ivas_qmetadata_dec.c | 2 +- lib_dec/ivas_qspherical_dec.c | 2 +- lib_dec/ivas_range_uni_dec.c | 2 +- lib_dec/ivas_rom_dec.c | 2 +- lib_dec/ivas_rom_dec.h | 2 +- lib_dec/ivas_sba_dec.c | 2 +- lib_dec/ivas_sba_dirac_stereo_dec.c | 2 +- lib_dec/ivas_sba_rendering_internal.c | 2 +- lib_dec/ivas_sce_dec.c | 2 +- lib_dec/ivas_sns_dec.c | 2 +- lib_dec/ivas_spar_decoder.c | 2 +- lib_dec/ivas_spar_md_dec.c | 2 +- lib_dec/ivas_stat_dec.h | 2 +- lib_dec/ivas_stereo_adapt_GR_dec.c | 2 +- lib_dec/ivas_stereo_cng_dec.c | 2 +- lib_dec/ivas_stereo_dft_dec.c | 2 +- lib_dec/ivas_stereo_dft_dec_dmx.c | 2 +- lib_dec/ivas_stereo_dft_plc.c | 2 +- lib_dec/ivas_stereo_eclvq_dec.c | 2 +- lib_dec/ivas_stereo_esf_dec.c | 2 +- lib_dec/ivas_stereo_ica_dec.c | 2 +- lib_dec/ivas_stereo_icbwe_dec.c | 2 +- lib_dec/ivas_stereo_mdct_core_dec.c | 2 +- lib_dec/ivas_stereo_mdct_stereo_dec.c | 2 +- lib_dec/ivas_stereo_switching_dec.c | 2 +- lib_dec/ivas_stereo_td_dec.c | 2 +- lib_dec/ivas_svd_dec.c | 2 +- lib_dec/ivas_tcx_core_dec.c | 2 +- lib_dec/ivas_td_low_rate_dec.c | 2 +- lib_dec/jbm_jb4_circularbuffer.c | 2 +- lib_dec/jbm_jb4_circularbuffer.h | 2 +- lib_dec/jbm_jb4_inputbuffer.c | 2 +- lib_dec/jbm_jb4_inputbuffer.h | 2 +- lib_dec/jbm_jb4_jmf.c | 2 +- lib_dec/jbm_jb4_jmf.h | 2 +- lib_dec/jbm_jb4sb.c | 2 +- lib_dec/jbm_jb4sb.h | 2 +- lib_dec/jbm_pcmdsp_apa.c | 2 +- lib_dec/jbm_pcmdsp_apa.h | 2 +- lib_dec/jbm_pcmdsp_fifo.c | 2 +- lib_dec/jbm_pcmdsp_fifo.h | 2 +- lib_dec/jbm_pcmdsp_similarityestimation.c | 2 +- lib_dec/jbm_pcmdsp_similarityestimation.h | 2 +- lib_dec/jbm_pcmdsp_window.c | 2 +- lib_dec/jbm_pcmdsp_window.h | 2 +- lib_dec/lead_deindexing.c | 2 +- lib_dec/lib_dec.c | 2 +- lib_dec/lib_dec.h | 2 +- lib_dec/lp_exc_d.c | 2 +- lib_dec/lsf_dec.c | 2 +- lib_dec/lsf_msvq_ma_dec.c | 2 +- lib_dec/nelp_dec.c | 2 +- lib_dec/peak_vq_dec.c | 2 +- lib_dec/pit_dec.c | 2 +- lib_dec/pitch_extr.c | 2 +- lib_dec/post_dec.c | 2 +- lib_dec/ppp_dec.c | 2 +- lib_dec/pvq_core_dec.c | 2 +- lib_dec/pvq_decode.c | 2 +- lib_dec/range_dec.c | 2 +- lib_dec/re8_dec.c | 2 +- lib_dec/rom_dec.c | 2 +- lib_dec/rom_dec.h | 2 +- lib_dec/rst_dec.c | 2 +- lib_dec/stat_dec.h | 2 +- lib_dec/stat_noise_uv_dec.c | 2 +- lib_dec/swb_bwe_dec.c | 2 +- lib_dec/swb_bwe_dec_hr.c | 2 +- lib_dec/swb_bwe_dec_lr.c | 2 +- lib_dec/swb_tbe_dec.c | 2 +- lib_dec/syn_outp.c | 2 +- lib_dec/tcq_core_dec.c | 2 +- lib_dec/tcx_utils_dec.c | 2 +- lib_dec/tns_base_dec.c | 2 +- lib_dec/tonalMDCTconcealment.c | 2 +- lib_dec/transition_dec.c | 2 +- lib_dec/updt_dec.c | 2 +- lib_dec/vlpc_1st_dec.c | 2 +- lib_dec/vlpc_2st_dec.c | 2 +- lib_dec/voiced_dec.c | 2 +- lib_dec/waveadjust_fec_dec.c | 2 +- lib_enc/ACcontextMapping_enc.c | 2 +- lib_enc/FEC_enc.c | 2 +- lib_enc/SNR_calc.c | 2 +- lib_enc/acelp_core_enc.c | 2 +- lib_enc/acelp_core_switch_enc.c | 2 +- lib_enc/acelp_enc_util.c | 2 +- lib_enc/amr_wb_enc.c | 2 +- lib_enc/analy_lp.c | 2 +- lib_enc/analy_sp.c | 2 +- lib_enc/ari_enc.c | 2 +- lib_enc/ari_hm_enc.c | 2 +- lib_enc/arith_coder_enc.c | 2 +- lib_enc/avq_cod.c | 2 +- lib_enc/bass_psfilter_enc.c | 2 +- lib_enc/bw_detect.c | 2 +- lib_enc/cng_enc.c | 2 +- lib_enc/cod2t32.c | 2 +- lib_enc/cod4t64.c | 2 +- lib_enc/cod4t64_fast.c | 2 +- lib_enc/cod_ace.c | 2 +- lib_enc/cod_tcx.c | 2 +- lib_enc/cod_uv.c | 2 +- lib_enc/comvad_decision.c | 2 +- lib_enc/cor_shif.c | 2 +- lib_enc/core_enc_2div.c | 2 +- lib_enc/core_enc_init.c | 2 +- lib_enc/core_enc_ol.c | 2 +- lib_enc/core_enc_reconf.c | 2 +- lib_enc/core_enc_switch.c | 2 +- lib_enc/core_enc_updt.c | 2 +- lib_enc/core_switching_enc.c | 2 +- lib_enc/corr_xh.c | 2 +- lib_enc/decision_matrix_enc.c | 2 +- lib_enc/detect_transient.c | 2 +- lib_enc/diffcod.c | 2 +- lib_enc/dtx.c | 2 +- lib_enc/enc_acelp.c | 2 +- lib_enc/enc_acelp_tcx_main.c | 2 +- lib_enc/enc_acelpx.c | 2 +- lib_enc/enc_amr_wb.c | 2 +- lib_enc/enc_gain.c | 2 +- lib_enc/enc_gen_voic.c | 2 +- lib_enc/enc_gen_voic_rf.c | 2 +- lib_enc/enc_higher_acelp.c | 2 +- lib_enc/enc_nelp.c | 2 +- lib_enc/enc_pit_exc.c | 2 +- lib_enc/enc_ppp.c | 2 +- lib_enc/enc_prm.c | 2 +- lib_enc/enc_tran.c | 2 +- lib_enc/enc_uv.c | 2 +- lib_enc/energy.c | 2 +- lib_enc/eval_pit_contr.c | 2 +- lib_enc/evs_enc.c | 2 +- lib_enc/ext_sig_ana.c | 2 +- lib_enc/fd_cng_enc.c | 2 +- lib_enc/find_tar.c | 2 +- lib_enc/find_tilt.c | 2 +- lib_enc/find_uv.c | 2 +- lib_enc/find_wsp.c | 2 +- lib_enc/frame_spec_dif_cor_rate.c | 2 +- lib_enc/gain_enc.c | 2 +- lib_enc/gaus_enc.c | 2 +- lib_enc/gp_clip.c | 2 +- lib_enc/gs_enc.c | 2 +- lib_enc/guided_plc_enc.c | 2 +- lib_enc/hf_cod_amrwb.c | 2 +- lib_enc/hq_classifier_enc.c | 2 +- lib_enc/hq_core_enc.c | 2 +- lib_enc/hq_env_enc.c | 2 +- lib_enc/hq_hr_enc.c | 2 +- lib_enc/hq_lr_enc.c | 2 +- lib_enc/hvq_enc.c | 2 +- lib_enc/igf_enc.c | 2 +- lib_enc/igf_scf_enc.c | 2 +- lib_enc/init_enc.c | 2 +- lib_enc/inov_enc.c | 2 +- lib_enc/isf_enc_amr_wb.c | 2 +- lib_enc/ivas_agc_enc.c | 2 +- lib_enc/ivas_core_enc.c | 2 +- lib_enc/ivas_core_pre_proc.c | 2 +- lib_enc/ivas_core_pre_proc_front.c | 2 +- lib_enc/ivas_corecoder_enc_reconfig.c | 2 +- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_decision_matrix_enc.c | 2 +- lib_enc/ivas_dirac_enc.c | 2 +- lib_enc/ivas_enc.c | 2 +- lib_enc/ivas_enc_cov_handler.c | 2 +- lib_enc/ivas_entropy_coder.c | 2 +- lib_enc/ivas_front_vad.c | 2 +- lib_enc/ivas_init_enc.c | 2 +- lib_enc/ivas_ism_dtx_enc.c | 2 +- lib_enc/ivas_ism_enc.c | 2 +- lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_ism_param_enc.c | 2 +- lib_enc/ivas_lfe_enc.c | 2 +- lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_mc_param_enc.c | 2 +- lib_enc/ivas_mc_paramupmix_enc.c | 2 +- lib_enc/ivas_mcmasa_enc.c | 2 +- lib_enc/ivas_mct_core_enc.c | 2 +- lib_enc/ivas_mct_enc.c | 2 +- lib_enc/ivas_mct_enc_mct.c | 2 +- lib_enc/ivas_mdct_core_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 2 +- lib_enc/ivas_osba_enc.c | 2 +- lib_enc/ivas_pca_enc.c | 2 +- lib_enc/ivas_qmetadata_enc.c | 2 +- lib_enc/ivas_qspherical_enc.c | 2 +- lib_enc/ivas_range_uni_enc.c | 2 +- lib_enc/ivas_rom_enc.c | 2 +- lib_enc/ivas_rom_enc.h | 2 +- lib_enc/ivas_sba_enc.c | 2 +- lib_enc/ivas_sce_enc.c | 2 +- lib_enc/ivas_sns_enc.c | 2 +- lib_enc/ivas_spar_encoder.c | 2 +- lib_enc/ivas_spar_md_enc.c | 2 +- lib_enc/ivas_stat_enc.h | 2 +- lib_enc/ivas_stereo_adapt_GR_enc.c | 2 +- lib_enc/ivas_stereo_classifier.c | 2 +- lib_enc/ivas_stereo_cng_enc.c | 2 +- lib_enc/ivas_stereo_dft_enc.c | 2 +- lib_enc/ivas_stereo_dft_enc_itd.c | 2 +- lib_enc/ivas_stereo_dft_td_itd.c | 2 +- lib_enc/ivas_stereo_dmx_evs.c | 2 +- lib_enc/ivas_stereo_eclvq_enc.c | 2 +- lib_enc/ivas_stereo_ica_enc.c | 2 +- lib_enc/ivas_stereo_icbwe_enc.c | 2 +- lib_enc/ivas_stereo_mdct_core_enc.c | 2 +- lib_enc/ivas_stereo_mdct_igf_enc.c | 2 +- lib_enc/ivas_stereo_mdct_stereo_enc.c | 2 +- lib_enc/ivas_stereo_switching_enc.c | 2 +- lib_enc/ivas_stereo_td_analysis.c | 2 +- lib_enc/ivas_stereo_td_enc.c | 2 +- lib_enc/ivas_tcx_core_enc.c | 2 +- lib_enc/ivas_td_low_rate_enc.c | 2 +- lib_enc/lead_indexing.c | 2 +- lib_enc/lib_enc.c | 2 +- lib_enc/lib_enc.h | 2 +- lib_enc/long_enr.c | 2 +- lib_enc/lp_exc_e.c | 2 +- lib_enc/lsf_enc.c | 2 +- lib_enc/lsf_msvq_ma_enc.c | 2 +- lib_enc/ltd_stable.c | 2 +- lib_enc/mdct_classifier.c | 2 +- lib_enc/mdct_selector.c | 2 +- lib_enc/mslvq_enc.c | 2 +- lib_enc/multi_harm.c | 2 +- lib_enc/nelp_enc.c | 2 +- lib_enc/nois_est.c | 2 +- lib_enc/noise_adjust.c | 2 +- lib_enc/normalizecoefs.c | 2 +- lib_enc/peak_vq_enc.c | 2 +- lib_enc/pit_enc.c | 2 +- lib_enc/pitch_ol.c | 2 +- lib_enc/pitch_ol2.c | 2 +- lib_enc/plc_enc_ext.c | 2 +- lib_enc/ppp_enc.c | 2 +- lib_enc/pre_proc.c | 2 +- lib_enc/pvq_core_enc.c | 2 +- lib_enc/pvq_encode.c | 2 +- lib_enc/q_gain2p.c | 2 +- lib_enc/qlpc_avq.c | 2 +- lib_enc/qlpc_stoch.c | 2 +- lib_enc/range_enc.c | 2 +- lib_enc/re8_cod.c | 2 +- lib_enc/reordernorm.c | 2 +- lib_enc/rom_enc.c | 2 +- lib_enc/rom_enc.h | 2 +- lib_enc/rst_enc.c | 2 +- lib_enc/set_impulse.c | 2 +- lib_enc/setmodeindex.c | 2 +- lib_enc/sig_clas.c | 2 +- lib_enc/spec_center.c | 2 +- lib_enc/spec_flatness.c | 2 +- lib_enc/speech_music_classif.c | 2 +- lib_enc/stat_enc.h | 2 +- lib_enc/stat_noise_uv_enc.c | 2 +- lib_enc/subband_fft.c | 2 +- lib_enc/swb_bwe_enc.c | 2 +- lib_enc/swb_bwe_enc_hr.c | 2 +- lib_enc/swb_bwe_enc_lr.c | 2 +- lib_enc/swb_pre_proc.c | 2 +- lib_enc/swb_tbe_enc.c | 2 +- lib_enc/tcq_core_enc.c | 2 +- lib_enc/tcx_ltp_enc.c | 2 +- lib_enc/tcx_utils_enc.c | 2 +- lib_enc/tfa_enc.c | 2 +- lib_enc/tns_base_enc.c | 2 +- lib_enc/transient_detection.c | 2 +- lib_enc/transition_enc.c | 2 +- lib_enc/update_decision.c | 2 +- lib_enc/updt_enc.c | 2 +- lib_enc/updt_tar.c | 2 +- lib_enc/vad.c | 2 +- lib_enc/vad_param_updt.c | 2 +- lib_enc/vad_proc.c | 2 +- lib_enc/vbr_average_rate.c | 2 +- lib_enc/vlpc_1st_cod.c | 2 +- lib_enc/vlpc_2st_cod.c | 2 +- lib_enc/voiced_enc.c | 2 +- lib_enc/waveadjust_fec_cod.c | 2 +- lib_rend/ivas_MSPred.c | 2 +- lib_rend/ivas_NoiseGen.c | 2 +- lib_rend/ivas_PerceptualModel.c | 2 +- lib_rend/ivas_PredDecoder.c | 2 +- lib_rend/ivas_PredEncoder.c | 2 +- lib_rend/ivas_RMSEnvGrouping.c | 2 +- lib_rend/ivas_allrad_dec.c | 2 +- lib_rend/ivas_crend.c | 2 +- lib_rend/ivas_dirac_ana.c | 2 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 +- lib_rend/ivas_dirac_decorr_dec.c | 2 +- lib_rend/ivas_dirac_onsets_dec.c | 2 +- lib_rend/ivas_dirac_output_synthesis_dec.c | 2 +- lib_rend/ivas_dirac_rend.c | 2 +- lib_rend/ivas_efap.c | 2 +- lib_rend/ivas_hrtf.c | 2 +- lib_rend/ivas_lc3plus_common.c | 2 +- lib_rend/ivas_lc3plus_common.h | 2 +- lib_rend/ivas_lc3plus_dec.c | 2 +- lib_rend/ivas_lc3plus_dec.h | 2 +- lib_rend/ivas_lc3plus_enc.c | 2 +- lib_rend/ivas_lc3plus_enc.h | 2 +- lib_rend/ivas_lcld_decoder.c | 2 +- lib_rend/ivas_lcld_encoder.c | 2 +- lib_rend/ivas_lcld_prot.h | 2 +- lib_rend/ivas_lcld_rom_tables.c | 2 +- lib_rend/ivas_lcld_rom_tables.h | 2 +- lib_rend/ivas_limiter.c | 2 +- lib_rend/ivas_masa_merge.c | 2 +- lib_rend/ivas_mcmasa_ana.c | 2 +- lib_rend/ivas_objectRenderer.c | 2 +- lib_rend/ivas_objectRenderer_hrFilt.c | 2 +- lib_rend/ivas_objectRenderer_mix.c | 2 +- lib_rend/ivas_objectRenderer_sfx.c | 2 +- lib_rend/ivas_objectRenderer_sources.c | 2 +- lib_rend/ivas_objectRenderer_vec.c | 2 +- lib_rend/ivas_omasa_ana.c | 2 +- lib_rend/ivas_orient_trk.c | 2 +- lib_rend/ivas_output_init.c | 2 +- lib_rend/ivas_prot_rend.h | 2 +- lib_rend/ivas_reflections.c | 2 +- lib_rend/ivas_render_config.c | 2 +- lib_rend/ivas_reverb.c | 2 +- lib_rend/ivas_reverb_delay_line.c | 2 +- lib_rend/ivas_reverb_fft_filter.c | 2 +- lib_rend/ivas_reverb_filter_design.c | 2 +- lib_rend/ivas_reverb_iir_filter.c | 2 +- lib_rend/ivas_reverb_utils.c | 2 +- lib_rend/ivas_rom_TdBinauralRenderer.c | 2 +- lib_rend/ivas_rom_TdBinauralRenderer.h | 2 +- lib_rend/ivas_rom_binauralRenderer.c | 2 +- lib_rend/ivas_rom_binauralRenderer.h | 2 +- lib_rend/ivas_rom_binaural_crend_head.c | 2 +- lib_rend/ivas_rom_binaural_crend_head.h | 2 +- lib_rend/ivas_rom_rend.c | 2 +- lib_rend/ivas_rom_rend.h | 2 +- lib_rend/ivas_rotation.c | 2 +- lib_rend/ivas_sba_rendering.c | 2 +- lib_rend/ivas_shoebox.c | 2 +- lib_rend/ivas_splitRend_lcld_dec.c | 2 +- lib_rend/ivas_splitRend_lcld_enc.c | 2 +- lib_rend/ivas_splitRendererPLC.c | 2 +- lib_rend/ivas_splitRendererPost.c | 2 +- lib_rend/ivas_splitRendererPre.c | 2 +- lib_rend/ivas_splitRenderer_utils.c | 2 +- lib_rend/ivas_stat_rend.h | 2 +- lib_rend/ivas_td_decorr.c | 2 +- lib_rend/ivas_vbap.c | 2 +- lib_rend/lib_rend.c | 2 +- lib_rend/lib_rend.h | 2 +- lib_util/audio_file_reader.c | 2 +- lib_util/audio_file_reader.h | 2 +- lib_util/audio_file_writer.c | 2 +- lib_util/audio_file_writer.h | 2 +- lib_util/bitstream_reader.c | 2 +- lib_util/bitstream_reader.h | 2 +- lib_util/bitstream_writer.c | 2 +- lib_util/bitstream_writer.h | 2 +- lib_util/cmdl_tools.c | 2 +- lib_util/cmdl_tools.h | 2 +- lib_util/cmdln_parser.c | 2 +- lib_util/cmdln_parser.h | 2 +- lib_util/evs_rtp_payload.c | 2 +- lib_util/evs_rtp_payload.h | 2 +- lib_util/g192.c | 2 +- lib_util/g192.h | 2 +- lib_util/hrtf_file_reader.c | 2 +- lib_util/hrtf_file_reader.h | 2 +- lib_util/ism_file_reader.c | 2 +- lib_util/ism_file_reader.h | 2 +- lib_util/ism_file_writer.c | 2 +- lib_util/ism_file_writer.h | 2 +- lib_util/jbm_file_reader.c | 2 +- lib_util/jbm_file_reader.h | 2 +- lib_util/jbm_file_writer.c | 2 +- lib_util/jbm_file_writer.h | 2 +- lib_util/ls_custom_file_reader.c | 2 +- lib_util/ls_custom_file_reader.h | 2 +- lib_util/masa_file_reader.c | 2 +- lib_util/masa_file_reader.h | 2 +- lib_util/masa_file_writer.c | 2 +- lib_util/masa_file_writer.h | 2 +- lib_util/mime_io.c | 2 +- lib_util/mime_io.h | 2 +- lib_util/render_config_reader.c | 2 +- lib_util/render_config_reader.h | 2 +- lib_util/rotation_file_reader.c | 2 +- lib_util/rotation_file_reader.h | 2 +- lib_util/rtpdump.c | 2 +- lib_util/rtpdump.h | 2 +- lib_util/split_rend_bfi_file_reader.c | 2 +- lib_util/split_rend_bfi_file_reader.h | 2 +- lib_util/split_render_file_read_write.c | 2 +- lib_util/split_render_file_read_write.h | 2 +- lib_util/tinywavein_c.h | 2 +- lib_util/tinywaveout_c.h | 2 +- lib_util/tsm_scale_file_reader.c | 2 +- lib_util/tsm_scale_file_reader.h | 2 +- lib_util/vector3_pair_file_reader.c | 2 +- lib_util/vector3_pair_file_reader.h | 2 +- readme.txt | 2 +- readme_split_rendering.txt | 2 +- scripts/IvasBuildAndRun.py | 2 +- scripts/IvasBuildAndRunChecks.py | 2 +- scripts/README.md | 2 +- scripts/batch_comp_audio.py | 2 +- scripts/binauralRenderer_interface/README.md | 2 +- .../Table_Format_Converter/generate_tables_from_rom_to_bin.c | 2 +- .../Table_Format_Converter/tables_format_converter_readme.txt | 2 +- scripts/binauralRenderer_interface/config_reader.c | 2 +- scripts/binauralRenderer_interface/config_reader.h | 2 +- .../fastconv/generate_BRIR_CLDFB_FASTCONV.m | 2 +- .../fastconv/generate_tables_for_fastconv.m | 2 +- .../fastconv/get_ivas_binary_header.m | 2 +- scripts/binauralRenderer_interface/fastconv/td2cldfb.m | 2 +- .../fastconv/write_fastconv_binary_data.m | 2 +- .../fastconv/write_fastconv_rom_table.m | 2 +- .../generate_crend_ivas_tables_from_sofa.c | 2 +- .../generate_ivas_binauralizer_tables_from_sofa.m | 2 +- ...e_ivas_binauralizer_tables_from_sofa_test_other_database.m | 2 +- .../ivas_crend_binaural_filter_design.c | 2 +- .../ivas_crend_binaural_filter_design.h | 2 +- .../binauralRenderer_interface/ivas_license_header.template | 2 +- .../ivas_rom_binaural_crend_head.template | 2 +- .../matlab_hrir_generation_scripts/SD_2_ROM.m | 2 +- .../matlab_hrir_generation_scripts/SHD_2_ROM.m | 2 +- .../matlab_hrir_generation_scripts/SOFA_save.m | 2 +- .../matlab_hrir_generation_scripts/SOFA_save_to_mat.m | 2 +- .../compute_lr_energies_and_iac.m | 2 +- .../matlab_hrir_generation_scripts/convert_SD2SHD_HRIRs.m | 2 +- .../matlab_hrir_generation_scripts/fir_to_cldfb_fir.m | 2 +- .../generate_HOA_HRIRs_MOD_lens.m | 2 +- .../generate_lr_energies_and_iac.m | 2 +- .../matlab_hrir_generation_scripts/generate_rom_tables.m | 4 ++-- .../matlab_hrir_generation_scripts/get_allpass_IRs.m | 2 +- .../matlab_hrir_generation_scripts/get_cldfb_filter.m | 2 +- .../matlab_hrir_generation_scripts/get_ls_layout_config.m | 2 +- .../matlab_hrir_generation_scripts/hrtf_library_loader.m | 2 +- .../matlab_hrir_generation_scripts/m_dft.m | 2 +- .../matlab_hrir_generation_scripts/m_hilbert.m | 2 +- .../matlab_hrir_generation_scripts/m_idft.m | 2 +- .../matlab_hrir_generation_scripts/mag2min_phase.m | 2 +- .../matlab_hrir_generation_scripts/make_unit_vectors.m | 2 +- .../matlab_hrir_generation_scripts/writeData3L.m | 2 +- .../mixer_conv_sofa_to_rom_table_converter_readme.txt | 2 +- .../binauralRenderer_interface/param_bin/SH_GainComputation.m | 2 +- .../param_bin/generate_BRIR_in_SHD_CLDFB_PARAMETRIC.m | 2 +- .../param_bin/generate_HRIR_in_SHD_CLDFB_PARAMETRIC.m | 2 +- .../param_bin/generate_tables_for_parametric_binauralizer.m | 2 +- .../param_bin/write_parametric_binauralizer_binary_data.m | 2 +- scripts/check-format.sh | 2 +- scripts/cut_bs.py | 2 +- scripts/find_unused_symbols.sh | 2 +- scripts/parse_options_h.sh | 2 +- scripts/parse_selftest_summary.py | 2 +- scripts/patch_code_headers.sh | 4 ++-- scripts/plot_meta_data.py | 2 +- scripts/prepare_combined_format_inputs.py | 2 +- scripts/prepare_delivery.sh | 2 +- scripts/prepare_instrumentation.sh | 2 +- scripts/pyaudio3dtools/__init__.py | 2 +- scripts/pyaudio3dtools/audio3dtools.py | 2 +- scripts/pyaudio3dtools/audioarray.py | 2 +- scripts/pyaudio3dtools/audiofile.py | 2 +- scripts/pyaudio3dtools/constants.py | 2 +- scripts/pyaudio3dtools/spatialaudioformat.py | 2 +- scripts/pyivastest/IvasBaseClass.py | 2 +- scripts/pyivastest/IvasModeAnalyzer.py | 2 +- scripts/pyivastest/IvasModeCollector.py | 2 +- scripts/pyivastest/IvasModeRunner.py | 2 +- scripts/pyivastest/IvasScriptsCommon.py | 2 +- scripts/pyivastest/IvasSvnBuilder.py | 2 +- scripts/pyivastest/__init__.py | 2 +- scripts/pyivastest/constants.py | 2 +- scripts/pyivastest/ivas_svn.py | 2 +- scripts/reverb/generate_acoustic_environments_metadata.py | 2 +- scripts/reverb/text_to_binary_payload.py | 2 +- scripts/runIvasCodec.py | 2 +- scripts/self_test.py | 2 +- scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c | 2 +- .../lc3plus/ivas_lc3plus_unit_test_selective_decoding.c | 2 +- scripts/strip_defines_cppp.sh | 2 +- scripts/strip_split_rendering.py | 2 +- scripts/strip_split_rendering.sh | 2 +- .../td_object_renderer/modeling_tool/Gen_Hrf_IVAS_Binary.m | 4 ++-- scripts/td_object_renderer/modeling_tool/HrfModBsp_Config.m | 2 +- scripts/td_object_renderer/modeling_tool/HrfModBsp_InitPath.m | 2 +- scripts/td_object_renderer/modeling_tool/Mod_Hrf_Itd_Main.m | 2 +- scripts/td_object_renderer/modeling_tool/README.md | 2 +- .../modeling_tool/evaluation/HrfModBspTdFir_InterpHrf.m | 2 +- .../modeling_tool/evaluation/evaluation_BspTdFir.m | 2 +- .../modeling_tool/modeling/BSplineAngCircFun.m | 2 +- .../td_object_renderer/modeling_tool/modeling/BSplineAngFun.m | 2 +- .../td_object_renderer/modeling_tool/modeling/BSplineFunc.m | 2 +- .../td_object_renderer/modeling_tool/modeling/BSplineItdFun.m | 2 +- .../modeling_tool/modeling/BSplineLSMod_HrfInterpTdFir.m | 2 +- .../modeling_tool/modeling/BSplineLSMod_ItdInterpTdFir.m | 2 +- .../modeling_tool/modeling/BSplineRemoveZeroBasis.m | 2 +- .../modeling_tool/modeling/BSplineSampMat.m | 2 +- .../modeling_tool/modeling/BSplineSampVec.m | 2 +- .../modeling_tool/modeling/BSplineSampVecITD.m | 2 +- .../td_object_renderer/modeling_tool/modeling/Mod_Hrf_Itd.m | 2 +- .../modeling_tool/modeling/SplitAngleData.m | 2 +- .../td_object_renderer/modeling_tool/modeling/frac_delay.m | 2 +- .../modeling_tool/modeling/modeling_BspTdFir.m | 2 +- .../td_object_renderer/modeling_tool/preprocessing/EstDelay.m | 2 +- .../modeling_tool/preprocessing/data_SOFA.m | 2 +- .../modeling_tool/spat_area/SpatArea_EvalElevAzimSet.m | 2 +- .../modeling_tool/spat_area/SpatArea_EvalInnProdWeights.m | 2 +- .../modeling_tool/spat_area/SpatArea_EvalSetDistr.m | 2 +- .../modeling_tool/spat_area/SpatArea_EvalSpatArea.m | 2 +- .../modeling_tool/spat_area/SpatArea_EvalTrainTestSets.m | 2 +- tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py | 2 +- tests/codec_be_on_mr_nonselection/test_param_file.py | 2 +- tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py | 2 +- tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py | 2 +- tests/codec_be_on_mr_selection/__init__.py | 2 +- tests/codec_be_on_mr_selection/constants.py | 2 +- tests/codec_be_on_mr_selection/test_experiments.py | 2 +- tests/conftest.py | 2 +- tests/create_short_testvectors.py | 2 +- tests/cut_pcm.py | 2 +- tests/hrtf_binary_loading/__init__.py | 2 +- tests/hrtf_binary_loading/conftest.py | 2 +- tests/hrtf_binary_loading/constants.py | 2 +- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 2 +- tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py | 2 +- tests/hrtf_binary_loading/utils.py | 2 +- tests/prepare_pytests.py | 2 +- tests/renderer/__init__.py | 2 +- tests/renderer/compare_audio.py | 2 +- tests/renderer/conftest.py | 2 +- tests/renderer/constants.py | 2 +- tests/renderer/data/renderer_config_format_readme.txt | 2 +- tests/renderer/test_renderer.py | 2 +- tests/renderer/utils.py | 2 +- tests/run_pytests.py | 2 +- tests/split_rendering/__init__.py | 2 +- tests/split_rendering/conftest.py | 2 +- tests/split_rendering/constants.py | 2 +- tests/split_rendering/test_split_rendering.py | 2 +- tests/split_rendering/utils.py | 2 +- tests/test_26444.py | 2 +- tests/test_param_file_ltv.py | 2 +- tests/testconfig.py | 2 +- 856 files changed, 859 insertions(+), 859 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index aa9c35e4f9..1c60a85b1a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ /****************************************************************************************************** - (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 diff --git a/apps/decoder.c b/apps/decoder.c index c93d717250..2db008afa5 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1,6 +1,6 @@ /****************************************************************************************************** - (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 diff --git a/apps/encoder.c b/apps/encoder.c index 21aa5d0b1d..882187601b 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -1,6 +1,6 @@ /****************************************************************************************************** - (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 diff --git a/apps/renderer.c b/apps/renderer.c index e230082ca8..d3c4c2c60f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1,6 +1,6 @@ /****************************************************************************************************** - (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 diff --git a/ci/build_all_linux.sh b/ci/build_all_linux.sh index 47ad54dc42..63beef18f0 100755 --- a/ci/build_all_linux.sh +++ b/ci/build_all_linux.sh @@ -1,6 +1,6 @@ #! /usr/bin/bash -# (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 diff --git a/ci/build_codec_instrumented_linux.sh b/ci/build_codec_instrumented_linux.sh index 7c4da0a7f5..2ff293c613 100755 --- a/ci/build_codec_instrumented_linux.sh +++ b/ci/build_codec_instrumented_linux.sh @@ -1,6 +1,6 @@ #! /usr/bin/bash -# (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 diff --git a/ci/build_codec_sanitizers_linux.sh b/ci/build_codec_sanitizers_linux.sh index d352fa32ec..f599d607ca 100755 --- a/ci/build_codec_sanitizers_linux.sh +++ b/ci/build_codec_sanitizers_linux.sh @@ -1,6 +1,6 @@ #! /usr/bin/bash -# (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 diff --git a/ci/combine_genpatt_and_jbm_profile.py b/ci/combine_genpatt_and_jbm_profile.py index b039ceb990..dd3ffe5858 100644 --- a/ci/combine_genpatt_and_jbm_profile.py +++ b/ci/combine_genpatt_and_jbm_profile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ - (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 diff --git a/ci/complexity_measurements/genWebpageData_Ram.csh b/ci/complexity_measurements/genWebpageData_Ram.csh index d6e5a842e3..c0e3eab411 100755 --- a/ci/complexity_measurements/genWebpageData_Ram.csh +++ b/ci/complexity_measurements/genWebpageData_Ram.csh @@ -1,6 +1,6 @@ #!/bin/tcsh -# (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 diff --git a/ci/complexity_measurements/genWebpageData_Rom.csh b/ci/complexity_measurements/genWebpageData_Rom.csh index 801dfda724..d2ed0b3f94 100755 --- a/ci/complexity_measurements/genWebpageData_Rom.csh +++ b/ci/complexity_measurements/genWebpageData_Rom.csh @@ -1,6 +1,6 @@ #!/bin/tcsh -# (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 diff --git a/ci/complexity_measurements/genWebpageData_WMOPS.csh b/ci/complexity_measurements/genWebpageData_WMOPS.csh index 4993ae81f2..8e052210c8 100755 --- a/ci/complexity_measurements/genWebpageData_WMOPS.csh +++ b/ci/complexity_measurements/genWebpageData_WMOPS.csh @@ -1,6 +1,6 @@ #!/bin/tcsh -# (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 diff --git a/ci/complexity_measurements/genWebpageData_WmopPerOperatingpoint.csh b/ci/complexity_measurements/genWebpageData_WmopPerOperatingpoint.csh index 3d9d9d448c..906d08c949 100755 --- a/ci/complexity_measurements/genWebpageData_WmopPerOperatingpoint.csh +++ b/ci/complexity_measurements/genWebpageData_WmopPerOperatingpoint.csh @@ -1,6 +1,6 @@ #!/bin/tcsh -# (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 diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index e81575892b..22ca8335fb 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -1,6 +1,6 @@ #! /bin/bash -# (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 diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index 0e2ec822fa..c4972eff5d 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -1,7 +1,7 @@ t */ -#ifdef FIX_969_USAN_IGF_ARITH int16_t pred; uint16_t pred_tmp; -#else - uint16_t pred; -#endif int16_t f, ctx, ctx_f, ctx_t; for ( f = 0; f < length; f++ ) @@ -226,12 +222,8 @@ static void decode_sfe_vector( if ( f == 0 ) { /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ -#ifdef FIX_969_USAN_IGF_ARITH ari_decode_14bits_s27_ext( st, &pred_tmp, &hPrivateData->acState, hPrivateData->cf_se00 ); pred = (int16_t) pred_tmp; -#else - ari_decode_14bits_s27_ext( st, &pred, &hPrivateData->acState, hPrivateData->cf_se00 ); -#endif x[f] = pred << 2; x[f] += arith_decode_bits( &hPrivateData->acState, st, 2 ); /* LSBs as 2 bit raw */ } -- GitLab From 6355bea61cdddbf82542fa0f1c6e4939ecad9c5f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:57:48 +0100 Subject: [PATCH 222/498] [cleanup] accept FIX_959_MASA_LINEAR_REND --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 17 ----------------- lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 22 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a33e9fcbb6..15aeeb449f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b1ce3d481c..3554697282 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1134,24 +1134,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifndef FIX_959_MASA_LINEAR_REND - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) - { - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - for ( n = 0; n < nchan_remapped; n++ ) - { - mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered ); - } - - if ( ( error = ivas_sba_linear_renderer( p_output, *nSamplesRendered, nchan_remapped, 0, output_config, st_ivas->hOutSetup ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) -#else if ( st_ivas->renderer_type == RENDERER_DIRAC ) -#endif { ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f050edde6a..f2241ac808 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -375,11 +375,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; } -#ifdef FIX_959_MASA_LINEAR_REND *renderer_type = RENDERER_SBA_LINEAR_DEC; -#else - st_ivas->renderer_type = RENDERER_SBA_LINEAR_DEC; -#endif } else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || ( ivas_format == SBA_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_MONO ) ) ) -- GitLab From e2f57c77317a2e0d139f6056c3bce14443b07eea Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:58:34 +0100 Subject: [PATCH 223/498] [cleanup] accept NONBE_FIX_BINARY_BINAURAL_READING --- apps/decoder.c | 68 ----------- apps/renderer.c | 33 ------ lib_com/ivas_error.h | 4 - lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 - lib_dec/lib_dec.c | 32 ----- lib_dec/lib_dec.h | 16 --- lib_rend/ivas_crend.c | 20 ---- lib_rend/ivas_hrtf.c | 4 - lib_rend/ivas_objectRenderer.c | 4 - lib_rend/ivas_objectRenderer_mix.c | 11 -- lib_rend/ivas_stat_rend.h | 12 -- lib_rend/lib_rend.c | 166 -------------------------- lib_rend/lib_rend.h | 4 - lib_util/hrtf_file_reader.c | 180 ----------------------------- lib_util/hrtf_file_reader.h | 21 ---- 16 files changed, 580 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ba01a78d2f..00efa03735 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -196,13 +196,11 @@ 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; #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #endif -#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -715,16 +713,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 ) @@ -737,16 +731,8 @@ 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 #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#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 ) @@ -755,25 +741,14 @@ int main( 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 ) @@ -786,20 +761,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 ) @@ -812,26 +781,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 ) @@ -844,16 +801,8 @@ int main( destroy_parambin_hrtf( hHrtfParambin ); } } -#else - if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -871,13 +820,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#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 } @@ -955,19 +897,9 @@ 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 ); diff --git a/apps/renderer.c b/apps/renderer.c index 9a5088afdb..e95f5d5adb 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -743,14 +743,12 @@ int main( #endif Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif #endif IsmPositionProvider *positionProvider; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; @@ -804,10 +802,8 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT hSplitRendFileReadWrite = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING CLDFBframeSize_smpls = 0; cldfb_in_flag = 0; -#endif #endif for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { @@ -881,16 +877,6 @@ int main( } } -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - if ( !isEmptyString( args.customHrtfFilePath ) ) - { - if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error opening file: %s\n", args.customHrtfFilePath ); - exit( -1 ); - } - } -#endif if ( !isEmptyString( args.renderConfigFilePath ) ) { @@ -1016,17 +1002,12 @@ int main( #endif const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( !isEmptyString( args.customHrtfFilePath ) ) { if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) @@ -1147,7 +1128,6 @@ int main( hrtfFileReader_close( &hrtfFileReader ); } -#endif /* === Configure === */ if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) @@ -1156,12 +1136,6 @@ int main( exit( -1 ); } -#ifndef NONBE_FIX_BINARY_BINAURAL_READING -#ifdef SPLIT_REND_WITH_HEAD_ROT - CLDFBframeSize_smpls = 0; - cldfb_in_flag = 0; -#endif -#endif if ( args.renderConfigFilePath[0] != '\0' ) { IVAS_RENDER_CONFIG_DATA renderConfig; @@ -2223,9 +2197,7 @@ int main( free( outInt16Buffer ); free( outFloatBuffer ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING cleanup: -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( bitsBufferData != NULL ) @@ -2258,15 +2230,10 @@ cleanup: RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - hrtfFileReader_close( &hrtfFileReader ); -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING destroy_td_hrtf( hHrtfTD ); destroy_SetOfHRTF( hSetOfHRTF ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES destroy_hrtf_statistics( hHrtfStatistics ); -#endif #endif IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 36d3fd3933..8440a13e0f 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -78,9 +78,7 @@ typedef enum IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_INVALID_HRTF, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, -#endif IVAS_ERR_INVALID_INPUT_FORMAT, IVAS_ERR_INVALID_INDEX, IVAS_ERR_NOT_SUPPORTED_OPTION, @@ -260,10 +258,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Acoustic environment not supported"; case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA: return "Renderer data missing in HRTF binary file"; -#endif case IVAS_ERR_INVALID_INPUT_FORMAT: return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: diff --git a/lib_com/options.h b/lib_com/options.h index 15aeeb449f..037cea8e5b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_BINARY_BINAURAL_READING /* Orange: Add support for reading binaural binary file */ #define NONBE_FIX_AVG_IAC_CLDFB_REVERB /* Orange: Add computation avg energy and iac tables for rom and binaural binary file */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 24ba618a3c..dacc54670a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2723,12 +2723,8 @@ void ivas_destroy_dec( { ivas_td_binaural_close( &st_ivas->hBinRendererTd ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( st_ivas->hHrtfTD != NULL ) -#else - else if ( st_ivas->hHrtfTD != NULL ) -#endif { BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 405a7bf997..afba5a8aff 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1882,11 +1882,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfTD == NULL ) @@ -1894,11 +1890,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfTD = &hIvasDec->st_ivas->hHrtfTD; -#else - *hHrtfTD = hIvasDec->st_ivas->hHrtfTD; -#endif return IVAS_ERR_OK; } @@ -1912,11 +1904,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* o : Set of HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) @@ -1924,11 +1912,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; -#else - *hSetOfHRTF = hIvasDec->st_ivas->hSetOfHRTF; -#endif return IVAS_ERR_OK; } @@ -1942,11 +1926,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( ivas_error IVAS_DEC_GetHrtfFastConvHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* o : FASTCONV HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfFastConv == NULL ) @@ -1954,11 +1934,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfFastConv = &hIvasDec->st_ivas->hHrtfFastConv; -#else - *hHrtfFastConv = hIvasDec->st_ivas->hHrtfFastConv; -#endif return IVAS_ERR_OK; } @@ -1972,11 +1948,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfParambin == NULL ) @@ -1984,11 +1956,7 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfParambin = &hIvasDec->st_ivas->hHrtfParambin; -#else - *hHrtfParambin = hIvasDec->st_ivas->hHrtfParambin; -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 882ac57f22..eafd391b14 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -406,39 +406,23 @@ ivas_error IVAS_DEC_FeedCustomLsData( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ -#endif ); /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* o : Set of HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv/* o : FASTCONV HRTF handle */ -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* o : FASTCONV HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin/* o : Parametric binauralizer HRTF handle */ -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#endif ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index e53535cdfc..988a9ecde7 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -91,9 +91,7 @@ ivas_error ivas_hrtf_init( hHrtf->pOut_to_bin_diffuse_im[j] = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 1; -#endif return IVAS_ERR_OK; } @@ -212,7 +210,6 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( hSetOfHRTF == NULL ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) || @@ -220,13 +217,8 @@ static ivas_error ivas_rend_initCrend( ( ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_FOA ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#else - if ( hSetOfHRTF == NULL ) -#endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 1; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -701,9 +693,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 0; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -711,24 +701,20 @@ static ivas_error ivas_rend_initCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_brir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_brir_combined->index_frequency_max_diffuse; } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_combined->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_combined->index_frequency_max_diffuse; @@ -804,12 +790,10 @@ static ivas_error ivas_rend_initCrend( { if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa3->index_frequency_max_diffuse; @@ -835,12 +819,10 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa2->index_frequency_max_diffuse; @@ -866,12 +848,10 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_foa->index_frequency_max_diffuse; diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 1f943595be..ec40720466 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -57,9 +57,7 @@ ivas_error ivas_HRTF_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary!" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING set_c( (int8_t *) ( *hHrtfTD ), 0, (int32_t) sizeof( TDREND_HRFILT_FiltSet_t ) ); -#endif return IVAS_ERR_OK; } @@ -190,9 +188,7 @@ ivas_error ivas_HRTF_parambin_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for parametric binauralizer HRTF tables!" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING set_c( (int8_t *) ( *hHrtfParambin ), 0, (int32_t) sizeof( HRTFS_PARAMBIN ) ); -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 4cf67ea6e0..2ba42cac6d 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -672,11 +672,7 @@ ivas_error ivas_td_binaural_open_ext( directivity = hRendCfg->directivity; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#else - return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#endif } diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 9b5d2ba03e..7fb2a06ad3 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -145,11 +145,7 @@ void TDREND_MIX_Dealloc( hBinRendererTd->Listener_p = NULL; } /* Dealloc HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hBinRendererTd->pHrFiltSet_p != NULL ) && ( hBinRendererTd->HrFiltSet_p != NULL ) ) -#else - if ( hBinRendererTd->HrFiltSet_p != NULL ) -#endif { if ( hBinRendererTd->HrFiltSet_p->FilterMethod == TDREND_HRFILT_Method_BSplineModel ) { @@ -179,17 +175,12 @@ void TDREND_MIX_Dealloc( } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == 1 ) { free( hBinRendererTd->HrFiltSet_p ); hBinRendererTd->HrFiltSet_p = NULL; *hBinRendererTd->pHrFiltSet_p = NULL; } -#else - free( hBinRendererTd->HrFiltSet_p ); - hBinRendererTd->HrFiltSet_p = NULL; -#endif } return; @@ -253,9 +244,7 @@ ivas_error TDREND_MIX_Init( hBinRendererTd->HrFiltSet_p = *hHrtfTD; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hBinRendererTd->pHrFiltSet_p = hHrtfTD; -#endif if ( hBinRendererTd->HrFiltSet_p->SampleRate != output_Fs ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 35ee806739..fde7b70bc1 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1160,9 +1160,7 @@ typedef struct ivas_binaural_td_rendering_struct float Gain; /* Mixer gain */ TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* pointer to HR filter set */ -#endif int16_t UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ int16_t DistAttenEnabled; /* (TRUE/FALSE) */ @@ -1174,11 +1172,7 @@ typedef struct { int32_t binaural_latency_ns; BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING TDREND_HRFILT_FiltSet_t **hHrtfTD; -#else - TDREND_HRFILT_FiltSet_t *hHrtfTD; -#endif } TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE; @@ -1201,9 +1195,7 @@ typedef struct ivas_hrtfs_structure uint16_t index_frequency_max_diffuse; int16_t max_num_ir; int16_t max_num_iterations; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t init_from_rom; -#endif float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int16_t same_inv_diffuse_weight; float gain_lfe; @@ -1650,11 +1642,7 @@ typedef struct ivas_masa_external_rendering_struct #endif REVERB_STRUCT_HANDLE hReverb; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING HRTFS_PARAMBIN_HANDLE *hHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif VBAP_HANDLE hVBAPdata; float *hoa_dec_mtx; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index bbc8441067..ea12814700 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -66,11 +66,7 @@ #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #define MAX_BIN_DELAY_SAMPLES 150 /* Maximum supported rendering latency for binaural IRs */ -#else -#define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ -#endif /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 5 @@ -227,7 +223,6 @@ typedef struct MASA_PREREND_HANDLE hMasaPrerend; } input_masa; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING typedef struct hrtf_handles { IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; @@ -238,7 +233,6 @@ typedef struct hrtf_handles IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; #endif } hrtf_handles; -#endif struct IVAS_REND { @@ -278,14 +272,7 @@ struct IVAS_REND RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ int16_t num_subframes; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hrtf_handles hHrtfs; -#else - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; - IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; - IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; - IVAS_DEC_HRTF_HANDLE hHrtfTD; -#endif }; @@ -293,15 +280,11 @@ struct IVAS_REND * Local function prototypes *-------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, const RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hHrtfs ); #else static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, hrtf_handles *hHrtfs ); #endif -#else -static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig ); -#endif static void freeMasaExtRenderer( MASA_EXT_REND_HANDLE *hMasaExtRendOut ); @@ -1354,9 +1337,6 @@ static ivas_error initIsmMasaRendering( if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1380,12 +1360,8 @@ static ivas_error setRendInputActiveIsm( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { ivas_error error; @@ -1425,18 +1401,14 @@ static ivas_error setRendInputActiveIsm( for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) { inputIsm->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#endif } #endif inputIsm->hOMasa = NULL; error = IVAS_ERR_OK; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -1445,14 +1417,10 @@ static ivas_error setRendInputActiveIsm( #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif { return error; @@ -1521,14 +1489,10 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #endif { return error; @@ -1566,18 +1530,12 @@ static void clearInputIsm( if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) { ivas_td_binaural_close( &inputIsm->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } #endif @@ -2221,11 +2179,9 @@ static ivas_error initMcBinauralRendering( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hMixconv, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif #endif uint8_t reconfigureFlag ) { @@ -2257,9 +2213,6 @@ static ivas_error initMcBinauralRendering( if ( !reconfigureFlag || ( !useTDRend && inputMc->tdRendWrapper.hBinRendererTd != NULL ) ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2270,9 +2223,6 @@ static ivas_error initMcBinauralRendering( if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } } @@ -2343,7 +2293,6 @@ static ivas_error initMcBinauralRendering( { /* open CREND */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) @@ -2352,19 +2301,11 @@ static ivas_error initMcBinauralRendering( outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) #endif #else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, outSampleRate ) ) != IVAS_ERR_OK ) #endif -#else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2403,9 +2344,6 @@ static ivas_error initMcMasaRendering( if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2493,12 +2431,8 @@ static ivas_error setRendInputActiveMc( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2536,13 +2470,11 @@ static ivas_error setRendInputActiveMc( inputMc->customLsInput = defaultCustomLs(); inputMc->tdRendWrapper = defaultTdRendWrapper(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->tdRendWrapper.binaural_latency_ns = (int32_t) ( hrtfs->hHrtfTD->latency_s * 1000000000.f ); } inputMc->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#endif inputMc->crendWrapper = NULL; inputMc->hReverb = NULL; inputMc->hMcMasa = NULL; @@ -2563,13 +2495,11 @@ static ivas_error setRendInputActiveMc( for ( i = 0; i < (int16_t) ( sizeof( inputMc->splitTdRendWrappers ) / sizeof( *inputMc->splitTdRendWrappers ) ); ++i ) { inputMc->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->splitTdRendWrappers[i].binaural_latency_ns = (int32_t) ( hrtfs->hHrtfTD->latency_s * 1000000000.f ); } inputMc->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#endif } if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) @@ -2577,14 +2507,10 @@ static ivas_error setRendInputActiveMc( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) #else if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, FALSE ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, FALSE ) ) != IVAS_ERR_OK ) #endif { return error; @@ -2639,9 +2565,6 @@ static void clearInputMc( if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2650,9 +2573,6 @@ static void clearInputMc( if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } #endif @@ -2785,16 +2705,12 @@ static ivas_error updateSplitPostRendPanGains( static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES , IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics #endif -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { ivas_error error; @@ -2854,7 +2770,6 @@ static ivas_error updateSbaPanGains( else #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) @@ -2867,13 +2782,6 @@ static ivas_error updateSbaPanGains( #else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2887,7 +2795,6 @@ static ivas_error updateSbaPanGains( return error; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) @@ -2900,13 +2807,6 @@ static ivas_error updateSbaPanGains( #else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2939,7 +2839,6 @@ static ivas_error setRendInputActiveSplitPostRend( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , #if defined _MSC_VER && !defined __clang__ #ifdef _MSC_VER @@ -2952,7 +2851,6 @@ static ivas_error setRendInputActiveSplitPostRend( #else hrtf_handles *hrtfs __attribute__( ( unused ) ) /* avoid unused parameter warning when compiling with clang */ #endif -#endif ) { ivas_error error; @@ -3007,12 +2905,8 @@ static ivas_error setRendInputActiveSba( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { ivas_error error; @@ -3055,9 +2949,7 @@ static ivas_error setRendInputActiveSba( { initRotGains( inputSba->rot_gains_prev[pos_idx] ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputSba->cldfbRendWrapper.hHrtfFastConv = hrtfs->hHrtfFastConv; -#endif #else inputSba->crendWrapper = NULL; inputSba->hDirAC = NULL; @@ -3072,14 +2964,10 @@ static ivas_error setRendInputActiveSba( } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) #else if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) #endif { return error; @@ -3154,12 +3042,8 @@ static ivas_error setRendInputActiveMasa( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ) #else @@ -3205,14 +3089,10 @@ static ivas_error setRendInputActiveMasa( } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hRendCfg, hrtfs ) ) != IVAS_ERR_OK ) #else if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = initMasaExtRenderer( inputMasa, outConfig ) ) != IVAS_ERR_OK ) #endif { return error; @@ -3309,9 +3189,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, -#endif const int16_t nonDiegeticPan, const float nonDiegeticPanGain, const int16_t num_subframes ) @@ -3478,7 +3356,6 @@ ivas_error IVAS_REND_Open( } #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; @@ -3516,7 +3393,6 @@ ivas_error IVAS_REND_Open( { return error; } -#endif #endif return IVAS_ERR_OK; @@ -3663,14 +3539,10 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( continue; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL, NULL ) ) != IVAS_ERR_OK ) #else if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) #endif { return error; @@ -3997,11 +3869,7 @@ ivas_error IVAS_REND_AddInput( int32_t maxNumInputsOfType; void *inputsArray; int32_t inputStructSize; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles * ); -#else - ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); -#endif int32_t inputIndex; /* Validate function arguments */ @@ -4073,11 +3941,7 @@ ivas_error IVAS_REND_AddInput( } *inputId = makeInputId( inConfig, inputIndex ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -4146,11 +4010,9 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif #endif FALSE ) ) != IVAS_ERR_OK ) { @@ -4995,11 +4857,9 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif #endif TRUE ) ) != IVAS_ERR_OK ) { @@ -5065,11 +4925,9 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif #endif TRUE ) ) != IVAS_ERR_OK ) { @@ -8737,7 +8595,6 @@ void IVAS_REND_Close( ivas_external_orientation_close( &hIvasRend->hExternalOrientationData ); ivas_combined_orientation_close( &hIvasRend->hCombinedOrientationData ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &hIvasRend->hHrtfs.hHrtfFastConv ); @@ -8748,7 +8605,6 @@ void IVAS_REND_Close( ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#endif #endif free( hIvasRend ); @@ -8904,7 +8760,6 @@ int32_t IVAS_REND_GetCntFramesLimited( #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfHandle( ) * @@ -8991,7 +8846,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* @@ -9401,11 +9255,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#else - hHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -9541,15 +9391,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( static ivas_error initMasaExtRenderer( input_masa *inputMasa, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const AUDIO_CONFIG outConfig, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const RENDER_CONFIG_DATA *hRendCfg, #endif hrtf_handles *hrtfs -#else - const AUDIO_CONFIG outConfig -#endif ) { int16_t i; @@ -9578,11 +9424,7 @@ static ivas_error initMasaExtRenderer( hMasaExtRend->hDiracDecBin = NULL; #endif hMasaExtRend->hReverb = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hMasaExtRend->hHrtfParambin = &hrtfs->hHrtfParambin; -#else - hMasaExtRend->hHrtfParambin = NULL; -#endif hMasaExtRend->hVBAPdata = NULL; hMasaExtRend->hoa_dec_mtx = NULL; @@ -9673,11 +9515,7 @@ static ivas_error initMasaExtRenderer( { if ( hMasaExtRend->renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9775,11 +9613,7 @@ static void freeMasaExtRenderer( if ( hMasaExtRend->hHrtfParambin != NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_HRTF_parambin_binary_close( hMasaExtRend->hHrtfParambin ); -#else - ivas_HRTF_parambin_binary_close( &hMasaExtRend->hHrtfParambin ); -#endif } if ( hMasaExtRend->hVBAPdata != NULL ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1a4a6abc08..ff5536299e 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -128,9 +128,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, /* i : load hrtf binary file */ -#endif const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ const int16_t num_subframes /* i : number of subframes */ @@ -200,7 +198,6 @@ ivas_error IVAS_REND_GetDelay( int32_t *timeScale /* o : Time scale of the delay, equal to renderer output sampling rate */ ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*! r: error code */ ivas_error IVAS_REND_GetHrtfHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS render handle */ @@ -229,7 +226,6 @@ ivas_error IVAS_REND_GetHrtfStatisticsHandle( IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); #endif -#endif /* Functions to be called during rendering */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 206ca9019b..eeb91167f2 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -679,11 +679,7 @@ static ivas_error load_reverb_from_binary( return header_check_result; } #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; -#else - return IVAS_ERR_FAILED_FILE_READ; -#endif } return IVAS_ERR_OK; @@ -727,9 +723,6 @@ static ivas_error TDREND_MIX_LoadHRTF( ) { int16_t tmp; -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - ivas_error error; -#endif bool is_tdrend; ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; @@ -738,15 +731,10 @@ static ivas_error TDREND_MIX_LoadHRTF( int32_t hrtf_data_size_max; char *hrtf_data; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = IVAS_ERR_OK; -#else - error = IVAS_ERR_OK; -#endif if ( ( header_check_result = read_and_check_hrtf_binary_file_header( &hrtfs_file_header, f_hrtf ) ) != IVAS_ERR_OK ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* try if it is old format for BE tests*/ fseek( f_hrtf, 0, SEEK_SET ); @@ -767,7 +755,6 @@ static ivas_error TDREND_MIX_LoadHRTF( } return header_check_result; -#endif } is_tdrend = FALSE; @@ -821,34 +808,18 @@ static ivas_error TDREND_MIX_LoadHRTF( if ( HrFiltSet_p->FilterMethod != TDREND_HRFILT_Method_BSplineModel ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." ); -#else - error = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." ); -#endif } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = LoadBSplineBinary( HrFiltSet_p, f_hrtf ); -#else - error = LoadBSplineBinary( HrFiltSet_p, f_hrtf ); -#endif } } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; -#else - return IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "HR filter not found in binary file." ); -#endif } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return header_check_result; -#else - return error; -#endif } @@ -931,7 +902,6 @@ static void HRTF_energy_sections_precalc( } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_td_hrtf() * @@ -1002,76 +972,6 @@ void destroy_td_hrtf( return; } -#else -/*---------------------------------------------------------------------* - * dealloc_HRTF_binary() - * - * Deallocated memory allocated by load_HRTF_binary - *---------------------------------------------------------------------*/ - -ivas_error dealloc_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf /* i/o: HRTF handle */ -) -{ - int16_t i; - ivas_error error; - error = IVAS_ERR_OK; - - if ( hHrtf == NULL ) - { - return error; - } - - if ( !hHrtf->ModelParams.modelROM ) - { - if ( hHrtf->ModelParams.UseItdModel ) - { - free( hHrtf->ModelParamsITD.elevKSeq_dyn ); - free( hHrtf->ModelParamsITD.azimKSeq_dyn ); - free( hHrtf->ModelParamsITD.W_dyn ); - free( hHrtf->ModelParamsITD.azimBsShape_dyn ); - free( hHrtf->ModelParamsITD.elevBsShape_dyn ); - } - free( hHrtf->ModelParams.elevKSeq_dyn ); - free( hHrtf->ModelParams.azim_start_idx_dyn ); - free( hHrtf->ModelParams.azimDim2_dyn ); - free( hHrtf->ModelParams.azimDim3_dyn ); - free( hHrtf->ModelParams.AlphaL_dyn ); - free( hHrtf->ModelParams.AlphaR_dyn ); - free( hHrtf->ModelParams.azimSegSamples_dyn ); - - free( hHrtf->ModelParams.azimShapeIdx_dyn ); - free( hHrtf->ModelParams.azimShapeSampFactor_dyn ); - free( hHrtf->ModelParams.elevBsShape_dyn ); - - for ( i = 0; i < hHrtf->ModelParams.num_unique_azim_splines; i++ ) - { - free( hHrtf->ModelParams.azimBsShape_dyn[i] ); - free( &hHrtf->ModelParams.azimBsShape_dyn[i] ); - } - - free( (void *) hHrtf->ModelParams.azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ - for ( i = 0; i < hHrtf->ModelParams.elevDim3; i++ ) - { - free( hHrtf->ModelParams.azimKSeq[i] ); - } - free( hHrtf->ModelParams.azimKSeq ); - - free( hHrtf->ModelParams.EL_dyn ); - free( hHrtf->ModelParams.ER_dyn ); - - free( hHrtf->ModelEval.hrfModL ); - free( hHrtf->ModelEval.hrfModR ); - - for ( i = 0; i < 3; i++ ) - { - free( hHrtf->lr_energy_and_iac_dyn[i] ); - } - } - - return error; -} -#endif /*---------------------------------------------------------------------* @@ -1097,11 +997,7 @@ static ivas_error create_HRTF_from_rawdata( { if ( ( ( *hHRTF ) = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); -#else - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for HRTF binary data\n" ); -#endif } if ( ( error = ivas_hrtf_init( *hHRTF ) ) != IVAS_ERR_OK ) @@ -1114,9 +1010,7 @@ static ivas_error create_HRTF_from_rawdata( return IVAS_ERR_INTERNAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ( *hHRTF )->init_from_rom = 0; -#endif hrtf_data_rptr = hrtf_data; /* latency_s */ @@ -1346,28 +1240,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( hrtf_data_rptr = hrtf_data; -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - /* BINAURAL_CONVBANDS */ - if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); - } - hrtf_data_rptr += sizeof( uint16_t ); - -#endif /* HRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1420,13 +1303,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA3_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1478,13 +1359,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA2_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1537,13 +1416,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( FOA_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1596,13 +1473,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1685,9 +1560,7 @@ ivas_error load_fastconv_HRTF_from_binary( ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t asFastconv = 0; -#endif f_hrtf = hrtfReader->file; @@ -1735,9 +1608,7 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING asFastconv = 1; -#endif } else { @@ -1746,7 +1617,6 @@ ivas_error load_fastconv_HRTF_from_binary( } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asFastconv ) { return IVAS_ERR_OK; @@ -1755,9 +1625,6 @@ ivas_error load_fastconv_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -1849,9 +1716,7 @@ ivas_error load_parambin_HRTF_from_binary( ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t asParam = 0; -#endif f_hrtf = hrtfReader->file; @@ -1901,9 +1766,7 @@ ivas_error load_parambin_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING asParam = 1; -#endif } else { @@ -1912,7 +1775,6 @@ ivas_error load_parambin_HRTF_from_binary( } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asParam ) { return IVAS_ERR_OK; @@ -1921,9 +1783,6 @@ ivas_error load_parambin_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -2030,15 +1889,6 @@ ivas_error create_SetOfHRTF_from_binary( } free( hrtf_data ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - if ( ( ( *hSetOfHRTF ).hHRTF_hrir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_brir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_foa == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa2 == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 == NULL ) ) - { - if ( destroy_SetOfHRTF( hSetOfHRTF ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create all the HRTF from binary file" ); - } - } -#endif return IVAS_ERR_OK; } @@ -2050,21 +1900,13 @@ ivas_error create_SetOfHRTF_from_binary( * Destroy the HRTF CRend handle *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING static void destroy_HRTF( -#else -static ivas_error destroy_HRTF( -#endif HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ ) { uint16_t i, j; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( *hHRTF != NULL && hHRTF != NULL && ( *hHRTF )->init_from_rom == 0 ) -#else - if ( *hHRTF != NULL && hHRTF != NULL ) -#endif { for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { @@ -2104,15 +1946,10 @@ static ivas_error destroy_HRTF( *hHRTF = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return; -#else - return IVAS_ERR_OK; -#endif } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_SetOfHRTF() * @@ -2171,23 +2008,6 @@ void destroy_parambin_hrtf( return; } -#else -ivas_error destroy_SetOfHRTF( - HRTFS_CREND_HANDLE hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -) -{ - if ( hSetOfHRTF != NULL ) - { - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_combined ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_hoa3 ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_hoa2 ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_foa ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_brir_combined ) ); - } - - return IVAS_ERR_OK; -} -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 3416c5b7d1..0048def686 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -124,15 +124,9 @@ ivas_error create_SetOfHRTF_from_binary( * Destroy the HRTF data set. *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING void destroy_SetOfHRTF( IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ ); -#else -ivas_error destroy_SetOfHRTF( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -); -#endif /*---------------------------------------------------------------------* @@ -146,7 +140,6 @@ ivas_error load_fastconv_HRTF_from_binary( const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_fastconv_hrtf() * @@ -156,7 +149,6 @@ ivas_error load_fastconv_HRTF_from_binary( void destroy_fastconv_hrtf( IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* i/o: FastConv HRTF handle */ ); -#endif /*---------------------------------------------------------------------* * load_parambin_HRTF_from_binary() @@ -170,7 +162,6 @@ ivas_error load_parambin_HRTF_from_binary( ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_parambin_hrtf() * @@ -203,16 +194,4 @@ ivas_error destroy_hrtf_statistics( ); #endif -#else -/*---------------------------------------------------------------------* - * dealloc_HRTF_binary() - * - * Deallocated memory allocated by load_HRTF_binary - *---------------------------------------------------------------------*/ - -ivas_error dealloc_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf /* i/o: HRTF handle */ -); - -#endif #endif /* IVAS_HRTF_FILE_READER_H */ -- GitLab From a9cd220d158de1fcd6a46f509eec2c845a95b468 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:00:41 +0100 Subject: [PATCH 224/498] [cleanup] accept NONBE_FIX_AVG_IAC_CLDFB_REVERB --- lib_com/ivas_cnst.h | 4 - lib_com/options.h | 1 - lib_rend/ivas_reverb_filter_design.c | 4 - lib_util/hrtf_file_reader.c | 26 ------ .../generate_crend_ivas_tables_from_sofa.c | 79 ------------------- 5 files changed, 114 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 38e9518e61..cfd26f7725 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1663,15 +1663,11 @@ typedef enum #define RV_FILTER_MAX_FFT_SIZE ( 512 ) #define RV_FILTER_MAX_HISTORY ( 512 - 160 ) /* for longest history */ #define RV_LENGTH_NR_FC ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1 -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define RV_LENGTH_NR_FC_16KHZ ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1 -#endif #define IVAS_REVERB_DEFAULT_N_BANDS 31 #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 037cea8e5b..00be7fb6bf 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_AVG_IAC_CLDFB_REVERB /* Orange: Add computation avg energy and iac tables for rom and binaural binary file */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index e90efe1307..20d9502c2e 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -714,14 +714,12 @@ void ivas_reverb_get_hrtf_set_properties( const float norm_freq = out_freq_step * out_bin_idx; /* Computing the bin index in the source data */ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( in_freq_count == out_freq_count ) { base_idx = out_bin_idx; } else { -#endif const float tbl_index = ( norm_freq - inp_freq_offset ) / inp_freq_step; if ( tbl_index <= 0.0f ) /* In case of extrapolation (below 1st bin), choose nearest */ @@ -739,9 +737,7 @@ void ivas_reverb_get_hrtf_set_properties( relative_pos = 1.0f; } } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB } -#endif /* Computing 2 bins data for later interpolation */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index eeb91167f2..3eca568142 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -448,32 +448,24 @@ static ivas_error set_default_reverb_iac_energy( ) { int16_t i; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t lr_iac_len; -#endif if ( HrFiltSet_p == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB lr_iac_len = LR_IAC_LENGTH_NR_FC; if ( HrFiltSet_p->SampleRate == 16000 ) { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif if ( HrFiltSet_p->ModelParams.modelROM == 0 ) { for ( i = 0; i < 3; i++ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); -#else - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); -#endif if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -492,15 +484,9 @@ static ivas_error set_default_reverb_iac_energy( mvr2r( defaultHRIR_coherence_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); break; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], lr_iac_len ); mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], lr_iac_len ); mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], lr_iac_len ); -#else - mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); -#endif break; } } @@ -557,7 +543,6 @@ static ivas_error load_reverb_from_binary( ivas_hrtfs_header_t hrtf_header; int32_t hrtf_data_size_max; char *hrtf_data; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t lr_iac_len; #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES @@ -578,7 +563,6 @@ static ivas_error load_reverb_from_binary( { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif header_check_result = IVAS_ERR_OK; @@ -650,7 +634,6 @@ static ivas_error load_reverb_from_binary( /* left/right energy and interaural coherence for late reverb */ for ( i = 0; i < 3; i++ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { @@ -658,15 +641,6 @@ static ivas_error load_reverb_from_binary( } fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), lr_iac_len, f_hrtf ); HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; -#else - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; -#endif } #endif } diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index eb7a473fbf..2c76002b63 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -1316,7 +1316,6 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define IVAS_REVERB_FFT_SIZE_48K ( 512 ) #define IVAS_REVERB_FFT_SIZE_32K ( 512 ) @@ -1351,7 +1350,6 @@ static uint16_t get_fft_size( return 0; } -#endif /*-------------------------------------------------------------------* * ivas_reverb_get_hrtf_set_properties() @@ -1412,14 +1410,12 @@ void ivas_reverb_get_hrtf_set_properties( const float norm_freq = out_freq_step * out_bin_idx; /* Computing the bin index in the source data */ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( in_freq_count == out_freq_count ) { base_idx = out_bin_idx; } else { -#endif const float tbl_index = ( norm_freq - inp_freq_offset ) / inp_freq_step; if ( tbl_index <= 0.0f ) /* In case of extrapolation (below 1st bin), choose nearest */ @@ -1437,9 +1433,7 @@ void ivas_reverb_get_hrtf_set_properties( relative_pos = 1.0f; } } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB } -#endif /* Computing 2 bins data for later interpolation */ /* Zeroing before accumalation for average value computing */ @@ -1744,9 +1738,7 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) if ( frame_len_ms == 5 ) frame_len = frame_len >> 2; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB frame_len = get_fft_size( frame_len ); -#endif data_IR_current = sofa_data_IR_val_48k; sofa_N = sofa_N_48k; @@ -1788,7 +1780,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) float **pHrtf_set_r_im = NULL; float *pTemp = NULL; int16_t nr_fc_fft_filter = LR_IAC_LENGTH_NR_FC; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB nr_fc_fft_filter = ( frame_len >> 1 ) + 1; float *p_avg_lr = NULL; float *pCoherence = NULL; @@ -1796,10 +1787,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) pCoherence = (float *) malloc( sizeof( float * ) * nr_fc_fft_filter ); memset( p_avg_lr, 0, sizeof( float ) * nr_fc_fft_filter * 2 ); memset( pCoherence, 0, sizeof( float ) * nr_fc_fft_filter ); -#else - float p_avg_lr[LR_IAC_LENGTH_NR_FC * 2] = { 0 }; - float pCoherence[LR_IAC_LENGTH_NR_FC] = { 0 }; -#endif pHrtf_set_l_re = (float **) malloc( sizeof( float * ) * sofa_M ); pHrtf_set_l_im = (float **) malloc( sizeof( float * ) * sofa_M ); @@ -1818,14 +1805,10 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) { pTemp[n] = (float) ( data_IR_current[size * i + n] * (double) mdft_scale_fact ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB memcpy( pHrtf_set_l_re[i], pTemp, frame_len ); memset( pHrtf_set_l_im[i], 0, frame_len ); DoRTFTn( pHrtf_set_l_re[i], pHrtf_set_l_im[i], frame_len ); -#else - ivas_mdft( pTemp, pHrtf_set_l_re[i], pHrtf_set_l_im[i], frame_len, frame_len ); -#endif pHrtf_set_r_re[i] = (float *) malloc( sizeof( float ) * ( frame_len ) ); memset( pHrtf_set_r_re[i], 0, sizeof( float ) * frame_len ); @@ -1836,22 +1819,14 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) { pTemp[n] = (float) ( data_IR_current[size * i + sofa_N + n] * (double) mdft_scale_fact ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB memcpy( pHrtf_set_r_re[i], pTemp, frame_len ); memset( pHrtf_set_r_im[i], 0, frame_len ); DoRTFTn( pHrtf_set_r_re[i], pHrtf_set_r_im[i], frame_len ); -#else - ivas_mdft( pTemp, pHrtf_set_r_re[i], pHrtf_set_r_im[i], frame_len, frame_len ); -#endif } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB ivas_reverb_get_hrtf_set_properties( pHrtf_set_l_re, pHrtf_set_l_im, pHrtf_set_r_re, pHrtf_set_r_im, IVAS_AUDIO_CONFIG_5_1, sofa_M, nr_fc_fft_filter, nr_fc_fft_filter, p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence ); -#else - ivas_reverb_get_hrtf_set_properties( pHrtf_set_l_re, pHrtf_set_l_im, pHrtf_set_r_re, pHrtf_set_r_im, IVAS_AUDIO_CONFIG_5_1, sofa_M, frame_len, nr_fc_fft_filter, p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence ); -#endif update_h_file_with_reverb( sample_rates[indSR] ); update_c_file_with_reverb( p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence, sample_rates[indSR], nr_fc_fft_filter ); @@ -1889,7 +1864,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) free( pTemp ); pTemp = NULL; } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( pCoherence ) { free( pCoherence ); @@ -1900,7 +1874,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) free( p_avg_lr ); p_avg_lr = NULL; } -#endif } /* close the file */ @@ -2021,13 +1994,11 @@ void write_array_uint16_to_file( FILE *fp, uint16_t *vec, int32_t size_vec, int3 *---------------------------------------------------------------------*/ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherence, const int32_t samplerate, const int16_t len ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB char len_str[26] = "LR_IAC_LENGTH_NR_FC"; if ( samplerate == 16000 ) { strcpy( len_str, "LR_IAC_LENGTH_NR_FC_16KHZ" ); } -#endif if ( c_file_path == NULL ) return; @@ -2055,29 +2026,17 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc fprintf( fp, "\n/* Sample Rate = %ld */\n", (long) samplerate ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nconst float defaultHRIR_coherence_%dkHz[%s] = \n", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nconst float defaultHRIR_coherence_%dkHz[LR_IAC_LENGTH_NR_FC] = \n", samplerate / 1000 ); -#endif write_array_float_to_file( fp, pCoherence, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_left_avg_power_[LR_IAC_LENGTH_NR_FC];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nconst float defaultHRIR_left_avg_power_%dkHz[%s] = \n", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nconst float defaultHRIR_left_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC] = \n", samplerate / 1000 ); -#endif write_array_float_to_file( fp, pEner_l, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nconst float defaultHRIR_right_avg_power_%dkHz[%s] = \n", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nconst float defaultHRIR_right_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC] = \n", samplerate / 1000 ); -#endif write_array_float_to_file( fp, pEner_r, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); @@ -2308,13 +2267,11 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int *---------------------------------------------------------------------*/ void update_h_file_with_reverb( int32_t samplerate ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB char len_str[26] = "LR_IAC_LENGTH_NR_FC"; if ( samplerate == 16000 ) { strcpy( len_str, "LR_IAC_LENGTH_NR_FC_16KHZ" ); } -#endif if ( h_file_path == NULL ) return; @@ -2334,22 +2291,10 @@ void update_h_file_with_reverb( int32_t samplerate ) fprintf( fp, "\n/* Sample Rate = %ld */\n", (long) samplerate ); /* float *defaultHRIR_coherence_[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nextern float defaultHRIR_coherence_%dkHz[%s];", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nextern float defaultHRIR_coherence_%dkHz[LR_IAC_LENGTH_NR_FC];", samplerate / 1000 ); -#endif /* float *defaultHRIR_left_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC];", samplerate / 1000 ); -#endif /* float *defaultHRIR_right_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC];", samplerate / 1000 ); -#endif if ( samplerate == LAST_SAMPLERATE ) { @@ -2869,13 +2814,11 @@ void write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCohere char *binary_file_full_path = NULL; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t len = LR_IAC_LENGTH_NR_FC; if ( samplerate == 16000 ) { len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif if ( pEner_l == NULL ) return; @@ -2890,53 +2833,31 @@ void write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCohere return; hrtf_bin = NULL; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_data_size = sizeof( float ) * 3 * len; -#else - hrtf_data_size = sizeof( float ) * 3 * LR_IAC_LENGTH_NR_FC; -#endif hrtf_bin = (char *) malloc( hrtf_data_size ); if ( hrtf_bin == NULL ) return; memset( hrtf_bin, 0x00, hrtf_data_size ); hrtf_bin_wptr = hrtf_bin; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB for ( iTap = 0; iTap < len; iTap++ ) -#else - for ( iTap = 0; iTap < LR_IAC_LENGTH_NR_FC; iTap++ ) -#endif { sprintf( tmpStr, FORMAT_FLOAT, pEner_l[iTap] ); sscanf( tmpStr, "%f", &( ( (float *) hrtf_bin_wptr )[iTap] ) ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_bin_wptr += sizeof( float ) * len; for ( iTap = 0; iTap < len; iTap++ ) -#else - hrtf_bin_wptr += sizeof( float ) * LR_IAC_LENGTH_NR_FC; - for ( iTap = 0; iTap < LR_IAC_LENGTH_NR_FC; iTap++ ) -#endif { sprintf( tmpStr, FORMAT_FLOAT, pEner_r[iTap] ); sscanf( tmpStr, "%f", &( ( (float *) hrtf_bin_wptr )[iTap] ) ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_bin_wptr += sizeof( float ) * len; for ( iTap = 0; iTap < len; iTap++ ) -#else - hrtf_bin_wptr += sizeof( float ) * LR_IAC_LENGTH_NR_FC; - for ( iTap = 0; iTap < LR_IAC_LENGTH_NR_FC; iTap++ ) -#endif { sprintf( tmpStr, FORMAT_FLOAT, pCoherence[iTap] ); sscanf( tmpStr, "%f", &( ( (float *) hrtf_bin_wptr )[iTap] ) ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_bin_wptr += sizeof( float ) * len; -#else - hrtf_bin_wptr += sizeof( float ) * LR_IAC_LENGTH_NR_FC; -#endif binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + 1 + strlen( "Reverb" ) + 1 + 5 + 3 + 4 ) ); sprintf( binary_file_full_path, "%s_%s_%ikHz.bin", binary_file_path, "Reverb", samplerate / 1000 ); -- GitLab From 285b645fb1427f1b6d5757495375933f331ed299 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:01:25 +0100 Subject: [PATCH 225/498] [cleanup] accept NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER --- lib_com/options.h | 1 - lib_rend/ivas_reflections.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 00be7fb6bf..7f64491672 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ diff --git a/lib_rend/ivas_reflections.c b/lib_rend/ivas_reflections.c index 095f07de53..0b42a0b6ff 100644 --- a/lib_rend/ivas_reflections.c +++ b/lib_rend/ivas_reflections.c @@ -59,17 +59,9 @@ static uint16_t LC_mixing_7_1[7] = { 0, 1, 2, 3, 4, 3, 4 }; static uint16_t LC_mixing_5_1_2[7] = { 0, 1, 2, 3, 4, 0, 1 }; -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 3, 4 }; -#else -static uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 2, 3 }; -#endif -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 3, 4 }; -#else -static uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 2, 3 }; -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_er_init() -- GitLab From 6f8d51a458b41304e2c0ed253bc26e3c49d81291 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:02:10 +0100 Subject: [PATCH 226/498] [cleanup] accept NONBE_FIX_935_SBA_REVERB --- lib_com/options.h | 1 - lib_dec/ivas_output_config.c | 4 ---- lib_dec/ivas_sba_dec.c | 4 ---- lib_dec/ivas_spar_decoder.c | 4 ---- 4 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7f64491672..60824eb763 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f2241ac808..1bbe35b6cf 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -160,11 +160,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef NONBE_FIX_935_SBA_REVERB if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index bb4f17c381..d8433ab8b7 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -194,11 +194,7 @@ ivas_error ivas_sba_dec_reconfigure( } else { -#ifdef NONBE_FIX_935_SBA_REVERB if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL -#else - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 9769c6e569..c3faa8bd31 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -250,11 +250,7 @@ ivas_error ivas_spar_dec_open( } if ( st_ivas->ivas_format == SBA_ISM_FORMAT && -#ifdef NONBE_FIX_935_SBA_REVERB st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL && -#else - ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && -#endif st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { /* get correct granularity in case of binaural rendering of the discrete objects with the td obj renderer */ -- GitLab From 92370ac27d2a84ebfa544a75c71957afad0d8817 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:02:48 +0100 Subject: [PATCH 227/498] [cleanup] accept NONBE_FIX_952_MC_PARAMUPMIX_5MS --- lib_com/options.h | 1 - lib_dec/ivas_mc_paramupmix_dec.c | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 60824eb763..5bc449bf44 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index e6eadb43d2..b623c9fc46 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -118,13 +118,11 @@ void ivas_mc_paramupmix_dec_read_BS( } } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { mvr2r( hMCParamUpmix->alpha_prev[i], hMCParamUpmix->alpha_sf[i], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[i], hMCParamUpmix->beta_sf[i], IVAS_MAX_NUM_BANDS ); } -#endif hMCParamUpmix->first_frame = 1; } @@ -144,7 +142,6 @@ void ivas_mc_paramupmix_dec_read_BS( st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); st0->total_brate = st_ivas->hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS if ( hMCParamUpmix->first_frame == 0 ) { for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) @@ -153,7 +150,6 @@ void ivas_mc_paramupmix_dec_read_BS( mvr2r( hMCParamUpmix->betas[i], hMCParamUpmix->beta_prev[i], IVAS_MAX_NUM_BANDS ); } } -#endif for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { @@ -175,13 +171,11 @@ void ivas_mc_paramupmix_dec_read_BS( hMCParamUpmix->first_frame = 0; } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { mvr2r( hMCParamUpmix->alpha_prev[i], hMCParamUpmix->alpha_sf[i], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[i], hMCParamUpmix->beta_sf[i], IVAS_MAX_NUM_BANDS ); } -#endif } pop_wmops(); @@ -273,13 +267,6 @@ void ivas_mc_paramupmix_dec_render( assert( slots_to_render == 0 ); #endif { -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - mvr2r( hMCParamUpmix->alpha_prev[ch], hMCParamUpmix->alpha_sf[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); - } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT slot_index_start = 0; @@ -304,13 +291,6 @@ void ivas_mc_paramupmix_dec_render( /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_prev[ch], IVAS_MAX_NUM_BANDS ); - } -#endif } *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; -- GitLab From 96d8c66faf485cc783c86a0234c03edb007839ea Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:03:29 +0100 Subject: [PATCH 228/498] [cleanup] accept NONBE_FIX_967_ISM_MONO_DMX --- lib_com/ivas_prot.h | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 12 ------------ lib_dec/ivas_mono_dmx_renderer.c | 28 ---------------------------- 4 files changed, 45 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a8b5e90570..a989dddc8e 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5472,11 +5472,7 @@ void ivas_mono_dmx_renderer_close( MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer /* i/ i/o: Mono downmix structure */ ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx( -#else -void ivas_mono_downmix_render_passive( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ diff --git a/lib_com/options.h b/lib_com/options.h index 5bc449bf44..c70665b416 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 3554697282..7c6f1fdfa6 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -196,11 +196,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif } else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) { @@ -392,11 +388,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -520,11 +512,7 @@ ivas_error ivas_jbm_dec_tc( } else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif /* add W */ for ( n = 0; n < nchan_out; n++ ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 1da119f000..ffccaa93f8 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -48,9 +48,6 @@ #define DOWNMIX_ALPHA 0.95f /* Smoothing coefficient */ #define DOWNMIX_MAX_GAIN 4.0f /* Maximum allowed gain */ -#ifndef NONBE_FIX_967_ISM_MONO_DMX -#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4 // FhG esr: this seems to be obsolete; not related to issue 967 -#endif /*------------------------------------------------------------------------- @@ -106,11 +103,7 @@ void ivas_mono_dmx_renderer_close( * Downmix process *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx( -#else -void ivas_mono_downmix_render_passive( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ @@ -118,9 +111,7 @@ void ivas_mono_downmix_render_passive( { int16_t i, j, numInputChannels; float proto_signal[L_FRAME48k], eq; -#ifdef NONBE_FIX_967_ISM_MONO_DMX float inputEnergy_local, protoEnergy_local; -#endif MONO_DOWNMIX_RENDERER_HANDLE hDownmix; numInputChannels = st_ivas->nSCE; @@ -143,10 +134,8 @@ void ivas_mono_downmix_render_passive( hDownmix = st_ivas->hMonoDmxRenderer; set_zero( proto_signal, output_frame ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX inputEnergy_local = 0; protoEnergy_local = 0; -#endif /* Compute the Proto Signal */ for ( i = 0; i < numInputChannels; i++ ) @@ -154,7 +143,6 @@ void ivas_mono_downmix_render_passive( v_add( output_f[i], proto_signal, proto_signal, output_frame ); } -#ifdef NONBE_FIX_967_ISM_MONO_DMX /* compute the input energy, proto energy */ for ( i = 0; i < output_frame; i++ ) { @@ -165,26 +153,10 @@ void ivas_mono_downmix_render_passive( inputEnergy_local += ( output_f[j][i] * output_f[j][i] ); } } -#else - /* compute the input energy, proto energy after smoothing */ - hDownmix->inputEnergy *= DOWNMIX_ALPHA; - hDownmix->protoEnergy *= DOWNMIX_ALPHA; - for ( i = 0; i < output_frame; i++ ) - { - hDownmix->protoEnergy += proto_signal[i] * proto_signal[i]; - - for ( j = 0; j < numInputChannels; j++ ) - { - hDownmix->inputEnergy += ( output_f[j][i] * output_f[j][i] ); - } - } -#endif -#ifdef NONBE_FIX_967_ISM_MONO_DMX hDownmix->inputEnergy *= DOWNMIX_ALPHA; hDownmix->protoEnergy *= DOWNMIX_ALPHA; hDownmix->inputEnergy += ( 1.0f - DOWNMIX_ALPHA ) * inputEnergy_local; hDownmix->protoEnergy += ( 1.0f - DOWNMIX_ALPHA ) * protoEnergy_local; -#endif /* compute the eq factor */ eq = min( DOWNMIX_MAX_GAIN, sqrtf( hDownmix->inputEnergy / ( EPSILON + hDownmix->protoEnergy ) ) ); -- GitLab From 1c41671d3a0d8d143848d6aa9b223e31b874066b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:04:17 +0100 Subject: [PATCH 229/498] [cleanup] accept NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX --- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c70665b416..06beed1f4b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 5fa4d78eb4..9fcb8f9f43 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -154,12 +154,9 @@ void ivas_ism_render_sf( float gain, prev_gain; float tc_local[MAX_NUM_OBJECTS][L_FRAME48k]; float *p_tc[MAX_NUM_OBJECTS]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; int16_t n_samples_rendered_loop; -#endif -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity ); first_sf = st_ivas->hTcBuffer->subframes_rendered; @@ -171,7 +168,6 @@ void ivas_ism_render_sf( slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } -#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -184,7 +180,6 @@ void ivas_ism_render_sf( tc_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* Number of subframes to delay metadata to sync with audio */ if ( st_ivas->hDecoderConfig->Opt_delay_comp ) { @@ -194,7 +189,6 @@ void ivas_ism_render_sf( { ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -217,21 +211,15 @@ void ivas_ism_render_sf( set_f( output_f[i], 0.0f, n_samples_to_render ); } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_in_subframe; n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#endif if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); -#else - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); -#endif interp_offset = 0; } @@ -240,7 +228,6 @@ void ivas_ism_render_sf( /* Combined rotation: rotate the object positions depending the head and external orientations */ if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX if ( subframe_idx >= ism_md_subframe_update_jbm ) { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); @@ -249,9 +236,6 @@ void ivas_ism_render_sf( { rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); } -#else - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); -#endif if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); @@ -272,18 +256,10 @@ void ivas_ism_render_sf( { g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; tc = p_tc[i]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX for ( k = 0; k < n_samples_in_subframe; k++ ) -#else - for ( k = 0; k < n_samples_to_render; k++ ) -#endif { g2 = 1.0f - *g1; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#else - output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#endif } } @@ -293,19 +269,12 @@ void ivas_ism_render_sf( st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX p_tc[i] += n_samples_in_subframe; -#endif } /* update combined orientation access index */ -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); -#else - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); -#endif -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX n_samples_rendered_loop += n_samples_in_subframe; if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) { @@ -315,7 +284,6 @@ void ivas_ism_render_sf( tc_offset += n_samples_in_subframe; interp_offset += n_samples_in_subframe; } -#endif return; } -- GitLab From 3e395de1f9e7b80f0205e3caff41dfc24a6e74c9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:05:01 +0100 Subject: [PATCH 230/498] [cleanup] accept NONBE_FIX_977_OSBA_GAIN_MISMATCH --- lib_com/options.h | 1 - lib_enc/ivas_osba_enc.c | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 06beed1f4b..e1eaa1221c 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index bcff38b21d..e2416ab3f7 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -72,11 +72,7 @@ static void ivas_merge_sba_transports( { for ( j = 0; j < input_frame; j++ ) { -#ifdef NONBE_FIX_977_OSBA_GAIN_MISMATCH data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] ); -#else - data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] ); -#endif } } @@ -447,9 +443,6 @@ static void ivas_osba_render_ism_to_sba( int16_t azimuth, elevation; float gains[MAX_INPUT_CHANNELS]; float g1, g2; -#ifndef NONBE_FIX_977_OSBA_GAIN_MISMATCH - float output_gain; -#endif int16_t nchan_sba; @@ -484,16 +477,6 @@ static void ivas_osba_render_ism_to_sba( } /* Gain with loudness-matching gains */ -#ifndef NONBE_FIX_977_OSBA_GAIN_MISMATCH - output_gain = 0.7499f; - for ( j = 0; j < nchan_sba; j++ ) - { - for ( k = 0; k < input_frame; k++ ) - { - data_out_f[j][k] *= output_gain; - } - } -#endif return; } -- GitLab From bf7e8aef816a086b08490113e9e675c6cc995fc6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:07:20 +0100 Subject: [PATCH 231/498] formatting --- lib_dec/lib_dec.c | 10 +++++----- lib_rend/ivas_stat_rend.h | 6 +++--- lib_rend/lib_rend.c | 19 +++++++------------ lib_util/hrtf_file_reader.c | 6 +++--- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index afba5a8aff..564543a800 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1672,7 +1672,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( const int16_t subframe_idx, /* i : subframe index */ const IVAS_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ #else - const int16_t subframe_idx /* i : subframe index */ + const int16_t subframe_idx /* i : subframe index */ #endif ) { @@ -1881,7 +1881,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ) { @@ -1903,7 +1903,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ) { @@ -1925,7 +1925,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfFastConvHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ) { @@ -1947,7 +1947,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfParamBinHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index fde7b70bc1..e95ff21a38 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1157,9 +1157,9 @@ typedef struct ivas_binaural_td_rendering_struct TDREND_SRC_t *Sources[MAX_NUM_TDREND_CHANNELS]; - float Gain; /* Mixer gain */ - TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ - TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ + float Gain; /* Mixer gain */ + TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ + TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* pointer to HR filter set */ int16_t UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ea12814700..d107f0216e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1361,8 +1361,7 @@ static ivas_error setRendInputActiveIsm( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; @@ -2432,8 +2431,7 @@ static ivas_error setRendInputActiveMc( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t i; @@ -2778,9 +2776,9 @@ static ivas_error updateSbaPanGains( #endif #else #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif #endif { @@ -2838,8 +2836,7 @@ static ivas_error setRendInputActiveSplitPostRend( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - RENDER_CONFIG_DATA *hRendCfg - , + RENDER_CONFIG_DATA *hRendCfg, #if defined _MSC_VER && !defined __clang__ #ifdef _MSC_VER #pragma warning( disable : 4100 ) @@ -2906,8 +2903,7 @@ static ivas_error setRendInputActiveSba( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; @@ -9395,8 +9391,7 @@ static ivas_error initMasaExtRenderer( #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const RENDER_CONFIG_DATA *hRendCfg, #endif - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { int16_t i; ivas_error error; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 3eca568142..3d455495e0 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1181,9 +1181,9 @@ static ivas_error create_HRTF_from_rawdata( static ivas_error create_fastconv_HRTF_from_rawdata( - HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ - char *hrtf_data, /* i : pointer to binary file */ - HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ + HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ + char *hrtf_data, /* i : pointer to binary file */ + HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ BINAURAL_INPUT_AUDIO_CONFIG input_cfg /* i : Input binaural config */ ) { -- GitLab From 4188ad0b31add2ffa7f07091eef6ca5c4d85fc03 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 8 Feb 2024 14:45:19 +1100 Subject: [PATCH 232/498] sanitizer fixes --- apps/renderer.c | 4 ++++ lib_dec/lib_dec.c | 7 ++++++ lib_rend/ivas_crend.c | 4 +++- lib_rend/ivas_lcld_decoder.c | 46 +++++++++++++++++++++++++++++++++++- 4 files changed, 59 insertions(+), 2 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index e0e0c411c8..a3da5b6d09 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2280,6 +2280,10 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); +#ifdef SPLIT_REND_LCLD_5MS + SplitRendBFIFileReader_close( &splitRendBFIReader ); +#endif + Vector3PairFileReader_close( &referenceVectorReader ); #ifndef NONBE_FIX_BINARY_BINAURAL_READING hrtfFileReader_close( &hrtfFileReader ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 9ce0c12a87..d94d9958b7 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3735,6 +3735,13 @@ ivas_error IVAS_DEC_GetSplitRendBits( splitRendBits->pose_correction = hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits->pose_correction; splitRendBits->codec_frame_size_ms = hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits->codec_frame_size_ms; +#ifdef SPLIT_REND_LCLD_5MS + /* data consumed, free it */ + free( hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits ); + hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits = NULL; +#endif + + return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index fedb722b4e..c7d7b7e5eb 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1806,7 +1806,9 @@ void ivas_rend_closeCldfbRend( } ivas_binRenderer_close( &pCldfbRend->hCldfbRend ); - +#ifdef SPLIT_REND_LCLD_5MS + ivas_binaural_hrtf_close( &pCldfbRend->hHrtfFastConv ); +#endif ivas_HRTF_fastconv_binary_close( &pCldfbRend->hHrtfFastConv ); return; diff --git a/lib_rend/ivas_lcld_decoder.c b/lib_rend/ivas_lcld_decoder.c index 64848af700..ab434b2d41 100644 --- a/lib_rend/ivas_lcld_decoder.c +++ b/lib_rend/ivas_lcld_decoder.c @@ -713,7 +713,11 @@ void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder ) static void ApplyRMSEnvelope( const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iNumGroups, const int32_t *piGroupLengths, int32_t **ppiRMSEnvelope, float **ppfReal, float **ppfImag ); +#ifdef SPLIT_REND_LCLD_5MS +static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag, const int32_t *piBandwidths ); +#else static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag ); +#endif static void InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, float **ppfImag, NoiseGen *psNoiseGen ); @@ -819,10 +823,17 @@ int32_t DecodeLCLDFrame( pppfLCLDReal[n], pppfLCLDImag[n], psLCLDDecoder->psNoiseGen ); +#ifdef SPLIT_REND_LCLD_5MS + ReplaceSign( psLCLDDecoder->iNumBlocks, psLCLDDecoder->iNumBands, + psLCLDDecoder->pppiLCLDSignReal[n], + psLCLDDecoder->pppiLCLDSignImag[n], + pppfLCLDReal[n], pppfLCLDImag[n], psLCLDDecoder->piBandwidths ); +#else ReplaceSign( psLCLDDecoder->iNumBlocks, LCLD_BANDS, psLCLDDecoder->pppiLCLDSignReal[n], psLCLDDecoder->pppiLCLDSignImag[n], pppfLCLDReal[n], pppfLCLDImag[n] ); +#endif } #ifdef DEBUG_WRITE_PREDICTORS { @@ -915,7 +926,16 @@ static void ApplyRMSEnvelope( return; } - +#ifdef SPLIT_REND_LCLD_5MS +static void ReplaceSign( + const int32_t iNumBlocks, + const int32_t iNumLCLDBands, + int32_t **ppiSignReal, + int32_t **ppiSignImag, + float **ppfReal, + float **ppfImag, + const int32_t *piBandwidths ) +#else static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, @@ -923,11 +943,34 @@ static void ReplaceSign( int32_t **ppiSignImag, float **ppfReal, float **ppfImag ) +#endif { int32_t b, n; +#ifdef SPLIT_REND_LCLD_5MS + int32_t m, idx; +#endif for ( n = 0; n < iNumBlocks; n++ ) { +#ifdef SPLIT_REND_LCLD_5MS + idx = 0; + for ( b = 0; b < iNumLCLDBands; b++ ) + { + for ( m = 0; m < piBandwidths[b]; m++ ) + { + if ( ppiSignReal[n][idx] == 1 ) + { + ppfReal[n][idx] = -ppfReal[n][idx]; + } + + if ( ppiSignImag[n][idx] == 1 ) + { + ppfImag[n][idx] = -ppfImag[n][idx]; + } + idx++; + } + } +#else for ( b = 0; b < iNumLCLDBands; b++ ) { if ( ppiSignReal[n][b] == 1 ) @@ -940,6 +983,7 @@ static void ReplaceSign( ppfImag[n][b] = -ppfImag[n][b]; } } +#endif } return; -- GitLab From affc3b90ded20674bf1771be081473fbe9798821 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 8 Feb 2024 09:36:42 +0100 Subject: [PATCH 233/498] refactor script - functionality is still the same --- tests/create_short_testvectors.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 3b92bd8e45..30e1659a12 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -41,25 +41,31 @@ from pathlib import Path from cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() -TEST_VECTOR_DIR = str(HERE.joinpath("../scripts/testv").resolve()) +TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() NUM_CHANNELS = "4" # currently only FOA CUT_FROM = "0.0" CUT_LEN = "5.0" +FILE_IDS = ["stvFOA"] +GAINS = ["1.0", "16.0", ".004"] + + +def collect_files(): + files = [f.absolute() for f in TEST_VECTOR_DIR.iterdir() if f.suffix == ".wav" and any([f.name.startswith(id) for id in FILE_IDS])] + return files + def create_short_testvectors(): - for fs in ['48', '32', '16']: - in_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c.wav" - cut_gain = "1.0" - cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) - cut_gain = "16.0" - cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) - cut_gain = ".004" - cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + for f in collect_files(): + for fs in ['48', '32', '16']: + for g in GAINS: + suffix = "_cut" + if g != "1.0": + suffix += f"_{g}" + + out_file = f.parent.joinpath(f.stem + suffix + f.suffix) + cut_samples(f, out_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, g) if __name__ == "__main__": -- GitLab From edea7deedb5b0ff0f637298ef13420ea5bf44ffd Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 8 Feb 2024 09:47:14 +0100 Subject: [PATCH 234/498] refactor cut_pcm --- .../test_param_file.py | 2 +- .../test_sba_bs_enc.py | 2 +- tests/create_short_testvectors.py | 15 +++++++-------- tests/cut_pcm.py | 8 +++++++- tests/test_param_file_ltv.py | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 5133a21b0c..21ff5be817 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -436,7 +436,7 @@ def pre_proc_input(testv_file, fs): num_channel = "16" cut_file = testv_file.replace(".wav", num_channel + "chn_" + cut_gain + ".wav") cut_samples( - testv_file, cut_file, num_channel, fs + "000", cut_from, cut_len, cut_gain + testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain ) return cut_file diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index 650bddb17d..b20829e0a0 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -551,10 +551,10 @@ def sba_enc( input_path, cut_file, num_channels, - sampling_rate + "000", cut_from, cut_len, cut_gain, + sample_rate=sampling_rate + "000", ) input_path = cut_file diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 30e1659a12..e2fde0291f 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -58,14 +58,13 @@ def collect_files(): def create_short_testvectors(): for f in collect_files(): - for fs in ['48', '32', '16']: - for g in GAINS: - suffix = "_cut" - if g != "1.0": - suffix += f"_{g}" - - out_file = f.parent.joinpath(f.stem + suffix + f.suffix) - cut_samples(f, out_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, g) + for g in GAINS: + suffix = "_cut" + if g != "1.0": + suffix += f"_{g}" + + out_file = f.parent.joinpath(f.stem + suffix + f.suffix) + cut_samples(f, out_file, NUM_CHANNELS, CUT_FROM, CUT_LEN, g) if __name__ == "__main__": diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index 99a6f6fc10..752a4eff14 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -61,7 +61,7 @@ def usage(): return 1 -def cut_samples(in_file, out_file, num_channels, sample_rate, start, duration, gain="1.0"): +def cut_samples(in_file, out_file, num_channels, start, duration, gain="1.0", sample_rate=None): """ Function to cut samples from an audio file (wav or pcm) """ @@ -70,6 +70,12 @@ def cut_samples(in_file, out_file, num_channels, sample_rate, start, duration, g if sys.version_info[0] < 3 or sys.version_info[1] < 7: sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + if sample_rate is None and not str(in_file).endswith(".wav"): + raise ValueError(f"For non-wav files, samplerate must be explicitly given") + elif sample_rate is None: + # set to default of pyaudio3dtools.audiofile.readfile -> for wav files it will be ignored anyway + sample_rate = 48000 + # all input parameters are strings - convert some fs = int(sample_rate) start_sec = float(start) diff --git a/tests/test_param_file_ltv.py b/tests/test_param_file_ltv.py index d74a32aa76..b410e90f23 100644 --- a/tests/test_param_file_ltv.py +++ b/tests/test_param_file_ltv.py @@ -433,7 +433,7 @@ def pre_proc_input(testv_file, fs): num_channel = "16" cut_file = testv_file.replace(".wav", num_channel + "chn_" + cut_gain + ".wav") cut_samples( - testv_file, cut_file, num_channel, fs + "000", cut_from, cut_len, cut_gain + testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain ) return cut_file -- GitLab From e38fd5373b08555021b5c3d0e6f543bc9256dba9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 8 Feb 2024 10:00:46 +0100 Subject: [PATCH 235/498] amend patch --- lib_com/ari_hm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 8655cfd94f..fe9f077290 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -272,7 +272,12 @@ void tcx_hm_modify_envelope( const int16_t L_frame /* i : number of spectral lines */ ) { +#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI + int16_t h, x; + int32_t k; +#else int16_t k, h, x; +#endif Word16 inv_shape[2 * kTcxHmParabolaHalfWidth + 1]; /* Q15 */ if ( gain == 0 ) @@ -301,7 +306,7 @@ void tcx_hm_modify_envelope( ++h; #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI tmp = ( h * lag ); - k = (int16_t) ( tmp >> fract_res ); + k = tmp >> fract_res ; #else k = ( h * lag ) >> fract_res; #endif -- GitLab From 270cb0c9f8251538e4b12edf0207f0c50518dbe1 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 8 Feb 2024 11:12:17 +0100 Subject: [PATCH 236/498] remove switches generation --- .../generate_crend_ivas_tables_from_sofa.c | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index 2c76002b63..58c0df3340 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -2019,7 +2019,6 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc if ( samplerate == DEFAULT_SAMPLERATE ) { - fprintf( fp, "\n#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES\n" ); fprintf( fp, "\n/********************** default HRIR reverb rom tables **********************/\n" ); } @@ -2040,10 +2039,6 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc write_array_float_to_file( fp, pEner_r, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); - if ( samplerate == LAST_SAMPLERATE ) - { - fprintf( fp, "\n#endif\n" ); - } if ( fp ) fclose( fp ); @@ -2158,7 +2153,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\nconst uint16_t %s_%s_index_frequency_max_diffuse_%2dkHz = %d;", DECLARATION_NAME, lscfg.name, samplerate / 1000, hrtf->index_frequency_max_diffuse ); /* float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ - fprintf( fp, "\n#ifdef FIX_INV_DIFFUSE_WEIGHT" ); fprintf( fp, "\nconst float %s_%s_inv_diffuse_weight_%2dkHz[BINAURAL_CHANNELS][%s]=", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "{" ); write_array_float_to_file( fp, hrtf->inv_diffuse_weight[0], hrtf->max_num_ir, hrtf->max_num_ir, FORMAT_FLOAT, 0, TAB_WITH_SPACE_OR_NOT ); @@ -2166,11 +2160,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int write_array_float_to_file( fp, hrtf->inv_diffuse_weight[1], hrtf->max_num_ir, hrtf->max_num_ir, FORMAT_FLOAT, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "}" ); fprintf( fp, ";" ); - fprintf( fp, "\n#else" ); - fprintf( fp, "\nconst float %s_%s_inv_diffuse_weight_%2dkHz[%s]=", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); - write_array_float_to_file( fp, hrtf->inv_diffuse_weight[0], hrtf->max_num_ir, hrtf->max_num_ir, FORMAT_FLOAT, 0, TAB_WITH_SPACE_OR_NOT ); - fprintf( fp, ";" ); - fprintf( fp, "\n#endif" ); /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) @@ -2284,7 +2273,6 @@ void update_h_file_with_reverb( int32_t samplerate ) if ( samplerate == DEFAULT_SAMPLERATE ) { - fprintf( fp, "\n #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES\n" ); fprintf( fp, "\n/********************** default HRIR reverb rom tables **********************/\n" ); } @@ -2296,10 +2284,6 @@ void update_h_file_with_reverb( int32_t samplerate ) fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); - if ( samplerate == LAST_SAMPLERATE ) - { - fprintf( fp, "\n\n#endif\n" ); - } if ( fp ) fclose( fp ); @@ -2393,11 +2377,7 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\nextern uint16_t %s_%s_index_frequency_max_diffuse_%2dkHz;", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); /* float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ - fprintf( fp, "\n#ifdef FIX_INV_DIFFUSE_WEIGHT" ); fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[BINAURAL_CHANNELS][%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); - fprintf( fp, "\n#else" ); - fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); - fprintf( fp, "\n#endif" ); /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) { -- GitLab From 366c01c8313e493d6d0189a928afa845883d4170 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 11:15:49 +0100 Subject: [PATCH 237/498] [fix] crashing renderer tests due to newly introduced record_property argument --- tests/hrtf_binary_loading/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 66d177541f..3bd2028f6e 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -351,6 +351,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( ) hrtf_file_path = hrtf_file_dir.joinpath(hrir_name) ref_out = run_renderer( + None, test_info, in_fmt, out_fmt, @@ -366,6 +367,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( frame_size=frame_size, ) cut_out = run_renderer( + None, test_info, in_fmt, out_fmt, -- GitLab From ec5c0f8da6a361275458138066b7001374603de2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 11:17:46 +0100 Subject: [PATCH 238/498] [format] isort --profile black ./tests && black ./tests --- tests/cmp_pcm.py | 18 +- .../test_masa_enc_dec.py | 37 ++- .../test_param_file.py | 53 ++-- .../test_sba_bs_dec_plc.py | 52 ++-- .../test_sba_bs_enc.py | 32 ++- tests/codec_be_on_mr_selection/__init__.py | 21 +- tests/codec_be_on_mr_selection/constants.py | 3 +- .../test_experiments.py | 7 +- tests/conftest.py | 25 +- tests/create_short_testvectors.py | 21 +- tests/cut_pcm.py | 24 +- tests/hrtf_binary_loading/constants.py | 6 +- .../test_renderer_ROM_vs_file.py | 9 +- tests/hrtf_binary_loading/utils.py | 2 +- tests/prepare_pytests.py | 31 +- tests/renderer/test_renderer.py | 264 ++++++++++++------ tests/renderer/utils.py | 21 +- tests/run_pytests.py | 21 +- tests/scale_pcm.py | 16 +- tests/test_26444.py | 40 +-- tests/test_param_file_ltv.py | 53 ++-- tests/testconfig.py | 8 +- 22 files changed, 468 insertions(+), 296 deletions(-) diff --git a/tests/cmp_pcm.py b/tests/cmp_pcm.py index 9db7ccd39e..13a1c1ba5a 100755 --- a/tests/cmp_pcm.py +++ b/tests/cmp_pcm.py @@ -1,18 +1,18 @@ #!/usr/bin/env python3 +import argparse import os import sys -import argparse THIS_PATH = os.path.join(os.getcwd(), __file__) sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) +import numpy as np import pyaudio3dtools import pyivastest -import numpy as np -def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, str): +def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0) -> (int, str): """ Compare 2 PCM files for bitexactness """ @@ -34,7 +34,9 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, s1, _ = pyaudio3dtools.audiofile.readfile(file1, nchannels, fs, outdtype=np.int16) s2, _ = pyaudio3dtools.audiofile.readfile(file2, nchannels, fs, outdtype=np.int16) - nchannels = s1.shape[1] # In case of wav input, override the nchannels with the one from the wav header + nchannels = s1.shape[ + 1 + ] # In case of wav input, override the nchannels with the one from the wav header if s1.shape != s2.shape: print( @@ -43,7 +45,9 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, ) return 1, "FAIL: File lengths differ" - cmp_result = pyaudio3dtools.audioarray.compare(s1, s2, fs, per_frame=False, get_mld=get_mld) + cmp_result = pyaudio3dtools.audioarray.compare( + s1, s2, fs, per_frame=False, get_mld=get_mld + ) if cmp_result["bitexact"]: return 0, "SUCCESS: Files are bitexact" @@ -55,9 +59,9 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, if get_mld: mld_msg = f"MLD: {cmp_result['MLD']}" print(mld_msg) - if cmp_result['MLD'] <= mld_lim: + if cmp_result["MLD"] <= mld_lim: return 0, f"MLD: {cmp_result['MLD']} <= {mld_lim}" - else: + else: return 1, f"MLD: {cmp_result['MLD']} > {mld_lim}" return 1, "Non-BE" diff --git a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py index c8338e4212..ccb5a8c8ff 100644 --- a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py @@ -33,14 +33,15 @@ __doc__ = """ The outputs are compared with C generated references. """ -import os import errno -import pytest -from typing import Optional +import os from filecmp import cmp +from typing import Optional + +import pytest -from tests.conftest import EncoderFrontend, DecoderFrontend from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend # params # output_mode_list = ['MONO', 'STEREO', '5_1', '7_1', '5_1_2', '5_1_4', '7_1_4', 'FOA', 'HOA2', 'HOA3', 'BINAURAL', 'BINAURAL_ROOM', 'EXT'] @@ -203,17 +204,22 @@ def test_masa_enc_dec( # Compare audio outputs pcmcmp_res, reason = cmp_pcm( - dec_output_dut, dec_output_ref, output_mode, int(out_fs * 1000), get_mld=get_mld, mld_lim=get_mld_lim + dec_output_dut, + dec_output_ref, + output_mode, + int(out_fs * 1000), + get_mld=get_mld, + mld_lim=get_mld_lim, ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) if get_mld and get_mld_lim > 0: if pcmcmp_res != 0: - pytest.fail(reason) + pytest.fail(reason) else: # Fail if compare fails compare result if metacmp_res == False and pcmcmp_res != 0: @@ -230,19 +236,24 @@ def test_masa_enc_dec( filecmp_res = cmp(dec_output_ref, dec_output_dut) if filecmp_res == False: cmp_result, reason = cmp_pcm( - dec_output_dut, dec_output_ref, output_mode, int(out_fs * 1000), get_mld=get_mld, mld_lim=get_mld_lim + dec_output_dut, + dec_output_ref, + output_mode, + int(out_fs * 1000), + get_mld=get_mld, + mld_lim=get_mld_lim, ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) # Report compare result if cmp_result != 0: - pytest.fail(reason) + pytest.fail(reason) else: if get_mld: - record_property("MLD","0") + record_property("MLD", "0") print("Comparison bit exact") # remove_output( diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 5133a21b0c..f1c3a543e6 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -32,19 +32,20 @@ __doc__ = """ Execute tests specified via a parameter file. """ -import os -from pathlib import Path import errno -import platform import filecmp +import os +import platform +from pathlib import Path from subprocess import run + import pytest + from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend from tests.cut_pcm import cut_samples -from tests.conftest import EncoderFrontend, DecoderFrontend from tests.testconfig import PARAM_FILE - VALID_DEC_OUTPUT_CONF = [ "MONO", "STEREO", @@ -200,7 +201,7 @@ def test_param_file_tests( is_exist = os.path.exists(cut_file) if is_exist: os.remove(cut_file) - + # check for networkSimulator_g192 command line if sim_opts != "": sim_split = sim_opts.split() @@ -230,7 +231,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # check for eid-xor command line if eid_opts != "": eid_split = eid_opts.split() @@ -255,7 +256,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # evaluate decoder options dec_split = dec_opts.split() assert len(dec_split) >= 3 @@ -302,7 +303,6 @@ def test_param_file_tests( assert bitstream_file_dec == "bit" # in the parameter file, only "bit" is used as bitstream file name # -> re-use bitstream filename from encoder call - # the output file is not the real output filename # -> construct output filename @@ -321,21 +321,26 @@ def test_param_file_tests( update_ref, tracefile_dec, ) - + if update_ref in [0, 2]: dut_output_file = f"{dut_base_path}/param_file/dec/{output_file}" ref_output_file = f"{reference_path}/param_file/dec/{output_file}" fs = int(sampling_rate) * 1000 output_differs, reason = cmp_pcm( - dut_output_file, ref_output_file, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim + dut_output_file, + ref_output_file, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, ) md_out_files = get_expected_md_files(ref_output_file, enc_split, output_config) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) metadata_differs = False for md_file in md_out_files: @@ -354,7 +359,7 @@ def test_param_file_tests( if get_mld and get_mld_lim > 0: if output_differs: - pytest.fail(reason) + pytest.fail(reason) else: if output_differs or metadata_differs: msg = "Difference between ref and dut in " @@ -378,7 +383,6 @@ def test_param_file_tests( os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") - def encode( dut_encoder_frontend, ref_encoder_frontend, @@ -490,7 +494,8 @@ def simulate( cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file cmd_opts[3] = f"{dut_out_dir}/{netsim_tracefile}" run(netsim + cmd_opts, check=False) - + + def error_insertion( reference_path, dut_base_path, @@ -501,7 +506,7 @@ def error_insertion( """ Call eid-xor to insert frame erasure on REF and/or DUT encoder output. """ - + # directories dut_out_dir = f"{dut_base_path}/param_file/enc" ref_out_dir = f"{reference_path}/param_file/enc" @@ -511,28 +516,21 @@ def error_insertion( ref_out_file = f"{ref_out_dir}/{eid_xor_outfile}" if platform.system() == "Windows": - eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", "Win32", "eid-xor.exe" - ) - ] + eid_xor = [os.path.join(rootdir, "scripts", "tools", "Win32", "eid-xor.exe")] elif platform.system() in ["Linux", "Darwin"]: eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", platform.system(), "eid-xor" - ) + os.path.join(rootdir, "scripts", "tools", platform.system(), "eid-xor") ] else: assert False, f"eid-xor not available for {platform.system()}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): # call eid-xor on REF encoder output cmd_opts = eid_opts_list cmd_opts[-3] = f"{ref_out_dir}/{eid_xor_infile}" cmd_opts[-1] = f"{ref_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) - + if update_ref in [0, 2]: # call eid-xor on DUT encoder output cmd_opts = eid_opts_list @@ -540,6 +538,7 @@ def error_insertion( cmd_opts[-1] = f"{dut_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) + def decode( decoder_frontend, ref_decoder_frontend, diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py index 484ada6c8a..7cbdd0bfc5 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py @@ -1,5 +1,4 @@ -__copyright__ = \ - """ +__copyright__ = """ (C) 2022-2023 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, @@ -29,27 +28,27 @@ __copyright__ = \ the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ - """ +__doc__ = """ Execute SBA decoder tests using different PLC patterns. """ -import os import errno +import os + import pytest from tests.cmp_pcm import cmp_pcm from tests.conftest import DecoderFrontend # params -tag_list = ['stvFOA'] -plc_patterns = ['PLperc12mblen5', 'PLperc40mblen50', 'PLperc42mblen2'] -dtx_set = ['0', '1'] -ivas_br_list = ['13200','16400','32000', '64000', '96000', '256000'] -sampling_rate_list = ['48', '32', '16'] +tag_list = ["stvFOA"] +plc_patterns = ["PLperc12mblen5", "PLperc40mblen50", "PLperc42mblen2"] +dtx_set = ["0", "1"] +ivas_br_list = ["13200", "16400", "32000", "64000", "96000", "256000"] +sampling_rate_list = ["48", "32", "16"] gain_list = [0, 1] -AbsTol = '0' +AbsTol = "0" def check_and_makedir(dir_path): @@ -93,17 +92,22 @@ def test_sba_plc_system( get_mld_lim, ): SID = 0 - if dtx == '1' and ivas_br not in ['13200','16400','24400','32000', '64000']: + if dtx == "1" and ivas_br not in ["13200", "16400", "24400", "32000", "64000"]: # skip high bitrates for DTX until DTX issue is resolved pytest.skip() - if ivas_br == '13200' or ivas_br == '16400': - if dtx == '1' and gain_flag == 0 and fs != '16' and plc_pattern == 'PLperc12mblen5': + if ivas_br == "13200" or ivas_br == "16400": + if ( + dtx == "1" + and gain_flag == 0 + and fs != "16" + and plc_pattern == "PLperc12mblen5" + ): SID = 1 else: pytest.skip() - if gain_flag == 1 and ivas_br not in ['13200','16400','24400','32000']: + if gain_flag == 1 and ivas_br not in ["13200", "16400", "24400", "32000"]: pytest.skip() - tag = tag + fs + 'c' + tag = tag + fs + "c" # dec sba_dec_plc( @@ -148,12 +152,11 @@ def sba_dec_plc( get_mld=False, get_mld_lim=0, ): - # ------------ run cmd ------------ tag_out = f"{tag}_ivasbr{ivas_br[:-3]}k_DTX{dtx}" if gain_flag != -1: - tag_out += f'_Gain{gain_flag}' + tag_out += f"_Gain{gain_flag}" plc_tag_out = f"{tag_out}_{plc_pattern}" dut_out_dir = f"{dut_base_path}/sba_bs/raw" @@ -197,12 +200,19 @@ def sba_dec_plc( # -------------- compare cmd -------------- fs = int(sampling_rate) * 1000 - cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim) + cmp_result, reason = cmp_pcm( + dut_out_raw, + ref_out_raw, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) # report compare result if cmp_result != 0: diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index 650bddb17d..8cb83a864d 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -33,14 +33,15 @@ __doc__ = """ The outputs are compared with C generated references. """ -import os import errno +import os + import pytest +from cut_bs import cut_from_start from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend from tests.cut_pcm import cut_samples -from tests.conftest import EncoderFrontend, DecoderFrontend -from cut_bs import cut_from_start # params @@ -185,15 +186,19 @@ def test_sba_enc_system( get_mld, get_mld_lim, ): - if dtx == "1" and ivas_br not in ["13200", "16400", "24400", "32000", "64000"]: # skip high bitrates for DTX until DTX issue is resolved pytest.skip() if SID == 1: - if ivas_br not in ["13200", "16400", "64000"] or fs == "16" or gain_flag == 1 or dtx == "0": + if ( + ivas_br not in ["13200", "16400", "64000"] + or fs == "16" + or gain_flag == 1 + or dtx == "0" + ): pytest.skip() else: - if ivas_br in ["13200","16400"]: + if ivas_br in ["13200", "16400"]: pytest.skip() if ivas_br == "sw_24k4_256k.bin" and gain_flag != 1: pytest.skip() @@ -249,7 +254,7 @@ def test_sba_enc_system( gain_flag, keep_files, get_mld=get_mld, - get_mld_lim=get_mld_lim + get_mld_lim=get_mld_lim, ) @@ -685,12 +690,19 @@ def sba_dec( ) fs = int(sampling_rate) * 1000 - cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim ) + cmp_result, reason = cmp_pcm( + dut_out_raw, + ref_out_raw, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) # report compare result if cmp_result != 0: diff --git a/tests/codec_be_on_mr_selection/__init__.py b/tests/codec_be_on_mr_selection/__init__.py index 14f0bb0b17..c950f177b9 100644 --- a/tests/codec_be_on_mr_selection/__init__.py +++ b/tests/codec_be_on_mr_selection/__init__.py @@ -28,14 +28,16 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -import tempfile -import pytest -import os import filecmp -from pathlib import Path +import os import subprocess -from .constants import OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT, DTX_ON, FER_5PERC +import tempfile +from pathlib import Path + +import pytest + from ..testconfig import MD5_REF_DICT +from .constants import DTX_ON, FER_5PERC, OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT HERE = Path(__file__).parent # set environment variables in CI job @@ -95,7 +97,14 @@ def apply_error_pattern_on_bitstream( if in_bitstream == out_bitstream: in_bitstream = Path(tmpdir).joinpath(in_bitstream.name) - cmd = ["eid-xor", "-vbr", "-fer", str(in_bitstream), str(error_pattern), str(out_bitstream)] + cmd = [ + "eid-xor", + "-vbr", + "-fer", + str(in_bitstream), + str(error_pattern), + str(out_bitstream), + ] subprocess.run(cmd) diff --git a/tests/codec_be_on_mr_selection/constants.py b/tests/codec_be_on_mr_selection/constants.py index e0afebc5d6..a9bc727915 100644 --- a/tests/codec_be_on_mr_selection/constants.py +++ b/tests/codec_be_on_mr_selection/constants.py @@ -29,8 +29,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ from itertools import product -from typing import Union, List - +from typing import List, Union DTX_ON = "DTXon" DTX_OFF = "DTXoff" diff --git a/tests/codec_be_on_mr_selection/test_experiments.py b/tests/codec_be_on_mr_selection/test_experiments.py index 53fdd8eba9..08b2f3ea4f 100644 --- a/tests/codec_be_on_mr_selection/test_experiments.py +++ b/tests/codec_be_on_mr_selection/test_experiments.py @@ -29,13 +29,14 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest + from . import run_check from .constants import ( - P800_CATEGORIES, + BS1534_MASA_PARAMS_UNIFIED, BS1534_N_FILES, - P800_PARAMS_UNIFIED, BS1534_PARAMS_UNIFIED, - BS1534_MASA_PARAMS_UNIFIED, + P800_CATEGORIES, + P800_PARAMS_UNIFIED, ) diff --git a/tests/conftest.py b/tests/conftest.py index 14f78f2c3b..e2831ff484 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -33,15 +33,17 @@ Pytest customization (configuration and fixtures) for the IVAS codec test suite. """ import logging -from pathlib import Path +import os import platform -from subprocess import run, TimeoutExpired, CalledProcessError, STDOUT +import tempfile import textwrap +from pathlib import Path +from subprocess import STDOUT, CalledProcessError, TimeoutExpired, run from typing import Optional, Union -import os -from tests import testconfig + import pytest -import tempfile + +from tests import testconfig logger = logging.getLogger(__name__) USE_LOGGER_FOR_DBG = False # current tests do not make use of the logger feature @@ -49,6 +51,7 @@ USE_LOGGER_FOR_DBG = False # current tests do not make use of the logger featur HERE = Path(__file__).parent SCRIPTS_DIR = str(HERE.parent.joinpath("scripts").absolute()) import sys + sys.path.append(SCRIPTS_DIR) import prepare_combined_format_inputs @@ -171,6 +174,7 @@ def pytest_addoption(parser): default="0", ) + @pytest.fixture(scope="session", autouse=True) def update_ref(request): """ @@ -181,6 +185,7 @@ def update_ref(request): """ return int(request.config.getoption("--update_ref")) + @pytest.fixture(scope="session", autouse=True) def create_combined_formats_testvectors(request): """ @@ -189,6 +194,7 @@ def create_combined_formats_testvectors(request): prepare_combined_format_inputs.main() + @pytest.fixture(scope="session", autouse=True) def get_mld(request): """ @@ -196,6 +202,7 @@ def get_mld(request): """ return request.config.option.mld + @pytest.fixture(scope="session", autouse=True) def get_mld_lim(request): """ @@ -203,6 +210,7 @@ def get_mld_lim(request): """ return float(request.config.getoption("--mld-lim")) + @pytest.fixture(scope="session") def keep_files(request) -> bool: """ @@ -445,7 +453,6 @@ class DecoderFrontend: command.extend(["-q"]) if plc_file is not None: - system = platform.system() if system == "Windows": @@ -466,7 +473,7 @@ class DecoderFrontend: eid_command += [ str(input_bitstream_path), str(plc_file), - str(input_bitstream_path) + eid_output_suffix + str(input_bitstream_path) + eid_output_suffix, ] try: @@ -495,7 +502,9 @@ class DecoderFrontend: log_dbg_msg(f"{self._type} decoder command:\n{cmd_str}") try: - result = run(command, capture_output=True, check=False, timeout=self.timeout) + result = run( + command, capture_output=True, check=False, timeout=self.timeout + ) except TimeoutExpired: pytest.fail(f"{self._type} decoder run timed out after {self.timeout}s.") diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 3b92bd8e45..54823e1998 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (C) 2022-2023 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, @@ -31,13 +30,13 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ Create short (5sec) testvectors. """ import sys from pathlib import Path + from cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() @@ -49,17 +48,23 @@ CUT_LEN = "5.0" def create_short_testvectors(): - for fs in ['48', '32', '16']: + for fs in ["48", "32", "16"]: in_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c.wav" cut_gain = "1.0" cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + cut_samples( + in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain + ) cut_gain = "16.0" cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + cut_samples( + in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain + ) cut_gain = ".004" cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + cut_samples( + in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain + ) if __name__ == "__main__": diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index 99a6f6fc10..17c441adce 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (C) 2022-2023 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, @@ -31,8 +30,7 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ Script to cut samples from a 16-bit PCM file. USAGE : cut_pcm.py in_file_pcm out_file_pcm num_channels sample_rate start duration [gain] @@ -45,11 +43,12 @@ duration: duration in seconds gain: optional gain value to apply to the copied samples """ -import sys import platform -import numpy as np +import sys from pathlib import Path +import numpy as np + HERE = Path(__file__).parent.resolve() SCRIPTS_DIR = str(HERE.joinpath("../scripts").resolve()) sys.path.append(SCRIPTS_DIR) @@ -61,14 +60,19 @@ def usage(): return 1 -def cut_samples(in_file, out_file, num_channels, sample_rate, start, duration, gain="1.0"): +def cut_samples( + in_file, out_file, num_channels, sample_rate, start, duration, gain="1.0" +): """ Function to cut samples from an audio file (wav or pcm) """ # check for python >= 3.7 if sys.version_info[0] < 3 or sys.version_info[1] < 7: - sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + sys.exit( + "This script is written for Python >= 3.7. Found: " + + platform.python_version() + ) # all input parameters are strings - convert some fs = int(sample_rate) @@ -87,10 +91,10 @@ def cut_samples(in_file, out_file, num_channels, sample_rate, start, duration, g + f" - input is too short ({num_in_samples})" ) - s_out = s[num_samples_to_skip:num_samples_to_skip + dur_samples, :] * gain_f + s_out = s[num_samples_to_skip : num_samples_to_skip + dur_samples, :] * gain_f audiofile.writefile(out_file, s_out, fs) - + def main(argv): if len(argv) < 7: diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 223fa864f6..036047c85c 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -33,11 +33,7 @@ import re from pathlib import Path -from tests.renderer.constants import ( - OUTPUT_FORMATS_BINAURAL, - SCRIPTS_DIR, - TESTV_DIR, -) +from tests.renderer.constants import OUTPUT_FORMATS_BINAURAL, SCRIPTS_DIR, TESTV_DIR TESTS_DIR = Path(__file__).parent diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index 1fd7bbbe3e..ff552bd9ad 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -33,15 +33,14 @@ import pytest from tests.hrtf_binary_loading.utils import * - from tests.renderer.constants import ( - INPUT_FORMATS_AMBI, - INPUT_FORMATS_ISM, - INPUT_FORMATS_MC, - CUSTOM_LS_TO_TEST, CUSTOM_LAYOUT_DIR, + CUSTOM_LS_TO_TEST, FRAMING_TO_TEST, HR_TRAJECTORY_DIR, + INPUT_FORMATS_AMBI, + INPUT_FORMATS_ISM, + INPUT_FORMATS_MC, ) """ Ambisonics """ diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 3bd2028f6e..0f9d9e8f23 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -38,7 +38,7 @@ from typing import Dict, Optional import pytest from tests.renderer.compare_audio import compare_audio_arrays -from tests.renderer.utils import check_BE, run_cmd, test_info, run_renderer +from tests.renderer.utils import check_BE, run_cmd, run_renderer, test_info from .constants import * diff --git a/tests/prepare_pytests.py b/tests/prepare_pytests.py index 64fafde1cc..135121d464 100755 --- a/tests/prepare_pytests.py +++ b/tests/prepare_pytests.py @@ -34,13 +34,13 @@ __doc__ = """ Script to prepare the pytest tests. """ -import os -import sys import argparse -import subprocess +import os import platform - +import subprocess +import sys from pathlib import Path + from create_short_testvectors import create_short_testvectors BIN_EXT = ".exe" if platform.system() == "Windows" else "" @@ -58,7 +58,10 @@ def main(argv): """ # check for python >= 3.7 if sys.version_info[0] < 3 or sys.version_info[1] < 7: - sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + sys.exit( + "This script is written for Python >= 3.7. Found: " + + platform.python_version() + ) parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( @@ -78,15 +81,21 @@ def main(argv): use_dut_binaries = False # check for DUT binaries - if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists(DEFAULT_DECODER_DUT): + if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists( + DEFAULT_DECODER_DUT + ): sys.exit( f"Need DUT binaries {DEFAULT_ENCODER_DUT} and {DEFAULT_DECODER_DUT}.\n" "Please create the binaries." ) # check for REF binaries - if not os.path.exists(DEFAULT_ENCODER_REF) or not os.path.exists(DEFAULT_DECODER_REF): - print(f"REF binaries {DEFAULT_ENCODER_REF} and {DEFAULT_DECODER_REF} not found.") + if not os.path.exists(DEFAULT_ENCODER_REF) or not os.path.exists( + DEFAULT_DECODER_REF + ): + print( + f"REF binaries {DEFAULT_ENCODER_REF} and {DEFAULT_DECODER_REF} not found." + ) print("DUT binaries will be used for reference generation.") use_dut_binaries = True @@ -98,7 +107,11 @@ def main(argv): else: base_cmd = ["python3", "-m", "pytest"] if args.param_file: - base_cmd += ["tests/codec_be_on_mr_nonselection/test_param_file.py", "--param_file", args.param_file] + base_cmd += [ + "tests/codec_be_on_mr_nonselection/test_param_file.py", + "--param_file", + args.param_file, + ] else: base_cmd += ["tests/codec_be_on_mr_nonselection"] base_cmd += [ diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 9750cc11f4..3093dd7234 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -42,19 +42,22 @@ from .utils import * ############################################################################## """ Ambisonics """ + @pytest.mark.create_ref @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ambisonics( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -62,15 +65,17 @@ def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ambisonics_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ambisonics_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -80,17 +85,24 @@ def test_ambisonics_binaural_static(record_property, test_info, in_fmt, out_fmt, @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) def test_ambisonics_binaural_headrotation( - record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, ): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -101,15 +113,17 @@ def test_ambisonics_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_multichannel(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_multichannel( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -117,18 +131,20 @@ def test_multichannel(record_property, test_info, in_fmt, out_fmt, frame_size, g @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_multichannel_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_multichannel_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -138,7 +154,14 @@ def test_multichannel_binaural_static(record_property, test_info, in_fmt, out_fm @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) def test_multichannel_binaural_headrotation( - record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -150,7 +173,7 @@ def test_multichannel_binaural_headrotation( out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, - get_mld=get_mld, + get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -162,7 +185,9 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ism( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( record_property, test_info, @@ -170,7 +195,7 @@ def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, g out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, + get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -179,21 +204,23 @@ def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, g @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ism_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] except KeyError: in_meta_files = None run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, in_meta_files=in_meta_files, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -202,22 +229,31 @@ def test_ism_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_ @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim): +def test_ism_binaural_headrotation( + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, +): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] except KeyError: in_meta_files = None run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -228,16 +264,18 @@ def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_masa( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -245,19 +283,21 @@ def test_masa(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_masa_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -266,20 +306,29 @@ def test_masa_binaural_static(record_property, test_info, in_fmt, out_fmt, frame @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim): +def test_masa_binaural_headrotation( + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, +): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -287,13 +336,13 @@ def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, @pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim): run_renderer( - record_property, + record_property, test_info, "META", "MASA2", metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -304,43 +353,49 @@ def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_custom_ls_input(record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim): +def test_custom_ls_input( + record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @pytest.mark.create_ref @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("in_fmt", OUTPUT_FORMATS) -def test_custom_ls_output(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_custom_ls_output( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @pytest.mark.create_ref @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("in_fmt", CUSTOM_LS_TO_TEST) -def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_custom_ls_input_output( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"), CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -348,15 +403,17 @@ def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_custom_ls_input_binaural(record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim): +def test_custom_ls_input_binaural( + record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -366,17 +423,24 @@ def test_custom_ls_input_binaural(record_property, test_info, in_layout, out_fmt @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) def test_custom_ls_input_binaural_headrotation( - record_property, test_info, in_layout, out_fmt, trj_file, frame_size, get_mld, get_mld_lim + record_property, + test_info, + in_layout, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, ): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -387,16 +451,18 @@ def test_custom_ls_input_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_metadata( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, "META", out_fmt, metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -407,15 +473,17 @@ def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_m @pytest.mark.parametrize("out_fmt", ["STEREO"]) @pytest.mark.parametrize("in_fmt", ["MONO"]) @pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) -def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim): +def test_non_diegetic_pan_static( + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -423,15 +491,17 @@ def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, no @pytest.mark.parametrize("out_fmt", ["STEREO"]) @pytest.mark.parametrize("in_fmt", ["ISM1"]) @pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) -def test_non_diegetic_pan_ism_static(record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim): +def test_non_diegetic_pan_ism_static( + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -455,7 +525,7 @@ def test_ambisonics_binaural_headrotation_refrotzero( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -477,12 +547,14 @@ def test_ambisonics_binaural_headrotation_refrotzero( # Note that reference rotation is supplied per 4 subframes; head rotation per subframe. @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refrotequal(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ambisonics_binaural_headrotation_refrotequal( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -516,7 +588,7 @@ def test_ambisonics_binaural_headrotation_refveczero( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -539,7 +611,9 @@ def test_ambisonics_binaural_headrotation_refveczero( # looking-direction of the head rotation and therefore compensates it (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvecequal(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ambisonics_binaural_headrotation_refvecequal( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -548,7 +622,7 @@ def test_ambisonics_binaural_headrotation_refvecequal(record_property, test_info pytest.xfail("WIP : minor differences to be resolved") else: compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -574,7 +648,9 @@ def test_ambisonics_binaural_headrotation_refvecequal(record_property, test_info # in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvec_rotating(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ambisonics_binaural_headrotation_refvec_rotating( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -583,7 +659,7 @@ def test_ambisonics_binaural_headrotation_refvec_rotating(record_property, test_ pytest.xfail("WIP : minor differences to be resolved") else: compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -619,7 +695,7 @@ def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -654,7 +730,7 @@ def test_ambisonics_binaural_headrotation_refveclev_vs_refvec( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -680,7 +756,9 @@ def test_ambisonics_binaural_headrotation_refveclev_vs_refvec( # in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel_binaural_headrotation_refvec_rotating(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_multichannel_binaural_headrotation_refvec_rotating( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -715,7 +793,9 @@ def test_multichannel_binaural_headrotation_refvec_rotating(record_property, tes # in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_headrotation_refvec_rotating(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ism_binaural_headrotation_refvec_rotating( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -725,7 +805,7 @@ def test_ism_binaural_headrotation_refvec_rotating(record_property, test_info, i in_meta_files = None compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index a70546ddec..d9780106cb 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -110,8 +110,8 @@ def run_renderer( binary_suffix: str = "", frame_size: Optional[str] = "20ms", hrtf_file: Optional[str] = None, - get_mld = False, - mld_lim = 0, + get_mld=False, + mld_lim=0, ) -> str: # prepare arguments and filepaths if trj_file is not None: @@ -230,11 +230,18 @@ def run_renderer( out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem)) if get_mld: - output_differs, reason = cmp_pcm(out_file, out_file_ref, out_fmt, ref_fs, get_mld=get_mld, mld_lim=get_mld_lim) + output_differs, reason = cmp_pcm( + out_file, + out_file_ref, + out_fmt, + ref_fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + ) mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) if output_differs: pytest.fail(f"Output differs: ({reason})") else: @@ -263,7 +270,7 @@ def compare_renderer_args( record_property, test_info, in_fmt, out_fmt, ref_kwargs: Dict, cut_kwargs: Dict ): out_file_ref = run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -271,7 +278,7 @@ def compare_renderer_args( ) ref, ref_fs = readfile(out_file_ref) out_file_cut = run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, diff --git a/tests/run_pytests.py b/tests/run_pytests.py index 91ab8f27d5..55be6579c3 100755 --- a/tests/run_pytests.py +++ b/tests/run_pytests.py @@ -37,11 +37,11 @@ Test prerequisites are checked for and check failures are reported. When prerequisites are met, the pytest test is executed. """ -import os -import sys import argparse -import subprocess +import os import platform +import subprocess +import sys from pathlib import Path BIN_EXT = ".exe" if platform.system() == "Windows" else "" @@ -57,7 +57,10 @@ def main(argv): """ # check for python >= 3.7 if sys.version_info[0] < 3 or sys.version_info[1] < 7: - sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + sys.exit( + "This script is written for Python >= 3.7. Found: " + + platform.python_version() + ) parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( @@ -81,7 +84,9 @@ def main(argv): ) # check for DUT binaries - if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists(DEFAULT_DECODER_DUT): + if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists( + DEFAULT_DECODER_DUT + ): sys.exit( f"Need DUT binaries {DEFAULT_ENCODER_DUT} and {DEFAULT_DECODER_DUT}.\n" "Please create the binaries." @@ -93,7 +98,11 @@ def main(argv): else: cmd = ["python3", "-m", "pytest"] if args.param_file: - cmd += ["tests/codec_be_on_mr_nonselection/test_param_file.py", "--param_file", args.param_file] + cmd += [ + "tests/codec_be_on_mr_nonselection/test_param_file.py", + "--param_file", + args.param_file, + ] else: cmd += ["tests/codec_be_on_mr_nonselection"] cmd += ["-n", args.numprocesses] diff --git a/tests/scale_pcm.py b/tests/scale_pcm.py index 9aef914da1..614e8cef3f 100755 --- a/tests/scale_pcm.py +++ b/tests/scale_pcm.py @@ -1,33 +1,35 @@ #!/usr/bin/env python3 -import os -import sys import argparse +import os import pathlib +import sys THIS_PATH = os.path.join(os.getcwd(), __file__) sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) +import concurrent.futures + +import numpy as np import pyaudio3dtools import pyivastest -import numpy as np -import concurrent.futures def scale_folder(folder, factor): - files = list(folder.glob("*.wav")) with concurrent.futures.ThreadPoolExecutor() as executor: executor.map(scale_file, files, files, [factor] * len(files)) -def scale_file(file1, file2, factor = 1.0) -> None: + +def scale_file(file1, file2, factor=1.0) -> None: """ Scale file1 to file2 """ s1, fs = pyaudio3dtools.audiofile.readfile(file1) - s2 = s1 * factor; + s2 = s1 * factor pyaudio3dtools.audiofile.writefile(file2, s2, fs) + if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("folder", type=pathlib.Path) diff --git a/tests/test_26444.py b/tests/test_26444.py index ccf8d23fad..61fd2d39fe 100644 --- a/tests/test_26444.py +++ b/tests/test_26444.py @@ -32,21 +32,28 @@ __doc__ = """ Execute tests specified via a parameter file. """ -import os -from pathlib import Path import filecmp +import os import subprocess +from pathlib import Path + import pytest test_dict = {} -TEST_DIR = "evs_be_test" -scripts=["Readme_AMRWB_IO_dec.txt", "Readme_AMRWB_IO_enc.txt", "Readme_EVS_dec.txt","Readme_EVS_enc.txt", "Readme_JBM_dec.txt"] +TEST_DIR = "evs_be_test" +scripts = [ + "Readme_AMRWB_IO_dec.txt", + "Readme_AMRWB_IO_enc.txt", + "Readme_EVS_dec.txt", + "Readme_EVS_enc.txt", + "Readme_JBM_dec.txt", +] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: tag = "" enc_opts = "" dec_opts = "" - diff_opts = "" + diff_opts = "" for line in fp.readlines(): if line.startswith("$ENC_BIN"): enc_opts = line @@ -54,33 +61,33 @@ for s in scripts: dec_opts = line if line.startswith("$DIFF_BIN"): diff_opts = line[9:] - tag = s + "--" + diff_opts.split()[1].split('/')[-1] + tag = s + "--" + diff_opts.split()[1].split("/")[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") - continue + continue test_dict[tag] = (enc_opts, dec_opts, diff_opts) tag = "" enc_opts = "" dec_opts = "" - diff_opts = "" + diff_opts = "" + @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_evs_26444(test_tag): - enc_opts, dec_opts, diff_opts = test_dict[test_tag] if enc_opts: enc_opts = enc_opts.replace("./", TEST_DIR + "/") - subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:]) + subprocess.run(["./IVAS_cod", "-q"] + enc_opts.split()[1:]) if dec_opts: dec_opts = dec_opts.replace("./", TEST_DIR + "/") - subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:]) - + subprocess.run(["./IVAS_dec", "-q"] + dec_opts.split()[1:]) + diff_opts = diff_opts.replace("./", TEST_DIR + "/") - if ';' in diff_opts: - cmd1, cmd2 = diff_opts.split(';') + if ";" in diff_opts: + cmd1, cmd2 = diff_opts.split(";") cmd1 = cmd1.split() - cmd2 = cmd2.split() + cmd2 = cmd2.split() result1 = filecmp.cmp(cmd1[0], cmd1[1]) result2 = filecmp.cmp(cmd2[2], cmd2[3]) else: @@ -89,6 +96,3 @@ def test_evs_26444(test_tag): result2 = True if not (result1 and result2): pytest.fail("Output differs") - - - \ No newline at end of file diff --git a/tests/test_param_file_ltv.py b/tests/test_param_file_ltv.py index d74a32aa76..5eae8d343d 100644 --- a/tests/test_param_file_ltv.py +++ b/tests/test_param_file_ltv.py @@ -32,17 +32,20 @@ __doc__ = """ Execute tests specified via a parameter file. """ -import os -from pathlib import Path import errno -import platform import filecmp +import os +import platform +from pathlib import Path from subprocess import run + import pytest + from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend from tests.cut_pcm import cut_samples -from tests.conftest import EncoderFrontend, DecoderFrontend -#from tests.testconfig import PARAM_FILE + +# from tests.testconfig import PARAM_FILE VALID_DEC_OUTPUT_CONF = [ @@ -201,7 +204,7 @@ def test_param_file_tests( is_exist = os.path.exists(cut_file) if is_exist: os.remove(cut_file) - + # check for networkSimulator_g192 command line if sim_opts != "": sim_split = sim_opts.split() @@ -231,7 +234,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # check for eid-xor command line if eid_opts != "": eid_split = eid_opts.split() @@ -256,7 +259,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # evaluate decoder options dec_split = dec_opts.split() assert len(dec_split) >= 3 @@ -303,7 +306,6 @@ def test_param_file_tests( assert bitstream_file_dec == "bit" # in the parameter file, only "bit" is used as bitstream file name # -> re-use bitstream filename from encoder call - # the output file is not the real output filename # -> construct output filename @@ -322,21 +324,26 @@ def test_param_file_tests( update_ref, tracefile_dec, ) - + if update_ref in [0, 2]: dut_output_file = f"{dut_base_path}/param_file/dec/{output_file}" ref_output_file = f"{reference_path}/param_file/dec/{output_file}" fs = int(sampling_rate) * 1000 output_differs, reason = cmp_pcm( - dut_output_file, ref_output_file, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim + dut_output_file, + ref_output_file, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, ) md_out_files = get_expected_md_files(ref_output_file, enc_split, output_config) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) metadata_differs = False for md_file in md_out_files: @@ -375,7 +382,6 @@ def test_param_file_tests( os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") - def encode( dut_encoder_frontend, ref_encoder_frontend, @@ -487,7 +493,8 @@ def simulate( cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file cmd_opts[3] = f"{dut_out_dir}/{netsim_tracefile}" run(netsim + cmd_opts, check=False) - + + def error_insertion( reference_path, dut_base_path, @@ -498,7 +505,7 @@ def error_insertion( """ Call eid-xor to insert frame erasure on REF and/or DUT encoder output. """ - + # directories dut_out_dir = f"{dut_base_path}/param_file/enc" ref_out_dir = f"{reference_path}/param_file/enc" @@ -508,28 +515,21 @@ def error_insertion( ref_out_file = f"{ref_out_dir}/{eid_xor_outfile}" if platform.system() == "Windows": - eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", "Win32", "eid-xor.exe" - ) - ] + eid_xor = [os.path.join(rootdir, "scripts", "tools", "Win32", "eid-xor.exe")] elif platform.system() in ["Linux", "Darwin"]: eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", platform.system(), "eid-xor" - ) + os.path.join(rootdir, "scripts", "tools", platform.system(), "eid-xor") ] else: assert False, f"eid-xor not available for {platform.system()}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): # call eid-xor on REF encoder output cmd_opts = eid_opts_list cmd_opts[-3] = f"{ref_out_dir}/{eid_xor_infile}" cmd_opts[-1] = f"{ref_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) - + if update_ref in [0, 2]: # call eid-xor on DUT encoder output cmd_opts = eid_opts_list @@ -537,6 +537,7 @@ def error_insertion( cmd_opts[-1] = f"{dut_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) + def decode( decoder_frontend, ref_decoder_frontend, diff --git a/tests/testconfig.py b/tests/testconfig.py index 1dbfbb8403..93a29429f2 100644 --- a/tests/testconfig.py +++ b/tests/testconfig.py @@ -1,5 +1,4 @@ -__copyright__ = \ -""" +__copyright__ = """ (C) 2022-2023 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, @@ -29,11 +28,10 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ To configure test modules. """ PARAM_FILE = "scripts/config/self_test.prm" -MD5_REF_DICT = dict() \ No newline at end of file +MD5_REF_DICT = dict() -- GitLab From 9f335434993596d21f666ea60e8a313b6d5e5da6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 8 Feb 2024 11:20:02 +0100 Subject: [PATCH 239/498] clang format --- lib_com/ari_hm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index fe9f077290..0ee33b042f 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -306,7 +306,7 @@ void tcx_hm_modify_envelope( ++h; #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI tmp = ( h * lag ); - k = tmp >> fract_res ; + k = tmp >> fract_res; #else k = ( h * lag ) >> fract_res; #endif -- GitLab From e2d1b6921183a56138d0f56cdc8950d3224fa0e8 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 8 Feb 2024 11:27:15 +0100 Subject: [PATCH 240/498] fix warning under VS --- lib_com/ari_hm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 0ee33b042f..7060e6cd21 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -299,7 +299,11 @@ void tcx_hm_modify_envelope( int32_t tmp; #endif +#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI + for ( x = (int16_t) max( 0, k - kTcxHmParabolaHalfWidth ); x <= (int16_t) min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) +#else for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) +#endif { env[x] = Mpy_32_16( env[x], inv_shape[x - k + kTcxHmParabolaHalfWidth] ); } -- GitLab From 6ee8b46a1e951a40f35fe6a3995b2cbcf49789d5 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 8 Feb 2024 12:12:32 +0100 Subject: [PATCH 241/498] add argument for scope of short testvector creation --- tests/create_short_testvectors.py | 34 +++++++++++++++++++++---------- tests/cut_pcm.py | 7 ++----- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index e2fde0291f..45b4b863c8 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (C) 2022-2023 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, @@ -31,12 +30,12 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ Create short (5sec) testvectors. """ import sys +import argparse from pathlib import Path from cut_pcm import cut_samples @@ -47,25 +46,38 @@ NUM_CHANNELS = "4" # currently only FOA CUT_FROM = "0.0" CUT_LEN = "5.0" -FILE_IDS = ["stvFOA"] +FILE_IDS = ["stvFOA", "stv20A", "stv3OA", "stv51MC", "stv71MC", "stv512MC", "stv514MC", "stv714MC", "ISM", "MASA"] GAINS = ["1.0", "16.0", ".004"] -def collect_files(): - files = [f.absolute() for f in TEST_VECTOR_DIR.iterdir() if f.suffix == ".wav" and any([f.name.startswith(id) for id in FILE_IDS])] +def collect_files(file_ids): + files = [ + f.absolute() + for f in TEST_VECTOR_DIR.iterdir() + if f.suffix == ".wav" and any([id in f.name for id in file_ids]) and not "_cut" in f.name + ] return files -def create_short_testvectors(): - for f in collect_files(): +def create_short_testvectors(which="foa"): + file_ids = [] + if which == "all": + file_ids = FILE_IDS + elif which == "foa": + file_ids = FILE_IDS[:1] + + for f in collect_files(file_ids): for g in GAINS: suffix = "_cut" if g != "1.0": suffix += f"_{g}" - out_file = f.parent.joinpath(f.stem + suffix + f.suffix) + out_file = f.parent.joinpath(f.stem + suffix + f.suffix) cut_samples(f, out_file, NUM_CHANNELS, CUT_FROM, CUT_LEN, g) if __name__ == "__main__": - sys.exit(create_short_testvectors()) + parser = argparse.ArgumentParser() + parser.add_argument("which", choices=["foa", "all"]) + args = parser.parse_args() + sys.exit(create_short_testvectors(args.which)) diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index 752a4eff14..3094e2fb5c 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -87,11 +87,8 @@ def cut_samples(in_file, out_file, num_channels, start, duration, gain="1.0", sa num_in_samples = s.shape[0] num_samples_to_skip = int(start_sec * fs) dur_samples = int(dur_sec * fs) - if num_samples_to_skip + dur_samples > num_in_samples: - sys.exit( - f"requested too many samples ({num_samples_to_skip}+{dur_samples})" - + f" - input is too short ({num_in_samples})" - ) + if num_samples_to_skip > dur_samples: + raise ValueError(f"Requested to skip {num_samples_to_skip}, but file only has {dur_samples} samples") s_out = s[num_samples_to_skip:num_samples_to_skip + dur_samples, :] * gain_f -- GitLab From b248081a88827437ec1e60b00f2cd2a8a79172f4 Mon Sep 17 00:00:00 2001 From: Arnaud Lefort Date: Thu, 8 Feb 2024 14:49:01 +0100 Subject: [PATCH 242/498] Fading optimisation in terms of complexity. --- lib_com/options.h | 5 ++- lib_enc/ivas_stereo_dmx_evs.c | 69 ++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e28f394469..aa98bf6944 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,7 +168,10 @@ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ #define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ -#define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ +#define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ +#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA +#define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ +#endif /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index 813d10e1cf..29893d17ea 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -120,10 +120,10 @@ #define STEREO_DMX_EVS_SGC_LEGY_THRES_48 5.E8 #define STEREO_DMX_EVS_SGC_GMAX 1.4142f #define STEREO_DMX_EVS_SGC_GMIN 0.7071f -#endif #define STEREO_DMX_EVS_IPD_ILD_THRES 3.16f // 5dB #define STEREO_DMX_EVS_IPD_SF_THRES 0.05f +#endif /*-----------------------------------------------------------------------* * Local function prototypes @@ -1577,7 +1577,11 @@ void stereo_dmx_evs_enc( #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA float dmx_weight, corr; +#ifdef NONBE_FIX_947_STEREO_DMX_FADOPT + int16_t k, m, n, pha_len, fad_len, input_subframe, input_frame, n_fad_r, n_fad_g, m_fad_g, n_fad_cnt, sbfad_len; +#else int16_t k, m, n, pha_len, fad_len, input_subframe, input_frame, n_fad_r, n_fad_g, m_fad_g, n_fad_cnt; +#endif float data_f[CPE_CHANNELS][L_FRAME48k]; float mem_prev[STEREO_DMX_EVS_FAD_LEN_MAX], data_mem[STEREO_DMX_EVS_DATA_LEN_MAX]; float dmx_poc_data[L_FRAME48k], dmx_pha_data[L_FRAME48k], subframe_energy[STEREO_DMX_EVS_NB_SBFRM]; @@ -1823,7 +1827,11 @@ void stereo_dmx_evs_enc( else { hPHA->n_fad_g = input_frame - hPHA->n_fad_g - 1; +#ifdef NONBE_FIX_947_STEREO_DMX_FADOPT + hPHA->n_fad_cnt = 0; +#else hPHA->n_fad_cnt = is_transient ? 0 : n_fad_r - hPHA->n_fad_cnt; +#endif } } else if ( is_transient ) @@ -1840,6 +1848,59 @@ void stereo_dmx_evs_enc( n_fad_cnt = hPHA->n_fad_cnt; m_fad_g = input_frame - n_fad_g - 1; +#ifdef NONBE_FIX_947_STEREO_DMX_FADOPT + if ( n_fad_r == 1 ) + { + n_fad_cnt = 0; + for ( n = 0; n < fad_len; n++ ) + { + p_dmx_data[n] *= fad_g[n_fad_g++]; + p_dmx_data[n] += fad_g[m_fad_g--] * p_dmx_data_fo[n]; + } + } + else + { + n = 0; + sbfad_len = 0; + if ( n_fad_cnt != 0 ) + { + sbfad_len = min( fad_len, n_fad_r - n_fad_cnt ); + for ( ; n < sbfad_len; n++ ) + { + p_dmx_data[n] *= fad_g[n_fad_g]; + p_dmx_data[n] += fad_g[m_fad_g] * p_dmx_data_fo[n]; + } + n_fad_cnt = 0; + n_fad_g++; + m_fad_g--; + } + + sbfad_len = (int16_t) ( ( fad_len - sbfad_len ) / n_fad_r ); + for ( k = 0; k < sbfad_len; k++ ) + { + for ( m = 0; m < n_fad_r; m++ ) + { + p_dmx_data[n] *= fad_g[n_fad_g]; + p_dmx_data[n] += fad_g[m_fad_g] * p_dmx_data_fo[n]; + n++; + } + n_fad_g++; + m_fad_g--; + } + + for ( ; n < fad_len; n++ ) + { + p_dmx_data[n] *= fad_g[n_fad_g]; + p_dmx_data[n] += fad_g[m_fad_g] * p_dmx_data_fo[n]; + if ( ++n_fad_cnt >= n_fad_r ) + { + n_fad_cnt = 0; + n_fad_g++; + m_fad_g--; + } + } + } +#else for ( n = 0; n < fad_len; n++ ) { p_dmx_data[n] *= fad_g[n_fad_g]; @@ -1852,6 +1913,7 @@ void stereo_dmx_evs_enc( m_fad_g--; } } +#endif hPHA->n_fad_g = n_fad_g; hPHA->n_fad_cnt = n_fad_cnt; @@ -2407,8 +2469,11 @@ ivas_error stereo_dmx_evs_init_encoder( #ifndef NONBE_FIX_947_STEREO_DMX_EVS_PHA hStereoDmxEVS->hPHA->fad_len_prc = (int16_t) ( STEREO_DMX_EVS_FADE_LEN_PRC * (float) input_Fs / 1000.0f ); -#endif + fad_len = hStereoDmxEVS->hPHA->fad_len_prc; +#else fad_len = input_frame; +#endif + fad_g = hStereoDmxEVS->hPHA->fad_g_prc; fad_r = 1.0f / (float) ( fad_len + 1 ); fad_len2 = fad_len / 2; -- GitLab From 29975c71bc0ca47c464d4349edd94c205f77e05d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 8 Feb 2024 15:12:40 +0100 Subject: [PATCH 243/498] Add prepare_combined_format_inputs.py --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98f7b950ac..2b0477f4dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1245,6 +1245,7 @@ ivas-conformance: - non_be_flag=0 - exit_code=0 - python3 tests/create_short_testvectors.py + - python3 prepare_combined_format_inputs.py - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref --html=report1.html --self-contained-html --keep_files || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 --keep_files || exit_code=$? - python3 -m pytest tests/renderer/test_renderer.py --create_ref --keep_files || exit_code=$? -- GitLab From 2d839a7787df4ff1795c29718a8f61151c8da59f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 8 Feb 2024 15:14:56 +0100 Subject: [PATCH 244/498] Fix call to scripts/prepare_combined_format_inputs.py --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b0477f4dd..f16bf9e2f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1245,7 +1245,7 @@ ivas-conformance: - non_be_flag=0 - exit_code=0 - python3 tests/create_short_testvectors.py - - python3 prepare_combined_format_inputs.py + - python3 scripts/prepare_combined_format_inputs.py - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref --html=report1.html --self-contained-html --keep_files || exit_code=$? - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 --keep_files || exit_code=$? - python3 -m pytest tests/renderer/test_renderer.py --create_ref --keep_files || exit_code=$? -- GitLab From b1f56f6019f66729ac757330d339d672186549ad Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 15:54:14 +0100 Subject: [PATCH 245/498] [format] run formatting again --- tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py | 3 +-- tests/create_short_testvectors.py | 3 +-- tests/cut_pcm.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py index 2aef74ec66..d6c26415ea 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py @@ -1,5 +1,4 @@ -__copyright__ = \ - """ +__copyright__ = """ (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, diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index e04bdf753e..0b8ee79c81 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (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, diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index ece225b5fa..60bac699cb 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (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, -- GitLab From c81f1b4b074e367b97c725c7b6afe9b2179a98f1 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 8 Feb 2024 16:22:03 +0100 Subject: [PATCH 246/498] add git pull in long self test --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3dd07fca2..8c5d81e59b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1240,6 +1240,7 @@ test-long-self-test: ### switch to main - git checkout main + - git pull - echo "Building reference codec at commit $(git rev-parse HEAD)" ### build main (ref) binaries -- GitLab From d5c2b34fc166f6bfd3afef0def9fa08bfeff90f4 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 16:24:21 +0100 Subject: [PATCH 247/498] move renderer pytest data to scripts/testv --- .../renderer/data => scripts/testv}/ism1_ivas_mtdt_config.txt | 0 .../renderer/data => scripts/testv}/ism1_shorthand_config.txt | 0 .../renderer/data => scripts/testv}/ism2_ivas_mtdt_config.txt | 0 .../renderer/data => scripts/testv}/ism2_shorthand_config.txt | 0 .../renderer/data => scripts/testv}/ism3_ivas_mtdt_config.txt | 0 .../renderer/data => scripts/testv}/ism3_shorthand_config.txt | 0 .../renderer/data => scripts/testv}/ism4_ivas_mtdt_config.txt | 0 .../renderer/data => scripts/testv}/ism4_shorthand_config.txt | 0 {tests/renderer/data => scripts/testv}/ism_0a_0e.csv | 0 {tests/renderer/data => scripts/testv}/masa_scene.txt | 0 .../renderer/data => scripts/testv}/mixed_ivas_mtdt_config.txt | 0 .../data => scripts/testv}/mixed_ivas_mtdt_gain_config.txt | 0 .../data => scripts/testv}/mixed_mc714_foa_masa2_ism4.txt | 0 {tests/renderer/data => scripts/testv}/mixed_scene.txt | 0 {tests/renderer/data => scripts/testv}/mixed_scene_simple.txt | 0 .../renderer/data => scripts/testv}/mixed_shorthand_config.txt | 0 .../data => scripts/testv}/mixed_shorthand_gain_config.txt | 0 .../data => scripts/testv}/mixed_shorthand_limiter_config.txt | 0 .../data => scripts/testv}/renderer_config_format_readme.txt | 0 .../data => scripts/testv}/spectral_test_10ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_11ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_12ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_13ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_15ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_16ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_17ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_18ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_19ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_1ch_48kHz.wav | 0 .../data => scripts/testv}/spectral_test_20ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_2ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_3ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_4ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_5ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_6ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_7ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_8ch_48kHz.wav | 0 .../renderer/data => scripts/testv}/spectral_test_9ch_48kHz.wav | 0 tests/renderer/constants.py | 2 +- 39 files changed, 1 insertion(+), 1 deletion(-) rename {tests/renderer/data => scripts/testv}/ism1_ivas_mtdt_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism1_shorthand_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism2_ivas_mtdt_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism2_shorthand_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism3_ivas_mtdt_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism3_shorthand_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism4_ivas_mtdt_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism4_shorthand_config.txt (100%) rename {tests/renderer/data => scripts/testv}/ism_0a_0e.csv (100%) rename {tests/renderer/data => scripts/testv}/masa_scene.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_ivas_mtdt_config.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_ivas_mtdt_gain_config.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_mc714_foa_masa2_ism4.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_scene.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_scene_simple.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_shorthand_config.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_shorthand_gain_config.txt (100%) rename {tests/renderer/data => scripts/testv}/mixed_shorthand_limiter_config.txt (100%) rename {tests/renderer/data => scripts/testv}/renderer_config_format_readme.txt (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_10ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_11ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_12ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_13ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_15ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_16ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_17ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_18ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_19ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_1ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_20ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_2ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_3ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_4ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_5ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_6ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_7ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_8ch_48kHz.wav (100%) rename {tests/renderer/data => scripts/testv}/spectral_test_9ch_48kHz.wav (100%) diff --git a/tests/renderer/data/ism1_ivas_mtdt_config.txt b/scripts/testv/ism1_ivas_mtdt_config.txt similarity index 100% rename from tests/renderer/data/ism1_ivas_mtdt_config.txt rename to scripts/testv/ism1_ivas_mtdt_config.txt diff --git a/tests/renderer/data/ism1_shorthand_config.txt b/scripts/testv/ism1_shorthand_config.txt similarity index 100% rename from tests/renderer/data/ism1_shorthand_config.txt rename to scripts/testv/ism1_shorthand_config.txt diff --git a/tests/renderer/data/ism2_ivas_mtdt_config.txt b/scripts/testv/ism2_ivas_mtdt_config.txt similarity index 100% rename from tests/renderer/data/ism2_ivas_mtdt_config.txt rename to scripts/testv/ism2_ivas_mtdt_config.txt diff --git a/tests/renderer/data/ism2_shorthand_config.txt b/scripts/testv/ism2_shorthand_config.txt similarity index 100% rename from tests/renderer/data/ism2_shorthand_config.txt rename to scripts/testv/ism2_shorthand_config.txt diff --git a/tests/renderer/data/ism3_ivas_mtdt_config.txt b/scripts/testv/ism3_ivas_mtdt_config.txt similarity index 100% rename from tests/renderer/data/ism3_ivas_mtdt_config.txt rename to scripts/testv/ism3_ivas_mtdt_config.txt diff --git a/tests/renderer/data/ism3_shorthand_config.txt b/scripts/testv/ism3_shorthand_config.txt similarity index 100% rename from tests/renderer/data/ism3_shorthand_config.txt rename to scripts/testv/ism3_shorthand_config.txt diff --git a/tests/renderer/data/ism4_ivas_mtdt_config.txt b/scripts/testv/ism4_ivas_mtdt_config.txt similarity index 100% rename from tests/renderer/data/ism4_ivas_mtdt_config.txt rename to scripts/testv/ism4_ivas_mtdt_config.txt diff --git a/tests/renderer/data/ism4_shorthand_config.txt b/scripts/testv/ism4_shorthand_config.txt similarity index 100% rename from tests/renderer/data/ism4_shorthand_config.txt rename to scripts/testv/ism4_shorthand_config.txt diff --git a/tests/renderer/data/ism_0a_0e.csv b/scripts/testv/ism_0a_0e.csv similarity index 100% rename from tests/renderer/data/ism_0a_0e.csv rename to scripts/testv/ism_0a_0e.csv diff --git a/tests/renderer/data/masa_scene.txt b/scripts/testv/masa_scene.txt similarity index 100% rename from tests/renderer/data/masa_scene.txt rename to scripts/testv/masa_scene.txt diff --git a/tests/renderer/data/mixed_ivas_mtdt_config.txt b/scripts/testv/mixed_ivas_mtdt_config.txt similarity index 100% rename from tests/renderer/data/mixed_ivas_mtdt_config.txt rename to scripts/testv/mixed_ivas_mtdt_config.txt diff --git a/tests/renderer/data/mixed_ivas_mtdt_gain_config.txt b/scripts/testv/mixed_ivas_mtdt_gain_config.txt similarity index 100% rename from tests/renderer/data/mixed_ivas_mtdt_gain_config.txt rename to scripts/testv/mixed_ivas_mtdt_gain_config.txt diff --git a/tests/renderer/data/mixed_mc714_foa_masa2_ism4.txt b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt similarity index 100% rename from tests/renderer/data/mixed_mc714_foa_masa2_ism4.txt rename to scripts/testv/mixed_mc714_foa_masa2_ism4.txt diff --git a/tests/renderer/data/mixed_scene.txt b/scripts/testv/mixed_scene.txt similarity index 100% rename from tests/renderer/data/mixed_scene.txt rename to scripts/testv/mixed_scene.txt diff --git a/tests/renderer/data/mixed_scene_simple.txt b/scripts/testv/mixed_scene_simple.txt similarity index 100% rename from tests/renderer/data/mixed_scene_simple.txt rename to scripts/testv/mixed_scene_simple.txt diff --git a/tests/renderer/data/mixed_shorthand_config.txt b/scripts/testv/mixed_shorthand_config.txt similarity index 100% rename from tests/renderer/data/mixed_shorthand_config.txt rename to scripts/testv/mixed_shorthand_config.txt diff --git a/tests/renderer/data/mixed_shorthand_gain_config.txt b/scripts/testv/mixed_shorthand_gain_config.txt similarity index 100% rename from tests/renderer/data/mixed_shorthand_gain_config.txt rename to scripts/testv/mixed_shorthand_gain_config.txt diff --git a/tests/renderer/data/mixed_shorthand_limiter_config.txt b/scripts/testv/mixed_shorthand_limiter_config.txt similarity index 100% rename from tests/renderer/data/mixed_shorthand_limiter_config.txt rename to scripts/testv/mixed_shorthand_limiter_config.txt diff --git a/tests/renderer/data/renderer_config_format_readme.txt b/scripts/testv/renderer_config_format_readme.txt similarity index 100% rename from tests/renderer/data/renderer_config_format_readme.txt rename to scripts/testv/renderer_config_format_readme.txt diff --git a/tests/renderer/data/spectral_test_10ch_48kHz.wav b/scripts/testv/spectral_test_10ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_10ch_48kHz.wav rename to scripts/testv/spectral_test_10ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_11ch_48kHz.wav b/scripts/testv/spectral_test_11ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_11ch_48kHz.wav rename to scripts/testv/spectral_test_11ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_12ch_48kHz.wav b/scripts/testv/spectral_test_12ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_12ch_48kHz.wav rename to scripts/testv/spectral_test_12ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_13ch_48kHz.wav b/scripts/testv/spectral_test_13ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_13ch_48kHz.wav rename to scripts/testv/spectral_test_13ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_15ch_48kHz.wav b/scripts/testv/spectral_test_15ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_15ch_48kHz.wav rename to scripts/testv/spectral_test_15ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_16ch_48kHz.wav b/scripts/testv/spectral_test_16ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_16ch_48kHz.wav rename to scripts/testv/spectral_test_16ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_17ch_48kHz.wav b/scripts/testv/spectral_test_17ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_17ch_48kHz.wav rename to scripts/testv/spectral_test_17ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_18ch_48kHz.wav b/scripts/testv/spectral_test_18ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_18ch_48kHz.wav rename to scripts/testv/spectral_test_18ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_19ch_48kHz.wav b/scripts/testv/spectral_test_19ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_19ch_48kHz.wav rename to scripts/testv/spectral_test_19ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_1ch_48kHz.wav b/scripts/testv/spectral_test_1ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_1ch_48kHz.wav rename to scripts/testv/spectral_test_1ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_20ch_48kHz.wav b/scripts/testv/spectral_test_20ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_20ch_48kHz.wav rename to scripts/testv/spectral_test_20ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_2ch_48kHz.wav b/scripts/testv/spectral_test_2ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_2ch_48kHz.wav rename to scripts/testv/spectral_test_2ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_3ch_48kHz.wav b/scripts/testv/spectral_test_3ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_3ch_48kHz.wav rename to scripts/testv/spectral_test_3ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_4ch_48kHz.wav b/scripts/testv/spectral_test_4ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_4ch_48kHz.wav rename to scripts/testv/spectral_test_4ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_5ch_48kHz.wav b/scripts/testv/spectral_test_5ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_5ch_48kHz.wav rename to scripts/testv/spectral_test_5ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_6ch_48kHz.wav b/scripts/testv/spectral_test_6ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_6ch_48kHz.wav rename to scripts/testv/spectral_test_6ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_7ch_48kHz.wav b/scripts/testv/spectral_test_7ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_7ch_48kHz.wav rename to scripts/testv/spectral_test_7ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_8ch_48kHz.wav b/scripts/testv/spectral_test_8ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_8ch_48kHz.wav rename to scripts/testv/spectral_test_8ch_48kHz.wav diff --git a/tests/renderer/data/spectral_test_9ch_48kHz.wav b/scripts/testv/spectral_test_9ch_48kHz.wav similarity index 100% rename from tests/renderer/data/spectral_test_9ch_48kHz.wav rename to scripts/testv/spectral_test_9ch_48kHz.wav diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 056242bd3c..b49f006d79 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -35,7 +35,7 @@ from pathlib import Path """ Set up paths """ TESTS_DIR = Path(__file__).parent SCRIPTS_DIR = TESTS_DIR.parents[1].joinpath("scripts").resolve() -TEST_VECTOR_DIR = TESTS_DIR.joinpath("data") +TEST_VECTOR_DIR = SCRIPTS_DIR.joinpath("testv") OUTPUT_PATH_REF = TESTS_DIR.joinpath("ref") OUTPUT_PATH_CUT = TESTS_DIR.joinpath("cut") -- GitLab From 8bef53f6d3986f976901f40522d96719642b480e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 16:32:37 +0100 Subject: [PATCH 248/498] update mixed scene .txt file --- scripts/testv/mixed_mc714_foa_masa2_ism4.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/testv/mixed_mc714_foa_masa2_ism4.txt b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt index e29dabb46c..c7f8e4276a 100644 --- a/scripts/testv/mixed_mc714_foa_masa2_ism4.txt +++ b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt @@ -1,4 +1,4 @@ -../../../scripts/testv/mixed_mc714_foa_masa2_ism4.wav +mixed_mc714_foa_masa2_ism4.wav 7 MC 1 @@ -9,16 +9,16 @@ SBA MASA 17 2 -../../../scripts/testv/stv2MASA2TC48c.met +MASA2TC48c.met ISM 19 -../../../scripts/testv/stvISM1.csv +stvISM1.csv ISM 20 -../../../scripts/testv/stvISM2.csv +stvISM2.csv ISM 21 -../../../scripts/testv/stvISM3.csv +stvISM3.csv ISM 22 -../../../scripts/testv/stvISM4.csv \ No newline at end of file +stvISM4.csv -- GitLab From c610912336ae13e77dbfc903e2035cced5a73a97 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 16:43:56 +0100 Subject: [PATCH 249/498] [ci] remove old cp command in .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f16bf9e2f1..de622c6cfb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1268,7 +1268,6 @@ ivas-conformance: - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - cp -r tests/ref testvec/testv/ref - cp -r tests/dut/* testvec/testv/ref - - cp -r tests/renderer/data testvec/renderer/data - cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r conformance-test testvec/ - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec -- GitLab From 597f9fb4561819f8462a7713fcf935f44e12ee56 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 8 Feb 2024 16:48:47 +0100 Subject: [PATCH 250/498] dummy commit to trigger ci -- GitLab From 6983d22c488b81724f880f3ee653b2d0c4fb221f Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Thu, 8 Feb 2024 16:49:56 +0100 Subject: [PATCH 251/498] Use hOutSetup.output_config for ism --- lib_dec/ivas_ism_dec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index b2bcf783da..89b1e68316 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,7 +199,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( { return error; } +#ifdef NONBE_FIX_978_MC_TDREND_REVERB + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -- GitLab From 7ef27b78f65d05258bd21a1d0628bd1a6ecb704d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Feb 2024 17:00:39 +0100 Subject: [PATCH 252/498] [ci] fix path in conformance test --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de622c6cfb..cace6c4614 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1268,7 +1268,7 @@ ivas-conformance: - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - cp -r tests/ref testvec/testv/ref - cp -r tests/dut/* testvec/testv/ref - - cp -r tests/renderer/cut testvec/testv/renderer/ref + - cp -r tests/renderer/cut testvec/renderer/ref - cp -r conformance-test testvec/ - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin -- GitLab From 9801a2653714f0d91bf6daade580ec02d37d7f96 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 8 Feb 2024 17:07:02 +0100 Subject: [PATCH 253/498] add remote and branch to pull command --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c5d81e59b..3c0c52bbe9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1240,7 +1240,7 @@ test-long-self-test: ### switch to main - git checkout main - - git pull + - git pull origin main - echo "Building reference codec at commit $(git rev-parse HEAD)" ### build main (ref) binaries -- GitLab From 7b9c9c6aacb9a1d7f7a10e941a88c7a1c0caa0e9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 9 Feb 2024 07:35:17 +0100 Subject: [PATCH 254/498] Fix copying of testvec data --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cace6c4614..f3d355e4d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1259,7 +1259,7 @@ ivas-conformance: - mkdir testvec - mkdir testvec/binauralRenderer_interface - mkdir testvec/testv - - mkdir testvec/renderer + - mkdir testvec/testv/renderer - mkdir testvec/bin - cp -r scripts/testv/* testvec/testv - cp -r scripts/ls_layouts testvec @@ -1268,7 +1268,7 @@ ivas-conformance: - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - cp -r tests/ref testvec/testv/ref - cp -r tests/dut/* testvec/testv/ref - - cp -r tests/renderer/cut testvec/renderer/ref + - cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r conformance-test testvec/ - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin -- GitLab From 36a6fb1c7dc9cac173be5d38615808e059dba76b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 9 Feb 2024 08:07:56 +0100 Subject: [PATCH 255/498] Fix in mixed_mc714_foa_masa2_ism4.txt --- scripts/testv/mixed_mc714_foa_masa2_ism4.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/testv/mixed_mc714_foa_masa2_ism4.txt b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt index c7f8e4276a..800e88ae7c 100644 --- a/scripts/testv/mixed_mc714_foa_masa2_ism4.txt +++ b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt @@ -9,7 +9,7 @@ SBA MASA 17 2 -MASA2TC48c.met +stv2MASA2TC48c.met ISM 19 stvISM1.csv -- GitLab From 556cf09d5b5fdfa64295975d4141241febb10570 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 09:33:42 +0100 Subject: [PATCH 256/498] disable switch FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0814cb7e11..8d8f4d3f12 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,7 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ -#define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ +// #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ /* #################### End BE switches ################################## */ -- GitLab From bb46214c454831d77373188be7f0e37465ef7581 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 11:44:49 +0100 Subject: [PATCH 257/498] activate testcases previously failing on main --- scripts/config/self_test.prm | 12 ++++++------ scripts/config/self_test_ltv.prm | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index ef7c2b4521..25cef6b5e6 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1314,9 +1314,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/stv51MC48c.wav_sw_48-48_7_1_4.tst // Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching -// ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv51MC48c.wav bit -// eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error -// ../IVAS_dec BINAURAL 48 bit_error testv/stv51MC48c.wav_sw_48-48_binaural_FER10.tst +../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv51MC48c.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error +../IVAS_dec BINAURAL 48 bit_error testv/stv51MC48c.wav_sw_48-48_binaural_FER10.tst // Multi-channel 5_1_2 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out ../IVAS_cod -mc 5_1_2 ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv512MC48c.wav bit @@ -1685,9 +1685,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stvOSBA_4ISM_3OA32c.wav_EXT_sw_13k2_512k_32-48.tst // OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5%, bandwidth switching -// ../IVAS_cod -max_band testv/ivas_bws_20fr_start_FB.txt -ism_sba 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_FOA48c.wav bit -// eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -// ../IVAS_dec BINAURAL 48 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-48_FER5.tst +../IVAS_cod -max_band testv/ivas_bws_20fr_start_FB.txt -ism_sba 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_FOA48c.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error +../IVAS_dec BINAURAL 48 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-48_FER5.tst // OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% ../IVAS_cod -ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_3ISM_2OA48c.wav bit diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 27db3b37df..1951ef3b8e 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1257,9 +1257,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/ltv48_MC51.wav_sw_48-48_7_1_4.tst // Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching -// ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_MC51.wav bit -// eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error -// ../IVAS_dec BINAURAL 48 bit_error testv/ltv48_MC51.wav_sw_48-48_binaural_FER10.tst +../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_MC51.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error +../IVAS_dec BINAURAL 48 bit_error testv/ltv48_MC51.wav_sw_48-48_binaural_FER10.tst // Multi-channel 5_1_2 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out ../IVAS_cod -mc 5_1_2 ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MC512.wav bit @@ -1612,9 +1612,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/ltv32_OSBA_4ISM_HOA3.wav_EXT_sw_13k2_512k_32-32.tst // OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5%, bandwidth switching -// ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_4ISM_FOA.wav bit -// eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -// ../IVAS_dec BINAURAL 48 bit_error testv/ltv48_OSBA_4ISM_FOA.wav_BINAURAL_sw_48-48_FER5.tst +../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_4ISM_FOA.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error +../IVAS_dec BINAURAL 48 bit_error testv/ltv48_OSBA_4ISM_FOA.wav_BINAURAL_sw_48-48_FER5.tst // OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% // ../IVAS_cod -ism_sba 3 2 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_3ISM_2OA.wav bit -- GitLab From c9ce35b8b0b731c0b08cc2ed4893a2007f3eeedf Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 12:09:26 +0100 Subject: [PATCH 258/498] remove merge artifacts --- lib_com/options.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 490b1a1edd..865e54b2f7 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,14 +163,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_BINARY_BINAURAL_READING /* Orange: Add support for reading binaural binary file */ -#define NONBE_FIX_AVG_IAC_CLDFB_REVERB /* Orange: Add computation avg energy and iac tables for rom and binaural binary file */ -#define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ -#define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ -#define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ -#define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ -#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ -#define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ -- GitLab From 612813eedb2ee66a948d54ab81a569bb089a8d0f Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 9 Feb 2024 12:18:48 +0100 Subject: [PATCH 259/498] in ParamMC decoder, set up rendering config for BINAURAL_ROOM_REVERB in the same way as BINAURAL_ROOM_IR --- lib_com/options.h | 6 +++++- lib_dec/ivas_output_config.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index e99cb812af..ac76eb3e52 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,7 +173,11 @@ #define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ #define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ -#define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ +#define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ +#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ + +#define DISABLE_LIMITER + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index da37b0ce96..27b6efb3a7 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -225,8 +225,12 @@ void ivas_renderer_select( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) +#else +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL ) #else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif #endif { #ifdef DEBUGGING -- GitLab From ea668d45f0ab59019a6bd792ae685414e77330d6 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 9 Feb 2024 12:36:10 +0100 Subject: [PATCH 260/498] do not disable the limiter --- lib_com/options.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ac76eb3e52..d281254582 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -176,8 +176,6 @@ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ -#define DISABLE_LIMITER - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From b3c125392f3116e433130582471db47342551822 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 14:05:44 +0100 Subject: [PATCH 261/498] instead of cast, use 32 bit var --- lib_com/ari_hm.c | 6 +++--- lib_com/options.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index afcdf52ad6..2a7718e843 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -273,8 +273,8 @@ void tcx_hm_modify_envelope( ) { #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI - int16_t h, x; - int32_t k; + int16_t h; + int32_t x, k; #else int16_t k, h, x; #endif @@ -300,7 +300,7 @@ void tcx_hm_modify_envelope( #endif #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI - for ( x = (int16_t) max( 0, k - kTcxHmParabolaHalfWidth ); x <= (int16_t) min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) + for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) #else for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) #endif diff --git a/lib_com/options.h b/lib_com/options.h index 865e54b2f7..8cd276584e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING /* FhG: fix usan error in MCT with bw swicthing */ -// #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ +#define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ /* #################### End BE switches ################################## */ -- GitLab From b63c0bef9e9e0d50baa367c06aaa2904c61848f0 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 9 Feb 2024 15:06:17 +0100 Subject: [PATCH 262/498] Add .exe suffix for Windows in renderer tests --- tests/renderer/constants.py | 7 +++++++ tests/renderer/test_renderer.py | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index b49f006d79..b2a25b9206 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -31,6 +31,7 @@ """ from pathlib import Path +import platform """ Set up paths """ TESTS_DIR = Path(__file__).parent @@ -46,6 +47,12 @@ TESTV_DIR = SCRIPTS_DIR.joinpath("testv") BIN_SUFFIX_MERGETARGET = "_ref" +if platform.system() == "Windows": + EXE_SUFFIX = ".exe" +elif platform.system() in ["Linux", "Darwin"]: + EXE_SUFFIX = "" +else: + assert False, f"Unsupported platform {platform.system()}" """ Renderer commandline template """ RENDERER_CMD = [ diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 9750cc11f4..9db98c1e88 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -52,6 +52,7 @@ def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get test_info, in_fmt, out_fmt, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -68,6 +69,7 @@ def test_ambisonics_binaural_static(record_property, test_info, in_fmt, out_fmt, test_info, in_fmt, out_fmt, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -88,6 +90,7 @@ def test_ambisonics_binaural_headrotation( in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -107,6 +110,7 @@ def test_multichannel(record_property, test_info, in_fmt, out_fmt, frame_size, g test_info, in_fmt, out_fmt, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -126,6 +130,7 @@ def test_multichannel_binaural_static(record_property, test_info, in_fmt, out_fm test_info, in_fmt, out_fmt, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -149,6 +154,7 @@ def test_multichannel_binaural_headrotation( in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -169,6 +175,7 @@ def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, g in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -191,6 +198,7 @@ def test_ism_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_ in_fmt, out_fmt, in_meta_files=in_meta_files, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -215,6 +223,7 @@ def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -235,6 +244,7 @@ def test_masa(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -255,6 +265,7 @@ def test_masa_binaural_static(record_property, test_info, in_fmt, out_fmt, frame in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -277,6 +288,7 @@ def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -292,6 +304,7 @@ def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim): "META", "MASA2", metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + binary_suffix=EXE_SUFFIX, get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -310,6 +323,7 @@ def test_custom_ls_input(record_property, test_info, in_layout, out_fmt, frame_s test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -325,6 +339,7 @@ def test_custom_ls_output(record_property, test_info, in_fmt, out_fmt, get_mld, test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), + binary_suffix=EXE_SUFFIX, get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -339,6 +354,7 @@ def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"), CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), + binary_suffix=EXE_SUFFIX, get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -354,6 +370,7 @@ def test_custom_ls_input_binaural(record_property, test_info, in_layout, out_fmt test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -374,6 +391,7 @@ def test_custom_ls_input_binaural_headrotation( CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -394,6 +412,7 @@ def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_m "META", out_fmt, metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, @@ -414,6 +433,7 @@ def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, no in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan, + binary_suffix=EXE_SUFFIX, get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -430,6 +450,7 @@ def test_non_diegetic_pan_ism_static(record_property, test_info, in_fmt, out_fmt in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan, + binary_suffix=EXE_SUFFIX, get_mld=get_mld, mld_lim=get_mld_lim, ) -- GitLab From be4f170ed7b0428ddb5c9d26bacbecedff875dce Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 9 Feb 2024 15:52:06 +0100 Subject: [PATCH 263/498] apply rendering-setup fix in the split-rendering path too --- lib_dec/ivas_output_config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 27b6efb3a7..def7de11e0 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -224,7 +224,12 @@ void ivas_renderer_select( *internal_config = transport_config; #ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + +#else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) +#endif #else #ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -- GitLab From 32ba3bb67b364a0debe7b2e40f6c0b2ce219dfec Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 16:51:12 +0100 Subject: [PATCH 264/498] make everything 32 bit as done in EVS --- lib_com/ari_hm.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 2a7718e843..3e83529bbb 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -273,8 +273,7 @@ void tcx_hm_modify_envelope( ) { #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI - int16_t h; - int32_t x, k; + int32_t h, x, k; #else int16_t k, h, x; #endif @@ -295,25 +294,12 @@ void tcx_hm_modify_envelope( while ( k <= L_frame + kTcxHmParabolaHalfWidth - 1 ) { -#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI - int32_t tmp; -#endif - -#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI - for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) -#else for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) -#endif { env[x] = Mpy_32_16( env[x], inv_shape[x - k + kTcxHmParabolaHalfWidth] ); } ++h; -#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI - tmp = ( h * lag ); - k = tmp >> fract_res; -#else k = ( h * lag ) >> fract_res; -#endif } return; -- GitLab From 8788323157886710dc5872f2a4f7f623ed85845e Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 17:02:13 +0100 Subject: [PATCH 265/498] fix typo in short testvector script and use short files for hrtf test --- tests/create_short_testvectors.py | 2 +- tests/hrtf_binary_loading/constants.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 34452ce257..719f7554ff 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -47,7 +47,7 @@ NUM_CHANNELS = "4" # currently only FOA CUT_FROM = "0.0" CUT_LEN = "5.0" -FILE_IDS = ["stvFOA", "stv20A", "stv3OA", "stv51MC", "stv71MC", "stv512MC", "stv514MC", "stv714MC", "ISM", "MASA"] +FILE_IDS = ["stvFOA", "stv2OA", "stv3OA", "stv51MC", "stv71MC", "stv512MC", "stv514MC", "stv714MC", "ISM", "MASA"] GAINS = ["1.0", "16.0", ".004"] def collect_files(file_ids): diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index ab5ae13fe2..5be9b6a044 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -61,19 +61,19 @@ INPUT_FORMATS_MASA_RENDERER = ["MASA1", "MASA2"] FORMAT_TO_FILE_MC_WOEXT = { - "5_1": "stv51MC{}c", - "7_1": "stv71MC{}c", - "5_1_2": "stv512MC{}c", - "5_1_4": "stv514MC{}c", - "7_1_4": "stv714MC{}c", + "5_1": "stv51MC{}c_cut", + "7_1": "stv71MC{}c_cut", + "5_1_2": "stv512MC{}c_cut", + "5_1_4": "stv514MC{}c_cut", + "7_1_4": "stv714MC{}c_cut", } FORMAT_TO_FILE_SBA_WOEXT = { - "1": "stvFOA{}c", - "2": "stv2OA{}c", - "3": "stv3OA{}c", + "1": "stvFOA{}c_cut", + "2": "stv2OA{}c_cut", + "3": "stv3OA{}c_cut", } -FORMAT_TO_FILE_ISM_WOEXT = "stv{}ISM{}s" -FORMAT_TO_FILE_MASA_WOEXT = "stv{}MASA{}TC{}c" +FORMAT_TO_FILE_ISM_WOEXT = "stv{}ISM{}s_cut" +FORMAT_TO_FILE_MASA_WOEXT = "stv{}MASA{}TC{}c_cut" BITRATE_ISM = { "1": 96000, -- GitLab From 2eb1c75c4108c024aeb134d5305bb5b564327972 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 9 Feb 2024 17:12:28 +0100 Subject: [PATCH 266/498] allow for length as cmdl param --- tests/create_short_testvectors.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 719f7554ff..fc1da4d439 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -45,7 +45,6 @@ TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() NUM_CHANNELS = "4" # currently only FOA CUT_FROM = "0.0" -CUT_LEN = "5.0" FILE_IDS = ["stvFOA", "stv2OA", "stv3OA", "stv51MC", "stv71MC", "stv512MC", "stv514MC", "stv714MC", "ISM", "MASA"] GAINS = ["1.0", "16.0", ".004"] @@ -59,7 +58,7 @@ def collect_files(file_ids): return files -def create_short_testvectors(which="foa"): +def create_short_testvectors(which="foa", cut_len=5.0): file_ids = [] if which == "all": file_ids = FILE_IDS @@ -73,12 +72,22 @@ def create_short_testvectors(which="foa"): suffix += f"_{g}" out_file = f.parent.joinpath(f.stem + suffix + f.suffix) - cut_samples(f, out_file, NUM_CHANNELS, CUT_FROM, CUT_LEN, g) + cut_samples(f, out_file, NUM_CHANNELS, CUT_FROM, f"{cut_len}", g) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("which", choices=["foa", "all"]) + + def positive_float(x: str) -> float: + x = float(x) + if x < 0.0: + raise ValueError("Value for cut_len needs to be positive!") + return x + + parser.add_argument("--cut_len", type=positive_float, default=5.0) args = parser.parse_args() - sys.exit(create_short_testvectors(args.which)) + which = args.which + cut_len = args.cut_len + sys.exit(create_short_testvectors(which=args.which, cut_len=cut_len)) -- GitLab From 36bf469eccb6b5f91a88015e1ae3053af70f2e00 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 12 Feb 2024 09:00:56 +0100 Subject: [PATCH 267/498] add job for hrtf loading test --- .gitlab-ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3dd07fca2..808031358e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1043,6 +1043,29 @@ lc3plus-ensure-no-code-changes: - modified_files=$(git status -s) - if [[ $modified_files ]]; then printf 'LC3plus codebase was modified!\n\n'"$modified_files"'\n\n'; exit $EXIT_CODE_FAIL; fi +check-bitexactness-hrtf-rom-and-file: + extends: + - .test-job-linux + - .rules-merge-request + stage: test + needs: ["build-codec-linux-cmake"] + timeout: "5 minutes" + script: + - *print-common-info + - cmake . + - make -j + - python3 tests/create_short_testvectors.py all --cut_len 1.0 + - python3 -m pytest tests/hrtf_binary_loading --html=report.html --junit-xml=report-junit.xml --self-contained-html + artifacts: + paths: + - report.html + - report-junit.xml + when: always + name: "$CI_JOB_NAME--$CI_MERGE_REQUEST_ID--sha-$CI_COMMIT_SHA--hrtf-loading" + expose_as: "logs-hrtf-loading" + expire_in: "5 days" + + # --------------------------------------------------------------- # Test jobs for main branch # --------------------------------------------------------------- -- GitLab From 38602c164d2ba91975c0dd37a314fa63ec0d880c Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 12 Feb 2024 09:12:42 +0100 Subject: [PATCH 268/498] make "which" argument for create_short_testsvectors.py optional --- tests/create_short_testvectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index fc1da4d439..c195bd6ab1 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -77,7 +77,7 @@ def create_short_testvectors(which="foa", cut_len=5.0): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("which", choices=["foa", "all"]) + parser.add_argument("--which", choices=["foa", "all"], default="foa") def positive_float(x: str) -> float: x = float(x) -- GitLab From 1763a2d6fd70073df5b7c99013c69292a8b66142 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 12 Feb 2024 09:28:27 +0100 Subject: [PATCH 269/498] pass argument correctly --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f812e5944..e1559861b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1054,7 +1054,7 @@ check-bitexactness-hrtf-rom-and-file: - *print-common-info - cmake . - make -j - - python3 tests/create_short_testvectors.py all --cut_len 1.0 + - python3 tests/create_short_testvectors.py --which all --cut_len 1.0 - python3 -m pytest tests/hrtf_binary_loading --html=report.html --junit-xml=report-junit.xml --self-contained-html artifacts: paths: -- GitLab From cefa2a68453e44ae9356e46fdc45b5b814479ebf Mon Sep 17 00:00:00 2001 From: Arnaud Lefort Date: Mon, 12 Feb 2024 13:56:18 +0100 Subject: [PATCH 270/498] ROM optimisation. --- lib_enc/ivas_rom_enc.c | 60 ++++------------------------------- lib_enc/ivas_rom_enc.h | 6 ++-- lib_enc/ivas_stereo_dmx_evs.c | 28 +++++++++++++--- 3 files changed, 33 insertions(+), 61 deletions(-) diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index 3f1d7c17c1..8273e0e444 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -536,7 +536,7 @@ const float ari_bit_estimate_s17_LC[RANGE_N_CONTEXT][RANGE_N_SYMBOLS] = #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC -const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 1] = { +const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 2] = { 0.00009518625f, 0.00038070876f, 0.00085645882f, 0.00152225529f, 0.00237784467f, 0.00342290120f, 0.00465702698f, 0.00607975212f, 0.00769053493f, 0.00948876211f, 0.01147374899f, 0.01364473980f, 0.01600090794f, 0.01854135633f, 0.02126511768f, 0.02417115495f, 0.02725836167f, 0.03052556242f, 0.03397151320f, 0.03759490201f, 0.04139434925f, 0.04536840829f, 0.04951556605f, 0.05383424350f, 0.05832279634f, 0.06297951556f, 0.06780262815f, 0.07279029773f, 0.07794062527f, 0.08325164980f, @@ -545,17 +545,9 @@ const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 1] = { 0.22781687170f, 0.23605238471f, 0.24438839446f, 0.25282172706f, 0.26134917154f, 0.26996748113f, 0.27867337446f, 0.28746353680f, 0.29633462133f, 0.30528325043f, 0.31430601697f, 0.32339948556f, 0.33256019391f, 0.34178465414f, 0.35106935407f, 0.36041075859f, 0.36980531103f, 0.37924943444f, 0.38873953302f, 0.39827199347f, 0.40784318636f, 0.41744946748f, 0.42708717932f, 0.43675265234f, 0.44644220647f, 0.45615215247f, 0.46587879332f, 0.47561842564f, 0.48536734113f, 0.49512182793f, - 0.50487817207f, 0.51463265887f, 0.52438157436f, 0.53412120668f, 0.54384784753f, 0.55355779353f, 0.56324734766f, 0.57291282068f, 0.58255053252f, 0.59215681364f, - 0.60172800653f, 0.61126046698f, 0.62075056556f, 0.63019468897f, 0.63958924141f, 0.64893064593f, 0.65821534586f, 0.66743980609f, 0.67660051444f, 0.68569398303f, - 0.69471674957f, 0.70366537867f, 0.71253646320f, 0.72132662554f, 0.73003251887f, 0.73865082846f, 0.74717827294f, 0.75561160554f, 0.76394761529f, 0.77218312830f, - 0.78031500895f, 0.78834016106f, 0.79625552909f, 0.80405809931f, 0.81174490093f, 0.81931300723f, 0.82675953671f, 0.83408165412f, 0.84127657161f, 0.84834154975f, - 0.85527389859f, 0.86207097866f, 0.86873020202f, 0.87524903320f, 0.88162499018f, 0.88785564535f, 0.89393862643f, 0.89987161734f, 0.90565235913f, 0.91127865081f, - 0.91674835020f, 0.92205937473f, 0.92720970227f, 0.93219737185f, 0.93702048444f, 0.94167720366f, 0.94616575650f, 0.95048443395f, 0.95463159171f, 0.95860565075f, - 0.96240509799f, 0.96602848680f, 0.96947443758f, 0.97274163833f, 0.97582884505f, 0.97873488232f, 0.98145864367f, 0.98399909206f, 0.98635526020f, 0.98852625101f, - 0.99051123789f, 0.99230946507f, 0.99392024788f, 0.99534297302f, 0.99657709880f, 0.99762215533f, 0.99847774471f, 0.99914354118f, 0.99961929124f, 0.99990481375f, }; -const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 1] = { +const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 2] = { 0.00002394563f, 0.00009578022f, 0.00021549689f, 0.00038308417f, 0.00059852602f, 0.00086180179f, 0.00117288627f, 0.00153174967f, 0.00193835760f, 0.00239267114f, 0.00289464674f, 0.00344423635f, 0.00404138732f, 0.00468604244f, 0.00537813998f, 0.00611761365f, 0.00690439261f, 0.00773840150f, 0.00861956044f, 0.00954778504f, 0.01052298638f, 0.01154507106f, 0.01261394118f, 0.01372949435f, 0.01489162374f, 0.01610021802f, 0.01735516144f, 0.01865633380f, 0.02000361046f, 0.02139686238f, @@ -571,26 +563,10 @@ const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 1] = { 0.31148744266f, 0.31602872341f, 0.32058762540f, 0.32516371195f, 0.32975654476f, 0.33436568391f, 0.33899068794f, 0.34363111384f, 0.34828651715f, 0.35295645195f, 0.35764047095f, 0.36233812551f, 0.36704896567f, 0.37177254021f, 0.37650839670f, 0.38125608152f, 0.38601513994f, 0.39078511611f, 0.39556555316f, 0.40035599320f, 0.40515597739f, 0.40996504598f, 0.41478273835f, 0.41960859304f, 0.42444214782f, 0.42928293972f, 0.43413050508f, 0.43898437958f, 0.44384409832f, 0.44870919580f, - 0.45357920605f, 0.45845366260f, 0.46333209856f, 0.46821404667f, 0.47309903931f, 0.47798660859f, 0.48287628638f, 0.48776760431f, 0.49266009390f, 0.49755328651f, - 0.50244671349f, 0.50733990610f, 0.51223239569f, 0.51712371362f, 0.52201339141f, 0.52690096069f, 0.53178595333f, 0.53666790144f, 0.54154633740f, 0.54642079395f, - 0.55129080420f, 0.55615590168f, 0.56101562042f, 0.56586949492f, 0.57071706028f, 0.57555785218f, 0.58039140696f, 0.58521726165f, 0.59003495402f, 0.59484402261f, - 0.59964400680f, 0.60443444684f, 0.60921488389f, 0.61398486006f, 0.61874391848f, 0.62349160330f, 0.62822745979f, 0.63295103433f, 0.63766187449f, 0.64235952905f, - 0.64704354805f, 0.65171348285f, 0.65636888616f, 0.66100931206f, 0.66563431609f, 0.67024345524f, 0.67483628805f, 0.67941237460f, 0.68397127659f, 0.68851255734f, - 0.69303578189f, 0.69754051698f, 0.70202633115f, 0.70649279473f, 0.71093947991f, 0.71536596078f, 0.71977181336f, 0.72415661564f, 0.72851994763f, 0.73286139142f, - 0.73718053115f, 0.74147695314f, 0.74575024586f, 0.75000000000f, 0.75422580852f, 0.75842726665f, 0.76260397196f, 0.76675552441f, 0.77088152635f, 0.77498158257f, - 0.77905530037f, 0.78310228955f, 0.78712216248f, 0.79111453413f, 0.79507902210f, 0.79901524667f, 0.80292283080f, 0.80680140022f, 0.81065058343f, 0.81447001175f, - 0.81825931934f, 0.82201814326f, 0.82574612347f, 0.82944290290f, 0.83310812746f, 0.83674144609f, 0.84034251077f, 0.84391097660f, 0.84744650177f, 0.85094874765f, - 0.85441737877f, 0.85785206290f, 0.86125247107f, 0.86461827756f, 0.86794916001f, 0.87124479936f, 0.87450487995f, 0.87772908952f, 0.88091711925f, 0.88406866379f, - 0.88718342126f, 0.89026109334f, 0.89330138522f, 0.89630400572f, 0.89926866722f, 0.90219508576f, 0.90508298105f, 0.90793207648f, 0.91074209915f, 0.91351277991f, - 0.91624385337f, 0.91893505796f, 0.92158613589f, 0.92419683325f, 0.92676689997f, 0.92929608988f, 0.93178416074f, 0.93423087422f, 0.93663599599f, 0.93899929566f, - 0.94132054687f, 0.94359952730f, 0.94583601865f, 0.94802980671f, 0.95018068135f, 0.95228843655f, 0.95435287043f, 0.95637378525f, 0.95835098745f, 0.96028428763f, - 0.96217350064f, 0.96401844550f, 0.96581894552f, 0.96757482822f, 0.96928592544f, 0.97095207327f, 0.97257311213f, 0.97414888675f, 0.97567924620f, 0.97716404390f, - 0.97860313762f, 0.97999638954f, 0.98134366620f, 0.98264483856f, 0.98389978198f, 0.98510837626f, 0.98627050565f, 0.98738605882f, 0.98845492894f, 0.98947701362f, - 0.99045221496f, 0.99138043956f, 0.99226159850f, 0.99309560739f, 0.99388238635f, 0.99462186002f, 0.99531395756f, 0.99595861268f, 0.99655576365f, 0.99710535326f, - 0.99760732886f, 0.99806164240f, 0.99846825033f, 0.99882711373f, 0.99913819821f, 0.99940147398f, 0.99961691583f, 0.99978450311f, 0.99990421978f, 0.99997605437f, -}; - -const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 1] = { + 0.45357920605f, 0.45845366260f, 0.46333209856f, 0.46821404667f, 0.47309903931f, 0.47798660859f, 0.48287628638f, 0.48776760431f, 0.49266009390f, 0.49755328651f, +}; + +const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 2] = { 0.00001066469f, 0.00004265829f, 0.00009597944f, 0.00017062587f, 0.00026659439f, 0.00038388092f, 0.00052248043f, 0.00068238703f, 0.00086359389f, 0.00106609329f, 0.00128987657f, 0.00153493420f, 0.00180125573f, 0.00208882979f, 0.00239764411f, 0.00272768552f, 0.00307893994f, 0.00345139239f, 0.00384502699f, 0.00425982692f, 0.00469577451f, 0.00515285116f, 0.00563103736f, 0.00613031272f, 0.00665065594f, 0.00719204483f, 0.00775445628f, 0.00833786630f, 0.00894225002f, 0.00956758164f, @@ -615,30 +591,6 @@ const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 1] = { 0.40425714674f, 0.40746442465f, 0.41067565002f, 0.41389068585f, 0.41710939500f, 0.42033164016f, 0.42355728386f, 0.42678618852f, 0.43001821639f, 0.43325322959f, 0.43649109013f, 0.43973165987f, 0.44297480059f, 0.44622037393f, 0.44946824144f, 0.45271826458f, 0.45597030469f, 0.45922422305f, 0.46247988086f, 0.46573713923f, 0.46899585921f, 0.47225590178f, 0.47551712789f, 0.47877939840f, 0.48204257416f, 0.48530651596f, 0.48857108456f, 0.49183614071f, 0.49510154512f, 0.49836715849f, - 0.50163284151f, 0.50489845488f, 0.50816385929f, 0.51142891544f, 0.51469348404f, 0.51795742584f, 0.52122060160f, 0.52448287211f, 0.52774409822f, 0.53100414079f, - 0.53426286077f, 0.53752011914f, 0.54077577695f, 0.54402969531f, 0.54728173542f, 0.55053175856f, 0.55377962607f, 0.55702519941f, 0.56026834013f, 0.56350890987f, - 0.56674677041f, 0.56998178361f, 0.57321381148f, 0.57644271614f, 0.57966835984f, 0.58289060500f, 0.58610931415f, 0.58932434998f, 0.59253557535f, 0.59574285326f, - 0.59894604691f, 0.60214501964f, 0.60533963500f, 0.60852975670f, 0.61171524865f, 0.61489597497f, 0.61807179998f, 0.62124258819f, 0.62440820435f, 0.62756851340f, - 0.63072338055f, 0.63387267120f, 0.63701625101f, 0.64015398588f, 0.64328574195f, 0.64641138564f, 0.64953078360f, 0.65264380276f, 0.65575031034f, 0.65885017380f, - 0.66194326091f, 0.66502943973f, 0.66810857859f, 0.67118054616f, 0.67424521138f, 0.67730244352f, 0.68035211216f, 0.68339408721f, 0.68642823889f, 0.68945443778f, - 0.69247255478f, 0.69548246115f, 0.69848402848f, 0.70147712872f, 0.70446163421f, 0.70743741763f, 0.71040435202f, 0.71336231083f, 0.71631116787f, 0.71925079735f, - 0.72218107386f, 0.72510187241f, 0.72801306840f, 0.73091453763f, 0.73380615634f, 0.73668780118f, 0.73955934921f, 0.74242067794f, 0.74527166531f, 0.74811218970f, - 0.75094212993f, 0.75376136529f, 0.75656977551f, 0.75936724078f, 0.76215364178f, 0.76492885963f, 0.76769277595f, 0.77044527283f, 0.77318623285f, 0.77591553909f, - 0.77863307513f, 0.78133872502f, 0.78403237337f, 0.78671390524f, 0.78938320627f, 0.79204016256f, 0.79468466080f, 0.79731658815f, 0.79993583236f, 0.80254228167f, - 0.80513582492f, 0.80771635145f, 0.81028375120f, 0.81283791462f, 0.81537873278f, 0.81790609727f, 0.82041990029f, 0.82292003461f, 0.82540639355f, 0.82787887107f, - 0.83033736170f, 0.83278176054f, 0.83521196333f, 0.83762786640f, 0.84002936669f, 0.84241636176f, 0.84478874978f, 0.84714642954f, 0.84948930047f, 0.85181726262f, - 0.85413021670f, 0.85642806402f, 0.85871070657f, 0.86097804698f, 0.86322998851f, 0.86546643511f, 0.86768729137f, 0.86989246256f, 0.87208185459f, 0.87425537409f, - 0.87641292831f, 0.87855442524f, 0.88067977351f, 0.88278888246f, 0.88488166212f, 0.88695802321f, 0.88901787716f, 0.89106113609f, 0.89308771285f, 0.89509752098f, - 0.89709047475f, 0.89906648914f, 0.90102547985f, 0.90296736332f, 0.90489205671f, 0.90679947791f, 0.90868954556f, 0.91056217902f, 0.91241729843f, 0.91425482462f, - 0.91607467923f, 0.91787678461f, 0.91966106390f, 0.92142744097f, 0.92317584048f, 0.92490618784f, 0.92661840924f, 0.92831243163f, 0.92998818275f, 0.93164559111f, - 0.93328458602f, 0.93490509755f, 0.93650705658f, 0.93809039477f, 0.93965504457f, 0.94120093924f, 0.94272801283f, 0.94423620020f, 0.94572543701f, 0.94719565974f, - 0.94864680566f, 0.95007881288f, 0.95149162029f, 0.95288516765f, 0.95425939549f, 0.95561424519f, 0.95694965897f, 0.95826557985f, 0.95956195169f, 0.96083871920f, - 0.96209582791f, 0.96333322420f, 0.96455085527f, 0.96574866918f, 0.96692661484f, 0.96808464200f, 0.96922270126f, 0.97034074407f, 0.97143872273f, 0.97251659041f, - 0.97357430113f, 0.97461180976f, 0.97562907205f, 0.97662604460f, 0.97760268488f, 0.97855895124f, 0.97949480287f, 0.98041019985f, 0.98130510314f, 0.98217947456f, - 0.98303327681f, 0.98386647347f, 0.98467902899f, 0.98547090871f, 0.98624207886f, 0.98699250653f, 0.98772215971f, 0.98843100728f, 0.98911901899f, 0.98978616551f, - 0.99043241836f, 0.99105774998f, 0.99166213370f, 0.99224554372f, 0.99280795517f, 0.99334934406f, 0.99386968728f, 0.99436896264f, 0.99484714884f, 0.99530422549f, - 0.99574017308f, 0.99615497301f, 0.99654860761f, 0.99692106006f, 0.99727231448f, 0.99760235589f, 0.99791117021f, 0.99819874427f, 0.99846506580f, 0.99871012343f, - 0.99893390671f, 0.99913640611f, 0.99931761297f, 0.99947751957f, 0.99961611908f, 0.99973340561f, 0.99982937413f, 0.99990402056f, 0.99995734171f, 0.99998933531f, }; #else diff --git a/lib_enc/ivas_rom_enc.h b/lib_enc/ivas_rom_enc.h index 1af7fb93d4..3dae881bc8 100644 --- a/lib_enc/ivas_rom_enc.h +++ b/lib_enc/ivas_rom_enc.h @@ -121,9 +121,9 @@ extern const uint16_t ECSQ_tab_vals[ECSQ_PARAM_COUNT - 1][1 + ECSQ_TAB_VALS_SIZE *----------------------------------------------------------------------------------*/ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC -extern const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 1]; -extern const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 1]; -extern const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 1]; +extern const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 2]; +extern const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 2]; +extern const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 2]; #else extern const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 4]; extern const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 4]; diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index 9c6919f22e..c5c7eba3ec 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -1275,23 +1275,30 @@ static void weighted_ave( { #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC - int16_t i, len; + int16_t i, len, len2; float gain_tmp = 0.f, gain_sub; len = input_frame >> 1; + len2 = input_frame >> 2; gain_sub = gain - old_gain; - for ( i = 0; i < len; i++ ) + for ( i = 0; i < len2; i++ ) { gain_tmp = old_gain + gain_sub * wnd[i]; dst[i] = src1[i] * gain_tmp + src2[i] * ( 1.0f - gain_tmp ); } + for ( ; i < len; i++ ) + { + gain_tmp = old_gain + gain_sub * ( 1.0f - wnd[len - i - 1] ); + dst[i] = src1[i] * gain_tmp + src2[i] * ( 1.0f - gain_tmp ); + } for ( ; i < input_frame; i++ ) { dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); } #else + int16_t i, len; float gain_tmp = 0.f, gain_sub; @@ -1307,7 +1314,9 @@ static void weighted_ave( { dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); } + #endif + return; } @@ -1426,22 +1435,31 @@ static void adapt_gain( { #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC - int16_t i, len; + int16_t i, len, len2; float gain_tmp, gain_sub; len = input_frame >> 1; + len2 = len / 2; gain_sub = gain - old_gain; - for ( i = 0; i < len; i++ ) + for ( i = 0; i < len2; i++ ) { gain_tmp = old_gain + gain_sub * wnd[i]; dst[i] = src[i] * gain_tmp; } + for ( ; i < len; i++ ) + { + gain_tmp = old_gain + gain_sub * ( 1.0f - wnd[len - i - 1] ); + dst[i] = src[i] * gain_tmp; + } + for ( ; i < input_frame; i++ ) { dst[i] = src[i] * gain; } + #else + int16_t i, len; float gain_tmp, gain_sub; @@ -1457,7 +1475,9 @@ static void adapt_gain( { dst[i] = src[i] * gain; } + #endif + return; } -- GitLab From f5d9e358215d1bea78bc530ccc2be38df7ad1858 Mon Sep 17 00:00:00 2001 From: Arnaud Lefort Date: Mon, 12 Feb 2024 13:59:23 +0100 Subject: [PATCH 271/498] NONBE_FIX_567_DOUBLE_STEREO_DMX not defined by default. --- lib_com/options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6112030907..61ad676840 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,9 +171,9 @@ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ -#define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ +#define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ -#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ +//#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ #define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ #define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA -- GitLab From 5ee1cf946cb78097c45f7303835bc1026d6d149b Mon Sep 17 00:00:00 2001 From: Mikko-Ville Laitinen Date: Mon, 12 Feb 2024 15:39:37 +0200 Subject: [PATCH 272/498] Write default metadata for ISM_MASA_MODE_MASA_ONE_OBJ EXT output --- lib_dec/lib_dec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a9dfc7817b..82beb04759 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1637,7 +1637,11 @@ ivas_error IVAS_DEC_GetObjectMetadata( hIsmMeta = st_ivas->hIsmMetaData[objectIdx]; +#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT + if ( hIsmMeta == NULL || zero_flag || ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( hIsmMeta == NULL || zero_flag ) +#endif { metadata->azimuth = 0.f; metadata->elevation = 0.f; -- GitLab From 3f9600e9c585885ede17d310ed61b2ea795b6f98 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 12 Feb 2024 15:57:23 +0100 Subject: [PATCH 273/498] Update parse_commands.py for Windows --- parse_commands.py | 130 +++++++++++++++++++++++++++++----------------- 1 file changed, 82 insertions(+), 48 deletions(-) diff --git a/parse_commands.py b/parse_commands.py index eb0cbfa412..1cf6accde5 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -15,10 +15,12 @@ if __name__ == '__main__': input = args.input txt_file = args.txt_file - TESTV_PATH='$TESTV_PATH/' - REF_PATH='$REF_PATH/' - CUT_PATH='$CUT_PATH/' + TESTV_PATH='$TESTV_PATH' + REF_PATH='$REF_PATH' + CUT_PATH='$CUT_PATH' + here = Path(__file__).parent.resolve() + cmds_enc=[] cmds_dec=[] cmds_rend=[] @@ -40,20 +42,21 @@ if __name__ == '__main__': with open('enc_header.txt','r') as header: outfile.write(header.read()) for cmd in cmds_enc: - arg1 = cmd.split()[0] - root_folder = arg1[0:arg1.find("ivas-codec/")+10] - cmd = cmd.replace(root_folder + r'/IVAS_cod', '$CUT_ENC_BIN') - cmd = cmd.replace(r'\\', '/') - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths - cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH ) - - if not "pca" in cmd: - outfile.write(cmd+'\n') - bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd) - if bts: - outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+' >> $LOG_FILE 2>&1\n') - outfile.write('\n') + args = [] + for arg in cmd.split(): + # Adjust file arguments, pass other arguments as they are + if path.exists(arg): + arg = path.relpath(arg).replace('\\','/') + arg = re.sub('IVAS_cod(.exe)?', '$CUT_ENC_BIN', arg) + arg = re.sub('scripts', TESTV_PATH, arg) + arg = re.sub('tests', CUT_PATH, arg) + args.append(arg) + cmd = ' '.join(args) + outfile.write(cmd+'\n') + bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd) + if bts: + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+bts.group(1)+' >> $LOG_FILE 2>&1\n') + outfile.write('\n') with open('script_footer.txt','r') as footer: outfile.write(footer.read()) @@ -64,34 +67,53 @@ if __name__ == '__main__': outfile_jbm.write(header.read()) for cmd in cmds_dec: absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) - arg1 = cmd.split()[0] - root_folder = arg1[0:arg1.find("ivas-codec/")+10] - cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') - cmd = cmd.replace(r'\\', '/') - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths - inputs = cmd.count(root_folder) - 1 - if ".fer " in cmd: - cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) - else: - cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) - cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) + + args = [] + inputs = sum([1 if path.exists(a) else 0 for a in cmd.split()]) - 2 # One is the exec, one is the output, rest is inputs + for arg in cmd.split(): + # Adjust file arguments, pass other arguments as they are + if path.exists(arg): + arg = path.relpath(arg).replace('\\','/') + arg = re.sub('IVAS_dec(.exe)?', '$CUT_DEC_BIN', arg) + arg = re.sub('scripts', TESTV_PATH, arg) + if ".fer " in cmd: + arg = re.sub('tests/ref', REF_PATH + r'/ref', arg) + else: + if inputs > 0: + arg, count = re.subn('tests/dut', REF_PATH + r'/ref', arg) + inputs = inputs - count + arg = re.sub('tests', CUT_PATH, arg) + args.append(arg) + cmd = ' '.join(args) + + #arg1 = cmd.split()[0] + #root_folder = arg1[0:arg1.find("ivas-codec/")+10] + #cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') + #cmd = cmd.replace(r'\\', '/') + #cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + #cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths + # inputs = cmd.count(root_folder) - 1 + # if ".fer " in cmd: + # cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) + # else: + # cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) + # cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) if 'VOIP' in cmd: outfile = outfile_jbm else: outfile = outfile_dec - - if not "pca" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd and not "stvFOA32c4chn_0.004.wav" in cmd: - outfile.write(cmd+'\n') - out = re.search(r"\s(([\S]+)(.wav))$", cmd) - if out: - diff_cmds=[] - for output in glob.glob(absolute_out.group(1) + '*'): - output = output.replace(root_folder + r'/tests/', CUT_PATH) - diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1') - outfile.write(('; ').join(diff_cmds)) - outfile.write('\n\n') + + outfile.write(cmd+'\n') + out = re.search(r"\s(([\S]+)(.wav))$", cmd) + if out: + diff_cmds=[] + for output in glob.glob(absolute_out.group(1) + '*'): + output = path.relpath(output).replace('\\','/') + output = re.sub('tests', CUT_PATH, output) + diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+output+' >> $LOG_FILE 2>&1') + outfile.write(('; ').join(diff_cmds)) + outfile.write('\n\n') with open('script_footer.txt','r') as footer: outfile_dec.write(footer.read()) footer.seek(0) @@ -101,21 +123,33 @@ if __name__ == '__main__': with open('rend_header.txt','r') as header: outfile.write(header.read()) for cmd in cmds_rend: - arg1 = cmd.split()[0] - root_folder = arg1[0:arg1.find("ivas-codec/")+10] + args = [] + for arg in cmd.split(): + # Adjust file arguments, pass other arguments as they are + if path.exists(arg): + arg = path.relpath(arg).replace('\\','/') + arg = re.sub('IVAS_rend(.exe)?', '$CUT_REND_BIN', arg) + arg = re.sub('scripts', TESTV_PATH, arg) + arg = re.sub('tests/renderer/data', TESTV_PATH + r'renderer/data/', arg) + arg = re.sub('tests', CUT_PATH, arg) + args.append(arg) + cmd = ' '.join(args) + + # arg1 = cmd.split()[0] + # root_folder = arg1[0:arg1.find("ivas-codec/")+10] - cmd = cmd.replace(r'\\', '/') + # cmd = cmd.replace(r'\\', '/') - cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') - cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - cmd = cmd.replace(root_folder + r'/tests/renderer/data/', TESTV_PATH + r'renderer/data/') - cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) + # cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') + # cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) + # cmd = cmd.replace(root_folder + r'/tests/renderer/data/', TESTV_PATH + r'renderer/data/') + # cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) if "cut" in cmd: outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) if out and "cut" in out.group(1): - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'renderer/cut',REF_PATH + r'renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer/cut',REF_PATH + r'/renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') with open('script_footer.txt','r') as footer: outfile.write(footer.read()) \ No newline at end of file -- GitLab From 9d7458f4414e708741897ebf57f947ebf6da0709 Mon Sep 17 00:00:00 2001 From: Arnaud Lefort Date: Mon, 12 Feb 2024 16:32:13 +0100 Subject: [PATCH 274/498] Define NONBE_FIX_947_STEREO_DMX_ROMOPT added. --- lib_com/options.h | 7 ++++-- lib_enc/ivas_stereo_dmx_evs.c | 42 ++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 61ad676840..241a2f6936 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,10 +174,13 @@ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ //#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ -#define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ +#define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ +#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC +#define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ +#endif #define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA -#define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ +#define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ #endif #define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index c5c7eba3ec..11cc506c9c 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -1275,6 +1275,8 @@ static void weighted_ave( { #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC +#ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT + int16_t i, len, len2; float gain_tmp = 0.f, gain_sub; @@ -1297,6 +1299,26 @@ static void weighted_ave( dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); } +#else + + int16_t i, len; + float gain_tmp = 0.f, gain_sub; + + len = input_frame >> 1; + gain_sub = gain - old_gain; + + for ( i = 0; i < len; i++ ) + { + gain_tmp = old_gain + gain_sub * wnd[i]; + dst[i] = src1[i] * gain_tmp + src2[i] * ( 1.0f - gain_tmp ); + } + for ( ; i < input_frame; i++ ) + { + dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); + } + +#endif + #else int16_t i, len; @@ -1435,11 +1457,13 @@ static void adapt_gain( { #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC +#ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT + int16_t i, len, len2; float gain_tmp, gain_sub; len = input_frame >> 1; - len2 = len / 2; + len2 = input_frame >> 2; gain_sub = gain - old_gain; for ( i = 0; i < len2; i++ ) @@ -1453,6 +1477,22 @@ static void adapt_gain( dst[i] = src[i] * gain_tmp; } +#else + + int16_t i, len; + float gain_tmp, gain_sub; + + len = input_frame >> 1; + gain_sub = gain - old_gain; + + for ( i = 0; i < len; i++ ) + { + gain_tmp = old_gain + gain_sub * wnd[i]; + dst[i] = src[i] * gain_tmp; + } + +#endif + for ( ; i < input_frame; i++ ) { dst[i] = src[i] * gain; -- GitLab From 217f68d6e049a63e1c8bab2b80191a15ef051656 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 13 Feb 2024 11:52:01 +1100 Subject: [PATCH 275/498] fix for formatting issues --- apps/decoder.c | 3 --- apps/renderer.c | 7 +++---- lib_rend/ivas_PredEncoder.c | 8 ++++++-- lib_rend/ivas_lcld_decoder.c | 7 ------- lib_rend/ivas_lcld_encoder.c | 16 +++++++++------- lib_rend/ivas_lcld_prot.h | 10 ---------- lib_rend/ivas_prot_rend.h | 5 +++-- lib_rend/ivas_splitRend_lcld_dec.c | 2 ++ lib_rend/ivas_splitRend_lcld_enc.c | 1 + lib_rend/ivas_splitRendererPre.c | 3 +++ lib_rend/ivas_splitRenderer_utils.c | 5 +++-- 11 files changed, 30 insertions(+), 37 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 3e539f5123..e93eb594f5 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -483,7 +483,6 @@ int main( fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for split rendering!\n" ); } #endif - arg.enableHeadRotation = true; } #endif @@ -656,7 +655,6 @@ 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 ); @@ -690,7 +688,6 @@ int main( { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } - #endif #endif diff --git a/apps/renderer.c b/apps/renderer.c index 68307833c5..5e3f692608 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1936,7 +1936,6 @@ int main( exit( -1 ); } #endif - if ( ( error = IVAS_REND_FeedSplitBinauralBitstream( hIvasRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); @@ -2236,6 +2235,9 @@ cleanup: } split_rend_reader_writer_close( &hSplitRendFileReadWrite ); +#ifdef SPLIT_REND_LCLD_5MS + SplitRendBFIFileReader_close( &splitRendBFIReader ); +#endif #endif for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) @@ -2248,9 +2250,6 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); -#ifdef SPLIT_REND_LCLD_5MS - SplitRendBFIFileReader_close( &splitRendBFIReader ); -#endif Vector3PairFileReader_close( &referenceVectorReader ); destroy_td_hrtf( hHrtfTD ); diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 250368c6be..747e652cf5 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -47,7 +47,9 @@ * * *-------------------------------------------------------------------*/ -static void activate_bit( int32_t *state, int32_t bit_id ) +static void activate_bit( + int32_t *state, + const int32_t bit_id ) { ( *state ) |= ( 1 << bit_id ); } @@ -58,7 +60,9 @@ static void activate_bit( int32_t *state, int32_t bit_id ) * *-------------------------------------------------------------------*/ -static void deactivate_bit( int32_t *state, int32_t bit_id ) +static void deactivate_bit( + int32_t *state, + const int32_t bit_id ) { ( *state ) &= ( ~( 1 << bit_id ) ); } diff --git a/lib_rend/ivas_lcld_decoder.c b/lib_rend/ivas_lcld_decoder.c index ab434b2d41..c3710f9cca 100644 --- a/lib_rend/ivas_lcld_decoder.c +++ b/lib_rend/ivas_lcld_decoder.c @@ -1292,13 +1292,6 @@ static int32_t ReadMSInformation( return iBitsRead; } -#ifdef SPLIT_REND_LCLD_5MS -int32_t GetNumPredSubSets( LCLDDecoder *psLCLDDecoder ) -{ - return psLCLDDecoder->psPredictionDecoder->iNumSubSets; -} -#endif - static int32_t ReadGroupInformation( const int32_t iChannels, const int32_t iNumBlocks, diff --git a/lib_rend/ivas_lcld_encoder.c b/lib_rend/ivas_lcld_encoder.c index 80f484d338..811572e185 100644 --- a/lib_rend/ivas_lcld_encoder.c +++ b/lib_rend/ivas_lcld_encoder.c @@ -95,10 +95,11 @@ struct LCLD_ENCODER * *------------------------------------------------------------------------------------------*/ -static int32_t Quantize( const float fVal, - const float fScale, - int32_t *iSign, - const int32_t iMaxVal ) +static int32_t Quantize( + const float fVal, + const float fScale, + int32_t *iSign, + const int32_t iMaxVal ) { int32_t iVal; if ( fVal > 0.0f ) @@ -122,9 +123,10 @@ static int32_t Quantize( const float fVal, * *------------------------------------------------------------------------------------------*/ -static float UnQuantize( const int32_t iVal, - const float fScale, - const int32_t iSign ) +static float UnQuantize( + const int32_t iVal, + const float fScale, + const int32_t iSign ) { float fVal; if ( iSign == 0 ) diff --git a/lib_rend/ivas_lcld_prot.h b/lib_rend/ivas_lcld_prot.h index 54d1f771bb..1353868980 100644 --- a/lib_rend/ivas_lcld_prot.h +++ b/lib_rend/ivas_lcld_prot.h @@ -85,10 +85,6 @@ ivas_error CreateLCLDDecoder( const int32_t iSampleRate, const int32_t iChannels ); #else -int32_t GetNumPredSubSets( - LCLDDecoder *psLCLDDecoder -); - ivas_error CreateLCLDDecoder( LCLDDecoder **psLCLDDecoder_out, const int32_t iSampleRate, @@ -199,12 +195,6 @@ typedef struct NOISE_GEN float *pfNoiseBuffer; } NoiseGen; -#ifdef SPLIT_REND_LCLD_5MS -NoiseGen *CreateNoiseGen( - void -); -#endif - void DeleteNoiseGen( NoiseGen *psNoiseGen ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 87fe0c34a8..8a3237c2ff 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -2036,8 +2036,9 @@ int32_t ivas_split_rend_bitstream_read_int32( ); #ifdef SPLIT_REND_LCLD_5MS -int32_t get_bit( const int32_t state, - const int32_t bit_id +int32_t get_bit( + const int32_t state, + const int32_t bit_id ); #endif diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index 3ca53e513d..6e53411e2b 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -47,6 +47,7 @@ * * *------------------------------------------------------------------------*/ + #ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_splitBinLCLDDecOpen( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, @@ -73,6 +74,7 @@ ivas_error ivas_splitBinLCLDDecOpen( splitBinLCLDDec->pLcld_dec = NULL; /* place holder for CLDFB decoder handle */ splitBinLCLDDec->iChannels = iChannels; + #ifndef SPLIT_REND_LCLD_5MS if ( ( error = CreateLCLDDecoder( &splitBinLCLDDec->psLCLDDecoder, iSampleRate, iChannels ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index 54674c80bb..85dd1e2442 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -191,6 +191,7 @@ void ivas_splitBinLCLDEncProcess( assert( Cldfb_In_Real != NULL ); assert( Cldfb_In_Imag != NULL ); assert( pBits != NULL ); + #ifdef SPLIT_REND_LCLD_5MS available_bits_local = available_bits; #endif diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index bbe0cd9a85..0a9cdb237c 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1794,6 +1794,7 @@ void ivas_init_split_rend_handles( * * *------------------------------------------------------------------------*/ + #ifdef SPLIT_REND_LCLD_5MS static ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, @@ -1811,6 +1812,7 @@ static ivas_error split_renderer_open_lc3plus( ivas_error error; int16_t i, delayBufferLength; LC3PLUS_CONFIG config; + #ifdef SPLIT_REND_LCLD_5MS config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000; config.ivas_frame_duration_us = ( pSplitRendConfig->dof == 0 ) ? config.lc3plus_frame_duration_us * num_subframes : 20000; @@ -2521,6 +2523,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( { float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX]; float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX]; + #ifdef SPLIT_REND_LCLD_5MS for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) #else diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index e18e4b6628..74fd854b24 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -1113,8 +1113,9 @@ ivas_error ivas_split_rend_choose_default_codec( * *-------------------------------------------------------------------*/ -int32_t get_bit( const int32_t state, - const int32_t bit_id ) +int32_t get_bit( + const int32_t state, + const int32_t bit_id ) { return ( state & ( 1 << bit_id ) ); } -- GitLab From 00fd99b00dd67faaca1bf1f48a2ef067b6cdfc8c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 08:53:35 +0100 Subject: [PATCH 276/498] Fixes in parse_commands.py --- parse_commands.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/parse_commands.py b/parse_commands.py index 1cf6accde5..f2cefd52e9 100644 --- a/parse_commands.py +++ b/parse_commands.py @@ -69,20 +69,17 @@ if __name__ == '__main__': absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) args = [] - inputs = sum([1 if path.exists(a) else 0 for a in cmd.split()]) - 2 # One is the exec, one is the output, rest is inputs for arg in cmd.split(): # Adjust file arguments, pass other arguments as they are if path.exists(arg): arg = path.relpath(arg).replace('\\','/') arg = re.sub('IVAS_dec(.exe)?', '$CUT_DEC_BIN', arg) arg = re.sub('scripts', TESTV_PATH, arg) - if ".fer " in cmd: - arg = re.sub('tests/ref', REF_PATH + r'/ref', arg) + arg = re.sub('tests/ref', REF_PATH + r'/ref', arg) # For .fer cases the bitstream is in ref + if re.search("\.wav$",arg): + arg = re.sub('tests', CUT_PATH, arg) # Output argument for decoder ends with .wav else: - if inputs > 0: - arg, count = re.subn('tests/dut', REF_PATH + r'/ref', arg) - inputs = inputs - count - arg = re.sub('tests', CUT_PATH, arg) + arg = re.sub('tests/dut', REF_PATH + r'/ref', arg) # Input argument args.append(arg) cmd = ' '.join(args) -- GitLab From c56ee4c909df23498cc0c92670909291fef7528e Mon Sep 17 00:00:00 2001 From: Mikko-Ville Laitinen Date: Tue, 13 Feb 2024 09:54:20 +0200 Subject: [PATCH 277/498] Improve ISM metadata sync for ISM_MASA_MODE_PARAM_ONE_OBJ EXT --- lib_dec/ivas_omasa_dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index fc1682dbe5..07a97e4e6e 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -1135,8 +1135,8 @@ void ivas_omasa_render_objects_from_mix( /* Set object metadata to the ism struct */ for ( n = 0; n < nchan_ism; n++ ) { - st_ivas->hIsmMetaData[n]->azimuth = st_ivas->hMasaIsmData->azimuth_ism[n][0]; - st_ivas->hIsmMetaData[n]->elevation = st_ivas->hMasaIsmData->elevation_ism[n][0]; + st_ivas->hIsmMetaData[n]->azimuth = st_ivas->hMasaIsmData->azimuth_ism[n][st_ivas->hSpatParamRendCom->dirac_read_idx]; + st_ivas->hIsmMetaData[n]->elevation = st_ivas->hMasaIsmData->elevation_ism[n][st_ivas->hSpatParamRendCom->dirac_read_idx]; } /* Move the separated object signal to the correct output channel */ -- GitLab From c68fa456caa26356c3d7e6736e9538543bbce55c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 09:49:14 +0100 Subject: [PATCH 278/498] Merge tests/renderer/conftest.py with tests/conftest.py --- tests/conftest.py | 11 ++++++++++ tests/renderer/conftest.py | 44 -------------------------------------- 2 files changed, 11 insertions(+), 44 deletions(-) delete mode 100644 tests/renderer/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py index fd3c4a0898..c66de954d9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -164,6 +164,17 @@ def pytest_addoption(parser): default="0", ) + parser.addoption( + "--create_ref", + action="store_true", + default=False, + ) + parser.addoption( + "--create_cut", + action="store_true", + default=False, + ) + @pytest.fixture(scope="session", autouse=True) def update_ref(request): """ diff --git a/tests/renderer/conftest.py b/tests/renderer/conftest.py deleted file mode 100644 index 4668d742db..0000000000 --- a/tests/renderer/conftest.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -""" - (C) 2022-2023 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 - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of 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 - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. -""" - - -def pytest_addoption(parser): - parser.addoption( - "--create_ref", - action="store_true", - default=False, - ) - parser.addoption( - "--create_cut", - action="store_true", - default=False, - ) -- GitLab From 1b622b7a9acfd35d33505bdebec1c713479e21b8 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 10:42:52 +0100 Subject: [PATCH 279/498] Updates for Windows runner --- .gitlab-ci.yml | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b7efd1b597..2b3055f750 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1221,10 +1221,8 @@ test-be-to-release: ivas-conformance: - extends: - - .test-job-linux-needs-testv-dir tags: - - pytest-html-updated + - ivas-windows stage: test timeout: "60 minutes" rules: @@ -1233,29 +1231,28 @@ ivas-conformance: exit_codes: - 123 script: - - *print-common-info + - *print-common-info-windows # Prepare reference exec, use tests and scripts from reference - source_branch_commit_sha=$(git rev-parse HEAD) - git checkout main # This should be set to a relevant reference - - make -j - - cp IVAS_cod IVAS_cod_ref - - cp IVAS_dec IVAS_dec_ref - - cp IVAS_rend IVAS_rend_ref + - py .\scripts\strip_split_rendering.py + - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug + - cp IVAS_cod.exe IVAS_cod_ref.exe + - cp IVAS_dec.exe IVAS_dec_ref.exe + - cp IVAS_rend.exe IVAS_rend_ref.exe - git restore . - git checkout $source_branch_commit_sha # Reference creation - - non_be_flag=0 - - exit_code=0 - - python3 tests/create_short_testvectors.py - - python3 scripts/prepare_combined_format_inputs.py - - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref --html=report1.html --self-contained-html --keep_files || exit_code=$? - - python3 -m pytest tests/codec_be_on_mr_nonselection/ -v -n auto --update_ref 1 -m create_ref_part2 --keep_files || exit_code=$? - - python3 -m pytest tests/renderer/test_renderer.py --create_ref --keep_files || exit_code=$? + - python tests/create_short_testvectors.py + - python scripts/prepare_combined_format_inputs.py + - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --html=report1.html --self-contained-html --keep_files + - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files + - python -m pytest tests/renderer/test_renderer.py --create_ref --keep_files # Output creation - - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html || exit_code=$? - - python3 parse_commands.py report_cmd.html Readme_IVAS.txt + - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html + - python parse_commands.py report_cmd.html Readme_IVAS.txt # Copy input data and output ref data @@ -1278,12 +1275,9 @@ ivas-conformance: # Test run generated scripts in testvec - cd testvec - - exit_code=0 - - python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$? - - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + - python -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html - mv report.html .. - mv report-junit.xml .. - - *merge-request-comparison-check artifacts: name: "ivas-conformance-$CI_COMMIT_SHORT_SHA" -- GitLab From b4335305652bce63ab8c3ad0b4d39a5b6086b642 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 10:49:21 +0100 Subject: [PATCH 280/498] Fix for windows --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b3055f750..6bc4070c19 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1233,7 +1233,7 @@ ivas-conformance: script: - *print-common-info-windows # Prepare reference exec, use tests and scripts from reference - - source_branch_commit_sha=$(git rev-parse HEAD) + - source_branch_commit_sha = $(git rev-parse HEAD) - git checkout main # This should be set to a relevant reference - py .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug -- GitLab From 9268140327772ab72910bd3c8634ba7eac5ad00a Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 10:55:21 +0100 Subject: [PATCH 281/498] Fix for windows --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6bc4070c19..ab295e5c27 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1233,7 +1233,7 @@ ivas-conformance: script: - *print-common-info-windows # Prepare reference exec, use tests and scripts from reference - - source_branch_commit_sha = $(git rev-parse HEAD) + - $source_branch_commit_sha = $(git rev-parse HEAD) - git checkout main # This should be set to a relevant reference - py .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug -- GitLab From c80d12d8e1eef013dfb1f226d1a6749363d157cd Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 11:14:38 +0100 Subject: [PATCH 282/498] Shorten name of tests due to 255 character file name limit on Windows --- scripts/config/self_test.prm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 25cef6b5e6..ef7e879851 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1424,37 +1424,37 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-48_EXT_JBM5.tst -// OMASA 2Dir2TC 1ISM at bitrate switching techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 +// OMASA 2Dir2TC 1ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 ../IVAS_cod -ism_masa 1 2 testv/stvISM1.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_1ism.bin 48 testv/stvOMASA_1ISM_2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL_ROOM_IR 48 netsimoutput testv/stvOMASA_1ISM_2MASA2TC48c.wav_BINAURAL_ROOM_IR_sw_48-48_JBM5.tst -// OMASA 2Dir2TC 2ISM at bitrate switching techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 48kHz out, 7.1 out, JBM Prof 5 +// OMASA 2Dir2TC 2ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 48kHz out, 7.1 out, JBM Prof 5 ../IVAS_cod -ism_masa 2 2 testv/stvISM1.csv NULL testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_48k_omasatechs_2ism.bin 48 testv/stvOMASA_2ISM_2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP 7_1 48 netsimoutput testv/stvOMASA_2ISM_2MASA2TC48c.wav_7_1_sw_48-48_JBM5.tst -// OMASA 2Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out, JBM Prof 5 +// OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out, JBM Prof 5 ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP MONO 48 netsimoutput testv/stvOMASA_3ISM_2MASA2TC48c.wav_MONO_sw_48-48_JBM5.tst -// OMASA 2Dir1TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, JBM Prof 5 +// OMASA 2Dir1TC 3ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, JBM Prof 5 ../IVAS_cod -ism_masa 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA1TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_48k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA1TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP STEREO 32 netsimoutput testv/stvOMASA_3ISM_2MASA1TC48c.wav_STEREO_sw_48-32_JBM5.tst -// OMASA 1Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.2 out, JBM Prof 5 +// OMASA 1Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.2 out, JBM Prof 5 ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv1MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_3ism.bin 32 testv/stvOMASA_3ISM_1MASA2TC32c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP 5_1_2 48 netsimoutput testv/stvOMASA_3ISM_1MASA2TC32c.wav_5_1_2_sw_32-48_JBM5.tst -// OMASA 1Dir1TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, JBM Prof 5 +// OMASA 1Dir1TC 4ISM at br sw techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, JBM Prof 5 ../IVAS_cod -ism_masa 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA1TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_32k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_1MASA1TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 48 netsimoutput testv/stvOMASA_4ISM_1MASA1TC48c.wav_BINAURAL_sw_48-48_JBM5.tst -// OMASA 1Dir2TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, FOA out, JBM Prof 5 +// OMASA 1Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, FOA out, JBM Prof 5 ../IVAS_cod -ism_masa 4 2 NULL testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_1MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP FOA 48 netsimoutput testv/stvOMASA_4ISM_1MASA2TC48c.wav_FOA_sw_48-48_JBM5.tst @@ -1569,29 +1569,29 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 -// OMASA 2Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out +// OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA2TC48c.wav bit ../IVAS_dec MONO 48 bit testv/stvOMASA_3ISM_2MASA2TC48c.wav_MONO_sw_48-48.tst -// OMASA 2Dir1TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% +// OMASA 2Dir1TC 3ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% ../IVAS_cod -ism_masa 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA1TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_48k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA1TC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error ../IVAS_dec STEREO 32 bit_error testv/stvOMASA_3ISM_2MASA1TC48c.wav_STEREO_sw_48-32_FER10.tst -// OMASA 1Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.4 out +// OMASA 1Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.4 out ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv1MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_3ism.bin 32 testv/stvOMASA_3ISM_1MASA2TC32c.wav bit ../IVAS_dec 5_1_4 48 bit testv/stvOMASA_3ISM_1MASA2TC32c.wav_5_1_4_sw_32-48.tst -// OMASA 1Dir1TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5% +// OMASA 1Dir1TC 4ISM at br sw techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5% ../IVAS_cod -ism_masa 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA1TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_32k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_1MASA1TC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/stvOMASA_4ISM_1MASA1TC48c.wav_BINAURAL_sw_48-48_FER5.tst -// OMASA 1Dir2TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, HOA3 out +// OMASA 1Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, HOA3 out ../IVAS_cod -ism_masa 4 2 NULL testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_1MASA2TC48c.wav bit ../IVAS_dec HOA3 48 bit testv/stvOMASA_4ISM_1MASA2TC48c.wav_HOA3_sw_48-48.tst -// OMASA 2Dir2TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out +// OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_384k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst -- GitLab From 43f33d6bdcf59aad6dfdb48d6c6a70ede8e4fd25 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 11:56:48 +0100 Subject: [PATCH 283/498] Shorten test names --- scripts/config/self_test.prm | 92 ++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index ef7e879851..fc77c76ed6 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -303,27 +303,27 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv 32000 32 testv/stv32n.wav bit ../IVAS_dec MONO 32 bit testv/stv32n.wav_1ISM_32000_32-32_DTX_MONO.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, head rotation, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, HR, random FER at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 48000 48 testv/stv1ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit_error testv/stv1ISM48s.wav_64000_48-48_binaural_room_HR.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, random FER at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 48000 48 testv/stv1ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL 48 bit_error testv/stv1ISM48s.wav_64000_48-48_FER5_binaural_HR.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, head rotation, external orientation, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, HR, exo, random FER at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 48000 48 testv/stv1ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit_error testv/stv1ISM48s.wav_64000_48-48_FER5_binaural_room_HR_EXOF.tst -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, random FER at 5% +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, random FER at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR.tst -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, external orientation, random FER at 5% +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, exo, random FER at 5% ../IVAS_cod -ism 1 testv/stvISM1.csv 80000 48 testv/stv1ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stv1ISM48s.wav_80000_48-16_FER5_binaural_file_TDHR_EXOF.tst @@ -374,11 +374,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 2 testv/stvISM1.csv testv/stvISM2.csv 80000 48 testv/stvST48n.wav bit ../IVAS_dec STEREO 48 bit testv/stvST48n.wav_2ISM_80000_48-48_DTX_STEREO.tst -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit ../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR.tst -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation, external orientation +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR, exo ../IVAS_cod -ism 2 testv/stvISM1.csv testv/stvISM2.csv 128000 48 testv/stv2ISM48s.wav bit ../IVAS_dec -t testv/headrot_case01_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/stv2ISM48s.wav_128000_48-32_binaural_file_TDHR_EXOF.tst @@ -421,7 +421,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv3ISM48s.wav_192000_48-48_binauralfile.tst -// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FER at 5% +// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, random FER at 5% ../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 192000 48 testv/stv3ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case02_3000_q.csv BINAURAL 48 bit_error testv/stv3ISM48s.wav_192000_48-48_binaural_file_TDHR_FER5.tst @@ -447,7 +447,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48n.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv4ISM48n.wav_32000_48-48_DTX_BINAURAL.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 32000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv4ISM48s.wav_32000_48-48_binaural_file_TDHR_EXOF.tst @@ -493,11 +493,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural.tst -// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation +// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural_file_TDHR.tst -// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation +// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF.tst @@ -505,11 +505,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit ../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, Orientation tracking +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, HR, OT ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 48 bit testv/stv4ISM48s.pcm_256000_48-48_TDHR_OtrAvg.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, external orientation, Orientation tracking +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, HR, exo, OT ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL 48 bit testv/stv4ISM48s.pcm_256000_48-48_TDHR_EXOF_OtrAvg.tst @@ -521,12 +521,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit ../IVAS_dec HOA3 48 bit testv/stv4ISM48n.wav_brate_sw_48-48_DTX_hoa3.tst -// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, directivity configuration, random FER at 5% +// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst -// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation, directivity configuration, random FER at 5% +// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst @@ -573,15 +573,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_Binaural_Headrot.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, external orientation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_Binaural_Headrot_EXOF.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, Orientation tracking +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, OT ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 32 bit testv/stv3OA32c.pcm_SBA_24400_32-32_Binaural_Headrot_OtrAvg.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, external orientation, Orientation tracking +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, exo, OT ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL 32 bit testv/stv3OA32c.pcm_SBA_24400_32-32_Binaural_Headrot_EXOF_OtrAvg.tst @@ -594,7 +594,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_Headrot.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, external orientation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, exo ../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_Headrot_EXOF.tst @@ -636,15 +636,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_BinauralRoom_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_BinauralRoom_Headrot_EXOF.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, Orientation tracking +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, Orientation tracking, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst @@ -652,7 +652,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst @@ -660,7 +660,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking in level mode, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking in level mode, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst @@ -673,7 +673,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_DTX_Binaural_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, exo ../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_DTX_Binaural_Headrot_EXOF.tst @@ -719,7 +719,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 80000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_80000_32-32_Binaural_Headrot.tst -// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, external orientation +// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -sba 3 80000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_80000_32-32_Binaural_Headrot_EXOF.tst @@ -735,15 +735,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_128000_32-32_Binaural_room_Headrot.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, external orientation +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, exo ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_128000_32-32_Binaural_room_Headrot_EXOF.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, Orientation tracking +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, Orientation tracking, external orientation +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT, exo ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst @@ -781,7 +781,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 256000 32 testv/stvFOA32c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_256000_32-32_BINAURAL_ROOM.tst -// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, external orientation +// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, exo ../IVAS_cod -sba 1 256000 32 testv/stvFOA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_256000_32-32_BinauralRoom_Headrot_EXOF.tst @@ -798,7 +798,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_binaural.tst -// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst @@ -904,7 +904,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/stv1MASA1TC48c.met 24400 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA1TC48c.wav_24400_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, external orientation +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, exo ../IVAS_cod -masa 1 testv/stv1MASA1TC48c.met 24400 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA1TC48c.wav_24400_48-48_BinauralRoom_Headrot_EXOF.tst @@ -934,7 +934,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/stv2MASA1TC48c.met 128000 48 testv/stv2MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv2MASA1TC48c.wav_128000_48-48_BINAURAL_Headrot.tst -// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -masa 1 testv/stv2MASA1TC48c.met 128000 48 testv/stv2MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv2MASA1TC48c.wav_128000_48-48_BINAURAL_Headrot_EXOF.tst @@ -959,15 +959,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA2TC48c.wav_32000_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, external orientation +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, exo ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA2TC48c.wav_32000_48-48_BinauralRoom_Headrot_EXOF.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, Orientation tracking +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, OT ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, Orientation tracking, external orientation +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, OT, exo ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst @@ -1006,7 +1006,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 64000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv2MASA2TC48c.wav_64000_48-48_BINAURAL_Headrot.tst -// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 64000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv2MASA2TC48c.wav_64000_48-48_BINAURAL_Headrot_EXOF.tst @@ -1107,7 +1107,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_Headrot_EXOF.tst @@ -1124,7 +1124,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_Headrot_EXOF.tst @@ -1132,7 +1132,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_room_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, external orientation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, exo ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_room_Headrot_EXOF.tst @@ -1149,7 +1149,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 128000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_128000_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo ../IVAS_cod -mc 5_1 128000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_128000_48-48_Binaural_Headrot_EXOF.tst @@ -1166,19 +1166,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec MONO 48 bit testv/stv51MC48c.wav_MC51_256000_48-48_mono.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, head rotation +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_256000_48-48_BinauralRoom_Headrot.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, head rotation, external orientation +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_256000_48-48_BinauralRoom_Headrot_EXOF.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, head rotation, Orientation tracking +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, head rotation, Orientation tracking, external orientation +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst @@ -1305,7 +1305,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_ER_v3.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_ER_v3.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config early reflections, head rotation +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config early reflections, HR ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_ER_v1.cfg -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_ER_v1_hrot.tst -- GitLab From 6388f89e3432ebb49345da1f4ddabdfdb443a4aa Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 14:11:54 +0100 Subject: [PATCH 284/498] Force copy to allow overwrite when forming testvec folder --- .gitlab-ci.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab295e5c27..a82b2eee33 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1237,9 +1237,9 @@ ivas-conformance: - git checkout main # This should be set to a relevant reference - py .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug - - cp IVAS_cod.exe IVAS_cod_ref.exe - - cp IVAS_dec.exe IVAS_dec_ref.exe - - cp IVAS_rend.exe IVAS_rend_ref.exe + - cp -force IVAS_cod.exe IVAS_cod_ref.exe + - cp -force IVAS_dec.exe IVAS_dec_ref.exe + - cp -force IVAS_rend.exe IVAS_rend_ref.exe - git restore . - git checkout $source_branch_commit_sha @@ -1256,20 +1256,21 @@ ivas-conformance: # Copy input data and output ref data + - rm -r -force testvec - mkdir testvec - mkdir testvec/binauralRenderer_interface - mkdir testvec/testv - mkdir testvec/testv/renderer - mkdir testvec/bin - - cp -r scripts/testv/* testvec/testv - - cp -r scripts/ls_layouts testvec - - cp -r scripts/switchPaths testvec - - cp -r scripts/trajectories testvec - - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - - cp -r tests/ref testvec/testv/ref - - cp -r tests/dut/* testvec/testv/ref - - cp -r tests/renderer/cut testvec/testv/renderer/ref - - cp -r conformance-test testvec/ + - cp -r -force scripts/testv/* testvec/testv + - cp -r -force scripts/ls_layouts testvec + - cp -r -force scripts/switchPaths testvec + - cp -r -force scripts/trajectories testvec + - cp -r -force scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface + - cp -r -force tests/ref testvec/testv/ref + - cp -r -force tests/dut/* testvec/testv/ref + - cp -r -force tests/renderer/cut testvec/testv/renderer/ref + - cp -r -force conformance-test testvec/ - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin -- GitLab From 79f1767a9646731d94584f6824e09a8e8a237f41 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 14:59:35 +0100 Subject: [PATCH 285/498] Ignore errors to do cp/rm without stopping in PowerShell --- .gitlab-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a82b2eee33..8cac3e5f65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1256,21 +1256,21 @@ ivas-conformance: # Copy input data and output ref data - - rm -r -force testvec + - rm -r -force -ErrorAction Ignore testvec - mkdir testvec - mkdir testvec/binauralRenderer_interface - mkdir testvec/testv - mkdir testvec/testv/renderer - mkdir testvec/bin - - cp -r -force scripts/testv/* testvec/testv - - cp -r -force scripts/ls_layouts testvec - - cp -r -force scripts/switchPaths testvec - - cp -r -force scripts/trajectories testvec - - cp -r -force scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - - cp -r -force tests/ref testvec/testv/ref - - cp -r -force tests/dut/* testvec/testv/ref - - cp -r -force tests/renderer/cut testvec/testv/renderer/ref - - cp -r -force conformance-test testvec/ + - cp -r -force -ErrorAction Ignore scripts/testv/* testvec/testv + - cp -r -force -ErrorAction Ignore scripts/ls_layouts 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 + - cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref + - cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref + - cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref + - cp -r -force -ErrorAction Ignore conformance-test testvec/ - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin -- GitLab From 2964ed1044eb09211148d2ad356c54d23998ff39 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 15:33:48 +0100 Subject: [PATCH 286/498] Change cleanup of testvec not to halt when it does not exist --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8cac3e5f65..5411c7959c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1256,7 +1256,7 @@ ivas-conformance: # Copy input data and output ref data - - rm -r -force -ErrorAction Ignore testvec + - if (Test-Path testvec) {rm -r -force testvec} - mkdir testvec - mkdir testvec/binauralRenderer_interface - mkdir testvec/testv -- GitLab From 53e521e31e6411e2fc06ae62710aee04324dc95d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 15:49:11 +0100 Subject: [PATCH 287/498] Fix copying of scripts --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5411c7959c..66c7e1d839 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1271,7 +1271,10 @@ ivas-conformance: - cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref - cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref - cp -r -force -ErrorAction Ignore conformance-test testvec/ - - cp Readme_IVAS_dec.txt Readme_IVAS_enc.txt Readme_IVAS_rend.txt Readme_IVAS_JBM_dec.txt testvec + - cp Readme_IVAS_dec.txt testvec + - cp Readme_IVAS_enc.txt testvec + - cp Readme_IVAS_rend.txt testvec + - cp Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin # Test run generated scripts in testvec -- GitLab From 8977758eda0ee6d60802eb2cf78df73bdb809b86 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 16:04:19 +0100 Subject: [PATCH 288/498] Fix for exec copying --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66c7e1d839..6496590d97 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1275,7 +1275,9 @@ ivas-conformance: - cp Readme_IVAS_enc.txt testvec - cp Readme_IVAS_rend.txt testvec - cp Readme_IVAS_JBM_dec.txt testvec - - cp IVAS_cod IVAS_dec IVAS_rend testvec/bin + - cp IVAS_cod.exe testvec/bin + - cp IVAS_dec.exe testvec/bin + - cp IVAS_rend.exe testvec/bin # Test run generated scripts in testvec - cd testvec -- GitLab From b8e34f0d1d7c8a94a60f1922abc23f6c4b1f5147 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 16:23:02 +0100 Subject: [PATCH 289/498] Move scripts into scripts folder --- .gitlab-ci.yml | 14 ++++++++------ dec_header.txt => scripts/dec_header.txt | 0 enc_header.txt => scripts/enc_header.txt | 0 jbm_header.txt => scripts/jbm_header.txt | 0 parse_commands.py => scripts/parse_commands.py | 0 rend_header.txt => scripts/rend_header.txt | 0 script_footer.txt => scripts/script_footer.txt | 0 .../conformance-test}/conftest.py | 0 .../conformance-test}/pytest.ini | 0 .../conformance-test}/test_26252.py | 0 10 files changed, 8 insertions(+), 6 deletions(-) rename dec_header.txt => scripts/dec_header.txt (100%) rename enc_header.txt => scripts/enc_header.txt (100%) rename jbm_header.txt => scripts/jbm_header.txt (100%) rename parse_commands.py => scripts/parse_commands.py (100%) rename rend_header.txt => scripts/rend_header.txt (100%) rename script_footer.txt => scripts/script_footer.txt (100%) rename {conformance-test => tests/conformance-test}/conftest.py (100%) rename {conformance-test => tests/conformance-test}/pytest.ini (100%) rename {conformance-test => tests/conformance-test}/test_26252.py (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6496590d97..efa6dc698c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1252,7 +1252,9 @@ ivas-conformance: # Output creation - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html - - python parse_commands.py report_cmd.html Readme_IVAS.txt + - cd scripts + - python parse_commands.py ../report_cmd.html Readme_IVAS.txt + - cd .. # Copy input data and output ref data @@ -1270,11 +1272,11 @@ ivas-conformance: - cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref - cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref - cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref - - cp -r -force -ErrorAction Ignore conformance-test testvec/ - - cp Readme_IVAS_dec.txt testvec - - cp Readme_IVAS_enc.txt testvec - - cp Readme_IVAS_rend.txt testvec - - cp Readme_IVAS_JBM_dec.txt testvec + - cp -r -force -ErrorAction Ignore tests/conformance-test testvec/ + - cp scripts/Readme_IVAS_dec.txt testvec + - cp scripts/Readme_IVAS_enc.txt testvec + - cp scripts/Readme_IVAS_rend.txt testvec + - cp scripts/Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod.exe testvec/bin - cp IVAS_dec.exe testvec/bin - cp IVAS_rend.exe testvec/bin diff --git a/dec_header.txt b/scripts/dec_header.txt similarity index 100% rename from dec_header.txt rename to scripts/dec_header.txt diff --git a/enc_header.txt b/scripts/enc_header.txt similarity index 100% rename from enc_header.txt rename to scripts/enc_header.txt diff --git a/jbm_header.txt b/scripts/jbm_header.txt similarity index 100% rename from jbm_header.txt rename to scripts/jbm_header.txt diff --git a/parse_commands.py b/scripts/parse_commands.py similarity index 100% rename from parse_commands.py rename to scripts/parse_commands.py diff --git a/rend_header.txt b/scripts/rend_header.txt similarity index 100% rename from rend_header.txt rename to scripts/rend_header.txt diff --git a/script_footer.txt b/scripts/script_footer.txt similarity index 100% rename from script_footer.txt rename to scripts/script_footer.txt diff --git a/conformance-test/conftest.py b/tests/conformance-test/conftest.py similarity index 100% rename from conformance-test/conftest.py rename to tests/conformance-test/conftest.py diff --git a/conformance-test/pytest.ini b/tests/conformance-test/pytest.ini similarity index 100% rename from conformance-test/pytest.ini rename to tests/conformance-test/pytest.ini diff --git a/conformance-test/test_26252.py b/tests/conformance-test/test_26252.py similarity index 100% rename from conformance-test/test_26252.py rename to tests/conformance-test/test_26252.py -- GitLab From 707906f6ff949a49c8f16755def94de63440741f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 16:50:25 +0100 Subject: [PATCH 290/498] parse_commands.py needs to be run from project root --- .gitlab-ci.yml | 13 +++++-------- scripts/parse_commands.py | 14 +++++++------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efa6dc698c..c67f7e0ac2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1252,10 +1252,7 @@ ivas-conformance: # Output creation - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html - - cd scripts - - python parse_commands.py ../report_cmd.html Readme_IVAS.txt - - cd .. - + - python scripts/parse_commands.py report_cmd.html Readme_IVAS.txt # Copy input data and output ref data - if (Test-Path testvec) {rm -r -force testvec} @@ -1273,10 +1270,10 @@ ivas-conformance: - cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref - cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref - cp -r -force -ErrorAction Ignore tests/conformance-test testvec/ - - cp scripts/Readme_IVAS_dec.txt testvec - - cp scripts/Readme_IVAS_enc.txt testvec - - cp scripts/Readme_IVAS_rend.txt testvec - - cp scripts/Readme_IVAS_JBM_dec.txt testvec + - cp Readme_IVAS_dec.txt testvec + - cp Readme_IVAS_enc.txt testvec + - cp Readme_IVAS_rend.txt testvec + - cp Readme_IVAS_JBM_dec.txt testvec - cp IVAS_cod.exe testvec/bin - cp IVAS_dec.exe testvec/bin - cp IVAS_rend.exe testvec/bin diff --git a/scripts/parse_commands.py b/scripts/parse_commands.py index f2cefd52e9..af98e668f5 100644 --- a/scripts/parse_commands.py +++ b/scripts/parse_commands.py @@ -39,7 +39,7 @@ if __name__ == '__main__': cmds_rend.extend(re.findall(r"Running command\\n(.*?)\\n", line)) with open(txt_file.replace('.','_enc.'),'w', newline='\n') as outfile: - with open('enc_header.txt','r') as header: + with open('scripts/enc_header.txt','r') as header: outfile.write(header.read()) for cmd in cmds_enc: args = [] @@ -57,13 +57,13 @@ if __name__ == '__main__': if bts: outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+bts.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') - with open('script_footer.txt','r') as footer: + with open('scripts/script_footer.txt','r') as footer: outfile.write(footer.read()) with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_JBM_dec.'),'w', newline='\n') as outfile_jbm: - with open('dec_header.txt','r') as header: + with open('scripts/dec_header.txt','r') as header: outfile_dec.write(header.read()) - with open('jbm_header.txt','r') as header: + with open('scripts/jbm_header.txt','r') as header: outfile_jbm.write(header.read()) for cmd in cmds_dec: absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) @@ -111,13 +111,13 @@ if __name__ == '__main__': diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+output+' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) outfile.write('\n\n') - with open('script_footer.txt','r') as footer: + with open('scripts/script_footer.txt','r') as footer: outfile_dec.write(footer.read()) footer.seek(0) outfile_jbm.write(footer.read()) with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile: - with open('rend_header.txt','r') as header: + with open('scripts/rend_header.txt','r') as header: outfile.write(header.read()) for cmd in cmds_rend: args = [] @@ -148,5 +148,5 @@ if __name__ == '__main__': if out and "cut" in out.group(1): outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer/cut',REF_PATH + r'/renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') - with open('script_footer.txt','r') as footer: + with open('scripts/script_footer.txt','r') as footer: outfile.write(footer.read()) \ No newline at end of file -- GitLab From c24e05f2e0a205dc709f6dd2e378d800bc6ab544 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 13 Feb 2024 16:55:49 +0100 Subject: [PATCH 291/498] Remove obsolete tests/split_rendering/conftest.py --- tests/split_rendering/conftest.py | 44 ------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 tests/split_rendering/conftest.py diff --git a/tests/split_rendering/conftest.py b/tests/split_rendering/conftest.py deleted file mode 100644 index c4c8b05174..0000000000 --- a/tests/split_rendering/conftest.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -""" - (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 - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of 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 - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. -""" - - -def pytest_addoption(parser): - parser.addoption( - "--create_ref", - action="store_true", - default=False, - ) - parser.addoption( - "--create_cut", - action="store_true", - default=False, - ) -- GitLab From e5723c2e59cd9e850ec68fc0744c88838f7c7563 Mon Sep 17 00:00:00 2001 From: Arnaud Lefort Date: Tue, 13 Feb 2024 18:19:25 +0100 Subject: [PATCH 292/498] NONBE_FIX_567_DOUBLE_STEREO_DMX defined by default. --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index e333514d8a..c3acf1c352 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,7 @@ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ -//#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ +#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ #define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC #define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ -- GitLab From 55be6194ef9f46ccd5f41749805e10ca78edbc4e Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 13 Feb 2024 19:37:03 +0100 Subject: [PATCH 293/498] add new set of filters --- .../ivas_binaural_51_brir-lc_16kHz.bin | 3 +++ .../ivas_binaural_51_brir-lc_32kHz.bin | 3 +++ .../ivas_binaural_51_brir-lc_48kHz.bin | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_16kHz.bin create mode 100644 scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_32kHz.bin create mode 100644 scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_48kHz.bin diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_16kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_16kHz.bin new file mode 100644 index 0000000000..20c688d2da --- /dev/null +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_16kHz.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c839dcbdcfb7de23b725325770a07de3fe0144dc56f0ba7b4a9627bc912c2547 +size 1771166 diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_32kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_32kHz.bin new file mode 100644 index 0000000000..c92f4c2af0 --- /dev/null +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_32kHz.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c88daaf248bb36ac11d0aa320b18ce87019ef6ad9fab6ac2b7f064b27048aac +size 2107682 diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_48kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_48kHz.bin new file mode 100644 index 0000000000..61f226bca4 --- /dev/null +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_51_brir-lc_48kHz.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed7e4b9f3306e7aecd2edf19b7ca9fb62240031fa248b26ad7c606fef36a20fe +size 2343650 -- GitLab From 24de8c92d7f5c6a64d6f04282adc3f3805c7b054 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Wed, 14 Feb 2024 11:24:49 +0100 Subject: [PATCH 294/498] fix bugs in scripts --- tests/hrtf_binary_loading/constants.py | 1 + tests/hrtf_binary_loading/utils.py | 12 +++++++----- tests/renderer/utils.py | 4 ++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 5be9b6a044..91ae0cbb51 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -51,6 +51,7 @@ DECODER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_dec"))] RENDERER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_rend"))] HRTF_BINARY_FILE = "ivas_binaural_{}kHz.bin" +# HRTF_BINARY_FILE = "ivas_binaural_51_brir-lc_{}kHz.bin" SAMPLE_RATE = ["16", "32", "48"] INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] # "MONO", "STEREO", diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 318ef0ce41..ec93f9a7a9 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -312,15 +312,16 @@ def compare_rom_vs_binary( out_rom, out_rom_fs = pyaudio3dtools.audiofile.readfile(out_rom_path) hrtf_file = HRTF_BINARY_FILE.format(out_fs) - if trj_file is not None: - option_list_dec.extend(["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))]) - else: - option_list_dec = ["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))] + if hrtf_file is not None: + if trj_file is not None: + option_list_dec.extend(["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))]) + else: + option_list_dec = ["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))] out_bin_path = DEC_BINARY_DIR.joinpath(in_file + file_ext).with_suffix(".wav") run_decoder( out_fmt, out_fs, bitstream_path, out_bin_path, add_option_list=option_list_dec ) - out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_rom_path) + out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_bin_path) check_BE(test_info, out_rom, out_rom_fs, out_bin, out_bin_fs) if keep_file == False: @@ -344,6 +345,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( config_file: Optional[str] = None, frame_size: Optional[str] = "20ms", hrir_name="ivas_binaural_48kHz.bin", + # hrir_name="ivas_binaural_51_brir-lc_48kHz.bin", keep_file=False, ): hrtf_file_dir = SCRIPTS_DIR.joinpath( diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 82847599b3..d597e65630 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -55,6 +55,7 @@ def test_info(request): def run_cmd(cmd, env=None): logging.info(f"\nRunning command\n{' '.join(cmd)}\n") + cmdJoin = ' '.join(cmd) try: sp.run(cmd, check=True, capture_output=True, text=True, env=env) except sp.CalledProcessError as e: @@ -195,6 +196,9 @@ def run_renderer( if trj_file is not None: cmd.extend(["-T", str(trj_file)]) + if hrtf_file is not None: + cmd.extend(["-hrtf", str(hrtf_file)]) + if non_diegetic_pan is not None: cmd.extend(["-non_diegetic_pan", str(non_diegetic_pan)]) if refrot_file is not None: -- GitLab From 1a387b9f135bfcd432824a04d148c49066c1ea5a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:03:53 +0100 Subject: [PATCH 295/498] [cleanup] accept FIX_963_USAN_ERROR --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_enc_itd.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c3acf1c352..4b6612ba1d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING /* FhG: fix usan error in MCT with bw swicthing */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index d90fdfa1e9..988f3a473b 100755 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -908,7 +908,6 @@ void stereo_dft_enc_compute_itd( { hStereoDft->expectedNumUpdates += 1 + min( hCPE->hFrontVad[0]->rem_dtx_ho, hCPE->hFrontVad[1]->rem_dtx_ho ); } -#ifdef FIX_963_USAN_ERROR if ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates == 0 ) { cng_xcorr_filt = max( CORR_FILT, sfm_L ); @@ -917,9 +916,6 @@ void stereo_dft_enc_compute_itd( { cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); } -#else - cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); -#endif hStereoDft->currentNumUpdates++; for ( i = 1; i < NFFT / 2; i++ ) { @@ -954,7 +950,6 @@ void stereo_dft_enc_compute_itd( if ( vad_flag_dtx[0] == 0 ) { /* expectedNumUpdates updated after call to dtx() in SID frames */ -#ifdef FIX_963_USAN_ERROR if ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates == 0 ) { cng_xcorr_filt = max( CORR_FILT, sfm_L ); @@ -963,9 +958,6 @@ void stereo_dft_enc_compute_itd( { cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); } -#else - cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); -#endif hStereoDft->currentNumUpdates++; hStereoDft->sfm = cng_xcorr_filt; } -- GitLab From d159f1e590104117dc02c4aa757376bac757f273 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:04:35 +0100 Subject: [PATCH 296/498] [cleanup] accept FIX_971_LOG2_IDX_GAIN_0 --- lib_com/options.h | 1 - lib_enc/swb_tbe_enc.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4b6612ba1d..4b0550341b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING /* FhG: fix usan error in MCT with bw swicthing */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index e6a553dcb1..758fa4fe76 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -2738,12 +2738,10 @@ void fb_tbe_enc( hBWE_TD->prev_fb_energy = sum2_f( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); fb_exc_energy = sum2_f( fb_exc, L_FRAME16k ) + EPSILON; ratio = (float) sqrt( temp2 / fb_exc_energy ); -#ifdef FIX_971_LOG2_IDX_GAIN_0 if ( ratio < 1.0f ) { ratio = 1.0f; } -#endif idxGain = (int16_t) ( log2_f( (float) ratio ) + 0.5f ); idxGain = max( 0, min( 15, idxGain ) ); ratio = (float) ( 1 << idxGain ); -- GitLab From de5257783ada67996323314416d3410cf0062729 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:05:23 +0100 Subject: [PATCH 297/498] [cleanup] accept FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING --- lib_com/options.h | 1 - lib_enc/ivas_mct_core_enc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4b0550341b..3980a1823a 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING /* FhG: fix usan error in MCT with bw swicthing */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 9a1ad2b17f..8705d94c64 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -279,14 +279,10 @@ void ivas_mct_core_enc( if ( switch_bw ) { -#ifdef FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING H_IGF_GRID igf_grid; igf_grid = sts[ch_core]->igf ? sts[ch_core]->hIGFEnc->igfData.igfInfo.grid : NULL; initMdctStereoEncData( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, sts[ch_core]->igf, igf_grid, 0 ); -#else - initMdctStereoEncData( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, sts[ch_core]->igf, sts[ch_core]->hIGFEnc->igfData.igfInfo.grid, 0 ); -#endif } if ( sts[ch_core]->igf ) -- GitLab From 52efb9b574805d6cbcf1057f35abf5ef3b0e136c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:06:44 +0100 Subject: [PATCH 298/498] [cleanup] accept FIX_983_DISC_ISM_DIGEST_NUM_OBJS --- lib_com/options.h | 1 - lib_dec/ivas_ism_param_dec.c | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3980a1823a..adbdd48c93 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ -#define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ #define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* Ericsson: premature cast to unsigned detected by USAN corrected */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 297472d173..9d1e179c8b 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -996,11 +996,7 @@ void ivas_ism_dec_digest_tc( st_ivas->renderer_type == RENDERER_OSBA_STEREO || ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { -#ifdef FIX_983_DISC_ISM_DIGEST_NUM_OBJS int16_t i; -#else - int16_t i, num_objects; -#endif int16_t azimuth, elevation; /* we have a full frame interpolator, adapt it */ @@ -1033,13 +1029,7 @@ void ivas_ism_dec_digest_tc( } /* also get the gains here */ -#ifdef FIX_983_DISC_ISM_DIGEST_NUM_OBJS for ( i = 0; i < st_ivas->nchan_ism; i++ ) -#else - num_objects = st_ivas->nchan_transport; - - for ( i = 0; i < num_objects; i++ ) -#endif { mvr2r( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmRendererData->prev_gains[i], MAX_OUTPUT_CHANNELS ); -- GitLab From ef50a9632bf638932dd1954affef7aa070ab7b7d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:07:26 +0100 Subject: [PATCH 299/498] [cleanup] accept FIX_976_USAN_PVQ_ENC_DEC_EVS_CR --- lib_com/options.h | 1 - lib_dec/pvq_core_dec.c | 14 -------------- lib_enc/pvq_core_enc.c | 4 ---- 3 files changed, 19 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index adbdd48c93..c6d77be6ed 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ -#define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* Ericsson: premature cast to unsigned detected by USAN corrected */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index a736792c31..976c118218 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -114,17 +114,11 @@ static void pvq_decode_band( for ( j = 0; j < Np; j++ ) { g_part[j] = -( (float) g_part_s[j] ) / 32768; -#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* note: here g_part needs to be become exactly 1.0(float) thus in BASOP Word16 g_part_s is in the negative Q15 domain */ -#endif -#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* aligned to BASOP to avoid USAN undefined negation warning for -(-32768) */ g_part_s[j] = negate( g_part_s[j] ); -#else - g_part_s[j] = -g_part_s[j]; -#endif } @@ -434,11 +428,7 @@ static void densitySymbolIndexDecode( { tot = res * ( res + 1 ) + 1; dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); -#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( ( res + 1 ) * ( res + 1 ) - dec_freq ) ) + res + 1; -#else - alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1; -#endif sym_freq = 2 * ( res - alpha ) + 1; cum_freq = alpha * ( 2 * ( res + 1 ) - alpha ); } @@ -456,11 +446,7 @@ static void densitySymbolIndexDecode( dec_freq = rc_decode( &st->BER_detect, hPVQ, tot ); if ( dec_freq < tot - ( res + 1 ) - ( res - ( c + 1 ) ) * ( res - c ) * c + c + 1 ) { -#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) ( res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) ) / ( 2 * res_c ); -#else - alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c ); -#endif sym_freq = 2 * alpha * res_c + 1; cum_freq = alpha * ( ( alpha - 1 ) * res_c + 1 ); diff --git a/lib_enc/pvq_core_enc.c b/lib_enc/pvq_core_enc.c index a8ca315ff5..ad2cd07ff5 100644 --- a/lib_enc/pvq_core_enc.c +++ b/lib_enc/pvq_core_enc.c @@ -124,12 +124,8 @@ static void pvq_encode_band( for ( j = 0; j < Np; j++ ) { g_part[j] = -( (float) g_part_s[j] ) / 32768; -#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR /* aligned to BASOP to avoid USAN undefined negation warning with -(-32768) */ g_part_s[j] = negate( g_part_s[j] ); -#else - g_part_s[j] = -g_part_s[j]; -#endif } srt_vec_ind( g_part_s, sg_part, idx_sort, Np ); -- GitLab From 4dae52c8933a0eccb7c4500246af9f031740133a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:08:12 +0100 Subject: [PATCH 300/498] [cleanup] accept NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN --- lib_com/options.h | 1 - lib_dec/ivas_sba_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c6d77be6ed..60630ea2fe 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 04a589534d..20bef3177b 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -254,11 +254,7 @@ ivas_error ivas_sba_dec_reconfigure( } /* save old */ -#ifdef NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN if ( ism_mode_old != ISM_SBA_MODE_DISC && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) -#else - if ( ism_mode_old != ISM_SBA_MODE_DISC ) -#endif { if ( st_ivas->hDirAC == NULL && st_ivas->hSpar != NULL ) { -- GitLab From 45032a332420ff2dfa5db615cae656d6be009642 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:09:10 +0100 Subject: [PATCH 301/498] [cleanup] accept NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES --- apps/decoder.c | 16 - apps/renderer.c | 16 - lib_com/common_api_types.h | 2 - lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 4 - lib_dec/ivas_init_dec.c | 22 - lib_dec/ivas_ism_dec.c | 12 - lib_dec/ivas_mct_dec.c | 8 - lib_dec/ivas_stat_dec.h | 2 - lib_dec/lib_dec.c | 2 - lib_dec/lib_dec.h | 2 - lib_rend/ivas_crend.c | 10 - lib_rend/ivas_dirac_dec_binaural_functions.c | 5 - lib_rend/ivas_hrtf.c | 4 - lib_rend/ivas_objectRenderer_mix.c | 21 - lib_rend/ivas_prot_rend.h | 62 --- lib_rend/ivas_reverb.c | 171 -------- lib_rend/ivas_reverb_filter_design.c | 184 --------- lib_rend/ivas_reverb_utils.c | 405 ------------------- lib_rend/ivas_stat_rend.h | 7 - lib_rend/lib_rend.c | 109 ----- lib_rend/lib_rend.h | 2 - lib_util/hrtf_file_reader.c | 131 ------ lib_util/hrtf_file_reader.h | 6 - 24 files changed, 1204 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index a4ae839ac6..6af2710450 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -198,9 +198,7 @@ int main( IVAS_RENDER_FRAMESIZE asked_frame_size; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -763,16 +761,6 @@ int main( } } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - 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; - } - } -#endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { @@ -833,7 +821,6 @@ int main( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -851,7 +838,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#endif } /*------------------------------------------------------------------------------------------* @@ -934,10 +920,8 @@ cleanup: IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); destroy_SetOfHRTF( hSetOfHRTF ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); -#endif } IVAS_DEC_Close( &hIvasDec ); diff --git a/apps/renderer.c b/apps/renderer.c index 23058b1c00..018da65c97 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -747,9 +747,7 @@ int main( IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif IsmPositionProvider *positionProvider; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; RenderConfigReader *renderConfigReader = NULL; @@ -1037,16 +1035,6 @@ int main( } } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) ); - goto cleanup; - } - } -#endif if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { @@ -1105,7 +1093,6 @@ int main( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = IVAS_REND_GetHrtfStatisticsHandle( hIvasRend, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" ); @@ -1123,7 +1110,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#endif } hrtfFileReader_close( &hrtfFileReader ); @@ -2254,9 +2240,7 @@ cleanup: Vector3PairFileReader_close( &referenceVectorReader ); destroy_td_hrtf( hHrtfTD ); destroy_SetOfHRTF( hSetOfHRTF ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES destroy_hrtf_statistics( hHrtfStatistics ); -#endif IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); RenderConfigReader_close( &renderConfigReader ); diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 44f93fd2fe..f12eb6940f 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -163,9 +163,7 @@ typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; -#endif typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE; typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE; diff --git a/lib_com/options.h b/lib_com/options.h index 60630ea2fe..fabe8cb68b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 84e26ac0eb..feb59980cf 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1231,11 +1231,7 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_open_fastconv( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f8a863b49d..ae967a127e 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1077,12 +1077,10 @@ ivas_error ivas_init_decoder_front( return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK ) { return error; } -#endif } /*-------------------------------------------------------------------* @@ -1236,7 +1234,6 @@ ivas_error ivas_init_decoder( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*--------------------------------------------------------------------* * Allocate and initialize HRTF Statistics handle *--------------------------------------------------------------------*/ @@ -1248,7 +1245,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------* @@ -2003,11 +1999,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2046,21 +2038,11 @@ ivas_error ivas_init_decoder( } #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2507,9 +2489,7 @@ void ivas_initialize_handles_dec( st_ivas->hSetOfHRTF = NULL; st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES st_ivas->hHrtfStatistics = NULL; -#endif st_ivas->hoa_dec_mtx = NULL; st_ivas->hMasaIsmData = NULL; st_ivas->hSbaIsmData = NULL; @@ -2756,10 +2736,8 @@ void ivas_destroy_dec( /* Parametric binauralizer HRTF filters */ ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* HRTF statistics */ ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics ); -#endif /* Config. Renderer */ ivas_render_config_close( &( st_ivas->hRenderConfig ) ); diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index fb103b8a54..5583f58651 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -201,11 +201,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( } if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -234,17 +230,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( /* Open Crend Binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif #endif { return error; diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index f5af8b42e0..02f8483111 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1273,17 +1273,9 @@ static ivas_error ivas_mc_dec_reconfig( else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif #endif { return error; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index f1f5a7eaa8..d415a7402a 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1112,9 +1112,7 @@ typedef struct Decoder_Struct HRTFS_CREND_HANDLE hSetOfHRTF; /* Set of HRTFs handle (CRend) */ HRTFS_FASTCONV_HANDLE hHrtfFastConv; /* FASTCONV HRTF tables for binaural rendering */ HRTFS_PARAMBIN_HANDLE hHrtfParambin; /* HRTF tables for parametric binauralizer */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics; /* HRTF statistics handle */ -#endif LSSETUP_CUSTOM_HANDLE hLsSetupCustom; /* Custom LS configuration handle */ float *hoa_dec_mtx; /* Pointer to decoder matrix for SBA */ HEAD_TRACK_DATA_HANDLE hHeadTrackData; /* Head tracking data structure */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d8e7300c7a..8ed33e0a29 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2040,7 +2040,6 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * IVAS_DEC_GetHrtfStatisticsHandle( ) * @@ -2061,7 +2060,6 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * copyRendererConfigStruct( ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index f913d20913..2dccb45525 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -425,12 +425,10 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin/* o : Parametric binauralizer HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error IVAS_DEC_GetHrtfStatisticsHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); -#endif /*! r: error code*/ ivas_error IVAS_DEC_GetRenderConfig( diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 04af3f9a3d..8a45c47fdb 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1219,11 +1219,7 @@ ivas_error ivas_rend_openMultiBinCrend( ivas_error error; #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs ) ) != IVAS_ERR_OK ) #endif @@ -1248,9 +1244,7 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT const int32_t output_Fs, const int16_t num_poses @@ -1398,11 +1392,7 @@ ivas_error ivas_rend_openCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), hHrtfStatistics, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, NULL, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 47af4342bf..4078dd6221 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -239,12 +239,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL ) #endif { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - /* Todo Philips: Room acoustics should be passed here once the underlying part works. Probably enough to pick it from st_ivas but you know best. */ - if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 6fa8a6476b..95b88a0cd6 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -37,9 +37,7 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_prot.h" -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #include "ivas_rom_binaural_crend_head.h" -#endif /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open() @@ -214,7 +212,6 @@ void ivas_HRTF_parambin_binary_close( return; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_binary_open() * @@ -307,4 +304,3 @@ ivas_error ivas_HRTF_statistics_init( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 82dca9ff3b..ca828de2e7 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -391,27 +391,6 @@ static ivas_error DefaultBSplineModel( model = &( HrFiltSet_p->ModelParams ); modelITD = &( HrFiltSet_p->ModelParamsITD ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - switch ( output_Fs ) - { - case 48000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_48kHz; - break; - case 32000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_32kHz; - break; - case 16000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; - break; - } -#endif /* Set ROM flag for correct deallocation */ model->modelROM = TRUE; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index ad6c02d92b..975a2356aa 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -616,7 +616,6 @@ void ivas_HRTF_CRend_binary_close( HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_HRTF_statistics_init( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ int32_t sampleRate /* i : Sample rate */ @@ -630,7 +629,6 @@ ivas_error ivas_HRTF_statistics_binary_open( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); -#endif /*----------------------------------------------------------------------------------* * TD object renderer @@ -903,9 +901,7 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT const int32_t output_Fs, const int16_t num_poses @@ -960,43 +956,17 @@ ivas_error ivas_rend_crendProcessSubframe( * Reverberator *----------------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_binaural_reverb_init( -#else -ivas_error ivas_binaural_reverb_open_fastconv( -#endif REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ -#else -#endif const int16_t numBins, /* i : number of CLDFB bins */ const int16_t numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ -#else - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const AUDIO_CONFIG internal_config, /* i : internal audio config for FastConv */ -#endif const int32_t sampling_rate, /* i : sampling rate */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ -#else - const HRTFS_FASTCONV_HANDLE hHrtfFastConv /* i : FastConv HRTF handle */ -#endif ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -ivas_error ivas_binaural_reverb_open_parambin( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const int32_t sampling_rate, /* i : sampling rate */ - const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ -); -#endif void ivas_binaural_reverb_close( REVERB_STRUCT_HANDLE *hReverb /* i/o: binaural reverb handle */ @@ -1014,13 +984,7 @@ void ivas_binaural_reverb_processSubframe( ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ -#else - const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ - const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ - const float *lr_energy_and_iac[], /* i : precomuputed lr energies and iac */ -#endif RENDER_CONFIG_DATA *pConfig, /* i : Reverb configuration */ const int32_t output_Fs /* i : output sampling rate */ ); @@ -1177,23 +1141,12 @@ void ivas_reverb_calc_color_levels( float *pTarget_color_R ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_reverb_prepare_cldfb_params( const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, const HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, float *pOutput_t60, float *pOutput_ene ); -#else -ivas_error ivas_reverb_prepare_cldfb_params( - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, - const int32_t output_Fs, - float *pOutput_t60, - float *pOutput_ene ); -#endif void ivas_reverb_interpolate_acoustic_data( const int16_t input_table_size, @@ -1206,21 +1159,6 @@ void ivas_reverb_interpolate_acoustic_data( float *pOutput_dsr ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -void ivas_reverb_get_hrtf_set_properties( - float **ppHrtf_set_L_re, - float **ppHrtf_set_L_im, - float **ppHrtf_set_R_re, - float **ppHrtf_set_R_im, - const AUDIO_CONFIG input_audio_config, - const int16_t hrtf_count, - const int16_t in_freq_count, - const int16_t out_freq_count, - float *pOut_avg_pwr_L, - float *pOut_avg_pwr_R, - float *pOut_i_a_coherence -); -#endif /*---------------------------------------------------------------------------------* * Shoebox Prototypes diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index fb6c985560..c5262dafc6 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -939,69 +939,12 @@ static void set_fft_and_datablock_sizes( static void set_reverb_acoustic_data( ivas_reverb_params_t *pParams, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - const AUDIO_CONFIG input_audio_config, - const HRTFS_HANDLE hHrtf, -#endif IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics, -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - const int16_t subframe_len, -#endif const int16_t nr_fc_input, const int16_t nr_fc_fft_filter ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES int16_t bin_idx; -#else - int16_t nr_out_ch, hrtf_idx, offset, iter_idx, bin_idx; -#endif float ln_1e6_inverted, delay_diff, exp_argument; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - float *pHrtf_set_l_re[MAX_INTERN_CHANNELS]; - float *pHrtf_set_l_im[MAX_INTERN_CHANNELS]; - float *pHrtf_set_r_re[MAX_INTERN_CHANNELS]; - float *pHrtf_set_r_im[MAX_INTERN_CHANNELS]; - - /* use crend hrtf filters */ - if ( hHrtf != NULL ) - { - /* Compute HRTF set properties: average left/right energies, IA coherence */ - /* First, find the offset of the frequency-domain data for the 1st frame and assign HRTF pointers */ - for ( nr_out_ch = 0; nr_out_ch < BINAURAL_CHANNELS; nr_out_ch++ ) - { - for ( hrtf_idx = 0; hrtf_idx < hHrtf->max_num_ir; hrtf_idx++ ) - { - offset = 0; - for ( iter_idx = 0; iter_idx < hHrtf->num_iterations[hrtf_idx][nr_out_ch] - 1; iter_idx++ ) - { - offset += hHrtf->pIndex_frequency_max[hrtf_idx][nr_out_ch][iter_idx]; - } - - if ( nr_out_ch == 0 ) - { - pHrtf_set_l_re[hrtf_idx] = &hHrtf->pOut_to_bin_re[hrtf_idx][0][offset]; - pHrtf_set_l_im[hrtf_idx] = &hHrtf->pOut_to_bin_im[hrtf_idx][0][offset]; - } - else - { - pHrtf_set_r_re[hrtf_idx] = &hHrtf->pOut_to_bin_re[hrtf_idx][1][offset]; - pHrtf_set_r_im[hrtf_idx] = &hHrtf->pOut_to_bin_im[hrtf_idx][1][offset]; - } - } - } - - /* Compute HRTF set properties using frequency-domain HRTF data */ - ivas_reverb_get_hrtf_set_properties( pHrtf_set_l_re, pHrtf_set_l_im, pHrtf_set_r_re, pHrtf_set_r_im, input_audio_config, hHrtf->max_num_ir, subframe_len, - nr_fc_fft_filter, pParams->pHrtf_avg_pwr_response_l, pParams->pHrtf_avg_pwr_response_r, pParams->pHrtf_inter_aural_coherence ); - - pParams->pHrtf_avg_pwr_response_l_const = (const float *) pParams->pHrtf_avg_pwr_response_l; - pParams->pHrtf_avg_pwr_response_r_const = (const float *) pParams->pHrtf_avg_pwr_response_r; - pParams->pHrtf_inter_aural_coherence_const = (const float *) pParams->pHrtf_inter_aural_coherence; - } - -#endif /* interpolate input table data for T60 and DSR to the FFT filter grid */ ivas_reverb_interpolate_acoustic_data( nr_fc_input, pRoomAcoustics->pFc_input, pRoomAcoustics->pAcoustic_rt60, pRoomAcoustics->pAcoustic_dsr, nr_fc_fft_filter, pParams->pFc, pParams->pRt60, pParams->pDsr ); @@ -1096,13 +1039,7 @@ static ivas_error setup_FDN_branches( ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ -#else - const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ - const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ - const float *lr_energy_and_iac[], /* i : precomuputed lr energies and iac */ -#endif RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ const int32_t output_Fs /* i : output sampling rate */ ) @@ -1176,21 +1113,10 @@ ivas_error ivas_reverb_open( params.pFc[bin_idx] = freq_step * bin_idx; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES set_reverb_acoustic_data( ¶ms, &hRenderConfig->roomAcoustics, nr_fc_input, nr_fc_fft_filter ); params.pHrtf_avg_pwr_response_l_const = hHrtfStatistics->average_energy_l; params.pHrtf_avg_pwr_response_r_const = hHrtfStatistics->average_energy_r; params.pHrtf_inter_aural_coherence_const = hHrtfStatistics->inter_aural_coherence; -#else - if ( hHrtf == NULL && lr_energy_and_iac != NULL ) - { - params.pHrtf_avg_pwr_response_l_const = lr_energy_and_iac[0]; - params.pHrtf_avg_pwr_response_r_const = lr_energy_and_iac[1]; - params.pHrtf_inter_aural_coherence_const = lr_energy_and_iac[2]; - } - /* set up reverb acoustic data on the basis of HRTF data and renderer config */ - set_reverb_acoustic_data( ¶ms, input_audio_config, hHrtf, &hRenderConfig->roomAcoustics, subframe_len, nr_fc_input, nr_fc_fft_filter ); -#endif /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING @@ -1903,7 +1829,6 @@ static ivas_error ivas_binaural_reverb_open( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*------------------------------------------------------------------------- * ivas_binaural_reverb_init() * @@ -1952,102 +1877,6 @@ ivas_error ivas_binaural_reverb_init( return error; } -#else -/*------------------------------------------------------------------------- - * ivas_binaural_reverb_open_fastconv() - * - * Allocate and initialize binaural room reverberator handle for FastConv - *------------------------------------------------------------------------*/ - -ivas_error ivas_binaural_reverb_open_fastconv( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const AUDIO_CONFIG internal_config, /* i : internal audio config for FastConv */ - const int32_t sampling_rate, /* i : sampling rate */ - const HRTFS_FASTCONV_HANDLE hHrtfFastConv /* i : FastConv HRTF handle */ -) -{ - ivas_error error; - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; - - error = IVAS_ERR_OK; - - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) - { - revTimes = t60; - revEne = ene; - if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, internal_config, false, sampling_rate, t60, ene ) ) != IVAS_ERR_OK ) - { - return error; - } - preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); - } - else - { - revTimes = hHrtfFastConv->fastconvReverberationTimes; - revEne = hHrtfFastConv->fastconvReverberationEneCorrections; - preDelay = 10; - } - - error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); - - return error; -} - - -/*------------------------------------------------------------------------- - * ivas_binaural_reverb_open_parambin() - * - * Allocate and initialize binaural room reverberator handle for ParamBin - *------------------------------------------------------------------------*/ - -ivas_error ivas_binaural_reverb_open_parambin( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const int32_t sampling_rate, /* i : sampling rate */ - const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ -) -{ - ivas_error error; - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; - - error = IVAS_ERR_OK; - - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) - { - revTimes = t60; - revEne = ene; - /* Todo Philips: This needs a suitable function for ParamBin here. */ - // if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, internal_config, false, sampling_rate, t60, ene ) ) != IVAS_ERR_OK ) - // { - // return error; - // } - preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); - } - else - { - revTimes = hHrtfParambin->parametricReverberationTimes; - revEne = hHrtfParambin->parametricReverberationEneCorrections; - preDelay = 10; - } - - error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); - - return error; -} -#endif /*------------------------------------------------------------------------- * ivas_binaural_reverb_close() diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index b5009832d9..53fb4ebdf3 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -654,187 +654,3 @@ void ivas_reverb_interpolate_acoustic_data( return; } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-------------------------------------------------------------------* - * ivas_reverb_get_hrtf_set_properties() - * - * Function analyses the HRTF set and computes avarage left/right power spectrum - * and frequency-dependent IA coherence. Expects frequency-domain HRTF input - *-------------------------------------------------------------------*/ - -void ivas_reverb_get_hrtf_set_properties( - float **ppHrtf_set_L_re, - float **ppHrtf_set_L_im, - float **ppHrtf_set_R_re, - float **ppHrtf_set_R_im, - const AUDIO_CONFIG input_audio_config, - const int16_t hrtf_count, - const int16_t in_freq_count, - const int16_t out_freq_count, - float *pOut_avg_pwr_L, - float *pOut_avg_pwr_R, - float *out_i_a_coherence ) -{ - const float foa_sum_coeffs[4][3] = { - { 1.0, 1.0f, 0.0f }, - { 1.0, -1.0f, 0.0f }, - { 1.0, 0.0f, 1.0f }, - { 1.0, 0.0f, -1.0f } - }; - const float inp_freq_step = 0.5f / (float) in_freq_count; - const float inp_freq_offset = 0.5f * inp_freq_step; - const float out_freq_step = 0.5f / (float) ( out_freq_count - 1 ); - - int16_t used_hrtf_count, base_idx, freq_idx, hrtf_idx, out_bin_idx, ch_index, is_ambisonics; - float hrtf_count_inverted, relative_pos, weight_1st; - float avg_pwr_left[2]; - float avg_pwr_right[2]; - float IA_coherence[2]; - - if ( input_audio_config == IVAS_AUDIO_CONFIG_FOA || input_audio_config == IVAS_AUDIO_CONFIG_HOA2 || input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - is_ambisonics = 1; - used_hrtf_count = 4; /* Using only 1st order HRTFs */ - } - else - { - is_ambisonics = 0; - used_hrtf_count = hrtf_count; - } - - /* Interpolation (linear to a new grid) */ - base_idx = 0; - relative_pos = 0.0f; - hrtf_count_inverted = 1.0f / (float) used_hrtf_count; - - /* Loop over output frequency bins */ - for ( out_bin_idx = 0; out_bin_idx < out_freq_count; out_bin_idx++ ) - { - /* Computing normalized frequency for the current bin (1.0 corresponds to sampling rate) */ - const float norm_freq = out_freq_step * out_bin_idx; - - /* Computing the bin index in the source data */ - if ( in_freq_count == out_freq_count ) - { - base_idx = out_bin_idx; - } - else - { - const float tbl_index = ( norm_freq - inp_freq_offset ) / inp_freq_step; - - if ( tbl_index <= 0.0f ) /* In case of extrapolation (below 1st bin), choose nearest */ - { - base_idx = 0; - relative_pos = 0.0f; - } - else - { - base_idx = (int16_t) floorf( tbl_index ); - relative_pos = tbl_index - base_idx; - if ( base_idx > ( in_freq_count - 2 ) ) /* In case of extrapolation (above last bin), choose nearest */ - { - base_idx = in_freq_count - 2; - relative_pos = 1.0f; - } - } - } - - /* Computing 2 bins data for later interpolation */ - - /* Zeroing before accumalation for average value computing */ - avg_pwr_left[0] = 0.0f; - avg_pwr_left[1] = 0.0f; - avg_pwr_right[0] = 0.0f; - avg_pwr_right[1] = 0.0f; - IA_coherence[0] = 0.0f; - IA_coherence[1] = 0.0f; - - /* Get power spectra and cross - correlation between left and right hrtfs */ - /* Loop over all the HRTFs available */ - for ( hrtf_idx = 0; hrtf_idx < used_hrtf_count; hrtf_idx++ ) - { - /* Pointers to current HRTF data */ - float *current_base_L_ptr_re, *current_base_L_ptr_im, *current_base_R_ptr_re, *current_base_R_ptr_im; - - /* combined HRTF data used for FOA */ - float combined_channels_L_re[2]; - float combined_channels_L_im[2]; - float combined_channels_R_re[2]; - float combined_channels_R_im[2]; - - /* Process the frequency bins containing both real and img parts */ - /* In case of 5.1 or 7.1 formats, use the available HRTF paires directly*/ - if ( !is_ambisonics ) - { - current_base_L_ptr_re = ppHrtf_set_L_re[hrtf_idx] + base_idx; - current_base_R_ptr_re = ppHrtf_set_R_re[hrtf_idx] + base_idx; - current_base_L_ptr_im = ppHrtf_set_L_im[hrtf_idx] + base_idx; - current_base_R_ptr_im = ppHrtf_set_R_im[hrtf_idx] + base_idx; - } - - /* In case of FOA format, combine the W channel with the X/Y channels */ - else - { - for ( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - combined_channels_L_re[freq_idx] = 0.0f; - combined_channels_R_re[freq_idx] = 0.0f; - combined_channels_L_im[freq_idx] = 0.0f; - combined_channels_R_im[freq_idx] = 0.0f; - - for ( ch_index = 0; ch_index < 3; ch_index++ ) - { - combined_channels_L_re[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_L_re[ch_index][base_idx + freq_idx]; - combined_channels_R_re[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_R_re[ch_index][base_idx + freq_idx]; - combined_channels_L_im[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_L_im[ch_index][base_idx + freq_idx]; - combined_channels_R_im[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_R_im[ch_index][base_idx + freq_idx]; - } - } - - current_base_L_ptr_re = &combined_channels_L_re[0]; - current_base_R_ptr_re = &combined_channels_R_re[0]; - current_base_L_ptr_im = &combined_channels_L_im[0]; - current_base_R_ptr_im = &combined_channels_R_im[0]; - } - - for ( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - float L_re, L_im, R_re, R_im, C_re; - - L_re = current_base_L_ptr_re[freq_idx]; - R_re = current_base_R_ptr_re[freq_idx]; - L_im = current_base_L_ptr_im[freq_idx]; - R_im = current_base_R_ptr_im[freq_idx]; - - avg_pwr_left[freq_idx] += L_re * L_re + L_im * L_im; - avg_pwr_right[freq_idx] += R_re * R_re + R_im * R_im; - - /* Cross product (Re part) */ - C_re = L_re * R_re + L_im * R_im; - IA_coherence[freq_idx] += C_re; - } - } - - /* Compute the averages and the IA coherence */ - for ( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - avg_pwr_left[freq_idx] *= hrtf_count_inverted; - avg_pwr_right[freq_idx] *= hrtf_count_inverted; - IA_coherence[freq_idx] = hrtf_count_inverted * IA_coherence[freq_idx] / - sqrtf( avg_pwr_left[freq_idx] * avg_pwr_right[freq_idx] ); - - /* Limiting to (0...1) range in case of small numerical errors or negative values */ - IA_coherence[freq_idx] = min( IA_coherence[freq_idx], 1.0f ); - IA_coherence[freq_idx] = max( IA_coherence[freq_idx], 0.0f ); - } - - /* Computing weighted average of 2 nearest values (1 below + 1 above) for linear interpolation */ - weight_1st = 1.0f - relative_pos; - pOut_avg_pwr_L[out_bin_idx] = weight_1st * avg_pwr_left[0] + relative_pos * avg_pwr_left[1]; - pOut_avg_pwr_R[out_bin_idx] = weight_1st * avg_pwr_right[0] + relative_pos * avg_pwr_right[1]; - out_i_a_coherence[out_bin_idx] = weight_1st * IA_coherence[0] + relative_pos * IA_coherence[1]; - } - - return; -} -#endif diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 8bd3b287ae..6b1b362059 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -67,11 +67,7 @@ typedef struct cldfb_convolver_state float filter_states_im[BINAURAL_CONVBANDS][CLDFB_CONVOLVER_NTAPS_MAX]; } cldfb_convolver_state; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES static void ivas_reverb_set_energies( const float *avg_pwr_l, const float *avg_pwr_r, const int32_t sampling_rate, float *avg_pwr_l_out, float *avg_pwr_r_out ); -#else -static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( const HRTFS_FASTCONV_HANDLE hHrtfFastConv, const AUDIO_CONFIG input_audio_config, const int16_t use_brir, const int32_t sampling_rate, float *avg_pwr_left, float *avg_pwr_right ); -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_reverb_prepare_cldfb_params() @@ -80,15 +76,8 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( const HRTFS_FASTCO *-----------------------------------------------------------------------------------------*/ ivas_error ivas_reverb_prepare_cldfb_params( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, const HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#else - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, -#endif const int32_t output_Fs, float *pOutput_t60, float *pOutput_ene ) @@ -100,9 +89,6 @@ ivas_error ivas_reverb_prepare_cldfb_params( float delay_diff, ln_1e6_inverted, exp_argument; const float dist = DEFAULT_SRC_DIST; const float dmx_gain_2 = 4.0f * EVS_PI * dist * dist / 0.001f; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - ivas_error error; -#endif for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { @@ -123,14 +109,7 @@ ivas_error ivas_reverb_prepare_cldfb_params( pOutput_ene[idx] *= expf( exp_argument ); } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_reverb_set_energies( hHrtfStatistics->average_energy_l, hHrtfStatistics->average_energy_r, output_Fs, avg_pwr_left, avg_pwr_right ); -#else - if ( ( error = ivas_reverb_get_fastconv_hrtf_set_energies( hHrtfFastConv, input_audio_config, use_brir, output_Fs, avg_pwr_left, avg_pwr_right ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { @@ -140,353 +119,7 @@ ivas_error ivas_reverb_prepare_cldfb_params( return IVAS_ERR_OK; } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-----------------------------------------------------------------------------------------* - * Function ivas_cldfb_convolver() - * - * Function for convolving CLDFB-domain data with filter taps - *-----------------------------------------------------------------------------------------*/ - -static void ivas_cldfb_convolver( - cldfb_convolver_state *convolver_state, /* i/o: pointer to convolver state structure */ - float out_CLDFB_real[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* o : real part of binaural signals */ - float out_CLDFB_imag[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* o : imag part of binaural signals */ - float in_CLDFB_real[CLDFB_NO_CHANNELS_MAX], /* i : real part of input signals */ - float in_CLDFB_imag[CLDFB_NO_CHANNELS_MAX], /* i : imag part of input signals */ - const int16_t num_conv_bands, /* i : number of convolution bands */ - const int16_t num_taps /* i : number of filter taps */ -) -{ - int16_t band_idx, tap_idx; - float *filter_states_real_ptr, *filter_states_imag_ptr; - const float *filter_taps_left_re_ptr, *filter_taps_left_im_ptr, *filter_taps_right_re_ptr, *filter_taps_right_im_ptr; - - for ( band_idx = 0; band_idx < num_conv_bands; band_idx++ ) - { - float out_real_left, out_real_right, out_imag_left, out_imag_right; - out_real_left = 0.0f; - out_real_right = 0.0f; - out_imag_left = 0.0f; - out_imag_right = 0.0f; - - filter_states_real_ptr = (float *) &( convolver_state->filter_states_re[band_idx][0] ); - filter_states_imag_ptr = (float *) &( convolver_state->filter_states_im[band_idx][0] ); - - filter_taps_left_re_ptr = convolver_state->filter_taps_left_re[band_idx]; - filter_taps_left_im_ptr = convolver_state->filter_taps_left_im[band_idx]; - filter_taps_right_re_ptr = convolver_state->filter_taps_right_re[band_idx]; - filter_taps_right_im_ptr = convolver_state->filter_taps_right_im[band_idx]; - - for ( tap_idx = num_taps - 1; tap_idx > 0; tap_idx-- ) - { - filter_states_real_ptr[tap_idx] = filter_states_real_ptr[tap_idx - 1]; - filter_states_imag_ptr[tap_idx] = filter_states_imag_ptr[tap_idx - 1]; - - /* Left real and imag */ - out_real_left += ( filter_states_real_ptr[tap_idx] * filter_taps_left_re_ptr[tap_idx] ) - ( filter_states_imag_ptr[tap_idx] * filter_taps_left_im_ptr[tap_idx] ); - out_imag_left += ( filter_states_real_ptr[tap_idx] * filter_taps_left_im_ptr[tap_idx] ) + ( filter_states_imag_ptr[tap_idx] * filter_taps_left_re_ptr[tap_idx] ); - - /* Right real and imag*/ - out_real_right += ( filter_states_real_ptr[tap_idx] * filter_taps_right_re_ptr[tap_idx] ) - ( filter_states_imag_ptr[tap_idx] * filter_taps_right_im_ptr[tap_idx] ); - out_imag_right += ( filter_states_real_ptr[tap_idx] * filter_taps_right_im_ptr[tap_idx] ) + ( filter_states_imag_ptr[tap_idx] * filter_taps_right_re_ptr[tap_idx] ); - } - - filter_states_real_ptr[0] = in_CLDFB_real[band_idx]; - filter_states_imag_ptr[0] = in_CLDFB_imag[band_idx]; - - /* Left real and imag */ - out_CLDFB_real[0][band_idx] += out_real_left + ( filter_states_real_ptr[0] * filter_taps_left_re_ptr[0] ) - ( filter_states_imag_ptr[0] * filter_taps_left_im_ptr[0] ); - out_CLDFB_imag[0][band_idx] += out_imag_left + ( filter_states_real_ptr[0] * filter_taps_left_im_ptr[0] ) + ( filter_states_imag_ptr[0] * filter_taps_left_re_ptr[0] ); - - /* Right real and imag */ - out_CLDFB_real[1][band_idx] += out_real_right + ( filter_states_real_ptr[0] * filter_taps_right_re_ptr[0] ) - ( filter_states_imag_ptr[0] * filter_taps_right_im_ptr[0] ); - out_CLDFB_imag[1][band_idx] += out_imag_right + ( filter_states_real_ptr[0] * filter_taps_right_im_ptr[0] ) + ( filter_states_imag_ptr[0] * filter_taps_right_re_ptr[0] ); - } - - return; -} - - -/*-----------------------------------------------------------------------------------------* - * Function get_IR_from_filter_taps() - * - * Function converts CLDFB filter taps into time-domain data - *-----------------------------------------------------------------------------------------*/ - -static ivas_error get_IR_from_filter_taps( - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const int16_t hrtf_idx, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, - const int32_t sampling_rate, - const int16_t pulse_length, - float *pOut_l, - float *pOut_r ) -{ - int16_t i, j, band_idx, block_idx, block_len, block_count, input_sample_idx, output_sample_idx, array_idx; - HANDLE_CLDFB_FILTER_BANK handle_cldfb_analysis, handle_cldfb_synthesis_l, handle_cldfb_synthesis_r; - cldfb_convolver_state convolver_state; - float real_buffer_in[CLDFB_NO_CHANNELS_MAX]; - float imag_buffer_in[CLDFB_NO_CHANNELS_MAX]; - float out_CLDFB_real[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* o : real part of Binaural signals */ - float out_CLDFB_imag[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* o : imag part of Binaural signals */ - float dirac_pls[CLDFB_NO_CHANNELS_MAX + 1]; - ivas_error error; - - block_len = (int16_t) ( sampling_rate * INV_CLDFB_BANDWIDTH ); - block_count = N_INITIAL_IGNORED_FRAMES + ( pulse_length / block_len ); - - set_f( dirac_pls, 0, block_len + 1 ); - dirac_pls[0] = 1.0f; - input_sample_idx = 0; - output_sample_idx = 0; - - /* Assign CLDFB taps */ - if ( input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_HOA3[band_idx][hrtf_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_HOA3[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_HOA3[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA3[band_idx][hrtf_idx]; - } - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_HOA2[band_idx][hrtf_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_HOA2[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_HOA2[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA2[band_idx][hrtf_idx]; - } - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_FOA ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_FOA[band_idx][hrtf_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_FOA[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_FOA[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_FOA[band_idx][hrtf_idx]; - } - } - else - { - array_idx = 0; - if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1 ) - { - array_idx = channelIndex_CICP6[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1 ) - { - array_idx = channelIndex_CICP12[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1_2 ) - { - array_idx = channelIndex_CICP14[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1_4 ) - { - array_idx = channelIndex_CICP16[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1_4 ) - { - array_idx = channelIndex_CICP19[hrtf_idx]; - } - - if ( use_brir ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftBRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftBRIRImag[band_idx][array_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightBRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightBRIRImag[band_idx][array_idx]; - } - } - else - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag[band_idx][array_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag[band_idx][array_idx]; - } - } - } - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < CLDFB_CONVOLVER_NTAPS_MAX; j++ ) - { - convolver_state.filter_states_re[i][j] = 0; - convolver_state.filter_states_im[i][j] = 0; - } - } - - if ( ( error = openCldfb( &handle_cldfb_analysis, CLDFB_ANALYSIS, sampling_rate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - if ( ( error = openCldfb( &handle_cldfb_synthesis_l, CLDFB_SYNTHESIS, sampling_rate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - if ( ( error = openCldfb( &handle_cldfb_synthesis_r, CLDFB_SYNTHESIS, sampling_rate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Main loop for convolving dirac pulse with CLDFB filter taps */ - for ( block_idx = 0; block_idx < block_count; block_idx++ ) - { - float *ppRealBuf[1]; - float *ppImagBuf[1]; - - cldfbAnalysis_ts( &dirac_pls[input_sample_idx], real_buffer_in, imag_buffer_in, block_len, handle_cldfb_analysis ); - - /* Perform convolution */ - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - for ( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) - { - out_CLDFB_real[i][j] = 0; - out_CLDFB_imag[i][j] = 0; - } - } - - ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, BINAURAL_NTAPS ); - - ppRealBuf[0] = out_CLDFB_real[0]; - ppImagBuf[0] = out_CLDFB_imag[0]; - cldfbSynthesis( ppRealBuf, ppImagBuf, &pOut_l[output_sample_idx], block_len, handle_cldfb_synthesis_l ); - - ppRealBuf[0] = out_CLDFB_real[1]; - ppImagBuf[0] = out_CLDFB_imag[1]; - cldfbSynthesis( ppRealBuf, ppImagBuf, &pOut_r[output_sample_idx], block_len, handle_cldfb_synthesis_r ); - - if ( input_sample_idx == 0 ) - { - input_sample_idx = 1; - } - - if ( block_idx >= N_INITIAL_IGNORED_FRAMES ) - { - output_sample_idx += block_len; - } - } - - deleteCldfb( &handle_cldfb_analysis ); - deleteCldfb( &handle_cldfb_synthesis_l ); - deleteCldfb( &handle_cldfb_synthesis_r ); - - return IVAS_ERR_OK; -} - - -/*-----------------------------------------------------------------------------------------* - * Function ivas_reverb_get_cldfb_hrtf_set_properties() - * - * Function analyses the HRTF set and computes avarage left/right power spectrum - * and frequency-dependent IA coherence. - * Uses fastconv renderer filter taps to compute energies - *-----------------------------------------------------------------------------------------*/ - -static ivas_error ivas_reverb_get_cldfb_hrtf_set_properties( - AUDIO_CONFIG input_audio_config, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const int16_t use_brir, - const int32_t sampling_rate, - float *avg_pwr_left, - float *avg_pwr_right ) -{ - float current_HRTF_data_L[L_FRAME48k]; - float current_HRTF_data_R[L_FRAME48k]; - int16_t freq_idx, hrtf_idx, hrtf_count; - float hrtf_count_inverted; - int16_t fft_size, IR_length, log2_fft_size, half_fft_size, freq_count; - ivas_error error; - - fft_size = RV_FILTER_MAX_FFT_SIZE; - IR_length = CLDFB_NO_CHANNELS_MAX * ( ( fft_size + CLDFB_NO_CHANNELS_MAX - 1 ) / CLDFB_NO_CHANNELS_MAX ); - log2_fft_size = int_log2( fft_size ); - half_fft_size = fft_size >> 1; - freq_count = 1 + half_fft_size; - - /* chosing between ambisonics, 5.1 and 7.1 MC audio */ - if ( ( input_audio_config == IVAS_AUDIO_CONFIG_FOA ) || ( input_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) ) - { - hrtf_count = 1; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1 ) - { - hrtf_count = 7; - } - else - { - hrtf_count = 5; - input_audio_config = IVAS_AUDIO_CONFIG_5_1; - } - - /* Zeroing before accumalation for average value computing */ - for ( freq_idx = 0; freq_idx < freq_count; freq_idx++ ) - { - avg_pwr_left[freq_idx] = 0.0f; - avg_pwr_right[freq_idx] = 0.0f; - } - - /* Get power spectra and cross - correlation between left and right hrtfs - Loop over all the HRTFs available */ - for ( hrtf_idx = 0; hrtf_idx < hrtf_count; hrtf_idx++ ) - { - if ( ( error = get_IR_from_filter_taps( hHrtfFastConv, hrtf_idx, input_audio_config, use_brir, sampling_rate, IR_length, current_HRTF_data_L, current_HRTF_data_R ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Perform forward FFT on both L/R channels */ - fft_rel( current_HRTF_data_L, (int16_t) fft_size, (int16_t) log2_fft_size ); - fft_rel( current_HRTF_data_R, (int16_t) fft_size, (int16_t) log2_fft_size ); - - /* Process the DC bin (without img part) */ - avg_pwr_left[0] += current_HRTF_data_L[0] * current_HRTF_data_L[0]; - avg_pwr_right[0] += current_HRTF_data_R[0] * current_HRTF_data_R[0]; - - /* Process the Nyquist frequency bin (without img part) */ - avg_pwr_left[half_fft_size] += current_HRTF_data_L[half_fft_size] * current_HRTF_data_L[half_fft_size]; - avg_pwr_right[half_fft_size] += current_HRTF_data_R[half_fft_size] * current_HRTF_data_R[half_fft_size]; - - /* Process the other frequency bins containing both real and img parts */ - for ( freq_idx = 1; freq_idx < half_fft_size; freq_idx++ ) - { - float L_re, L_im, R_re, R_im; - L_re = current_HRTF_data_L[freq_idx]; - R_re = current_HRTF_data_R[freq_idx]; - L_im = current_HRTF_data_L[fft_size - freq_idx]; - R_im = current_HRTF_data_R[fft_size - freq_idx]; - - avg_pwr_left[freq_idx] += L_re * L_re + L_im * L_im; - avg_pwr_right[freq_idx] += R_re * R_re + R_im * R_im; - } - } - - /* Compute the averages and the IA coherence */ - hrtf_count_inverted = 1.0f / (float) hrtf_count; - for ( freq_idx = 0; freq_idx < freq_count; freq_idx++ ) - { - avg_pwr_left[freq_idx] *= hrtf_count_inverted; - avg_pwr_right[freq_idx] *= hrtf_count_inverted; - } - - return IVAS_ERR_OK; -} -#endif -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------------------------* * Function ivas_reverb_set_energies() * @@ -497,63 +130,25 @@ static ivas_error ivas_reverb_get_cldfb_hrtf_set_properties( static void ivas_reverb_set_energies( const float *avg_pwr_l, const float *avg_pwr_r, -#else -/*-----------------------------------------------------------------------------------------* - * Function ivas_reverb_get_fastconv_hrtf_set_energies() - * - * Function analyses the HRTF set and computes avarage left/right power spectrum. - * Uses fastconv renderer filter taps to compute energies. Output interpolated - * to CLDFB bin center frequencies - *-----------------------------------------------------------------------------------------*/ - -static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, -#endif const int32_t sampling_rate, float *avg_pwr_left, float *avg_pwr_right ) { int16_t freq_idx; const int16_t cldfb_freq_halfstep = MAX_SAMPLING_RATE / ( 4 * CLDFB_NO_CHANNELS_MAX ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - float avg_pwr_left_fft[FFT_SPECTRUM_SIZE]; - float avg_pwr_right_fft[FFT_SPECTRUM_SIZE]; -#endif float input_fc[FFT_SPECTRUM_SIZE]; float output_fc[CLDFB_NO_CHANNELS_MAX]; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - ivas_error error; -#endif -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const int16_t avg_pwr_len = sampling_rate == 16000 ? LR_IAC_LENGTH_NR_FC_16KHZ : LR_IAC_LENGTH_NR_FC; for ( freq_idx = 0; freq_idx < avg_pwr_len; freq_idx++ ) { input_fc[freq_idx] = freq_idx * ( 0.5f * sampling_rate / (float) ( avg_pwr_len - 1 ) ); } -#else - for ( freq_idx = 0; freq_idx < FFT_SPECTRUM_SIZE; freq_idx++ ) - { - input_fc[freq_idx] = freq_idx * ( 0.5f * sampling_rate / (float) ( FFT_SPECTRUM_SIZE - 1 ) ); - } -#endif for ( freq_idx = 0; freq_idx < CLDFB_NO_CHANNELS_MAX; freq_idx++ ) { output_fc[freq_idx] = (float) ( ( 2 * freq_idx + 1 ) * cldfb_freq_halfstep ); } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_reverb_interpolate_acoustic_data( avg_pwr_len, input_fc, avg_pwr_l, avg_pwr_r, CLDFB_NO_CHANNELS_MAX, output_fc, avg_pwr_left, avg_pwr_right ); -#else - if ( ( error = ivas_reverb_get_cldfb_hrtf_set_properties( input_audio_config, hHrtfFastConv, use_brir, sampling_rate, avg_pwr_left_fft, avg_pwr_right_fft ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_reverb_interpolate_acoustic_data( FFT_SPECTRUM_SIZE, input_fc, avg_pwr_left_fft, avg_pwr_right_fft, CLDFB_NO_CHANNELS_MAX, output_fc, avg_pwr_left, avg_pwr_right ); - return IVAS_ERR_OK; -#endif } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 35a7bce0be..bb91a6e7ab 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1063,11 +1063,6 @@ typedef struct TDREND_HRFILT_FiltSet_struct ModelParamsITD_t ModelParamsITD; TDREND_HRFILT_Method_t FilterMethod; /* HR filtering method */ float latency_s; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - const float *lr_energy_and_iac[3]; /* left/right energy and interaural coherence for late reverb */ - float *lr_energy_and_iac_dyn[3]; -#endif } TDREND_HRFILT_FiltSet_t; @@ -1330,7 +1325,6 @@ typedef struct ivas_hrtfs_parambin_struct } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES typedef struct ivas_hrtfs_statistics_struct { float *average_energy_l; @@ -1338,7 +1332,6 @@ typedef struct ivas_hrtfs_statistics_struct float *inter_aural_coherence; int16_t fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------------------* diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2b98bb020c..9f1e8330ab 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -229,9 +229,7 @@ typedef struct hrtf_handles IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; IVAS_DEC_HRTF_HANDLE hHrtfTD; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; -#endif } hrtf_handles; struct IVAS_REND @@ -280,11 +278,7 @@ struct IVAS_REND * Local function prototypes *-------------------------------------------------------------------*/ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, const RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hHrtfs ); -#else -static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, hrtf_handles *hHrtfs ); -#endif static void freeMasaExtRenderer( MASA_EXT_REND_HANDLE *hMasaExtRendOut ); @@ -1416,11 +1410,7 @@ static ivas_error setRendInputActiveIsm( #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1460,11 +1450,7 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), hrtfs->hHrtfStatistics, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1477,22 +1463,14 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), hrtfs->hHrtfStatistics, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2179,9 +2157,7 @@ static ivas_error initMcBinauralRendering( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif uint8_t reconfigureFlag ) { ivas_error error; @@ -2278,11 +2254,7 @@ static ivas_error initMcBinauralRendering( #endif if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && inputMc->hReverb == NULL ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), hHrtfStatistics, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), outConfig, NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2292,19 +2264,10 @@ static ivas_error initMcBinauralRendering( { /* open CREND */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, outSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2505,11 +2468,7 @@ static ivas_error setRendInputActiveMc( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, FALSE ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2705,10 +2664,8 @@ static ivas_error updateSbaPanGains( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES , IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics -#endif ) { ivas_error error; @@ -2769,17 +2726,9 @@ static ivas_error updateSbaPanGains( #endif { #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2794,17 +2743,9 @@ static ivas_error updateSbaPanGains( } #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2960,11 +2901,7 @@ static ivas_error setRendInputActiveSba( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) -#else - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3040,11 +2977,7 @@ static ivas_error setRendInputActiveMasa( const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ) -#else - ) /* Todo: This is not used at all within MASA. Support might be better to do after refactoring. */ -#endif { ivas_error error; rendering_context rendCtx; @@ -3055,9 +2988,6 @@ static ivas_error setRendInputActiveMasa( inputMasa = (input_masa *) input; rendCtx = inputMasa->base.ctx; outConfig = *rendCtx.pOutConfig; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - (void) hRendCfg; /* Suppress warning */ -#endif if ( !isIoConfigPairSupported( inConfig, outConfig ) ) { @@ -3085,11 +3015,7 @@ static ivas_error setRendInputActiveMasa( } else { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hRendCfg, hrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3374,9 +3300,7 @@ ivas_error IVAS_REND_Open( hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; hIvasRend->hHrtfs.hSetOfHRTF = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics = NULL; -#endif if ( asHrtfBinary ) { if ( ( error = ivas_HRTF_binary_open( &( hIvasRend->hHrtfs.hHrtfTD ) ) ) != IVAS_ERR_OK ) @@ -3395,19 +3319,15 @@ ivas_error IVAS_REND_Open( { return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_HRTF_statistics_binary_open( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ) != IVAS_ERR_OK ) { return error; } -#endif } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) { return error; } -#endif return IVAS_ERR_OK; } @@ -3553,11 +3473,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( continue; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL, NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -4037,9 +3953,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif FALSE ) ) != IVAS_ERR_OK ) { return error; @@ -4902,9 +4816,7 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif TRUE ) ) != IVAS_ERR_OK ) { return error; @@ -4970,9 +4882,7 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif TRUE ) ) != IVAS_ERR_OK ) { return error; @@ -8725,9 +8635,7 @@ void IVAS_REND_Close( ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#endif free( hIvasRend ); *phIvasRend = NULL; @@ -8969,7 +8877,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfStatisticsHandle( ) * @@ -8990,7 +8897,6 @@ ivas_error IVAS_REND_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#endif static ivas_error ivas_masa_ext_rend_dirac_rend_init( input_masa *inputMasa ) @@ -9353,13 +9259,9 @@ static ivas_error ivas_masa_ext_rend_dirac_rend_init( } static ivas_error ivas_masa_ext_rend_parambin_init( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES input_masa *inputMasa, /* i/o: MASA external renderer structure */ const RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration data handle */ HRTFS_STATISTICS_HANDLE hHrtfStatistics /* i : HRTF statistics */ -#else - input_masa *inputMasa /* i/o: MASA external renderer structure */ -#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -9455,12 +9357,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( hDiracDecBin->hReverb == NULL ) #endif { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - /* Todo Philips: Room acoustics should be passed here once the underlying part works. In this case, it probably should come from render context or somewhere else suitable. */ - if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9514,9 +9411,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const RENDER_CONFIG_DATA *hRendCfg, -#endif hrtf_handles *hrtfs ) { int16_t i; @@ -9642,11 +9537,7 @@ static ivas_error initMasaExtRenderer( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_masa_ext_rend_parambin_init( inputMasa, hRendCfg, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_masa_ext_rend_parambin_init( inputMasa ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 95a016da1f..a670e75af2 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -220,12 +220,10 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error IVAS_REND_GetHrtfStatisticsHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); -#endif /* Functions to be called during rendering */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index e018f44982..c9beb7323c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -436,85 +436,6 @@ static ivas_error LoadBSplineBinary( } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-------------------------------------------------------------------* - * set_default_reverb_iac_energy() - * - * Loads reverb data from file. - --------------------------------------------------------------------*/ - -static ivas_error set_default_reverb_iac_energy( - IVAS_DEC_HRTF_HANDLE HrFiltSet_p /* i/o: HR filter model parameter structure */ -) -{ - int16_t i; - int16_t lr_iac_len; - - if ( HrFiltSet_p == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - lr_iac_len = LR_IAC_LENGTH_NR_FC; - if ( HrFiltSet_p->SampleRate == 16000 ) - { - lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; - } - - if ( HrFiltSet_p->ModelParams.modelROM == 0 ) - { - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - } - switch ( HrFiltSet_p->SampleRate ) - { - case 48000: - mvr2r( defaultHRIR_left_avg_power_48kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_48kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_48kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); - break; - case 32000: - mvr2r( defaultHRIR_left_avg_power_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); - break; - case 16000: - mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], lr_iac_len ); - mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], lr_iac_len ); - mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], lr_iac_len ); - break; - } - } - else - { - switch ( HrFiltSet_p->SampleRate ) - { - case 48000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_48kHz; - break; - case 32000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_32kHz; - break; - case 16000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; - break; - } - } - - return IVAS_ERR_OK; -} -#endif /*-------------------------------------------------------------------* @@ -524,18 +445,11 @@ static ivas_error set_default_reverb_iac_energy( --------------------------------------------------------------------*/ static ivas_error load_reverb_from_binary( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ -#else - IVAS_DEC_HRTF_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ -#endif FILE *f_hrtf /* i : HR filter data file handle */ ) { -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - int16_t i; -#endif bool is_reverb; ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; @@ -545,21 +459,13 @@ static ivas_error load_reverb_from_binary( char *hrtf_data; int16_t lr_iac_len; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( hHrtfStatistics == NULL ) -#else - if ( HrFiltSet_p == NULL ) -#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } lr_iac_len = LR_IAC_LENGTH_NR_FC; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( sampleRate == 16000 ) -#else - if ( HrFiltSet_p->SampleRate == 16000 ) -#endif { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } @@ -616,7 +522,6 @@ static ivas_error load_reverb_from_binary( if ( is_reverb ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hHrtfStatistics->average_energy_l = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->average_energy_r = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->inter_aural_coherence = (float *) malloc( lr_iac_len * sizeof( float ) ); @@ -630,29 +535,9 @@ static ivas_error load_reverb_from_binary( fread( hHrtfStatistics->inter_aural_coherence, sizeof( const float ), lr_iac_len, f_hrtf ); hHrtfStatistics->fromROM = FALSE; -#else - /* left/right energy and interaural coherence for late reverb */ - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), lr_iac_len, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; - } -#endif } else { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - if ( ( header_check_result = set_default_reverb_iac_energy( HrFiltSet_p ) ) != IVAS_ERR_OK ) - { - return header_check_result; - } -#endif return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } @@ -666,22 +551,14 @@ static ivas_error load_reverb_from_binary( *---------------------------------------------------------------------*/ ivas_error load_reverb_binary( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ -#else - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ -#endif const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ) { fseek( hrtfReader->file, 0, SEEK_SET ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES return load_reverb_from_binary( hHrtfStatistics, sampleRate, hrtfReader->file ); -#else - return load_reverb_from_binary( hHrtf, hrtfReader->file ); -#endif } @@ -934,12 +811,6 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelEval.hrfModL ); free( ( *hHrtf )->ModelEval.hrfModR ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - for ( i = 0; i < 3; i++ ) - { - free( ( *hHrtf )->lr_energy_and_iac_dyn[i] ); - } -#endif } ivas_HRTF_binary_close( hHrtf ); @@ -1982,7 +1853,6 @@ void destroy_parambin_hrtf( return; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() * @@ -2002,4 +1872,3 @@ ivas_error destroy_hrtf_statistics( ivas_HRTF_statistics_close( hHrtfStatistics ); return IVAS_ERR_OK; } -#endif diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 6c280e2ff9..0eea40b117 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -98,12 +98,8 @@ ivas_error load_HRTF_binary( *---------------------------------------------------------------------*/ ivas_error load_reverb_binary( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ -#else - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ -#endif const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* @@ -182,7 +178,6 @@ void destroy_td_hrtf( IVAS_DEC_HRTF_HANDLE *hHRTF /* i/o: HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() * @@ -192,6 +187,5 @@ void destroy_td_hrtf( ivas_error destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ); -#endif #endif /* IVAS_HRTF_FILE_READER_H */ -- GitLab From 7696303de4a673e8b5851af2c3a0c96f5dda852e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:11:17 +0100 Subject: [PATCH 302/498] [cleanup] accept NONBE_FIX_973_HODIRAC_BAND_GROUPING --- lib_com/ivas_dirac_com.c | 7 +------ lib_com/options.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index 931da849d2..dfedb974a1 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -445,12 +445,7 @@ ivas_error ivas_dirac_sba_config( else { hQMetaData->useLowerBandRes = 0; -#ifndef NONBE_FIX_973_HODIRAC_BAND_GROUPING - if ( hodirac_flag == 0 ) -#endif - { - nbands_coded = nbands - 1; /* always combine the last two bands */ - } + nbands_coded = nbands - 1; /* always combine the last two bands */ } { diff --git a/lib_com/options.h b/lib_com/options.h index fabe8cb68b..6a8ee661f9 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ -- GitLab From cffafd77f843cae2b1efe521ee8c7701811c0f32 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:12:47 +0100 Subject: [PATCH 303/498] [cleanup] accept NONBE_FIX_951_MCMASA_5MS_RENDERING --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/fd_cng_dec.c | 6 ------ lib_dec/ivas_dirac_dec.c | 8 -------- lib_dec/ivas_sba_dec.c | 4 ---- lib_rend/ivas_dirac_dec_binaural_functions.c | 18 ------------------ 6 files changed, 39 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3bf7909e5c..64226d3b72 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3683,9 +3683,7 @@ void generate_masking_noise_lb_dirac( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ -#endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 6a8ee661f9..2c70645830 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index b3909c8f0b..588d692f4d 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1805,9 +1805,7 @@ void generate_masking_noise_lb_dirac( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ -#endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ) { @@ -1860,12 +1858,10 @@ void generate_masking_noise_lb_dirac( /* LB CLDFB - CNA from STFT: CNA applied only in channel 0*/ if ( cna_flag && tdBuffer != NULL ) { -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING int16_t cur_subframe; int16_t cur_subframe_start_outfs; int16_t cur_subframe_start_cngfs; int16_t slot_size_cng; -#endif while ( n_samples_out > 0 ) { @@ -1951,7 +1947,6 @@ void generate_masking_noise_lb_dirac( n_samples_start += hFdCngCom->frameSize; } -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; @@ -1972,7 +1967,6 @@ void generate_masking_noise_lb_dirac( /* set everything else to zero */ set_zero( tdBuffer + cur_subframe_start_outfs + move_size, subframe_size_outfs - move_size ); } -#endif } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 4003e1ad2f..f7f152b738 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1943,18 +1943,10 @@ void ivas_dirac_dec_render_sf( generate_masking_noise_dirac( st->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING &st_ivas->hTcBuffer->tc[1][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], -#else - st_ivas->hTcBuffer->tc[1], -#endif Cldfb_RealBuffer[1][0], Cldfb_ImagBuffer[1][0], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING slot_idx, -#else - index_slot, -#endif st->cna_dirac_flag && st->flag_cna, ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) && st->cng_type == FD_CNG && st->cng_sba_flag ); } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 20bef3177b..a6486927be 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -759,11 +759,7 @@ void ivas_sba_dec_digest_tc( ( ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) && ( nchan_transport == 1 && st_ivas->nchan_transport != 2 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) ) ) { Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st_ivas->hSpatParamRendCom, st->cna_dirac_flag && st->flag_cna ); -#else - generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st->cna_dirac_flag && st->flag_cna ); -#endif } return; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 4078dd6221..e0a4dc9549 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -668,28 +668,14 @@ static void ivas_dirac_dec_binaural_internal( if ( st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) { int16_t numCoreBands, b; -#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING - int16_t slotInFrame; -#endif numCoreBands = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->numCoreBands; -#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING - slotInFrame = hSpatParamRendCom->slots_rendered + slot; -#endif generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING &st_ivas->hTcBuffer->tc[nchan_transport][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], -#else - st_ivas->hTcBuffer->tc[nchan_transport], -#endif Cldfb_RealBuffer_in[2][slot], Cldfb_ImagBuffer_in[2][slot], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING slot, -#else - slotInFrame, -#endif st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); @@ -697,11 +683,7 @@ static void ivas_dirac_dec_binaural_internal( st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ NULL, Cldfb_RealBuffer_in[1][slot], Cldfb_ImagBuffer_in[1][slot], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING slot, -#else - slotInFrame, -#endif st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); -- GitLab From a4a9865e3c18a53b5b2a08912a4adfd5f9c5a779 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:13:41 +0100 Subject: [PATCH 304/498] [cleanup] accept NONBE_FIX_979_OSBA_STEREO_5MS --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 4 ---- lib_dec/ivas_osba_dec.c | 8 -------- lib_rend/ivas_output_init.c | 2 -- 4 files changed, 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2c70645830..6887c2a0ea 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ #define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 7f79838e31..c190d6249b 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -997,11 +997,7 @@ ivas_error ivas_jbm_dec_render( { for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) { -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS p_tc[n] = &p_output[n][st_ivas->hTcBuffer->n_samples_rendered]; -#else - p_tc[n] = p_output[n]; -#endif } for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 2b59a58977..6585db587e 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -267,23 +267,15 @@ ivas_error ivas_osba_render_sf( p_output_ism[n] = &output_ism[n][0]; } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS if ( !st_ivas->hDecoderConfig->Opt_tsm ) { int16_t tc_offset; tc_offset = st_ivas->hTcBuffer->n_samples_rendered; -#endif for ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS mvr2r( &p_output[n][tc_offset], &output_ism[n][tc_offset], nSamplesAsked ); -#else - mvr2r( p_output[n], output_ism[n], nSamplesAsked ); -#endif } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS } -#endif if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 2cda134a56..ca0b2eae5b 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -345,12 +345,10 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); -- GitLab From 531fa54e0b5a82d7dbcad525cca77f23f9e2103b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:14:42 +0100 Subject: [PATCH 305/498] [cleanup] accept NONBE_FIX_986_MC_BW_SWITCHING --- lib_com/options.h | 1 - lib_enc/bw_detect.c | 16 ---------------- lib_enc/ivas_cpe_enc.c | 4 ---- lib_enc/ivas_mct_enc.c | 10 ---------- 4 files changed, 31 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6887c2a0ea..b7828714ee 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,7 +174,6 @@ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ #endif -#define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index b8e583df4b..aa2326a0a7 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -713,7 +713,6 @@ int16_t set_bw_mct( } bw_changed = 0; -#ifdef NONBE_FIX_986_MC_BW_SWITCHING if ( mct_bwidth != last_mct_bwidth ) { bw_changed = 1; @@ -732,21 +731,6 @@ int16_t set_bw_mct( st->bwidth = mct_bwidth; } } -#else - if ( mct_bwidth != last_mct_bwidth ) - { - bw_changed = 1; - - for ( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) - { - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - st = hCPE[cpe_id]->hCoreCoder[ch]; - st->bwidth = mct_bwidth; - } - } - } -#endif return bw_changed; } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index b5b4c2dee1..f971fcbe67 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -546,14 +546,10 @@ ivas_error ivas_cpe_enc( if ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->element_mode != hCPE->last_element_mode || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal ) || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) { int16_t igf; -#ifdef NONBE_FIX_986_MC_BW_SWITCHING int16_t bw; bw = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? sts[n]->bwidth : sts[n]->max_bwidth; igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, bw, sts[n]->rf_mode ); -#else - igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode ); -#endif if ( ( error = IGF_Reconfig( &sts[n]->hIGFEnc, igf, 0, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index d1e6f9be20..83c5f57c17 100755 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -172,9 +172,6 @@ ivas_error ivas_mct_enc( float orig_spectrum_long[MCT_MAX_BLOCKS][CPE_CHANNELS][L_FRAME48k]; int16_t switch_bw; IVAS_FORMAT ivas_format; -#ifndef NONBE_FIX_986_MC_BW_SWITCHING - int16_t max_bwidth; -#endif int32_t ivas_total_brate; ivas_error error; float *pdata[MAX_INPUT_CHANNELS]; @@ -188,9 +185,6 @@ ivas_error ivas_mct_enc( hMCT->hBstr = st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; /* pointer to write MCT side bits */ ivas_format = st_ivas->hEncoderConfig->ivas_format; -#ifndef NONBE_FIX_986_MC_BW_SWITCHING - max_bwidth = st_ivas->hEncoderConfig->max_bwidth; -#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; #ifdef DEBUG_FORCE_MCT_CP @@ -234,11 +228,7 @@ ivas_error ivas_mct_enc( for ( n = 0; n < (int16_t) ( hMCT->nchan_out_woLFE * 0.5 ); n++ ) { -#ifdef NONBE_FIX_986_MC_BW_SWITCHING initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hCPE[0]->hCoreCoder[0]->bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, 0 ); -#else - initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, 0 ); -#endif } } -- GitLab From e5f2d688fd1913cbe85b4cec517877faea53d7a0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:15:31 +0100 Subject: [PATCH 306/498] [cleanup] accept NONBE_FIX_975_JBM_USAN --- lib_com/options.h | 1 - lib_dec/lib_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b7828714ee..ec62289ea9 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,7 +174,6 @@ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ #endif -#define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 8ed33e0a29..6290bfd980 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2410,18 +2410,14 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( return IVAS_ERR_INVALID_BITSTREAM; } -#ifdef NONBE_FIX_975_JBM_USAN partialCopyFrameType = 0; partialCopyOffset = 0; if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { -#endif /* check if frame contains a partial copy and get its offset */ evs_dec_previewFrame( au, auSize, &partialCopyFrameType, &partialCopyOffset ); -#ifdef NONBE_FIX_975_JBM_USAN } -#endif /* create data unit for primary copy in the frame */ dataUnit = JB4_AllocDataUnit( hIvasDec->hVoIP->hJBM ); -- GitLab From f319b7ae04b787e244646b0e960173017a4bf4f0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 14 Feb 2024 11:18:05 +0100 Subject: [PATCH 307/498] formatting --- lib_dec/fd_cng_dec.c | 8 ++++---- lib_rend/ivas_reverb.c | 6 +++--- lib_rend/ivas_reverb_filter_design.c | 1 - lib_rend/lib_rend.c | 9 +++------ lib_util/hrtf_file_reader.c | 7 ++----- lib_util/hrtf_file_reader.h | 2 +- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 588d692f4d..295999ce4a 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1802,11 +1802,11 @@ void generate_stereo_masking_noise( *-------------------------------------------------------------------*/ void generate_masking_noise_lb_dirac( - HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ - float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ - const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ + HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ + float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ + const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ - const int16_t cna_flag /* i : CNA flag for LB and HB */ + const int16_t cna_flag /* i : CNA flag for LB and HB */ ) { int16_t i; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index c5262dafc6..1f791df39c 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1038,10 +1038,10 @@ static ivas_error setup_FDN_branches( *------------------------------------------------------------------------*/ ivas_error ivas_reverb_open( - REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ + REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ - RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ - const int32_t output_Fs /* i : output sampling rate */ + RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ + const int32_t output_Fs /* i : output sampling rate */ ) { ivas_error error; diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index 53fb4ebdf3..65e6278cc4 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -653,4 +653,3 @@ void ivas_reverb_interpolate_acoustic_data( return; } - diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 9f1e8330ab..8194de9fba 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2663,10 +2663,8 @@ static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, - IVAS_DEC_HRTF_CREND_HANDLE hMixconv - , - IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics -) + IVAS_DEC_HRTF_CREND_HANDLE hMixconv, + IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics ) { ivas_error error; AUDIO_CONFIG inConfig; @@ -2976,8 +2974,7 @@ static ivas_error setRendInputActiveMasa( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index c9beb7323c..813a3dfc27 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -436,8 +436,6 @@ static ivas_error LoadBSplineBinary( } - - /*-------------------------------------------------------------------* * load_reverb_from_binary() * @@ -447,7 +445,7 @@ static ivas_error LoadBSplineBinary( static ivas_error load_reverb_from_binary( IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ - FILE *f_hrtf /* i : HR filter data file handle */ + FILE *f_hrtf /* i : HR filter data file handle */ ) { bool is_reverb; @@ -553,7 +551,7 @@ static ivas_error load_reverb_from_binary( ivas_error load_reverb_binary( IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ - const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ + const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ) { fseek( hrtfReader->file, 0, SEEK_SET ); @@ -810,7 +808,6 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelEval.hrfModL ); free( ( *hHrtf )->ModelEval.hrfModR ); - } ivas_HRTF_binary_close( hHrtf ); diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 0eea40b117..ab3254806f 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -100,7 +100,7 @@ ivas_error load_HRTF_binary( ivas_error load_reverb_binary( IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ - const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ + const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* * create_SetOfHRTF_from_binary() -- GitLab From ed932a58c9dfe1b49c5a3e19ebe234ce05ad8293 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 14 Feb 2024 13:02:28 +0100 Subject: [PATCH 308/498] Cleanup in parse_commands.py and test_param_file.py --- scripts/parse_commands.py | 23 ------------------- .../test_param_file.py | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/scripts/parse_commands.py b/scripts/parse_commands.py index af98e668f5..fe1a1840ad 100644 --- a/scripts/parse_commands.py +++ b/scripts/parse_commands.py @@ -82,19 +82,6 @@ if __name__ == '__main__': arg = re.sub('tests/dut', REF_PATH + r'/ref', arg) # Input argument args.append(arg) cmd = ' '.join(args) - - #arg1 = cmd.split()[0] - #root_folder = arg1[0:arg1.find("ivas-codec/")+10] - #cmd = cmd.replace(root_folder + r'/IVAS_dec', '$CUT_DEC_BIN') - #cmd = cmd.replace(r'\\', '/') - #cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - #cmd = cmd.replace('scripts/', TESTV_PATH) # To catch relative paths - # inputs = cmd.count(root_folder) - 1 - # if ".fer " in cmd: - # cmd = cmd.replace(root_folder + r'/tests/ref', REF_PATH + r'ref', 1) - # else: - # cmd = cmd.replace(root_folder + r'/tests/dut', REF_PATH + r'ref', inputs) - # cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) if 'VOIP' in cmd: outfile = outfile_jbm @@ -132,16 +119,6 @@ if __name__ == '__main__': args.append(arg) cmd = ' '.join(args) - # arg1 = cmd.split()[0] - # root_folder = arg1[0:arg1.find("ivas-codec/")+10] - - # cmd = cmd.replace(r'\\', '/') - - # cmd = cmd.replace(root_folder + r'/IVAS_rend', '$CUT_REND_BIN') - # cmd = cmd.replace(root_folder + r'/scripts/', TESTV_PATH) - # cmd = cmd.replace(root_folder + r'/tests/renderer/data/', TESTV_PATH + r'renderer/data/') - # cmd = cmd.replace(root_folder + r'/tests/', CUT_PATH) - if "cut" in cmd: outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index caf725a3c6..b502f44f01 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -165,7 +165,7 @@ def test_param_file_tests( not bitrate.isdigit() and "-dtx" in enc_split and "-sba" in enc_split - and testv_file.split("/")[test_vector_path.count("/")+1].startswith("stv") + and Path(testv_file).name.startswith("stv") ): sba_br_switching_dtx = 1 cut_file = pre_proc_input(testv_file, fs) -- GitLab From aa3be0aa5cee83589f5c22cbff67221e4838ec38 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 14 Feb 2024 13:19:44 +0100 Subject: [PATCH 309/498] Fix long test names in self_test_ltv.prm --- scripts/config/self_test_ltv.prm | 124 +++++++++++++++---------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 1951ef3b8e..8db2af9693 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -302,27 +302,27 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 1 testv/ltvISM1.csv 32000 32 testv/ltv32_1ISM.wav bit ../IVAS_dec MONO 32 bit testv/ltv32_1ISM.wav_1ISM_32000_32-32_DTX_MONO.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, head rotation, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, HR, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 48000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit_error testv/ltv48_1ISM.wav_64000_48-48_binaural_room_HR.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 48000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL 48 bit_error testv/ltv48_1ISM.wav_64000_48-48_binaural_HR.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, head rotation, external orientation, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, HR, exo, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 48000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit_error testv/ltv48_1ISM.wav_64000_48-48_binaural_room_HR_EXOF.tst -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, random FER at 5% +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 80000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/ltv48_1ISM.wav_80000_48-16_binaural_file_TDHR_FER5.tst -// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), head rotation, external orientation, random FER at 5% +// 1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, exo, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 80000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/ltv48_1ISM.wav_80000_48-16_binaural_file_TDHR_EXOF_FER5.tst @@ -373,11 +373,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 2 testv/ltvISM1.csv testv/ltvISM2.csv 80000 48 testv/ltv48_2ISM.wav bit ../IVAS_dec STEREO 48 bit testv/ltv48_2ISM.wav_2ISM_80000_48-48_DTX_STEREO.tst -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR ../IVAS_cod -ism 2 testv/ltvISM1.csv testv/ltvISM2.csv 128000 48 testv/ltv48_2ISM.wav bit ../IVAS_dec -t testv/headrot_case01_3000_q.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/ltv48_2ISM.wav_128000_48-32_binaural_file_TDHR.tst -// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), head rotation, external orientation +// 2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR, exo ../IVAS_cod -ism 2 testv/ltvISM1.csv testv/ltvISM2.csv 128000 48 testv/ltv48_2ISM.wav bit ../IVAS_dec -t testv/headrot_case01_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL 32 bit testv/ltv48_2ISM.wav_128000_48-32_binaural_file_TDHR_EXOF.tst @@ -420,7 +420,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 3 testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 192000 48 testv/ltv48_3ISM.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/ltv48_3ISM.wav_192000_48-48_binauralfile.tst -// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, random FER at 5% +// 3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, random FER at 5% ../IVAS_cod -ism 3 testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 192000 48 testv/ltv48_3ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case02_3000_q.csv BINAURAL 48 bit_error testv/ltv48_3ISM.wav_192000_48-48_binaural_file_TDHR_FER5.tst @@ -446,7 +446,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 32000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM.wav_32000_48-48_DTX_BINAURAL.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 32000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_4ISM.wav_32000_48-48_binaural_file_TDHR_EXOF.tst @@ -492,11 +492,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM.wav_256000_48-48_binaural.tst -// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation +// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/ltv48_4ISM.wav_256000_48-48_binaural_file_TDHR.tst -// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation +// 4 ISM with metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_4ISM.wav_256000_48-48_binaural_file_TDHR_EXOF.tst @@ -504,11 +504,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec 5_1 48 bit testv/ltv48_4ISM.wav_512000_48-48_5_1.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, Orientation tracking +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, HR, OT ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 48 bit testv/ltv48_4ISM.wav_256000_48-48_TDHR_OtrAvg.tst -// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, head rotation, external orientation, Orientation tracking +// 4 ISm with metadata at 256 kbps, 48 kHz in, 48 kHz out, TD BINAURAL out, HR, exo, OT ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL 48 bit testv/ltv48_4ISM.wav_256000_48-48_TDHR_EXOF_OtrAvg.tst @@ -520,12 +520,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 4 testv/ltvISM1.csv NULL NULL testv/ltvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_4ISM.wav bit ../IVAS_dec HOA3 48 bit testv/ltv48_4ISM.wav_brate_sw_48-48_DTX_hoa3.tst -// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, directivity configuration, random FER at 5% +// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst -// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, head rotation, external orientation, directivity configuration, random FER at 5% +// 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst @@ -564,19 +564,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/ltv32_HOA3.wav_SBA_24400_32-32_Binaural_Subframe_FER5.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR ../IVAS_cod -sba 3 24400 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_24400_32-32_Binaural_Headrot.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, external orientation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, exo ../IVAS_cod -sba 3 24400 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_24400_32-32_Binaural_Headrot_EXOF.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, Orientation tracking +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, OT ../IVAS_cod -sba 3 24400 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_24400_32-32_Binaural_Headrot_OtrAvg.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, external orientation, Orientation tracking +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, exo, OT ../IVAS_cod -sba 3 24400 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_24400_32-32_Binaural_Headrot_EXOF_OtrAvg.tst @@ -585,11 +585,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/ltv32_HOA3.wav_SBA_24400_32-32_DTX_Binaural_FER5.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR ../IVAS_cod -sba 3 -dtx 24400 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_24400_32-32_DTX_Binaural_Headrot.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, external orientation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR, exo ../IVAS_cod -sba 3 -dtx 24400 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_24400_32-32_DTX_Binaural_Headrot_EXOF.tst @@ -627,35 +627,35 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom_Subframe.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom_Headrot_EXOF.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, Orientation tracking +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, Orientation tracking, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, reference vector tracking +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, reference vector tracking, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, reference vector tracking in level mode +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking in level mode ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, reference vector tracking in level mode, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking in level mode, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst @@ -664,11 +664,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/ltv32_HOA3.wav_SBA_48000_32-32_DTX_Binaural_FER5.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation +// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR ../IVAS_cod -sba 3 -dtx 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_DTX_Binaural_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, external orientation +// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR, exo ../IVAS_cod -sba 3 -dtx 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_DTX_Binaural_Headrot_EXOF.tst @@ -706,11 +706,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/ltv32_HOA3.wav_SBA_80000_32-32_Binaural_FER5.tst -// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation +// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, HR ../IVAS_cod -sba 3 80000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_80000_32-32_Binaural_Headrot.tst -// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, external orientation +// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, exo ../IVAS_cod -sba 3 80000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/ltv32_HOA3.wav_SBA_80000_32-32_Binaural_Headrot_EXOF.tst @@ -722,19 +722,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 96000 48 testv/ltv48_FOA.wav bit ../IVAS_dec FOA 48 bit testv/ltv48_FOA.wav_SBA_96000_48-48_FOA.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_128000_32-32_Binaural_room_Headrot.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, external orientation +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_128000_32-32_Binaural_room_Headrot_EXOF.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, Orientation tracking +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, Orientation tracking, external orientation +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT, exo ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst @@ -772,7 +772,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 256000 32 testv/ltv32_FOA.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv32_FOA.wav_SBA_256000_32-32_BINAURAL_ROOM.tst -// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, Headrotation, external orientation +// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -sba 1 256000 32 testv/ltv32_FOA.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_FOA.wav_SBA_256000_32-32_BinauralRoom_Headrot_EXOF.tst @@ -789,7 +789,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -sba 3 512000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_512000_48-48_binaural.tst -// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -sba 3 512000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst @@ -855,11 +855,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom_Subframe.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation, external orientation +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom_Headrot_EXOF.tst @@ -885,11 +885,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 128000 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MASA1TC.wav_128000_48-48_BINAURAL_Subframe.tst -// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 128000 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MASA1TC.wav_128000_48-48_BINAURAL_Headrot.tst -// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 128000 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_MASA1TC.wav_128000_48-48_BINAURAL_Headrot_EXOF.tst @@ -910,19 +910,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_32000_48-48_BinauralRoom.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_32000_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation, external orientation +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_32000_48-48_BinauralRoom_Headrot_EXOF.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation, Orientation tracking +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation, Orientation tracking, external orientation +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst @@ -957,11 +957,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec EXT 48 bit_error testv/ltv48_MASA2TC.wav_64000_48-48_external_FER5.tst -// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 64000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MASA2TC.wav_64000_48-48_BINAURAL_Headrot.tst -// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 64000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_MASA2TC.wav_64000_48-48_BINAURAL_Headrot_EXOF.tst @@ -1058,11 +1058,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 24400 48 testv/ltv48_MC51.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_24400_48-48_Binaural_Subframe.tst -// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -mc 5_1 24400 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_24400_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -mc 5_1 24400 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_24400_48-48_Binaural_Headrot_EXOF.tst @@ -1075,19 +1075,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_Headrot_EXOF.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_room_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, Headrotation, external orientation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_room_Headrot_EXOF.tst @@ -1100,11 +1100,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 128000 48 testv/ltv48_MC51.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_128000_48-48_Binaural.tst -// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -mc 5_1 128000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_128000_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, external orientation +// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -mc 5_1 128000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_128000_48-48_Binaural_Headrot_EXOF.tst @@ -1121,19 +1121,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_MC51.wav_MC51_256000_48-48_mono.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, head rotation +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_256000_48-48_BinauralRoom_Headrot.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, head rotation, external orientation +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_256000_48-48_BinauralRoom_Headrot_EXOF.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, head rotation, Orientation tracking +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, head rotation, Orientation tracking, external orientation +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT, exo ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst @@ -1248,7 +1248,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit ../IVAS_dec -render_config testv/rend_config_ER_v3.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC714.wav_MC714_512000_48-48_MC_ER_v3.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config early reflections, head rotation +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config early reflections, HR ../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -render_config testv/rend_config_ER_v1.cfg -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC51.wav_MC51_512000_48-48_MC_ER_v1_hrot.tst -- GitLab From 2ac53f310086ee90455d6b0bd775d304e3ada7cb Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 14 Feb 2024 16:45:53 +0100 Subject: [PATCH 310/498] do not disable TD renderer for BINAURAL_ROOM_REVERB output from 5.1 and 7.1 format --- lib_com/options.h | 2 ++ lib_dec/ivas_output_config.c | 17 ++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f5e2002526..8257e53980 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,6 +180,8 @@ #endif #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ +#define DISABLE_LIMITER + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index def7de11e0..894b5b3683 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -224,18 +224,9 @@ void ivas_renderer_select( *internal_config = transport_config; #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) - -#else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) -#endif -#else -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL ) #else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif #endif { #ifdef DEBUGGING @@ -252,6 +243,10 @@ void ivas_renderer_select( { *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } + else if (output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) + { + *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; + } else { *renderer_type = RENDERER_BINAURAL_FASTCONV; @@ -267,7 +262,11 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_FASTCONV; } #endif +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && !(output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) ) +#else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) +#endif { /* force HOA3 domain for rotation*/ *internal_config = IVAS_AUDIO_CONFIG_HOA3; -- GitLab From d685508bda1408420be644a5d1e14df536638ac9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 14 Feb 2024 16:49:37 +0100 Subject: [PATCH 311/498] wrap new else if clause into ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING --- lib_dec/ivas_output_config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 894b5b3683..26e12695a5 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -243,10 +243,12 @@ void ivas_renderer_select( { *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING else if (output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) { *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; } +#endif else { *renderer_type = RENDERER_BINAURAL_FASTCONV; -- GitLab From d4da0e7a80863049a1c1d4942ec7b7aca43063e9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 14 Feb 2024 16:56:50 +0100 Subject: [PATCH 312/498] fix formatting --- lib_dec/ivas_output_config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 26e12695a5..61dfaef3f4 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -244,10 +244,10 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } #ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - else if (output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) - { - *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; - } + else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; + } #endif else { @@ -265,7 +265,7 @@ void ivas_renderer_select( } #endif #ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && !(output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) ) + if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && !( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) #endif -- GitLab From 89fa831d990cfd0d363a72d4ce0496f1994caa38 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 14 Feb 2024 17:20:36 +0100 Subject: [PATCH 313/498] re-enable limiter --- lib_com/options.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8257e53980..f5e2002526 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,8 +180,6 @@ #endif #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ -#define DISABLE_LIMITER - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From b78de2cdded66842f8fcf305a3b16cf72e717353 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 10:54:30 +0100 Subject: [PATCH 314/498] issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo; under FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO --- lib_com/options.h | 2 +- lib_dec/ivas_jbm_dec.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index ec62289ea9..f185ae6015 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ - +#define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index c190d6249b..ed6abac923 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -143,11 +143,13 @@ ivas_error ivas_jbm_dec_tc( { hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); } +#ifndef FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO if ( st_ivas->renderer_type == RENDERER_MC && st_ivas->hDecoderConfig->nchan_out == 1 ) { ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); } +#endif } else if ( st_ivas->ivas_format == ISM_FORMAT ) { -- GitLab From d429804ec75d31b33e4f5a82caf1f32ec03498ad Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 11:20:24 +0100 Subject: [PATCH 315/498] add ISM Non-diegetic panning gain condition to the self-test --- scripts/config/self_test.prm | 8 ++++++-- scripts/config/self_test_ltv.prm | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 25cef6b5e6..74aade6f43 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1466,9 +1466,13 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit -// NON DIEGETiC PAN at 60 kbps, 48kHz in, 48kHz out, STEREO out +// EVS non-diegetic panning at 60 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod 64000 48 testv/stv48c.wav bit -../IVAS_dec -non_diegetic_pan -0.5 48 bit testv/stv48c.pcm_MONO_64000_48-48_STEREO_NON-DIEGETIC-PAN_-0.5.tst +../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst + +// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod -ism 1 testv/stvISM1.csv 32000 48 testv/stv1ISM48s.wav bit +../IVAS_dec -non_diegetic_pan 80 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 1951ef3b8e..11ad024c92 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1409,9 +1409,13 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit -// NON DIEGETiC PAN at 60 kbps, 48kHz in, 48kHz out, STEREO out +// EVS non-diegetic panning at 60 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit -../IVAS_dec -non_diegetic_pan -0.5 48 bit testv/ltv48_STEREO.wav_MONO_64000_48-48_STEREO_NON-DIEGETIC-PAN_-0.5.tst +../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst + +// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod -ism 1 testv/ltv1ISM.csv 32000 48 testv/ltv48_1ISM.wav bit +../IVAS_dec -non_diegetic_pan 80 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst -- GitLab From c378d4e63d9fb01c5ca8b45fd1d30ea3d504d664 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 11:26:01 +0100 Subject: [PATCH 316/498] use both HRTF sets in test_binary_file test --- tests/hrtf_binary_loading/constants.py | 4 ++-- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 6 ++++-- tests/hrtf_binary_loading/utils.py | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 91ae0cbb51..10e257f9fa 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -50,8 +50,8 @@ DECODER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_dec"))] RENDERER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_rend"))] -HRTF_BINARY_FILE = "ivas_binaural_{}kHz.bin" -# HRTF_BINARY_FILE = "ivas_binaural_51_brir-lc_{}kHz.bin" +HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin" +HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin" SAMPLE_RATE = ["16", "32", "48"] INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] # "MONO", "STEREO", diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 7c3c3afc6e..bbc7f9a85c 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -32,13 +32,15 @@ import pytest from tests.hrtf_binary_loading.utils import * +from .constants import HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM """ Binary file """ @pytest.mark.parametrize("out_fs", SAMPLE_RATE) -def test_binary_file(test_info, out_fs): - check_binary_file(out_fs) +@pytest.mark.parametrize("hrtf_file", [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM]) +def test_binary_file(test_info, hrtf_file, out_fs): + check_binary_file(hrtf_file, out_fs) """ Multichannel """ diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index ec93f9a7a9..4ba2205a4d 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -140,9 +140,9 @@ def get_option_list_str(option_list): return option_list_str -def check_binary_file(out_fs): +def check_binary_file(hrtf_file, out_fs): with open( - str(HRTF_BINARY_DIR.joinpath(HRTF_BINARY_FILE.format(out_fs))), "rb" + str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb" ) as file: binary_data = file.read() @@ -153,7 +153,7 @@ def check_binary_file(out_fs): # Max length of HRTF data (4 bytes) binary_file_size = os.path.getsize( - str(HRTF_BINARY_DIR.joinpath(HRTF_BINARY_FILE.format(out_fs))) + str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))) ) if binary_file_size < 18: pytest.fail("HRTF binary file not compliant (size of file header)") -- GitLab From e37049790ef77fe4789c95a7b643461e3233831d Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 15 Feb 2024 11:48:37 +0100 Subject: [PATCH 317/498] remove inactive code from MC rendering configuration --- lib_dec/ivas_output_config.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index da37b0ce96..7354c28a4a 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -248,16 +248,6 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_FASTCONV; } -#if 0 // def DEBUGGING /*temp disabling this as paramMC crashes with CREND*/ - if ( st_ivas->hRenderConfig->renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) - { - *renderer_type = RENDERER_BINAURAL_MIXER_CONV; - } - else if ( st_ivas->hRenderConfig->renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) - { - *renderer_type = RENDERER_BINAURAL_FASTCONV; - } -#endif if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { /* force HOA3 domain for rotation*/ -- GitLab From cdafce8c0b8711e0485d00c4b057bb391267e292 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 12:00:22 +0100 Subject: [PATCH 318/498] add xfail cases to test_codec_ROM_vs_file.py --- tests/hrtf_binary_loading/constants.py | 2 + .../test_codec_ROM_vs_file.py | 48 ++++++++++++------- tests/hrtf_binary_loading/utils.py | 29 ++++++----- tests/renderer/utils.py | 13 +++-- 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 10e257f9fa..8c2a6cca8b 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -52,6 +52,8 @@ RENDERER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_rend"))] HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin" HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin" +HRTF_FILES= [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM] + SAMPLE_RATE = ["16", "32", "48"] INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] # "MONO", "STEREO", diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index bbc7f9a85c..b774d21476 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -32,13 +32,13 @@ import pytest from tests.hrtf_binary_loading.utils import * -from .constants import HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM +from .constants import HRTF_FILES """ Binary file """ @pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("hrtf_file", [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM]) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_binary_file(test_info, hrtf_file, out_fs): check_binary_file(hrtf_file, out_fs) @@ -49,7 +49,8 @@ def test_binary_file(test_info, hrtf_file, out_fs): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_file): # if in_fmt in ["MONO", "STEREO"]: # pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -69,6 +70,7 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs): in_fs, out_fmt, out_fs, + hrtf_file, ) @@ -76,8 +78,9 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_multichannel_binaural_headrotation( - test_info, in_fmt, out_fmt, out_fs, trj_file + test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_file ): # if in_fmt in ["MONO", "STEREO"]: # pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -98,6 +101,7 @@ def test_multichannel_binaural_headrotation( in_fs, out_fmt, out_fs, + hrtf_file, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -108,7 +112,8 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) @pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) -def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): # -sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D) # where Order specifies the Ambisionics order (1-3) @@ -124,6 +129,7 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt): fs, out_fmt, fs, + hrtf_file, ) @@ -131,7 +137,8 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) @pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) -def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_file): # -sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D) # where Order specifies the Ambisionics order (1-3) @@ -147,6 +154,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file): fs, out_fmt, fs, + hrtf_file, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -158,7 +166,8 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file): @pytest.mark.parametrize("fs", SAMPLE_RATE[-1:]) @pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) @pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) -def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): # -masa Ch File : MASA format # where Ch specifies the number of MASA input/transport channels (1 or 2) # and File specifies input file containing parametric MASA metadata @@ -178,6 +187,7 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt): fs, out_fmt, fs, + hrtf_file, ) @@ -186,7 +196,8 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt): @pytest.mark.parametrize("fs", SAMPLE_RATE[-1:]) @pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) @pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) -def test_masa_binaural_headrotation(test_info, in_tc, in_dir, fs, out_fmt, trj_file): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_masa_binaural_headrotation(test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file): # -masa Ch File : MASA format # where Ch specifies the number of MASA input/transport channels (1 or 2) # and File specifies input file containing parametric MASA metadata @@ -206,6 +217,7 @@ def test_masa_binaural_headrotation(test_info, in_tc, in_dir, fs, out_fmt, trj_f fs, out_fmt, fs, + hrtf_file, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -216,7 +228,8 @@ def test_masa_binaural_headrotation(test_info, in_tc, in_dir, fs, out_fmt, trj_f @pytest.mark.parametrize("out_fmt", [OUTPUT_FORMATS_BINAURAL[0]]) @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): # -ism [+]Ch Files : ISM format # where Ch specifies the number of ISMs (1-4) # and Files specify input files containing metadata, one file per object @@ -241,6 +254,7 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt): in_fs, out_fmt, out_fs, + hrtf_file, ) @@ -248,7 +262,8 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt): @pytest.mark.parametrize("out_fmt", [OUTPUT_FORMATS_BINAURAL[0]]) @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_headrotation(test_info, in_fmt, out_fs, out_fmt, trj_file): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_ism_binaural_headrotation(test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file): # -ism [+]Ch Files : ISM format # where Ch specifies the number of ISMs (1-4) # and Files specify input files containing metadata, one file per object @@ -273,6 +288,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fs, out_fmt, trj_file) in_fs, out_fmt, out_fs, + hrtf_file, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -283,7 +299,8 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fs, out_fmt, trj_file) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[-1:]) @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): # -ism [+]Ch Files : ISM format # where Ch specifies the number of ISMs (1-4) # and Files specify input files containing metadata, one file per object @@ -308,6 +325,7 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt): in_fs, out_fmt, out_fs, + hrtf_file, ) @@ -315,13 +333,10 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[-1:]) @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_ism_binaural_roomreverb_headrotation( - test_info, in_fmt, out_fs, out_fmt, trj_file + test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file ): - # -ism [+]Ch Files : ISM format - # where Ch specifies the number of ISMs (1-4) - # and Files specify input files containing metadata, one file per object - in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -342,5 +357,6 @@ def test_ism_binaural_roomreverb_headrotation( in_fs, out_fmt, out_fs, + hrtf_file, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 4ba2205a4d..4f8990ed77 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -141,9 +141,7 @@ def get_option_list_str(option_list): def check_binary_file(hrtf_file, out_fs): - with open( - str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb" - ) as file: + with open(str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb") as file: binary_data = file.read() # [Declaration of the binary file] @@ -286,13 +284,14 @@ def compare_rom_vs_binary( in_fs, out_fmt, out_fs, + hrtf_file: str, keep_file: Optional[bool] = False, trj_file: Optional[str] = None, ): option_str = "_".join(get_option_list_str(option_list_enc)) file_ext = f"_{option_str or ''}_{bitrate or ''}_{in_fs or ''}-{out_fs or ''}_{out_fmt or ''}-{uuid.uuid1()} " - # check_binary_file(out_fs) + xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM input_path = TESTV_DIR.joinpath(in_file).with_suffix(".wav") bitstream_path = BITSTREAM_DIR.joinpath(in_file + file_ext) @@ -311,19 +310,26 @@ def compare_rom_vs_binary( ) out_rom, out_rom_fs = pyaudio3dtools.audiofile.readfile(out_rom_path) - hrtf_file = HRTF_BINARY_FILE.format(out_fs) - if hrtf_file is not None: - if trj_file is not None: - option_list_dec.extend(["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))]) - else: - option_list_dec = ["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))] + hrtf_file = hrtf_file.format(out_fs) + if trj_file is not None: + option_list_dec.extend(["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))]) + else: + option_list_dec = ["-hrtf", str(HRTF_BINARY_DIR.joinpath(hrtf_file))] + out_bin_path = DEC_BINARY_DIR.joinpath(in_file + file_ext).with_suffix(".wav") run_decoder( out_fmt, out_fs, bitstream_path, out_bin_path, add_option_list=option_list_dec ) out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_bin_path) - check_BE(test_info, out_rom, out_rom_fs, out_bin, out_bin_fs) + check_BE( + test_info, + out_rom, + out_rom_fs, + out_bin, + out_bin_fs, + xfail=xfail, + ) if keep_file == False: os.remove(bitstream_path) os.remove(out_rom_path) @@ -345,7 +351,6 @@ def compare_renderer_vs_renderer_with_binary_hrir( config_file: Optional[str] = None, frame_size: Optional[str] = "20ms", hrir_name="ivas_binaural_48kHz.bin", - # hrir_name="ivas_binaural_51_brir-lc_48kHz.bin", keep_file=False, ): hrtf_file_dir = SCRIPTS_DIR.joinpath( diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index d597e65630..09e0cb7751 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -70,6 +70,7 @@ def check_BE( ref_fs: int, cut: np.ndarray, cut_fs: int, + xfail: bool = False, ): if ref is None or np.array_equal(ref, np.zeros_like(ref)): pytest.fail("REF signal does not exist or is zero!") @@ -88,10 +89,14 @@ def check_BE( cut = np.pad(cut, [(0, ref.shape[0] - cut.shape[0]), (0, 0)]) # check max_diff as well, since compare_audio_arrays will try to adjust for small delay differences - if not np.allclose(ref, cut, rtol=0, atol=2) and max_diff > 2: - pytest.fail( - f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" - ) + diff_found = not np.allclose(ref, cut, rtol=0, atol=2) and max_diff > 2 + if diff_found: + if xfail: + pytest.xfail(f"Expected diff between CuT and REF!") + else: + pytest.fail( + f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" + ) def run_renderer( -- GitLab From a92c12646b593636d83f60eca218124c27a35b18 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 12:06:22 +0100 Subject: [PATCH 319/498] Resolve "self_test.prm and self_test_ltv.prm are out of sync" --- scripts/config/self_test.prm | 7 +- scripts/config/self_test_ltv.prm | 106 +++++++++++++++++++++++++++++-- 2 files changed, 103 insertions(+), 10 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 25cef6b5e6..d67e37484d 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -883,6 +883,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stvFOA48c.pcm_planarSBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst + // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/stv1MASA1TC48c.met 13200 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv1MASA1TC48c.wav_13200_48-48_BINAURAL.tst @@ -1089,7 +1090,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 - // Multi-channel 5_1 at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 13200 48 testv/stv51MC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv51MC48c.wav_MC51_13200_48-48_5_1.tst @@ -1335,7 +1335,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv714MC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_sw_48-48_BINAURAL.tst - // Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file) ../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_IR 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_binaural_room.tst @@ -1568,7 +1567,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_384000_48-48.tst - // OMASA 2Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA2TC48c.wav bit ../IVAS_dec MONO 48 bit testv/stvOMASA_3ISM_2MASA2TC48c.wav_MONO_sw_48-48.tst @@ -1596,6 +1594,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst + // OSBA FOA 1ISM at 32 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_sba 1 1 testv/stvISM1.csv 32000 48 testv/stvOSBA_1ISM_FOA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOSBA_1ISM_FOA48c.wav_BINAURAL_32000_48-48.tst @@ -1696,7 +1695,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // OSBA 3ISM 3OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, BINAURAL ROOM REVERB out ../IVAS_cod -ism_sba 3 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_3ISM_3OA48c.wav bit -../IVAS_dec BINAURAL_ROOM_REVERB 32 bit testv/stvOSBA_3ISM_2OA48c.wav_BINAURAL_ROOM_REVERB_sw_48-32.tst +../IVAS_dec BINAURAL_ROOM_REVERB 32 bit testv/stvOSBA_3ISM_3OA48c.wav_BINAURAL_ROOM_REVERB_sw_48-32.tst // OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out ../IVAS_cod -ism_sba 1 -1 testv/stvISM1.csv 256000 48 testv/stvOSBA_1ISM_FOA48c.wav bit diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 1951ef3b8e..1ab13ef151 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -184,6 +184,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // stereo at 32 kbps, 48kHz in, 32kHz out, random FER at 5% ../IVAS_cod -stereo 32000 48 testv/ltv48_STEREO.wav bit +eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec STEREO 32 bit testv/ltv48_STEREO.wav_stereo_32000_48-32_FER5.tst // stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, bandwidth switching @@ -534,6 +535,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_4ISM.wav bit ../IVAS_dec EXT 48 bit testv/stv+4ISM48s.wav_brate_sw_48-48_DTX_EXT.tst +// 4 ISM with extended metadata and non diegetic pan object switching bitrate 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out +../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM_with_no_diegetic_switch.csv testv/ltvISM4.csv 256000 48 testv/ltv4ISM48n.wav bit +../IVAS_dec BINAURAL 48 bit testv/ltv+4ISM48n+non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst + // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/ltv32_HOA3.wav bit @@ -676,6 +681,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec 5_1_2 48 bit testv/ltv48_HOA3.wav_SBA_48000_48-48_5_1_2.tst +// SBA at 48 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms +../IVAS_cod -sba 3 48000 48 testv/ltv48_HOA3.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_48000_48-48_binaural_ht_fr5.tst + // SBA at 64 kbps, 32kHz in, 32kHz out, FOA out, DTX, random FER at 5% ../IVAS_cod -dtx -sba 1 64000 32 testv/ltv32_FOA.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error @@ -793,6 +802,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 512000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst +// SBA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms +../IVAS_cod -sba 3 512000 48 testv/ltv48_HOA3.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_512000_48-48_binaural_ht_fr5.tst + // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 48 testv/ltv48_FOA.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_FOA.wav_sw_48-48_BINAURAL.tst @@ -837,6 +850,39 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_FOA.wav bit ../IVAS_dec FOA 48 bit testv/ltv48_FOA.wav_sw_48-48_FOA.tst +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Headrotation +../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit +../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoomReverb_Headrot.tst + +// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, Headrotation +../IVAS_cod -sba -2 48000 32 testv/ltv32_HOA2.wav bit +../IVAS_dec -t testv/headrot.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA2.pcm_planarSBA_48000_32-32_BinauralRoomReverb_Config_renderer_Headrot.tst + +// SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation +../IVAS_cod -sba 1 48000 32 testv/ltv32_FOA.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin -t testv/headrot.csv BINAURAL_ROOM_REVERB 48 bit testv/ltv32_FOA.pcm_SBA_48000_32-48_BinauralRoomReverb_Headrot_BinauralFile.tst + +// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation +../IVAS_cod -sba -3 48000 32 testv/ltv32_HOA3.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_planarSBA_48000_32-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst + +// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out Headrotation +../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit +../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Headrot.tst + +// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, Headrotation +../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit +../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot.tst + +// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation +../IVAS_cod -sba 2 128000 32 testv/ltv48_HOA2.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/ltv32_HOA2.pcm_SBA_12800032-16_BinauralRoomReverb_Headrot_BinauralFile.tst + +// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation +../IVAS_cod -sba -1 128000 48 testv/ltv48_FOA.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv48_FOA.pcm_planarSBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst + + // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/ltv48_MASA1TC.met 13200 48 testv/ltv48_MASA1TC.wav bit @@ -1044,7 +1090,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 - // Multi-channel 5_1 at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 13200 48 testv/ltv48_MC51.wav bit ../IVAS_dec 5_1 48 bit testv/ltv48_MC51.wav_MC51_13200_48-48_5_1.tst @@ -1187,6 +1232,18 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 160000 48 testv/ltv48_MC714.wav bit ../IVAS_dec 7_1_4 48 bit testv/ltv48_MC714.wav_MC714_160000_48-48_MC714.tst +// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, fr 5ms +../IVAS_cod -mc 7_1_4 160000 48 testv/ltv48_MC714.wav bit +../IVAS_dec -fr 5 BINAURAL_ROOM_IR 48 bit testv/ltv48_MC714.wav_MC714_160000_48-48_MC_binaural_room_fr5.tst + +// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, with headtracking, BINAURAL out, fr 5ms +../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC714_512000_48-48_MC_binaural_ht_fr5.tst + +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms +../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC714.wav bit +../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC51_512000_48-48_MC_binaural_ht_fr5.tst + // Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5% ../IVAS_cod -mc 5_1_2 32000 48 testv/ltv48_MC512.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error @@ -1278,7 +1335,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/ltv48_MC714.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MC51.wav_sw_48-48_BINAURAL.tst - // Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file) ../IVAS_cod -mc 5_1_4 512000 48 testv/ltv48_MC514.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_IR 16 bit testv/ltv48_MC51.wav_MC51_512000_48-16_MC_binaural_room.tst @@ -1511,7 +1567,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_EXT_384000_48-48.tst - // OMASA 2Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_2TC.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OMASA_3ISM_2TC.wav_MONO_sw_48-48.tst @@ -1539,10 +1594,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst + // OSBA FOA 1ISM at 32 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_sba 1 1 testv/ltvISM1.csv 32000 48 testv/ltv48_OSBA_1ISM_FOA.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_1ISM_FOA.wav_BINAURAL_32000_48-48.tst +// OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out +../IVAS_cod -ism_sba 1 1 testv/stvISM1.csv 32000 16 testv/ltv16_OSBA_1ISM_FOA.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_REVERB 16 bit testv/ltv16_OSBA_1ISM_FOA.wav_BINAURAL_ROOM_REVERB_32000_16-16.tst + // OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -ism_sba 2 1 testv/ltvISM1.csv testv/ltvISM2.csv 64000 48 testv/ltv48_OSBA_2ISM_FOA.wav bit ../IVAS_dec HOA3 48 bit testv/ltv48_OSBA_2ISM_FOA.wav_HOA3_64000_48-48.tst @@ -1555,9 +1615,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_OSBA_4ISM_FOA.wav bit ../IVAS_dec EXT 48 bit testv/ltv48_OSBA_4ISM_FOA.wav_EXT_256000_48-48.tst -// OSBA FOA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL out +// OSBA FOA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL (Model from file) out ../IVAS_cod -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_OSBA_4ISM_FOA.wav bit -../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_FOA.wav_BINAURAL_512000_48-48.tst +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/ltv48_OSBA_4ISM_FOA.wav_BINAURAL_512000_48-48.tst + +// OSBA FOA 4ISM at 384 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR (Model from file) out +../IVAS_cod -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 384000 32 testv/ltv32_OSBA_4ISM_FOA.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin BINAURAL_ROOM_IR 32 bit testv/ltv32_OSBA_4ISM_FOA.wav_BINAURAL_384000_32-32.tst // OSBA 2OA 1ISM at 24.4 kbps, 48kHz in, 48kHz out, FOA out ../IVAS_cod -ism_sba 1 2 testv/ltvISM1.csv 24400 48 testv/ltv48_OSBA_1ISM_HOA2.wav bit @@ -1567,6 +1631,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 2 2 testv/ltvISM1.csv testv/ltvISM2.csv 48000 48 testv/ltv48_OSBA_2ISM_HOA2.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OSBA_2ISM_HOA2.wav_MONO_48000_48-48.tst +// OSBA 2OA 2ISM at 64 kbps, 32kHz in, 16kHz out, BINAURAL ROOM REVERB out +../IVAS_cod -ism_sba 2 2 testv/ltvISM1.csv testv/ltvISM2.csv 48000 32 testv/ltv32_OSBA_2ISM_HOA2.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/ltv32_OSBA_2ISM_HOA2.wav_MONO_64000_32-16.tst + // OSBA 2OA 3ISM at 96 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod -ism_sba 3 2 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv 96000 48 testv/ltv48_OSBA_3ISM_HOA2.wav bit ../IVAS_dec STEREO 48 bit testv/ltv48_OSBA_3ISM_HOA2.wav_STEREO_96000_48-48.tst @@ -1587,11 +1655,15 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 3 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv 128000 48 testv/ltv48_OSBA_3ISM_HOA3.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_3ISM_HOA3.wav_BINAURAL_128000_48-48.tst +// OSBA 3OA 3ISM at 160 kbps, 16kHz in, 48kHz out, BINAURAL ROOM IR out +../IVAS_cod -ism_sba 3 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv 160000 16 testv/ltv16_OSBA_3ISM_HOA3.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv16_OSBA_3ISM_HOA3.wav_BINAURAL_ROOM_IR_160000_16-48.tst + // OSBA 3OA 4ISM at 16.4 kbps, 48kHz in, 48kHz out, 5_1 out ../IVAS_cod -ism_sba 4 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 16400 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit ../IVAS_dec 5_1 48 bit testv/ltv48_OSBA_4ISM_HOA3.wav_5_1_16400_48-48.tst -// OSBA 3OA 4ISM bitrate switching 13.2 to 512, 48kHz in, 48kHz out, BIN out +// OSBA 3OA 4ISM bitrate switching 13.2 to 512, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_sba 4 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_HOA3.wav_BINAURAL_sw_13k2_512k_48-48.tst @@ -1620,3 +1692,25 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // ../IVAS_cod -ism_sba 3 2 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_3ISM_2OA.wav bit // eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error // ../IVAS_dec STEREO 32 bit_error testv/ltv48_OSBA_3ISM_2OA.wav_STEREO_sw_48-32_FER10.tst + + + +// OSBA 3ISM 3OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, BINAURAL ROOM REVERB out +../IVAS_cod -ism_sba 3 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 32 bit testv/ltv48_OSBA_4ISM_HOA3.wav_BINAURAL_ROOM_REVERB_sw_48-32.tst + +// OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism_sba 1 -1 testv/ltvISM1.csv 256000 48 testv/ltv48_OSBA_1ISM_FOA.wav bit +../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_pFOA.wav_BINAURAL_256000_48-48.tst + +// OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out +../IVAS_cod -ism_sba 2 -1 testv/ltvISM1.csv testv/ltvISM2.csv 512000 48 testv/stvOSBA_2ISM_FOA48c.wav bit +../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_pHOA2.wav_BINAURAL_512000_48-48.tst + +// OSBA planar 3OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out +../IVAS_cod -ism_sba 4 -3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_OSBA_4ISM_pHOA3.wav_BINAURAL_ROOM_IR_512000_48-48.tst + +// OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out +../IVAS_cod -ism_sba 4 -2 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_OSBA_4ISM_HOA2.wav bit +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OSBA_4ISM_pHOA2.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst \ No newline at end of file -- GitLab From 63f69603061872aedc699abde9c11b206477eb8e Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 12:11:08 +0100 Subject: [PATCH 320/498] add xfail cases to test_renderer_ROM_vs_file.py --- .../test_renderer_ROM_vs_file.py | 44 +++++++++++++------ tests/hrtf_binary_loading/utils.py | 17 +++---- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index 5adcc5ae73..d1cafe9c96 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -42,6 +42,7 @@ from tests.renderer.constants import ( INPUT_FORMATS_ISM, INPUT_FORMATS_MC, ) +from .constants import HRTF_FILES """ Ambisonics """ @@ -49,11 +50,12 @@ from tests.renderer.constants import ( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_ambisonics_binaural_static_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size + test_info, in_fmt, out_fmt, frame_size, hrtf_file ): compare_renderer_vs_renderer_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size=frame_size + test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size ) @@ -61,13 +63,15 @@ def test_ambisonics_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_ambisonics_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file ): compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, + hrtf_file, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) @@ -79,14 +83,15 @@ def test_ambisonics_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_multichannel_binaural_static_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size + test_info, in_fmt, out_fmt, frame_size, hrtf_file ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") compare_renderer_vs_renderer_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size=frame_size + test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size ) @@ -94,8 +99,9 @@ def test_multichannel_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_multichannel_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -104,6 +110,7 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, + hrtf_file, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) @@ -115,14 +122,15 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_size): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_ism_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_size, hrtf_file): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] except: in_meta_files = None compare_renderer_vs_renderer_with_binary_hrir( - test_info, in_fmt, out_fmt, in_meta_files=in_meta_files, frame_size=frame_size + test_info, in_fmt, out_fmt, hrtf_file, in_meta_files=in_meta_files, frame_size=frame_size ) @@ -130,8 +138,9 @@ def test_ism_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_ @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_ism_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] @@ -142,6 +151,7 @@ def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, + hrtf_file, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, frame_size=frame_size, @@ -154,7 +164,8 @@ def test_ism_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_size): +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +def test_masa_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_size, hrtf_file): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") @@ -162,6 +173,7 @@ def test_masa_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame test_info, in_fmt, out_fmt, + hrtf_file, in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) @@ -170,8 +182,9 @@ def test_masa_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_masa_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") @@ -180,6 +193,7 @@ def test_masa_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, + hrtf_file, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) @@ -191,13 +205,15 @@ def test_masa_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_custom_ls_input_binaural_with_binary_hrir( - test_info, in_layout, out_fmt, frame_size + test_info, in_layout, out_fmt, frame_size, hrtf_file ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, + hrtf_file, frame_size=frame_size, ) @@ -206,13 +222,15 @@ def test_custom_ls_input_binaural_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_custom_ls_input_binaural_headrotation_with_binary_hrir( - test_info, in_layout, out_fmt, trj_file, frame_size + test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_file ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, + hrtf_file, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 4f8990ed77..da7d3ba91c 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -322,14 +322,7 @@ def compare_rom_vs_binary( ) out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_bin_path) - check_BE( - test_info, - out_rom, - out_rom_fs, - out_bin, - out_bin_fs, - xfail=xfail, - ) + check_BE(test_info, out_rom, out_rom_fs, out_bin, out_bin_fs, xfail) if keep_file == False: os.remove(bitstream_path) os.remove(out_rom_path) @@ -340,6 +333,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, + hrtf_file, metadata_input: Optional[str] = None, in_meta_files: Optional[list] = None, trj_file: Optional[str] = None, @@ -350,13 +344,14 @@ def compare_renderer_vs_renderer_with_binary_hrir( refveclev_file: Optional[str] = None, config_file: Optional[str] = None, frame_size: Optional[str] = "20ms", - hrir_name="ivas_binaural_48kHz.bin", keep_file=False, ): + xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM + hrtf_file_dir = SCRIPTS_DIR.joinpath( "binauralRenderer_interface/binaural_renderers_hrtf_data" ) - hrtf_file_path = hrtf_file_dir.joinpath(hrir_name) + hrtf_file_path = hrtf_file_dir.joinpath(hrtf_file.format(48)) ref_out = run_renderer( None, test_info, @@ -394,7 +389,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( ref, ref_fs = pyaudio3dtools.audiofile.readfile(ref_out) cut, cut_fs = pyaudio3dtools.audiofile.readfile(cut_out) - check_BE(test_info, ref, ref_fs, cut, cut_fs) + check_BE(test_info, ref, ref_fs, cut, cut_fs, xfail) if keep_file == False: os.remove(ref_out) os.remove(cut_out) -- GitLab From b95b30843211c55adac39bb82be0b581c99b26c2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 15 Feb 2024 12:36:59 +0100 Subject: [PATCH 321/498] [format] python files using `isort --profile black . && black .` --- ci/collect_artifacts.py | 3 +- ci/combine_genpatt_and_jbm_profile.py | 4 +- ci/comment_defines.py | 10 +- .../mergeNewsletterRam.py | 2 +- .../mergeNewsletterRom.py | 6 +- .../parseNewsletterRam.py | 47 +- .../parseNewsletterRom.py | 50 +- .../parseNewsletterWmops.py | 2 +- ci/get_id_of_last_job_occurence.py | 10 +- ci/run_evs_be_test.py | 11 +- ci/run_evs_be_win_test.py | 125 +- ci/run_scheduled_sanitizer_test.py | 23 +- ci/setup_pages.py | 7 +- ci/test_vectors_available.py | 14 +- scripts/IvasBuildAndRun.py | 4 +- scripts/IvasBuildAndRunChecks.py | 15 +- scripts/batch_comp_audio.py | 3 +- scripts/cut_bs.py | 28 +- scripts/mem_analysis.py | 119 +- scripts/parse_mld.py | 31 +- scripts/parse_mld_xml.py | 42 +- scripts/parse_selftest_summary.py | 2 +- scripts/plot_meta_data.py | 11 +- scripts/prepare_combined_format_inputs.py | 144 +- scripts/prepare_mem_dryrun.py | 21 +- scripts/pyaudio3dtools/__init__.py | 6 +- scripts/pyaudio3dtools/audio3dtools.py | 5 +- scripts/pyaudio3dtools/audioarray.py | 32 +- scripts/pyaudio3dtools/audiofile.py | 1 - scripts/pyaudio3dtools/spatialaudioformat.py | 264 +- scripts/pyivastest/IvasBaseClass.py | 117 +- scripts/pyivastest/IvasModeAnalyzer.py | 45 +- scripts/pyivastest/IvasModeCollector.py | 26 +- scripts/pyivastest/IvasModeRunner.py | 138 +- scripts/pyivastest/IvasScriptsCommon.py | 39 +- scripts/pyivastest/IvasSvnBuilder.py | 85 +- scripts/pyivastest/__init__.py | 19 +- scripts/pyivastest/constants.py | 25 +- scripts/pyivastest/ivas_svn.py | 2 +- ...generate_acoustic_environments_metadata.py | 2709 +++++++++++++---- scripts/reverb/text_to_binary_payload.py | 220 +- scripts/runIvasCodec.py | 15 +- scripts/self_test.py | 66 +- .../lc3plus/split_rend_lc3plus_cmdlines.py | 42 +- scripts/strip_split_rendering.py | 108 +- tests/cmp_pcm.py | 18 +- .../test_masa_enc_dec.py | 37 +- .../test_param_file.py | 53 +- .../test_sba_bs_dec_plc.py | 51 +- .../test_sba_bs_enc.py | 31 +- tests/codec_be_on_mr_selection/__init__.py | 21 +- tests/codec_be_on_mr_selection/constants.py | 3 +- .../test_experiments.py | 7 +- tests/conftest.py | 26 +- tests/create_short_testvectors.py | 21 +- tests/cut_pcm.py | 24 +- tests/hrtf_binary_loading/constants.py | 6 +- .../test_renderer_ROM_vs_file.py | 9 +- tests/hrtf_binary_loading/utils.py | 2 +- tests/prepare_pytests.py | 31 +- tests/renderer/test_renderer.py | 264 +- tests/renderer/utils.py | 21 +- tests/run_pytests.py | 21 +- tests/scale_pcm.py | 15 +- tests/test_26444.py | 39 +- tests/test_param_file_ltv.py | 53 +- tests/testconfig.py | 8 +- 67 files changed, 3746 insertions(+), 1713 deletions(-) diff --git a/ci/collect_artifacts.py b/ci/collect_artifacts.py index d3228ba2e8..702f7fa3ef 100755 --- a/ci/collect_artifacts.py +++ b/ci/collect_artifacts.py @@ -1,9 +1,8 @@ #! /usr/bin/env python3 -import pathlib import argparse +import pathlib import re - TEST_TYPES = ["sanitizers"] diff --git a/ci/combine_genpatt_and_jbm_profile.py b/ci/combine_genpatt_and_jbm_profile.py index dd3ffe5858..4d2fd38a00 100644 --- a/ci/combine_genpatt_and_jbm_profile.py +++ b/ci/combine_genpatt_and_jbm_profile.py @@ -30,8 +30,8 @@ """ import argparse -import numpy as np +import numpy as np ERR_MAGIC_NUM_DLY_PROF = -1 ERR_MAGIC_NUM_G192 = 27424 @@ -54,7 +54,7 @@ def combine_error_profiles(genpatt_file, jbm_dly_profile, output_file): # insert lost frames based on .g192 file err_idx = np.where(ep == ERR_MAGIC_NUM_G192)[0] dly[err_idx] = -1 - + with open(output_file, "w") as f: for d in dly: f.write(f"{int(d)}\n") diff --git a/ci/comment_defines.py b/ci/comment_defines.py index 0b6e345703..7f6a77af4b 100755 --- a/ci/comment_defines.py +++ b/ci/comment_defines.py @@ -1,5 +1,5 @@ -import re import argparse +import re def process_file(file_path: str, defines_re): @@ -13,7 +13,9 @@ def process_file(file_path: str, defines_re): for i, line in enumerate(lines): for name, regex in defines_re.items(): # Spaces are replaced with underscores to avoid matching on multiple runs - lines[i] = regex.sub(lambda x: f"/* {x.group(0).replace(' ', '_')} */", line) + lines[i] = regex.sub( + lambda x: f"/* {x.group(0).replace(' ', '_')} */", line + ) if lines[i] != line: num_subbed[name] += 1 @@ -41,7 +43,9 @@ def main(args): if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Comment out preprocessor defines in c/c++ files") + parser = argparse.ArgumentParser( + description="Comment out preprocessor defines in c/c++ files" + ) parser.add_argument("-f", "--files", nargs="+", required=True, type=str) parser.add_argument("-d", "--defines", nargs="+", required=True, type=str) main(parser.parse_args()) diff --git a/ci/complexity_measurements/mergeNewsletterRam.py b/ci/complexity_measurements/mergeNewsletterRam.py index 6df5ee70fc..40b5f75c59 100755 --- a/ci/complexity_measurements/mergeNewsletterRam.py +++ b/ci/complexity_measurements/mergeNewsletterRam.py @@ -29,8 +29,8 @@ # accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and # the United Nations Convention on Contracts on the International Sales of Goods. import csv -import sys import re +import sys newsletterFilename = "" newsletterFilenameLast = "" diff --git a/ci/complexity_measurements/mergeNewsletterRom.py b/ci/complexity_measurements/mergeNewsletterRom.py index 0d410f28ef..0e75f26f58 100755 --- a/ci/complexity_measurements/mergeNewsletterRom.py +++ b/ci/complexity_measurements/mergeNewsletterRom.py @@ -29,8 +29,8 @@ # accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and # the United Nations Convention on Contracts on the International Sales of Goods. import csv -import sys import re +import sys newsletterFilename = "" newsletterFilenameLast = "" @@ -65,7 +65,9 @@ with open(newsletterFilenameTROM, "r") as csvfile: # now we have the following format # PROM enc, PROM dec, PROM com, PROM rend, PROM total, TROM enc, TROM dec, TROM com, TROM rend, TROM total -print("conf;PROM enc;PROM dec;PROM com;PROM rend;PROM total;TROM enc;TROM dec;TROM com;TROM rend;TROM total;total") +print( + "conf;PROM enc;PROM dec;PROM com;PROM rend;PROM total;TROM enc;TROM dec;TROM com;TROM rend;TROM total;total" +) for key in rom_table: rom = rom_table[key] diff --git a/ci/complexity_measurements/parseNewsletterRam.py b/ci/complexity_measurements/parseNewsletterRam.py index 4c432094ea..6fe1cd8993 100755 --- a/ci/complexity_measurements/parseNewsletterRam.py +++ b/ci/complexity_measurements/parseNewsletterRam.py @@ -31,8 +31,8 @@ """ import csv -import sys import re +import sys newsletterFilename = "" newsletterFilenameLast = "" @@ -133,30 +133,25 @@ for key in ram_table: max_total_encdec[0] = re.sub(" ", "_", key) max_total_encdec[1] = total_encdec - + print( - revision, # string revision $tmp[1] - shortDate, # string shortDate $tmp[2] - fullDate, # string fullDate $tmp[3] - - max_total_encdec[1], # value maxTotalRamCodecScore $tmp[4] - - max_total_enc[0], # string maxTotalRamEnc $tmp[5] - max_total_enc[1], # value maxTotalRamEnc $tmp[6] - max_total_dec[0], # string maxTotalRamDec $tmp[7] - max_total_dec[1], # value maxTotalRamDecScore $tmp[8] - - max_stack_encdec[1], # value maxStackCodecScore $tmp[9] - max_stack_enc[0], # string maxStackEnc $tmp[10] - max_stack_enc[1], # value maxStackEncScore $tmp[11] - max_stack_dec[0], # string maxStackDec $tmp[12] - max_stack_dec[1], # value maxStackDecScore $tmp[13] - - max_heap_encdec[1], # value maxHeapCodecScore $tmp[14] - max_heap_enc[0], # string maxHeapEnc $tmp[15] - max_heap_enc[1], # value maxHeapEncScore $tmp[16] - max_heap_dec[0], # string maxHeapDec $tmp[17] - max_heap_dec[1], # value maxHeapDecScore $tmp[19] - - newsletterFilenameLast, # string logFile $tmp[19] + revision, # string revision $tmp[1] + shortDate, # string shortDate $tmp[2] + fullDate, # string fullDate $tmp[3] + max_total_encdec[1], # value maxTotalRamCodecScore $tmp[4] + max_total_enc[0], # string maxTotalRamEnc $tmp[5] + max_total_enc[1], # value maxTotalRamEnc $tmp[6] + max_total_dec[0], # string maxTotalRamDec $tmp[7] + max_total_dec[1], # value maxTotalRamDecScore $tmp[8] + max_stack_encdec[1], # value maxStackCodecScore $tmp[9] + max_stack_enc[0], # string maxStackEnc $tmp[10] + max_stack_enc[1], # value maxStackEncScore $tmp[11] + max_stack_dec[0], # string maxStackDec $tmp[12] + max_stack_dec[1], # value maxStackDecScore $tmp[13] + max_heap_encdec[1], # value maxHeapCodecScore $tmp[14] + max_heap_enc[0], # string maxHeapEnc $tmp[15] + max_heap_enc[1], # value maxHeapEncScore $tmp[16] + max_heap_dec[0], # string maxHeapDec $tmp[17] + max_heap_dec[1], # value maxHeapDecScore $tmp[19] + newsletterFilenameLast, # string logFile $tmp[19] ) diff --git a/ci/complexity_measurements/parseNewsletterRom.py b/ci/complexity_measurements/parseNewsletterRom.py index 830ef945b9..2416a6fd0b 100755 --- a/ci/complexity_measurements/parseNewsletterRom.py +++ b/ci/complexity_measurements/parseNewsletterRom.py @@ -32,8 +32,8 @@ """ import csv -import sys import re +import sys newsletterFilename = "" newsletterFilenameLast = "" @@ -101,7 +101,7 @@ for key in rom_table: trom_total = int(rom[9]) total_encdec = prom_total + trom_total - + if prom_enc > max_prom_enc[1]: max_prom_enc[0] = re.sub(" ", "_", key) max_prom_enc[1] = prom_enc @@ -140,29 +140,25 @@ for key in rom_table: print( - revision, # string revision $tmp[1] - shortDate, # string shortDate $tmp[2] - fullDate, # string fullDate $tmp[3] - - max_total_encdec[1], # value maxTotalRomCodecScore $tmp[4] - - max_prom_enc[0], # string maxPROMEnc $tmp[5] - max_prom_enc[1], # value maxPROMEncScore $tmp[6] - max_prom_dec[0], # string maxPROMDec $tmp[7] - max_prom_dec[1], # value maxPROMDecScore $tmp[8] - max_prom_com[0], # string maxPROMCom $tmp[9] - max_prom_com[1], # value maxPROMComScore $tmp[10] - max_prom_rend[0], # string maxPROMRend $tmp[11] - max_prom_rend[1], # value maxPROMRendScore $tmp[12] - - max_trom_enc[0], # string maxTROMEnc $tmp[13] - max_trom_enc[1], # value maxTROMEncScore $tmp[14] - max_trom_dec[0], # string maxTROMDec $tmp[15] - max_trom_dec[1], # value maxTROMDecScore $tmp[16] - max_trom_com[0], # string maxTROMCom $tmp[17] - max_trom_com[1], # value maxTROMComScore $tmp[18] - max_trom_rend[0], # string maxTROMRend $tmp[19] - max_trom_rend[1], # value maxTROMRendScore $tmp[20] - - newsletterFilenameLast, # string logFile $tmp[21] + revision, # string revision $tmp[1] + shortDate, # string shortDate $tmp[2] + fullDate, # string fullDate $tmp[3] + max_total_encdec[1], # value maxTotalRomCodecScore $tmp[4] + max_prom_enc[0], # string maxPROMEnc $tmp[5] + max_prom_enc[1], # value maxPROMEncScore $tmp[6] + max_prom_dec[0], # string maxPROMDec $tmp[7] + max_prom_dec[1], # value maxPROMDecScore $tmp[8] + max_prom_com[0], # string maxPROMCom $tmp[9] + max_prom_com[1], # value maxPROMComScore $tmp[10] + max_prom_rend[0], # string maxPROMRend $tmp[11] + max_prom_rend[1], # value maxPROMRendScore $tmp[12] + max_trom_enc[0], # string maxTROMEnc $tmp[13] + max_trom_enc[1], # value maxTROMEncScore $tmp[14] + max_trom_dec[0], # string maxTROMDec $tmp[15] + max_trom_dec[1], # value maxTROMDecScore $tmp[16] + max_trom_com[0], # string maxTROMCom $tmp[17] + max_trom_com[1], # value maxTROMComScore $tmp[18] + max_trom_rend[0], # string maxTROMRend $tmp[19] + max_trom_rend[1], # value maxTROMRendScore $tmp[20] + newsletterFilenameLast, # string logFile $tmp[21] ) diff --git a/ci/complexity_measurements/parseNewsletterWmops.py b/ci/complexity_measurements/parseNewsletterWmops.py index c479deed06..3f884fd3aa 100755 --- a/ci/complexity_measurements/parseNewsletterWmops.py +++ b/ci/complexity_measurements/parseNewsletterWmops.py @@ -31,8 +31,8 @@ """ import csv -import sys import re +import sys newsletterFilename = "" newsletterFilenameLast = "" diff --git a/ci/get_id_of_last_job_occurence.py b/ci/get_id_of_last_job_occurence.py index d1faca502f..449902f50a 100755 --- a/ci/get_id_of_last_job_occurence.py +++ b/ci/get_id_of_last_job_occurence.py @@ -31,6 +31,7 @@ """ import argparse + import requests PER_PAGE_SUFFIX = "?per_page=50" @@ -50,13 +51,13 @@ def get_job_id(branch_name, job_name): for pl in resp_pls.json(): if pl["ref"] == branch_name: url_jobs = url_pls + f"/{pl['id']}/jobs" - + # only one of the suffixes here - this assumes only max of 50 jobs per pipeline # so only one page needed resp_jobs = requests.get(url_jobs + PER_PAGE_SUFFIX) if job_name not in resp_jobs.text: - continue + continue # find actual job by name for job in resp_jobs.json(): @@ -71,7 +72,8 @@ def get_job_id(branch_name, job_name): return job_id -if __name__ == '__main__': + +if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("branch_name") parser.add_argument("job_name") @@ -79,4 +81,4 @@ if __name__ == '__main__': args = parser.parse_args() job_id = get_job_id(args.branch_name, args.job_name) - print(job_id) \ No newline at end of file + print(job_id) diff --git a/ci/run_evs_be_test.py b/ci/run_evs_be_test.py index 70370b540b..3103a800c8 100755 --- a/ci/run_evs_be_test.py +++ b/ci/run_evs_be_test.py @@ -28,13 +28,12 @@ accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and the United Nations Convention on Contracts on the International Sales of Goods. """ -import subprocess +import concurrent.futures import pathlib +import subprocess import sys -import concurrent.futures from threading import Lock - README_FILES_PARALLEL = [ "Readme_AMRWB_IO_enc.txt", "Readme_AMRWB_IO_dec.txt", @@ -47,6 +46,7 @@ BINARY_PATHS = ["./bin/EVS_cod", "./bin/EVS_dec"] FOLDER_PATHS = ["testv"] BIN_PATHS = BINARY_PATHS * 2 + def main(): if not environment_is_correct(): @@ -56,7 +56,10 @@ def main(): # run first part in parallel with concurrent.futures.ThreadPoolExecutor() as executor: executor.map( - run_file, README_FILES_PARALLEL, BIN_PATHS, [result_dict] * len(README_FILES_PARALLEL) + run_file, + README_FILES_PARALLEL, + BIN_PATHS, + [result_dict] * len(README_FILES_PARALLEL), ) # JBM test can not run concurrently with the others diff --git a/ci/run_evs_be_win_test.py b/ci/run_evs_be_win_test.py index caa2ef2f93..4a93756787 100644 --- a/ci/run_evs_be_win_test.py +++ b/ci/run_evs_be_win_test.py @@ -28,34 +28,34 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ -from multiprocessing import Pool import argparse -import subprocess import os import shutil +import subprocess import sys +from multiprocessing import Pool def run_condition(eval_cmd, diff_cmd, id_count): - """ Run ENC or DEC command string and compare output with EVS test vectors. """ + """Run ENC or DEC command string and compare output with EVS test vectors.""" cmd = subprocess.run(eval_cmd.split(), capture_output=True, text=True, check=True) # diff - diff_fails = '' - if ';' in diff_cmd: + diff_fails = "" + if ";" in diff_cmd: # JBM cases - diff_cmd1, diff_cmd2 = diff_cmd.split(';') + diff_cmd1, diff_cmd2 = diff_cmd.split(";") cmd1 = subprocess.run(diff_cmd1.split(), stdout=subprocess.DEVNULL, check=False) cmd2 = subprocess.run(diff_cmd2.split(), stdout=subprocess.DEVNULL, check=False) if cmd1.returncode != 0: - diff_fails += f'{diff_cmd1}\n' + diff_fails += f"{diff_cmd1}\n" if cmd2.returncode != 0: - diff_fails += f'{diff_cmd2}\n' + diff_fails += f"{diff_cmd2}\n" else: cmd = subprocess.run(diff_cmd.split(), stdout=subprocess.DEVNULL, check=False) if cmd.returncode != 0: - diff_fails += f'{diff_cmd}\n' + diff_fails += f"{diff_cmd}\n" if diff_fails: return diff_fails else: @@ -79,17 +79,31 @@ def environment_is_correct(paths): return ret -if __name__ == '__main__': +if __name__ == "__main__": parser = argparse.ArgumentParser( - description='Run 26.444 test with parallel processes ') - parser.add_argument('-p', type=int, default=os.cpu_count(), - help='Number of processes (default cpu_count)') - parser.add_argument('-test_dir', type=str, default='./', - help='testvec directory from 26.444)') - parser.add_argument('-enc_bin', type=str, default='./bin/IVAS_cod.exe', - help='Encoder binary (default ./bin/IVAS_cod.exe)') - parser.add_argument('-dec_bin', type=str, default='./bin/IVAS_dec.exe', - help='Decoder binary (default ./bin/IVAS_dec.exe)') + description="Run 26.444 test with parallel processes " + ) + parser.add_argument( + "-p", + type=int, + default=os.cpu_count(), + help="Number of processes (default cpu_count)", + ) + parser.add_argument( + "-test_dir", type=str, default="./", help="testvec directory from 26.444)" + ) + parser.add_argument( + "-enc_bin", + type=str, + default="./bin/IVAS_cod.exe", + help="Encoder binary (default ./bin/IVAS_cod.exe)", + ) + parser.add_argument( + "-dec_bin", + type=str, + default="./bin/IVAS_dec.exe", + help="Decoder binary (default ./bin/IVAS_dec.exe)", + ) args = parser.parse_args() test_vec_dir = args.test_dir @@ -97,12 +111,19 @@ if __name__ == '__main__': enc_bin = args.enc_bin dec_bin = args.dec_bin - README_FILES = ['Readme_AMRWB_IO_dec.txt', 'Readme_AMRWB_IO_enc.txt', 'Readme_EVS_dec.txt', - 'Readme_EVS_enc.txt', 'Readme_JBM_dec.txt'] + README_FILES = [ + "Readme_AMRWB_IO_dec.txt", + "Readme_AMRWB_IO_enc.txt", + "Readme_EVS_dec.txt", + "Readme_EVS_enc.txt", + "Readme_JBM_dec.txt", + ] scripts = [os.path.join(test_vec_dir, script) for script in README_FILES] - if not environment_is_correct([f'{test_vec_dir}/testv'] + scripts + [enc_bin, dec_bin]): + if not environment_is_correct( + [f"{test_vec_dir}/testv"] + scripts + [enc_bin, dec_bin] + ): sys.exit(1) pool = Pool(processes) @@ -113,43 +134,53 @@ if __name__ == '__main__': with open(script) as file: tmp_dir = None eval_cmd = None - diff_cmd = '' + diff_cmd = "" for line in file: - if line.startswith('TMP='): + if line.startswith("TMP="): assert tmp_dir is None tmp_dir = line.split('"')[1] if os.path.exists(tmp_dir): shutil.rmtree(tmp_dir) os.makedirs(tmp_dir) - line = line.replace('testv', f'{test_vec_dir}/testv') - line = line if tmp_dir is None else line.replace( - '$TMP/', f'{tmp_dir}/') - if '$CUT_DEC_BIN' in line: - eval_cmd = dec_bin + ' -q ' + ' '.join(line.split()[1:]) - if '$CUT_ENC_BIN' in line: - eval_cmd = enc_bin + ' -q ' + ' '.join(line.split()[1:]) - if '$DIFF_BIN' in line: - if 'Readme_JBM_dec.txt' in script: - if '-w' not in line.split()[1]: - diff_cmd = 'FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n') + line = line.replace("testv", f"{test_vec_dir}/testv") + line = line if tmp_dir is None else line.replace("$TMP/", f"{tmp_dir}/") + if "$CUT_DEC_BIN" in line: + eval_cmd = dec_bin + " -q " + " ".join(line.split()[1:]) + if "$CUT_ENC_BIN" in line: + eval_cmd = enc_bin + " -q " + " ".join(line.split()[1:]) + if "$DIFF_BIN" in line: + if "Readme_JBM_dec.txt" in script: + if "-w" not in line.split()[1]: + diff_cmd = "FC.exe " + " ".join(line.split()[1:]).replace( + "/", "\\" + ).replace("\n", "/n") continue - diff_cmd += ';FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n').replace('-w', '/W') + diff_cmd += ";FC.exe " + " ".join(line.split()[1:]).replace( + "/", "\\" + ).replace("\n", "/n").replace("-w", "/W") else: - diff_cmd = 'FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n') - results.append(pool.apply_async( - run_condition, args=(eval_cmd, diff_cmd, id_count))) + diff_cmd = "FC.exe " + " ".join(line.split()[1:]).replace( + "/", "\\" + ).replace("\n", "/n") + results.append( + pool.apply_async( + run_condition, args=(eval_cmd, diff_cmd, id_count) + ) + ) id_count = id_count + 1 - print('Total number of conditions for', '"' + - os.path.basename(script) + '": ' + str(id_count - 1)) + print( + "Total number of conditions for", + '"' + os.path.basename(script) + '": ' + str(id_count - 1), + ) results = [r.get() for r in results if r.get()] if results: - print(f'\n --- {len(results)} test conditions failed ---') - print(''.join(results)) - with open('failed.txt', 'w') as f: - print(f' --- {len(results)} test conditions failed ---', file=f) - print(''.join(results), file=f) + print(f"\n --- {len(results)} test conditions failed ---") + print("".join(results)) + with open("failed.txt", "w") as f: + print(f" --- {len(results)} test conditions failed ---", file=f) + print("".join(results), file=f) sys.exit(1) else: - print('\n *** All tests passed! ***') + print("\n *** All tests passed! ***") sys.exit(0) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index fcea405370..fa5202ef94 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -30,19 +30,18 @@ """ import argparse -import sys -import subprocess import pathlib +import subprocess +import sys CI_SCRIPT_DIR = "./ci" sys.path.append(CI_SCRIPT_DIR) from collect_artifacts import ( - find_failed_files_for_sanitizer_test, collect_for_sanitizer_test, + find_failed_files_for_sanitizer_test, ) from combine_genpatt_and_jbm_profile import combine_error_profiles - SCRIPT_DIR = pathlib.Path("./scripts").resolve() DURATION = "120" CFG = "ci_linux_ltv.json" @@ -55,7 +54,9 @@ N_FRAMES_DLY_PROFILE = 7500 GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {N_FRAMES_DLY_PROFILE} {EP_FILE}" MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] -TIMEOUT = 60 * 15 # timeout of 15 minutes per en/decoding to safeguard against endless loops +TIMEOUT = ( + 60 * 15 +) # timeout of 15 minutes per en/decoding to safeguard against endless loops CONSOLE_OUT_FILE = "output_san.txt" @@ -82,11 +83,11 @@ def get_modes(in_format: str) -> list: in_format_for_script = "MC" elif "-" in in_format: # hyphen indicates combined format - scene_format, object_format = in_format.split('-') + scene_format, object_format = in_format.split("-") if scene_format in AMBISONICS_MODES: in_format_for_script = "OSBA" else: - assert(scene_format == "MASA") + assert scene_format == "MASA" in_format_for_script = "OMASA" cmd = [ @@ -214,15 +215,11 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr cmd_fec = cmd_no_fec + ["--decoder_only", "-J", DLY_PROFILE_OUT] print( - "======== Script command line WITH plc: ========\n{}".format( - " ".join(cmd_fec) - ) + "======== Script command line WITH plc: ========\n{}".format(" ".join(cmd_fec)) ) with open(CONSOLE_OUT_FILE, "a") as f: - proc = subprocess.Popen( - cmd_fec, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) + proc = subprocess.Popen(cmd_fec, stdout=subprocess.PIPE, stderr=subprocess.PIPE) for c in iter(lambda: proc.stdout.read(1), b""): sys.stdout.buffer.write(c) f.write(c.decode("utf8")) diff --git a/ci/setup_pages.py b/ci/setup_pages.py index cc90753de5..10a2e9e84e 100755 --- a/ci/setup_pages.py +++ b/ci/setup_pages.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 import os -import sys import pathlib import subprocess +import sys + from get_id_of_last_job_occurence import get_job_id JOBS = [ @@ -34,7 +35,9 @@ def main(): job_public = job + "-public" if job == "coverage-test-on-main-scheduled": job_public = "coverage" - pathlib.Path("coverage_stv").rename(public_folder.joinpath("coverage_stv")) + pathlib.Path("coverage_stv").rename( + public_folder.joinpath("coverage_stv") + ) pathlib.Path(job_public).rename(public_folder.joinpath(job_public)) diff --git a/ci/test_vectors_available.py b/ci/test_vectors_available.py index ecff222fdf..6c11898560 100644 --- a/ci/test_vectors_available.py +++ b/ci/test_vectors_available.py @@ -1,17 +1,23 @@ -import pytest -import pathlib -import json import itertools +import json +import pathlib + +import pytest TEST_CONFIG_DIR = pathlib.Path(__file__).parent.parent.joinpath("scripts/config") TEST_CONFIGS = [f for f in TEST_CONFIG_DIR.iterdir() if f.name.startswith("ci_linux")] + def get_testvectors_from_config(config) -> list: with open(config) as f: cfg = json.load(f) return list(cfg["inpaths"].values()) -TESTVECTORS = sorted(set(itertools.chain(*[get_testvectors_from_config(cfg) for cfg in TEST_CONFIGS]))) + +TESTVECTORS = sorted( + set(itertools.chain(*[get_testvectors_from_config(cfg) for cfg in TEST_CONFIGS])) +) + @pytest.mark.parametrize("testvector", TESTVECTORS) def test_vectors_available(testvector): diff --git a/scripts/IvasBuildAndRun.py b/scripts/IvasBuildAndRun.py index b1aae9c520..6113c2ae3e 100755 --- a/scripts/IvasBuildAndRun.py +++ b/scripts/IvasBuildAndRun.py @@ -33,9 +33,9 @@ import os.path import sys -from pyivastest.IvasSvnBuilder import * -from pyivastest import IvasScriptsCommon import pyivastest.constants as constants +from pyivastest import IvasScriptsCommon +from pyivastest.IvasSvnBuilder import * class IvasBuildAndRun(IvasScriptsCommon.IvasScript): diff --git a/scripts/IvasBuildAndRunChecks.py b/scripts/IvasBuildAndRunChecks.py index ac0b142777..4bca48a672 100755 --- a/scripts/IvasBuildAndRunChecks.py +++ b/scripts/IvasBuildAndRunChecks.py @@ -33,10 +33,9 @@ import os.path import sys -from pyivastest.IvasSvnBuilder import * -from pyivastest import IvasScriptsCommon import pyivastest.constants as constants - +from pyivastest import IvasScriptsCommon +from pyivastest.IvasSvnBuilder import * RET_CODE_FAILURE = 101 @@ -92,7 +91,8 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): "--rebuild", help="force a rebuild of the binaries", action="store_true" ) self.parser.add_argument( - "--usan_supp_file", help="suppression file for undef behaviour sanitizer", + "--usan_supp_file", + help="suppression file for undef behaviour sanitizer", default=None, ) @@ -184,7 +184,9 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): checks_ret_val.append(ret_val) if self.args["create_html_output"]: cmd = ["git", "rev-parse", "HEAD"] - commit_hash = subprocess.run(cmd, capture_output=True).stdout.decode("utf8") + commit_hash = subprocess.run(cmd, capture_output=True).stdout.decode( + "utf8" + ) br.build_and_run_dict[check]["analyzer"].write_html_file( check, self.args["create_html_output"], commit_hash ) @@ -211,10 +213,11 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): failed_encs = runner.failed_modes["enc"] failed_decs = runner.failed_modes["dec"] if len(failed_encs) > 0 or len(failed_decs) > 0 or ret_val != 0: - returncode = RET_CODE_FAILURE + returncode = RET_CODE_FAILURE return returncode + if __name__ == "__main__": script = IvasBuildAndRunChecks() sys.exit(script.run()) diff --git a/scripts/batch_comp_audio.py b/scripts/batch_comp_audio.py index ccb12ccf19..6854f41f30 100755 --- a/scripts/batch_comp_audio.py +++ b/scripts/batch_comp_audio.py @@ -40,8 +40,9 @@ import subprocess import sys import threading from itertools import repeat -from pyaudio3dtools.audiofile import readfile + from pyaudio3dtools.audioarray import compare +from pyaudio3dtools.audiofile import readfile FILES_EQUAL = "File A = File B" SNR_EXPR = r"SNR\s+=(.+)dB\s*\(.+= (.+)\)" diff --git a/scripts/cut_bs.py b/scripts/cut_bs.py index 2f3959100f..37f19733df 100755 --- a/scripts/cut_bs.py +++ b/scripts/cut_bs.py @@ -30,9 +30,9 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ -import struct import argparse import os.path +import struct import sys SID_BITS = {35, 48, 104} @@ -111,16 +111,27 @@ def cut_from_start(fp, fp_out, start_frame=0, start_with_sid=False): if __name__ == "__main__": - my_parser = argparse.ArgumentParser( - description="Cut a G.192 bit stream file" + my_parser = argparse.ArgumentParser(description="Cut a G.192 bit stream file") + my_parser.add_argument( + "--sid", + "-s", + help="Cut away all frames before the first SID frame", + action="store_true", ) my_parser.add_argument( - "--sid", "-s", help="Cut away all frames before the first SID frame", action="store_true" + "--frame", + "-f", + type=int, + help="Number of frames to cut from the start of the file.", + default=0, ) my_parser.add_argument( - "--frame", "-f", type=int, help="Number of frames to cut from the start of the file.", default=0 + "--length", + "-l", + type=int, + help="Cut bitstream to this length (in frames)", + default=-1, ) - my_parser.add_argument("--length", "-l", type=int, help="Cut bitstream to this length (in frames)", default=-1) my_parser.add_argument("bs_in", type=str, help="G.192 bit stream file name to cut") my_parser.add_argument("bs_out", type=str, help="Cut G.192 bit stream file name") my_args = my_parser.parse_args() @@ -144,6 +155,7 @@ if __name__ == "__main__": elif my_args.length: fr_cnt = cut_to_length(fp_in, fp_out, my_args.length) if fr_cnt != my_args.length: - print(f"Warning! Could not cut to length {my_args.length} as bitstream only contained {fr_cnt} frames!") + print( + f"Warning! Could not cut to length {my_args.length} as bitstream only contained {fr_cnt} frames!" + ) print(f"Cut {my_args.bs_in} to {fr_cnt} frames") - diff --git a/scripts/mem_analysis.py b/scripts/mem_analysis.py index fa2030c033..e3f3d8afe4 100644 --- a/scripts/mem_analysis.py +++ b/scripts/mem_analysis.py @@ -1,48 +1,59 @@ #!/usr/bin/env python3 -import os import argparse import csv -import sys +import os import struct +import sys + +import matplotlib.pyplot as plt import numpy as np import pandas as pd -import matplotlib.pyplot as plt # set matplotlib in interactive mode (plots figure and return control) # plt.ion() # plt.close('all') -parser = argparse.ArgumentParser(description='Analyze memory output file') -parser.add_argument('input',type=str,help='Memory analysis file (e.g. mem_analysis.csv)') +parser = argparse.ArgumentParser(description="Analyze memory output file") +parser.add_argument( + "input", type=str, help="Memory analysis file (e.g. mem_analysis.csv)" +) args = parser.parse_args() -fileIn = args.input +fileIn = args.input # read input .csv file -df = pd.read_csv(fileIn, header=None, names=['action_type', 'frame', 'name', 'line_no', 'mem_size']) -Nframes = max(df['frame']) +df = pd.read_csv( + fileIn, header=None, names=["action_type", "frame", "name", "line_no", "mem_size"] +) +Nframes = max(df["frame"]) # merge identical memory blocks -> create new column 'count' -df = df.groupby(df.columns.tolist(),as_index=False).size() -df = df.rename(columns={'size': 'count'}) +df = df.groupby(df.columns.tolist(), as_index=False).size() +df = df.rename(columns={"size": "count"}) # remove column 'action_type' -df.drop(columns = ['action_type']) +df.drop(columns=["action_type"]) # merge records with the same signature but different frame number -> create list of frames (sort in ascending order) -df = df.groupby(['name', 'line_no', 'mem_size', 'count'],as_index=False).agg({'frame': list}) -df['frame'] = df['frame'].apply(np.sort) -df['list_len'] = df['frame'].apply(len) # auxiliary column -> length of the list +df = df.groupby(["name", "line_no", "mem_size", "count"], as_index=False).agg( + {"frame": list} +) +df["frame"] = df["frame"].apply(np.sort) +df["list_len"] = df["frame"].apply(len) # auxiliary column -> length of the list # merge records with the same name and frame but different line number -> sum memory sizes and counts -df = df.groupby(['name', 'list_len'],as_index=False).agg({'line_no': list, 'mem_size': sum, 'count':sum, 'frame':'first'}) +df = df.groupby(["name", "list_len"], as_index=False).agg( + {"line_no": list, "mem_size": sum, "count": sum, "frame": "first"} +) # sort by memory size (put inter-frame memory blocks to the bottom) -select_inter = (df['list_len'] == 2) & (df.apply(lambda row : row['frame'][-1] - row['frame'][0], axis = 1) >= Nframes) +select_inter = (df["list_len"] == 2) & ( + df.apply(lambda row: row["frame"][-1] - row["frame"][0], axis=1) >= Nframes +) df_inter = df[select_inter] -df_inter = df_inter.sort_values(by=['mem_size'], ascending=False) +df_inter = df_inter.sort_values(by=["mem_size"], ascending=False) df_intra = df[~select_inter] -df_intra = df_intra.sort_values(by=['list_len'], ascending=True) +df_intra = df_intra.sort_values(by=["list_len"], ascending=True) # plot inter-frame memory blocks in horizontal bar graph (use .broken_barh method) fig, ax = plt.subplots() @@ -52,53 +63,77 @@ y_tick_labels = [] y_low = 1 for index, row in df_inter.iterrows(): l = f"{row['name']} on lines: {row['line_no']}, total memory size: {row['count']}x{row['mem_size']}" - fms = row['frame'].reshape((-1,2)) # convert frame numbers to two-column format - fms[:,1] -= fms[:,0] # second column should now represent the duration of the segment + fms = row["frame"].reshape((-1, 2)) # convert frame numbers to two-column format + fms[:, 1] -= fms[ + :, 0 + ] # second column should now represent the duration of the segment fmsT = fms.T fms_list = list(zip(fmsT[0], fmsT[1])) c = next(colors) - ax.broken_barh(xranges=fms_list, yrange=(y_low, row['count']), label=l, color=c) - y_ticks.append(y_low + 0.5 * row['count']) - y_tick_labels.append(row['name']) - y_low += row['count'] + 0.5 + ax.broken_barh(xranges=fms_list, yrange=(y_low, row["count"]), label=l, color=c) + y_ticks.append(y_low + 0.5 * row["count"]) + y_tick_labels.append(row["name"]) + y_low += row["count"] + 0.5 print(l + f", {row['count'] * fms.shape[0]/Nframes:.3f} mallocs per frame") - + # plot intra-frame memory blocks in horizontal bar graph (use .broken_barh method) -df_intra = df_intra.groupby(['name'],as_index=False).agg({'list_len': list, 'line_no': list, 'mem_size': list, 'count': list, 'frame': list}) +df_intra = df_intra.groupby(["name"], as_index=False).agg( + {"list_len": list, "line_no": list, "mem_size": list, "count": list, "frame": list} +) for index, row in df_intra.iterrows(): # repeat for all grouped memory records in the row - for j in range(len(row['list_len'])): + for j in range(len(row["list_len"])): l = f"{row['name']} on lines: {row['line_no'][j]}, total memory size: {row['count'][j]}x{row['mem_size'][j]}" - fms = row['frame'][j].astype(float).reshape((-1,2)) # convert frame numbers to two-column format - fms[:,1] -= fms[:,0] # second column should now represent the duration of the segment - idx_zero = fms[:,1] == 0 # find zero-length segments -> these are intra-frame memory blocks + fms = ( + row["frame"][j].astype(float).reshape((-1, 2)) + ) # convert frame numbers to two-column format + fms[:, 1] -= fms[ + :, 0 + ] # second column should now represent the duration of the segment + idx_zero = ( + fms[:, 1] == 0 + ) # find zero-length segments -> these are intra-frame memory blocks fms[idx_zero, 0] += 0.1 fms[idx_zero, 1] = 0.8 fmsT = fms.T fms_list = list(zip(fmsT[0], fmsT[1])) c = next(colors) - ax.broken_barh(xranges=fms_list, yrange=(y_low, row['count'][j]), label=l, color=c, alpha=0.6) + ax.broken_barh( + xranges=fms_list, + yrange=(y_low, row["count"][j]), + label=l, + color=c, + alpha=0.6, + ) print(l + f", {row['count'][j] * fms.shape[0]/Nframes:.3f} mallocs per frame") - y_ticks.append(y_low + 0.5 * max(row['count'])) - y_tick_labels.append(row['name']) - y_low += max(row['count']) + 0.5 + y_ticks.append(y_low + 0.5 * max(row["count"])) + y_tick_labels.append(row["name"]) + y_low += max(row["count"]) + 0.5 ax.set_yticks(y_ticks) ax.set_yticklabels(y_tick_labels) -ax.set_ylabel('Memory size') -ax.set_xlabel('Frame') -ax.set_title('Memory analysis') +ax.set_ylabel("Memory size") +ax.set_xlabel("Frame") +ax.set_title("Memory analysis") # shrink current axis's height by 20% on the bottom to fit the legend box = ax.get_position() ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8]) - -# insert the legend below the graph -ax.legend(loc="upper left", bbox_to_anchor=(0, -0.1), ncol=2, borderaxespad=0, fontsize='small') + +# insert the legend below the graph +ax.legend( + loc="upper left", + bbox_to_anchor=(0, -0.1), + ncol=2, + borderaxespad=0, + fontsize="small", +) # magnify to "almost" fullscreen size (select the alternative for your backend) fig = plt.gcf() -fig.set_size_inches(15, 9) # we need to set the size manually, otherwise savefig will save the figure in the default size +fig.set_size_inches( + 15, 9 +) # we need to set the size manually, otherwise savefig will save the figure in the default size mng = plt.get_current_fig_manager() mng.full_screen_toggle() # mng.frame.Maximize(True) @@ -106,5 +141,5 @@ mng.full_screen_toggle() # mng.window.state('zoomed') # show and save the figure (use block=True to wait until Figure is closed manually) -plt.savefig(os.path.splitext(args.input)[0] + '.png', dpi=100, bbox_inches='tight') +plt.savefig(os.path.splitext(args.input)[0] + ".png", dpi=100, bbox_inches="tight") plt.show(block=True) diff --git a/scripts/parse_mld.py b/scripts/parse_mld.py index 2a60e176e3..b999e83903 100644 --- a/scripts/parse_mld.py +++ b/scripts/parse_mld.py @@ -3,27 +3,30 @@ import argparse import re - # Main routine -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Parse HTML report to extract MLD values') - parser.add_argument('html_report',type=str,help='HTML report input file, e.g. report.html') - parser.add_argument('csv_file',type=str,help='Output CSV file, e.g. output.csv') +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Parse HTML report to extract MLD values" + ) + parser.add_argument( + "html_report", type=str, help="HTML report input file, e.g. report.html" + ) + parser.add_argument("csv_file", type=str, help="Output CSV file, e.g. output.csv") args = parser.parse_args() html_report = args.html_report - csv_file = args.csv_file - + csv_file = args.csv_file + mld = {} - - with open(html_report,'r') as infile: + + with open(html_report, "r") as infile: for line in infile.readlines(): - if "col-name" in line: - test_name = re.search('\[(.*)\]', line).group(1) + if "col-name" in line: + test_name = re.search("\[(.*)\]", line).group(1) mld[test_name] = 0.0 if "MLD" in line: mld_val = float(line.split()[1]) mld[test_name] = mld_val - - with open(csv_file,'w') as outfile: + + with open(csv_file, "w") as outfile: for test_name in mld: - outfile.write(test_name + ';' + str(mld[test_name])+'\n') \ No newline at end of file + outfile.write(test_name + ";" + str(mld[test_name]) + "\n") diff --git a/scripts/parse_mld_xml.py b/scripts/parse_mld_xml.py index e3b6dd57ae..fb1dc8e73a 100644 --- a/scripts/parse_mld_xml.py +++ b/scripts/parse_mld_xml.py @@ -8,30 +8,44 @@ Parse a junit report and create a MLD summary report. """ # Main routine -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Parse a junit report and create a MLD summary report.') - parser.add_argument('xml_report',type=str,help='XML junit report input file, e.g. report-junit.xml') - parser.add_argument('csv_file',type=str,help='Output CSV file, e.g. mld.csv') +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Parse a junit report and create a MLD summary report." + ) + parser.add_argument( + "xml_report", + type=str, + help="XML junit report input file, e.g. report-junit.xml", + ) + parser.add_argument("csv_file", type=str, help="Output CSV file, e.g. mld.csv") args = parser.parse_args() xml_report = args.xml_report - csv_file = args.csv_file + csv_file = args.csv_file tree = ElementTree.parse(xml_report) testsuite = tree.find(".//testsuite") - print(f"Found testsuite with {testsuite.get('tests')} tests and {testsuite.get('failures')} failures.") + print( + f"Found testsuite with {testsuite.get('tests')} tests and {testsuite.get('failures')} failures." + ) testcases = tree.findall(".//testcase") - with open(csv_file,'w') as outfile: + with open(csv_file, "w") as outfile: for testcase in testcases: - if testcase.find('.//skipped') == None: - if testcase.get('file') == None: - fulltestname = testcase.get('classname').replace('.','/') + ".py::" + testcase.get('name') + if testcase.find(".//skipped") == None: + if testcase.get("file") == None: + fulltestname = ( + testcase.get("classname").replace(".", "/") + + ".py::" + + testcase.get("name") + ) else: - fulltestname = testcase.get('file') + "::" + testcase.get('name') - if testcase.find('.//property') == None: + fulltestname = testcase.get("file") + "::" + testcase.get("name") + if testcase.find(".//property") == None: mld_val = None else: - mld_val = testcase.find('.//property').get('value') # Currently MLD is the only set property. If more are added updates are needed here. - outfile.write(fulltestname + ';' + str(mld_val)+'\n') + mld_val = testcase.find(".//property").get( + "value" + ) # Currently MLD is the only set property. If more are added updates are needed here. + outfile.write(fulltestname + ";" + str(mld_val) + "\n") diff --git a/scripts/parse_selftest_summary.py b/scripts/parse_selftest_summary.py index 8f03942e25..21aaa9e96e 100755 --- a/scripts/parse_selftest_summary.py +++ b/scripts/parse_selftest_summary.py @@ -32,8 +32,8 @@ """Parse the output from self_test.py, self_test_summary.txt, and check for test success.""" -import sys import re +import sys from pathlib import Path HERE = Path(__file__).parent.resolve() diff --git a/scripts/plot_meta_data.py b/scripts/plot_meta_data.py index 78d7bf5314..cc7962447f 100755 --- a/scripts/plot_meta_data.py +++ b/scripts/plot_meta_data.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__license__ = \ -""" +__license__ = """ (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, @@ -31,8 +30,7 @@ __license__ = \ the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ Script to plot meta data. USAGE : plot_meta_data.py text_file containing the data @@ -72,10 +70,11 @@ The following format of C code is to be used for dumping metadata to plot using """ import sys + import numpy as np -from bokeh.plotting import figure, show, output_file, save from bokeh.layouts import column from bokeh.palettes import Set3 +from bokeh.plotting import figure, output_file, save, show class metadata: @@ -211,4 +210,4 @@ if __name__ == "__main__": ) ) exit() - sys.exit(main(sys.argv)) \ No newline at end of file + sys.exit(main(sys.argv)) diff --git a/scripts/prepare_combined_format_inputs.py b/scripts/prepare_combined_format_inputs.py index c1ff088151..c081b75bb1 100755 --- a/scripts/prepare_combined_format_inputs.py +++ b/scripts/prepare_combined_format_inputs.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__license__ = \ -""" +__license__ = """ (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, @@ -35,109 +34,144 @@ import os import shutil import numpy as np +from pyaudio3dtools import audioarray, audiofile -from pyaudio3dtools import audiofile, audioarray def main(): FS = [48, 32, 16] # scripts/testv/ path - input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'testv') - output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'testv') + input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testv") + output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testv") - print(f'Writing new files into {output_dir}') + print(f"Writing new files into {output_dir}") # # prepare combined input for OMASA tests force_overwrite = False # overwrite existing files # define MASA test item files - masa_alts = ({'masa_meta_file': 'stv2MASA2TC{}c.met', - 'masa_audio_file': 'stv2MASA2TC{}c.wav', - 'masa_tag': '2MASA2TC'}, - {'masa_meta_file': 'stv2MASA1TC{}c.met', - 'masa_audio_file': 'stv2MASA1TC{}c.wav', - 'masa_tag': '2MASA1TC'}, - {'masa_meta_file': 'stv1MASA2TC{}c.met', - 'masa_audio_file': 'stv1MASA2TC{}c.wav', - 'masa_tag': '1MASA2TC'}, - {'masa_meta_file': 'stv1MASA1TC{}c.met', - 'masa_audio_file': 'stv1MASA1TC{}c.wav', - 'masa_tag': '1MASA1TC'}) - - sba_alts = ({'sba_audio_file': 'stvFOA{}c.wav', - 'sba_tag': 'FOA'}, - {'sba_audio_file': 'stv2OA{}c.wav', - 'sba_tag': '2OA'}, - {'sba_audio_file': 'stv3OA{}c.wav', - 'sba_tag': '3OA'}) + masa_alts = ( + { + "masa_meta_file": "stv2MASA2TC{}c.met", + "masa_audio_file": "stv2MASA2TC{}c.wav", + "masa_tag": "2MASA2TC", + }, + { + "masa_meta_file": "stv2MASA1TC{}c.met", + "masa_audio_file": "stv2MASA1TC{}c.wav", + "masa_tag": "2MASA1TC", + }, + { + "masa_meta_file": "stv1MASA2TC{}c.met", + "masa_audio_file": "stv1MASA2TC{}c.wav", + "masa_tag": "1MASA2TC", + }, + { + "masa_meta_file": "stv1MASA1TC{}c.met", + "masa_audio_file": "stv1MASA1TC{}c.wav", + "masa_tag": "1MASA1TC", + }, + ) + + sba_alts = ( + {"sba_audio_file": "stvFOA{}c.wav", "sba_tag": "FOA"}, + {"sba_audio_file": "stv2OA{}c.wav", "sba_tag": "2OA"}, + {"sba_audio_file": "stv3OA{}c.wav", "sba_tag": "3OA"}, + ) # files containing 1-4 ISMs as channels - ism_files = ('stv1ISM48s.wav', 'stv2ISM48s.wav', 'stv3ISM48s.wav', 'stv4ISM48s.wav') + ism_files = ("stv1ISM48s.wav", "stv2ISM48s.wav", "stv3ISM48s.wav", "stv4ISM48s.wav") # per-object metadata - ism_meta_files = ('stvISM1.csv', 'stvISM2.csv', 'stvISM3.csv', 'stvISM4.csv') + ism_meta_files = ("stvISM1.csv", "stvISM2.csv", "stvISM3.csv", "stvISM4.csv") wrote_files = [] for fs in FS: - for enum_idx, (ism_audio_file, ism_meta_file) in enumerate(zip(ism_files, ism_meta_files)): + for enum_idx, (ism_audio_file, ism_meta_file) in enumerate( + zip(ism_files, ism_meta_files) + ): n_isms = enum_idx + 1 - ism_audio, ism_fs = audiofile.readfile(filename=os.path.join(input_dir, ism_audio_file)) + ism_audio, ism_fs = audiofile.readfile( + filename=os.path.join(input_dir, ism_audio_file) + ) # no stv MASA files in other sampling rates available currently if fs == 48: for masa_item in masa_alts: - masa_tag = masa_item['masa_tag'] - masa_audio_file = masa_item['masa_audio_file'].format(fs) - meta_file = masa_item['masa_meta_file'].format(fs) + masa_tag = masa_item["masa_tag"] + masa_audio_file = masa_item["masa_audio_file"].format(fs) + meta_file = masa_item["masa_meta_file"].format(fs) - omasa_file_body = f'stvOMASA_{n_isms}ISM_{masa_tag}{fs}c' - omasa_file = os.path.join(output_dir, f'{omasa_file_body}.wav') + omasa_file_body = f"stvOMASA_{n_isms}ISM_{masa_tag}{fs}c" + omasa_file = os.path.join(output_dir, f"{omasa_file_body}.wav") if not os.path.exists(omasa_file) or force_overwrite: - audiofile.combinefiles(in_filenames=[os.path.join(input_dir, ism_audio_file), - os.path.join(input_dir, masa_audio_file)], - out_file=omasa_file, - in_fs=fs * 1000) + audiofile.combinefiles( + in_filenames=[ + os.path.join(input_dir, ism_audio_file), + os.path.join(input_dir, masa_audio_file), + ], + out_file=omasa_file, + in_fs=fs * 1000, + ) wrote_files.append(omasa_file) # copy ISM metadata files under names matching the combined file for ism_idx in range(n_isms): - ism_file_name = os.path.join(output_dir, f'{omasa_file_body}_ISM{ism_idx+1}{os.path.splitext(ism_meta_file)[1]}') + ism_file_name = os.path.join( + output_dir, + f"{omasa_file_body}_ISM{ism_idx+1}{os.path.splitext(ism_meta_file)[1]}", + ) if not os.path.exists(ism_file_name) or force_overwrite: - shutil.copyfile(os.path.join(input_dir, ism_meta_file), ism_file_name) + shutil.copyfile( + os.path.join(input_dir, ism_meta_file), ism_file_name + ) wrote_files.append(ism_file_name) # copy MASA metadata file under a matching name - masa_meta_name = os.path.join(output_dir, f'{omasa_file_body}{os.path.splitext(meta_file)[1]}') + masa_meta_name = os.path.join( + output_dir, f"{omasa_file_body}{os.path.splitext(meta_file)[1]}" + ) if not os.path.exists(masa_meta_name) or force_overwrite: - shutil.copyfile(os.path.join(input_dir, meta_file), masa_meta_name) + shutil.copyfile( + os.path.join(input_dir, meta_file), masa_meta_name + ) wrote_files.append(masa_meta_name) for sba_item in sba_alts: - sba_tag = sba_item['sba_tag'] - sba_audio_file = sba_item['sba_audio_file'].format(fs) + sba_tag = sba_item["sba_tag"] + sba_audio_file = sba_item["sba_audio_file"].format(fs) - osba_file_body = f'stvOSBA_{n_isms}ISM_{sba_tag}{fs}c' - osba_file = os.path.join(output_dir, f'{osba_file_body}.wav') + osba_file_body = f"stvOSBA_{n_isms}ISM_{sba_tag}{fs}c" + osba_file = os.path.join(output_dir, f"{osba_file_body}.wav") if not os.path.exists(osba_file) or force_overwrite: - audiofile.combinefiles(in_filenames=[os.path.join(input_dir, ism_audio_file), - os.path.join(input_dir, sba_audio_file)], - out_file=osba_file, - in_fs=fs * 1000) + audiofile.combinefiles( + in_filenames=[ + os.path.join(input_dir, ism_audio_file), + os.path.join(input_dir, sba_audio_file), + ], + out_file=osba_file, + in_fs=fs * 1000, + ) wrote_files.append(osba_file) # copy ISM metadata files under names matching the combined file for ism_idx in range(n_isms): - ism_file_name = os.path.join(output_dir, f'{osba_file_body}_ISM{ism_idx+1}{os.path.splitext(ism_meta_file)[1]}') + ism_file_name = os.path.join( + output_dir, + f"{osba_file_body}_ISM{ism_idx+1}{os.path.splitext(ism_meta_file)[1]}", + ) if not os.path.exists(ism_file_name) or force_overwrite: - shutil.copyfile(os.path.join(input_dir, ism_meta_file), ism_file_name) + shutil.copyfile( + os.path.join(input_dir, ism_meta_file), ism_file_name + ) wrote_files.append(ism_file_name) - # info print. helps setting up .gitignore if len(wrote_files) > 0: - print('New files written: {}'.format('\n'.join(wrote_files))) + print("New files written: {}".format("\n".join(wrote_files))) + if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/scripts/prepare_mem_dryrun.py b/scripts/prepare_mem_dryrun.py index 20da546c19..ff186a4510 100755 --- a/scripts/prepare_mem_dryrun.py +++ b/scripts/prepare_mem_dryrun.py @@ -1,10 +1,12 @@ #!/usr/bin/env python3 -import re, os, fnmatch +import fnmatch +import os +import re -sub = ['free','malloc','calloc'] -dirs = ['./lib_com','./lib_enc','./lib_dec','./lib_rend'] -suffix = '*.c' +sub = ["free", "malloc", "calloc"] +dirs = ["./lib_com", "./lib_enc", "./lib_dec", "./lib_rend"] +suffix = "*.c" skip = 0 @@ -13,18 +15,17 @@ for d in dirs: for path, ds, files in os.walk(d): for filename in fnmatch.filter(files, suffix): fileIn = os.path.join(path, filename) - with open(fileIn, 'r') as f_in: + with open(fileIn, "r") as f_in: lines = f_in.readlines() - with open(fileIn, 'w') as f_out: + with open(fileIn, "w") as f_out: skip = 0 for line in lines: - if re.search(r'#define\W+WMC_TOOL_SKIP', line): + if re.search(r"#define\W+WMC_TOOL_SKIP", line): skip = 1 - elif re.search(r'#undef\W+WMC_TOOL_SKIP', line): + elif re.search(r"#undef\W+WMC_TOOL_SKIP", line): skip = 0 else: if not skip: for s in sub: - line = re.sub(r'\b%s\b' % (s), '%s' % (s+'_'), line) + line = re.sub(r"\b%s\b" % (s), "%s" % (s + "_"), line) f_out.write(line) - diff --git a/scripts/pyaudio3dtools/__init__.py b/scripts/pyaudio3dtools/__init__.py index d4588ecbeb..ccf53c51e1 100644 --- a/scripts/pyaudio3dtools/__init__.py +++ b/scripts/pyaudio3dtools/__init__.py @@ -40,8 +40,4 @@ Imports functions class """ -from . import ( - audioarray, - audiofile, - spatialaudioformat, -) +from . import audioarray, audiofile, spatialaudioformat diff --git a/scripts/pyaudio3dtools/audio3dtools.py b/scripts/pyaudio3dtools/audio3dtools.py index e185a7a58f..0fec5c6ce9 100755 --- a/scripts/pyaudio3dtools/audio3dtools.py +++ b/scripts/pyaudio3dtools/audio3dtools.py @@ -34,10 +34,7 @@ import argparse import logging import os -from pyaudio3dtools import ( - audiofile, - spatialaudioformat, -) +from pyaudio3dtools import audiofile, spatialaudioformat main_logger = logging.getLogger("__main__") logger = main_logger.getChild(__name__) diff --git a/scripts/pyaudio3dtools/audioarray.py b/scripts/pyaudio3dtools/audioarray.py index 6a1b5b56e2..8fabd5ca1c 100644 --- a/scripts/pyaudio3dtools/audioarray.py +++ b/scripts/pyaudio3dtools/audioarray.py @@ -32,16 +32,16 @@ import logging import math -from typing import Callable, Iterable, Optional, Tuple - -import numpy as np import multiprocessing as mp -import scipy.signal as sig -import scipy.io.wavfile as wavfile -import subprocess import platform +import subprocess import tempfile from pathlib import Path +from typing import Callable, Iterable, Optional, Tuple + +import numpy as np +import scipy.io.wavfile as wavfile +import scipy.signal as sig main_logger = logging.getLogger("__main__") logger = main_logger.getChild(__name__) @@ -226,7 +226,13 @@ def cut(x: np.ndarray, limits: Tuple[int, int]) -> np.ndarray: return y -def compare(ref: np.ndarray, test: np.ndarray, fs: int, per_frame: bool = True, get_mld: bool = False) -> dict: +def compare( + ref: np.ndarray, + test: np.ndarray, + fs: int, + per_frame: bool = True, + get_mld: bool = False, +) -> dict: """Compare two audio arrays Parameters @@ -314,13 +320,13 @@ def compare(ref: np.ndarray, test: np.ndarray, fs: int, per_frame: bool = True, result["nframes_diff_percentage"] = nframes_diff_percentage if get_mld: - + mld_max = 0 toolsdir = Path(__file__).parent.parent.joinpath("tools") if platform.system() == "Windows": - mld = toolsdir.joinpath( "Win32").joinpath("mld.exe" ) + mld = toolsdir.joinpath("Win32").joinpath("mld.exe") elif platform.system() in ["Linux", "Darwin"]: - mld = toolsdir.joinpath(platform.system()).joinpath( "mld" ) + mld = toolsdir.joinpath(platform.system()).joinpath("mld") else: assert False, f"MLD tool not available for {platform.system()}" @@ -328,11 +334,11 @@ def compare(ref: np.ndarray, test: np.ndarray, fs: int, per_frame: bool = True, for i in range(nchannels): tmpfile_ref = Path(tmpdir).joinpath(f"ref_ch{i+1}.wav") tmpfile_test = Path(tmpdir).joinpath(f"test_ch{i+1}.wav") - r48 = resample(ref[:,i], fs, 48000); - t48 = resample(test[:,i], fs, 48000); + r48 = resample(ref[:, i], fs, 48000) + t48 = resample(test[:, i], fs, 48000) wavfile.write(str(tmpfile_ref), 48000, r48) wavfile.write(str(tmpfile_test), 48000, t48) - out = subprocess.check_output([mld,tmpfile_ref,tmpfile_test]) + out = subprocess.check_output([mld, tmpfile_ref, tmpfile_test]) mld_max = max(mld_max, float(out.split()[3])) result["MLD"] = mld_max diff --git a/scripts/pyaudio3dtools/audiofile.py b/scripts/pyaudio3dtools/audiofile.py index e790de7e09..d3153e21db 100644 --- a/scripts/pyaudio3dtools/audiofile.py +++ b/scripts/pyaudio3dtools/audiofile.py @@ -42,7 +42,6 @@ from typing import Optional, Tuple import numpy as np import scipy.io.wavfile as wav - from pyaudio3dtools import audioarray, spatialaudioformat diff --git a/scripts/pyaudio3dtools/spatialaudioformat.py b/scripts/pyaudio3dtools/spatialaudioformat.py index c223b28917..ee8c6315be 100644 --- a/scripts/pyaudio3dtools/spatialaudioformat.py +++ b/scripts/pyaudio3dtools/spatialaudioformat.py @@ -357,150 +357,126 @@ _format_configs = { "altname": "meta", }, # OSBA Formats - "OSBA_ISM1_HOA3": - { - "name": "OSBA_ISM1_HOA3", - "ambi_order": 3, - "isplanar": False, - "nchannels": 17, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba3_ism1", - - }, - "OSBA_ISM1_HOA2": - { - "name": "OSBA_ISM1_HOA2", - "ambi_order": 2, - "isplanar": False, - "nchannels": 10, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba2_ism1", - - }, - "OSBA_ISM1_FOA": - { - "name": "OSBA_ISM1_FOA", - "ambi_order": 1, - "isplanar": False, - "nchannels": 5, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba1_ism1", - - }, - "OSBA_ISM2_HOA3": - { - "name": "OSBA_ISM2_HOA3", - "ambi_order": 3, - "isplanar": False, - "nchannels": 18, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba3_ism2", - - }, - "OSBA_ISM2_HOA2": - { - "name": "OSBA_ISM2_HOA2", - "ambi_order": 2, - "isplanar": False, - "nchannels": 11, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba2_ism2", - - }, - "OSBA_ISM2_FOA": - { - "name": "OSBA_ISM2_FOA", - "ambi_order": 1, - "isplanar": False, - "nchannels": 6, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba1_ism2", - - }, - "OSBA_ISM3_HOA3": - { - "name": "OSBA_ISM3_HOA3", - "ambi_order": 3, - "isplanar": False, - "nchannels": 19, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba3_ism3", - - }, - "OSBA_ISM3_HOA2": - { - "name": "OSBA_ISM3_HOA2", - "ambi_order": 2, - "isplanar": False, - "nchannels": 12, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba2_ism3", - - }, - "OSBA_ISM3_FOA": - { - "name": "OSBA_ISM3_FOA", - "ambi_order": 1, - "isplanar": False, - "nchannels": 7, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba1_ism3", - - }, - "OSBA_ISM4_HOA3": - { - "name": "OSBA_ISM4_HOA3", - "ambi_order": 3, - "isplanar": False, - "nchannels": 20, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba3_ism4", - - }, - "OSBA_ISM4_HOA2": - { - "name": "OSBA_ISM4_HOA2", - "ambi_order": 2, - "isplanar": False, - "nchannels": 13, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba2_ism4", - - }, - "OSBA_ISM4_FOA": - { - "name": "OSBA_ISM4_FOA", - "ambi_order": 1, - "isplanar": False, - "nchannels": 8, - "isloudspeaker": False, - "isheadphones": False, - "lfe_index": [], - "altname": "osba1_ism4", - - }, + "OSBA_ISM1_HOA3": { + "name": "OSBA_ISM1_HOA3", + "ambi_order": 3, + "isplanar": False, + "nchannels": 17, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba3_ism1", + }, + "OSBA_ISM1_HOA2": { + "name": "OSBA_ISM1_HOA2", + "ambi_order": 2, + "isplanar": False, + "nchannels": 10, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba2_ism1", + }, + "OSBA_ISM1_FOA": { + "name": "OSBA_ISM1_FOA", + "ambi_order": 1, + "isplanar": False, + "nchannels": 5, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba1_ism1", + }, + "OSBA_ISM2_HOA3": { + "name": "OSBA_ISM2_HOA3", + "ambi_order": 3, + "isplanar": False, + "nchannels": 18, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba3_ism2", + }, + "OSBA_ISM2_HOA2": { + "name": "OSBA_ISM2_HOA2", + "ambi_order": 2, + "isplanar": False, + "nchannels": 11, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba2_ism2", + }, + "OSBA_ISM2_FOA": { + "name": "OSBA_ISM2_FOA", + "ambi_order": 1, + "isplanar": False, + "nchannels": 6, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba1_ism2", + }, + "OSBA_ISM3_HOA3": { + "name": "OSBA_ISM3_HOA3", + "ambi_order": 3, + "isplanar": False, + "nchannels": 19, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba3_ism3", + }, + "OSBA_ISM3_HOA2": { + "name": "OSBA_ISM3_HOA2", + "ambi_order": 2, + "isplanar": False, + "nchannels": 12, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba2_ism3", + }, + "OSBA_ISM3_FOA": { + "name": "OSBA_ISM3_FOA", + "ambi_order": 1, + "isplanar": False, + "nchannels": 7, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba1_ism3", + }, + "OSBA_ISM4_HOA3": { + "name": "OSBA_ISM4_HOA3", + "ambi_order": 3, + "isplanar": False, + "nchannels": 20, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba3_ism4", + }, + "OSBA_ISM4_HOA2": { + "name": "OSBA_ISM4_HOA2", + "ambi_order": 2, + "isplanar": False, + "nchannels": 13, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba2_ism4", + }, + "OSBA_ISM4_FOA": { + "name": "OSBA_ISM4_FOA", + "ambi_order": 1, + "isplanar": False, + "nchannels": 8, + "isloudspeaker": False, + "isheadphones": False, + "lfe_index": [], + "altname": "osba1_ism4", + }, } # Channel indices of planar Ambisonic components of ACN diff --git a/scripts/pyivastest/IvasBaseClass.py b/scripts/pyivastest/IvasBaseClass.py index ce19cc0f55..bad578f753 100644 --- a/scripts/pyivastest/IvasBaseClass.py +++ b/scripts/pyivastest/IvasBaseClass.py @@ -30,16 +30,23 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ +import filecmp +import json import logging import logging.handlers import os -import sys -import filecmp -import json import platform -from .constants import LOG_FILE_EXT, DECODER_OUTPUT_CONFIGS, LOG_FILE_DIR,SCRIPTS_CONFIGS_DIR, DEFAULT_IVAS_FORMAT_FILE -from copy import deepcopy import re +import sys +from copy import deepcopy + +from .constants import ( + DECODER_OUTPUT_CONFIGS, + DEFAULT_IVAS_FORMAT_FILE, + LOG_FILE_DIR, + LOG_FILE_EXT, + SCRIPTS_CONFIGS_DIR, +) PROGRESS = 70 CONSOLE = 80 @@ -302,31 +309,39 @@ class IvasBaseClass(object): @staticmethod def get_enc_file_name(path: str, item_base_name: str, mode: str) -> str: - return os.path.join(path, "enc", ''.join([item_base_name, "_", mode, ".192"])) - + return os.path.join(path, "enc", "".join([item_base_name, "_", mode, ".192"])) @staticmethod - def get_enc_log_file_name(path: str, item_base_name: str, mode: str, log_dir = LOG_FILE_DIR) -> str: - enc_log_name_tmp = ''.join([item_base_name, "_", mode, ".enc", LOG_FILE_EXT]) + def get_enc_log_file_name( + path: str, item_base_name: str, mode: str, log_dir=LOG_FILE_DIR + ) -> str: + enc_log_name_tmp = "".join([item_base_name, "_", mode, ".enc", LOG_FILE_EXT]) enc_log_name = os.path.join(path, log_dir, enc_log_name_tmp) return enc_log_name @staticmethod - def get_dec_file_name(path: str, item_base_name:str, output_config:str, out_ext=".wav") -> str: + def get_dec_file_name( + path: str, item_base_name: str, output_config: str, out_ext=".wav" + ) -> str: output_config_desc = IvasBaseClass.get_oc_desc(output_config) - dec_file_name = os.path.join(path, "dec", - ''.join([item_base_name, ".dec.", output_config_desc, out_ext])) + dec_file_name = os.path.join( + path, "dec", "".join([item_base_name, ".dec.", output_config_desc, out_ext]) + ) return dec_file_name @staticmethod - def get_dec_log_file_name(path: str, item_base_name:str, output_config:str, log_dir = LOG_FILE_DIR): + def get_dec_log_file_name( + path: str, item_base_name: str, output_config: str, log_dir=LOG_FILE_DIR + ): output_config_desc = IvasBaseClass.get_oc_desc(output_config) - dec_log_name_tmp = ''.join([item_base_name, ".dec.", output_config_desc, LOG_FILE_EXT]) + dec_log_name_tmp = "".join( + [item_base_name, ".dec.", output_config_desc, LOG_FILE_EXT] + ) dec_log_name = os.path.join(path, log_dir, dec_log_name_tmp) return dec_log_name @staticmethod - def get_oc_desc(output_config:str) -> str: + def get_oc_desc(output_config: str) -> str: if output_config.upper() not in DECODER_OUTPUT_CONFIGS: output_config_desc = os.path.splitext(os.path.basename(output_config))[0] else: @@ -343,7 +358,7 @@ class IvasBaseClass(object): format_file = os.path.join(SCRIPTS_CONFIGS_DIR, format_file) if not os.path.exists(format_file): return None - with open(format_file, 'r') as fp: + with open(format_file, "r") as fp: all_formats = IvasBaseClass.generate_all_formats(json.load(fp)) return all_formats @@ -352,9 +367,11 @@ class IvasBaseClass(object): def generate_all_formats(all_formats_json: dict) -> dict: all_formats = None if all_formats_json is not None: - if 'version' in all_formats_json: - if all_formats_json['version'] == 2: - all_formats = IvasBaseClass.generate_all_formats_v2(all_formats_json) + if "version" in all_formats_json: + if all_formats_json["version"] == 2: + all_formats = IvasBaseClass.generate_all_formats_v2( + all_formats_json + ) else: all_formats = all_formats_json return all_formats @@ -366,36 +383,56 @@ class IvasBaseClass(object): if ivas_format != "version": if all_formats is None: all_formats = {} - all_formats.update({ivas_format:{}}) + all_formats.update({ivas_format: {}}) for mode_group in all_formats_json[ivas_format]: - for bw in all_formats_json[ivas_format][mode_group]['bitrates']: - for br in all_formats_json[ivas_format][mode_group]['bitrates'][bw]: - new_mode_dict=deepcopy(all_formats_json[ivas_format][mode_group]) - if new_mode_dict['rs'] == True: + for bw in all_formats_json[ivas_format][mode_group]["bitrates"]: + for br in all_formats_json[ivas_format][mode_group]["bitrates"][ + bw + ]: + new_mode_dict = deepcopy( + all_formats_json[ivas_format][mode_group] + ) + if new_mode_dict["rs"] == True: table_bitrate = br - bitrate = all_formats_json[ivas_format][mode_group]['bitrates'][bw][br] - mode_bitrate = br.replace("/","_") + bitrate = all_formats_json[ivas_format][mode_group][ + "bitrates" + ][bw][br] + mode_bitrate = br.replace("/", "_") else: - #make sure the modes have the same names as the v1 ones... - if br%1000 == 0 and (br > 10000 and not all_formats_json[ivas_format][mode_group]['amr']): + # make sure the modes have the same names as the v1 ones... + if br % 1000 == 0 and ( + br > 10000 + and not all_formats_json[ivas_format][mode_group][ + "amr" + ] + ): table_bitrate = br // 1000 mode_bitrate = str(table_bitrate) else: - table_bitrate = (br // 100)/10 - mode_bitrate = f"{table_bitrate:04.1f}".replace(".","_") - bitrate=br - new_mode_dict.pop('bitrates') - new_mode_dict['bw'] = bw - new_mode_dict['bitrate']=bitrate - new_mode_dict['table_name'] = new_mode_dict['table_name'].format(table_bitrate=table_bitrate, bandwidth=bw.upper()) - new_mode_dict['encoptions'] = [x.format(bandwidth=bw) for x in new_mode_dict['encoptions']] - - new_mode=mode_group.format(bitrate=mode_bitrate,bandwidth=bw) - all_formats[ivas_format].update({new_mode:new_mode_dict}) - + table_bitrate = (br // 100) / 10 + mode_bitrate = f"{table_bitrate:04.1f}".replace( + ".", "_" + ) + bitrate = br + new_mode_dict.pop("bitrates") + new_mode_dict["bw"] = bw + new_mode_dict["bitrate"] = bitrate + new_mode_dict["table_name"] = new_mode_dict[ + "table_name" + ].format(table_bitrate=table_bitrate, bandwidth=bw.upper()) + new_mode_dict["encoptions"] = [ + x.format(bandwidth=bw) + for x in new_mode_dict["encoptions"] + ] + + new_mode = mode_group.format( + bitrate=mode_bitrate, bandwidth=bw + ) + all_formats[ivas_format].update({new_mode: new_mode_dict}) return all_formats + if __name__ == "__main__": import time diff --git a/scripts/pyivastest/IvasModeAnalyzer.py b/scripts/pyivastest/IvasModeAnalyzer.py index 9f52a90636..8d1dd2ddf0 100644 --- a/scripts/pyivastest/IvasModeAnalyzer.py +++ b/scripts/pyivastest/IvasModeAnalyzer.py @@ -30,17 +30,16 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ +import functools +import logging +import operator import os import re -import operator from copy import deepcopy -import logging -import functools -from pyivastest.IvasModeCollector import IvasModeCollector from pyivastest.constants import LOG_FILE_EXT from pyivastest.IvasBaseClass import IvasBaseClass - +from pyivastest.IvasModeCollector import IvasModeCollector INSTRUMENTED_RESULTS = { "WMOPS": { @@ -288,27 +287,32 @@ class IvasModeAnalyzer(IvasModeCollector): Returns ------- - + First value extracted from the line in the log file containing all keywords """ - + if type(keywords) != list: keywords = [keywords] - + if os.path.exists(filename): fp = open(filename) loglines = fp.readlines() fp.close() - matching_lines = [line for line in loglines if all(keyword in line for keyword in keywords)] + matching_lines = [ + line + for line in loglines + if all(keyword in line for keyword in keywords) + ] for line in matching_lines: - all_values_on_line = [float(s) for s in line.split() if re.match(r'^[0-9\.]*$', s)] + all_values_on_line = [ + float(s) for s in line.split() if re.match(r"^[0-9\.]*$", s) + ] if all_values_on_line: return all_values_on_line[position] - + return -1.0 - def sort_log_modes(self): list_to_sort = [] @@ -527,13 +531,18 @@ class IvasModeAnalyzer(IvasModeCollector): elif encdec == 4: if max_or_add == "add": total = number_format.format( - float(enc_value) + float(dec_value) + float(com_value) + float(rend_value) + float(enc_value) + + float(dec_value) + + float(com_value) + + float(rend_value) ) elif max_or_add == "max": total = number_format.format( max( float(enc_value) + float(com_value), - float(dec_value) + float(com_value) + float(rend_value), + float(dec_value) + + float(com_value) + + float(rend_value), ) ) result_line = [ @@ -686,7 +695,9 @@ class IvasModeAnalyzer(IvasModeCollector): if self.global_bitstream_processing is not None: suffices = self.get_bs_processing_suffices(self.global_bitstream_processing) - dec_item_base_name = "_".join([x for x in [item, mode, suffices] if x is not None]) + dec_item_base_name = "_".join( + [x for x in [item, mode, suffices] if x is not None] + ) log_name = IvasBaseClass.get_dec_log_file_name(self.dir, dec_item_base_name, oc) return log_name @@ -944,10 +955,10 @@ class IvasModeAnalyzer(IvasModeCollector): ------- """ - + if not os.path.exists(os.path.dirname(csv_file_name)): os.makedirs(os.path.dirname(csv_file_name)) - + with open(csv_file_name + ".csv", "w", newline="\n") as f: header = result_table.pop(0) # write header diff --git a/scripts/pyivastest/IvasModeCollector.py b/scripts/pyivastest/IvasModeCollector.py index fbba5f6ae2..3255dc3a8a 100644 --- a/scripts/pyivastest/IvasModeCollector.py +++ b/scripts/pyivastest/IvasModeCollector.py @@ -30,15 +30,16 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ -import re import json +import logging import os import os.path import platform -import logging +import re from copy import deepcopy -from pyivastest import IvasBaseClass -from pyivastest import constants + +from pyivastest import IvasBaseClass, constants + class IvasModeCollector(IvasBaseClass.IvasBaseClass): """ @@ -70,15 +71,24 @@ class IvasModeCollector(IvasBaseClass.IvasBaseClass): self.all_formats = formats_dict else: if not formats_fname: - formats_fname = os.path.join(constants.SCRIPTS_CONFIGS_DIR, constants.DEFAULT_IVAS_FORMAT_FILE) + formats_fname = os.path.join( + constants.SCRIPTS_CONFIGS_DIR, constants.DEFAULT_IVAS_FORMAT_FILE + ) self.all_formats = self.read_format_dict(formats_fname) if self.all_formats is None: # fall back to standard self.logger.warning( "IVAS Format dictonary file {} does not exist, falling back to {}!".format( - formats_fname,constants.DEFAULT_IVAS_FORMAT_FILE)) - self.all_formats = self.read_format_dict(os.path.join(constants.SCRIPTS_CONFIGS_DIR, constants.DEFAULT_IVAS_FORMAT_FILE)) - #fp.close() + formats_fname, constants.DEFAULT_IVAS_FORMAT_FILE + ) + ) + self.all_formats = self.read_format_dict( + os.path.join( + constants.SCRIPTS_CONFIGS_DIR, + constants.DEFAULT_IVAS_FORMAT_FILE, + ) + ) + # fp.close() self.flat_mode_list = None have_site_config_file = False diff --git a/scripts/pyivastest/IvasModeRunner.py b/scripts/pyivastest/IvasModeRunner.py index 79da317d0e..27f013ee8d 100644 --- a/scripts/pyivastest/IvasModeRunner.py +++ b/scripts/pyivastest/IvasModeRunner.py @@ -30,24 +30,24 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ -import os -import subprocess -import threading import concurrent.futures -import time +import json import logging import logging.handlers +import os import platform +import re +import subprocess +import threading +import time import traceback from copy import deepcopy -import re -import json -from pyivastest import IvasModeCollector -from pyivastest import constants -from pyaudio3dtools.spatialaudioformat import Format as spformat -import pyaudio3dtools.audiofile as af import pyaudio3dtools.audioarray as ar +import pyaudio3dtools.audiofile as af +from pyaudio3dtools.spatialaudioformat import Format as spformat +from pyivastest import IvasModeCollector, constants + BW_TO_SR = {"nb": 8, "wb": 16, "swb": 32, "fb": 48} RET_CODE_TIMEOUT_EXP = 9999 @@ -260,10 +260,14 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): if self.pcm_out is True: out_ext = ".pcm" - dec_log_name = self.get_dec_log_file_name(self.dir_name,item_base_name,output_config) + dec_log_name = self.get_dec_log_file_name( + self.dir_name, item_base_name, output_config + ) dec_log = open(dec_log_name, "w") if config["enc_returncode"] == 0: - dec_file_name = self.get_dec_file_name(self.dir_name, item_base_name, output_config, out_ext) + dec_file_name = self.get_dec_file_name( + self.dir_name, item_base_name, output_config, out_ext + ) if self.sample_rate_dec_out: out_sr = self.sample_rate_dec_out else: @@ -323,7 +327,13 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): dec_log.write(" ".join(dec_cmd)) try: - cur_dec_result = subprocess.run(dec_cmd, capture_output=True, text=True, env=self.run_env, timeout=self.timeout) + cur_dec_result = subprocess.run( + dec_cmd, + capture_output=True, + text=True, + env=self.run_env, + timeout=self.timeout, + ) returncode = cur_dec_result.returncode dec_log.write(cur_dec_result.stderr) dec_log.write(cur_dec_result.stdout) @@ -333,11 +343,12 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): if returncode != 0: fail_string = "Decoding {} to {} failed!" if returncode == RET_CODE_TIMEOUT_EXP: - fail_string = fail_string[:-1] + f" due to timeout after {self.timeout} seconds!" + fail_string = ( + fail_string[:-1] + + f" due to timeout after {self.timeout} seconds!" + ) - self.logger.error( - fail_string.format(enc_file_name, dec_file_name) - ) + self.logger.error(fail_string.format(enc_file_name, dec_file_name)) self.lock.acquire() if self.stats: self.stats["num_dec_errors"] += 1 @@ -494,7 +505,10 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): str(sample_rate_in), "_", config["cmd"]["in_config"].upper(), - "_L{}-{}s".format("_".join(str(self.start_time).split(".")), "_".join(str(self.end_time).split("."))), + "_L{}-{}s".format( + "_".join(str(self.start_time).split(".")), + "_".join(str(self.end_time).split(".")), + ), ".pcm", ] ) @@ -547,9 +561,13 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): elif config["cmd"]["in_config"][0:4] == "OSBA": # get number of ISMs expected osba_ism_config = config["cmd"]["in_config"][5:9] - osba_ism_format_dict = spformat.get_format_dict(osba_ism_config) + osba_ism_format_dict = spformat.get_format_dict( + osba_ism_config + ) wav_info = af.get_wav_file_info(in_file_name_transformed) - osba_ambi_config = spformat.detect_format(wav_info["channels"] - osba_ism_format_dict["nchannels"]) + osba_ambi_config = spformat.detect_format( + wav_info["channels"] - osba_ism_format_dict["nchannels"] + ) in_format = f"OSBA_{osba_ism_config}_{osba_ambi_config}" # save in config as json file @@ -570,16 +588,27 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): # first check if start time exceeds signal length start_time_samples = int(float(self.start_time) * fs) if start_time_samples >= in_len: - raise RuntimeError("Signal is shorter than given start time") + raise RuntimeError( + "Signal is shorter than given start time" + ) end_time_samples = int(float(self.end_time) * fs) cut_len_samples = end_time_samples - start_time_samples - if cut_len_samples + start_time_samples < in_len or start_time_samples > 0: + if ( + cut_len_samples + start_time_samples < in_len + or start_time_samples > 0 + ): end_time_samples = min(end_time_samples, in_len) - sig = ar.cut(sig, (start_time_samples, end_time_samples)) + sig = ar.cut( + sig, (start_time_samples, end_time_samples) + ) - pcm_log.write("Limit signal length to {}:{} samples".format(start_time_samples, end_time_samples)) + pcm_log.write( + "Limit signal length to {}:{} samples".format( + start_time_samples, end_time_samples + ) + ) af.writefile(pcm_name_cpy_transformed, sig, fs) resamp_in_path = pcm_name_cpy_transformed @@ -587,7 +616,12 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): pcm_name_transformed = self.transform_path(pcm_name) pcm_log.write("Resampling to {}".format(out_fs)) - af.convertfile(resamp_in_path, pcm_name_transformed, in_fs=fs, out_fs=out_fs) + af.convertfile( + resamp_in_path, + pcm_name_transformed, + in_fs=fs, + out_fs=out_fs, + ) in_config = config["cmd"]["in_config"].upper() @@ -641,9 +675,9 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): # metadata is either explicitly taken from the respective command line args or, # if not given, the default pattern form the config is used to get filenames in - # the same dir as the input file. NULL for ISM MD has to be explicitly given, + # the same dir as the input file. NULL for ISM MD has to be explicitly given, # otherwise this may hapen without the user being aware and lead to unexpected results. - # If the default filenames from the configs do not point to existing files, the + # If the default filenames from the configs do not point to existing files, the # codec will complain later nummetadata = enc_dec_cmd["nummetadata"] if nummetadata > 0: @@ -657,21 +691,26 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): # if not enough md files explicitly given, try default pattern from config if len(md_files) != nummetadata: - default = os.path.join(in_dir, enc_dec_cmd["metadatafilenames"][0]) + default = os.path.join( + in_dir, enc_dec_cmd["metadatafilenames"][0] + ) for i in range(len(md_files), nummetadata): md_f = default.format(item=item_base_name, mdi=i + 1) if not os.path.exists(md_f): - self.logger.warning(f"Can't find default md file {md_f} for item {item_base_name}. Default to NULL") + self.logger.warning( + f"Can't find default md file {md_f} for item {item_base_name}. Default to NULL" + ) md_f = "NULL" md_files.append(md_f) - if "MASA" in in_format: masa_md = self.global_masa_metadata # if not explicitly given, try default pattern from config if masa_md is None: - default = os.path.join(in_dir, enc_dec_cmd["metadatafilenames"][-1]) + default = os.path.join( + in_dir, enc_dec_cmd["metadatafilenames"][-1] + ) masa_md = default.format(item=item_base_name) md_files.append(masa_md) @@ -709,16 +748,24 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): # inject the input file's ambisonic order if pcm_name in self.pcm_info: enc_cmd = [ - x.format(ambi_order=self.pcm_info[pcm_name]["ambi_order"]) - if "{ambi_order}" in x - else x + ( + x.format(ambi_order=self.pcm_info[pcm_name]["ambi_order"]) + if "{ambi_order}" in x + else x + ) for x in enc_cmd ] enc_log = open(enc_log_name, "w") enc_log.write(" ".join(enc_cmd)) try: - enc_result = subprocess.run(enc_cmd, capture_output=True, text=True, env=self.run_env, timeout=self.timeout) + enc_result = subprocess.run( + enc_cmd, + capture_output=True, + text=True, + env=self.run_env, + timeout=self.timeout, + ) error = enc_result.returncode enc_log.write(enc_result.stderr) enc_log.write(enc_result.stdout) @@ -813,7 +860,9 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): if error != 0: fail_string = "Encoding failed for {}" if error == RET_CODE_TIMEOUT_EXP: - fail_string = fail_string + f" due to timeout after {self.timeout} seconds" + fail_string = ( + fail_string + f" due to timeout after {self.timeout} seconds" + ) self.lock.acquire() if self.stats: @@ -1089,9 +1138,11 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): None, list( map( - lambda x: mode_dec_files[x][0] - if not os.path.exists(mode_dec_files[x][1]) - else None, + lambda x: ( + mode_dec_files[x][0] + if not os.path.exists(mode_dec_files[x][1]) + else None + ), range(len(mode_dec_files)), ) ), @@ -1371,7 +1422,6 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): "Binaries: Encoder {}, Decoder {}".format(self.encoder, self.decoder) ) - def check_and_create_out_dirs(self): if not os.path.exists(self.dir_name): self.logger.console( @@ -1524,7 +1574,9 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): with self.dec_queue["condition"]: dec_queue_empty = len(self.dec_queue["dec_entries"]) == 0 all_encoded = self.dec_queue["all_encoded"] - all_modes_done = self.stats["num_modes"] == self.stats["num_modes_finished"] + all_modes_done = ( + self.stats["num_modes"] == self.stats["num_modes_finished"] + ) if dec_queue_empty and all_encoded and all_modes_done: self.dec_queue["condition"].notify() @@ -1535,7 +1587,9 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): # can not reuse dec_queue_empty here, since there might be new items after waiting while len(self.dec_queue["dec_entries"]) != 0: config = self.dec_queue["dec_entries"].pop(0) - tasks_dec.append(executor.submit(self.ivas_dec_thread, config)) + tasks_dec.append( + executor.submit(self.ivas_dec_thread, config) + ) self.dec_queue["condition"].notify() diff --git a/scripts/pyivastest/IvasScriptsCommon.py b/scripts/pyivastest/IvasScriptsCommon.py index 02cf6a6b8b..f50307fd0d 100644 --- a/scripts/pyivastest/IvasScriptsCommon.py +++ b/scripts/pyivastest/IvasScriptsCommon.py @@ -31,14 +31,15 @@ """ import argparse -import os import json -import re -import multiprocessing -from pyivastest.IvasBaseClass import * -import pyivastest.constants as constants import logging +import multiprocessing +import os import platform +import re + +import pyivastest.constants as constants +from pyivastest.IvasBaseClass import * # make sure we have colored output using shell escapes correctly on windows if platform.system() == "Windows": # Only if we are running on Windows @@ -142,9 +143,9 @@ class IvasScriptArgParser(argparse.ArgumentParser): type=int, ) self.add_argument( - "--timeout", - help="Timeout duration for an individual encoder/decoder run", - default=None, + "--timeout", + help="Timeout duration for an individual encoder/decoder run", + default=None, ) if not minimal: self.add_argument( @@ -577,23 +578,27 @@ def runner_setup(runner, args): end = float(arg) except ValueError: try: - start, end = arg.split(':') + start, end = arg.split(":") start = float(start) end = float(end) except ValueError: raise ValueError(f"Given duration string {arg} is invalid") - + runner.end_time = end runner.start_time = start if "fer_file" in args.keys() or "ber_file" in args.keys(): # assert that the eid-xor tool is there - bin_ext="" + bin_ext = "" if platform.system() == "Windows": - bin_ext=".exe" - eid_xor_path = os.path.join(runner.config["utilPath"], "".join(["eid-xor", bin_ext])) + bin_ext = ".exe" + eid_xor_path = os.path.join( + runner.config["utilPath"], "".join(["eid-xor", bin_ext]) + ) if not os.path.isfile(eid_xor_path): - raise FileNotFoundError(f"Could not find {eid_xor_path} (needed for error pattern insertion)") + raise FileNotFoundError( + f"Could not find {eid_xor_path} (needed for error pattern insertion)" + ) if args["fer_file"]: fer_suffix = "fer_{}".format( @@ -688,7 +693,7 @@ def runner_setup(runner, args): metadata_files = list() if args["ism_metadata_files"] != []: for f in args["ism_metadata_files"]: - md_f = f + md_f = f if os.path.isfile(f): md_f = os.path.abspath(f) metadata_files.append(md_f) @@ -715,7 +720,9 @@ def analyzer_setup(analyzer, args): # assert that the eid-xor tool is there eid_xor_path = os.path.join(analyzer.config["utilPath"], "eid-xor") if not os.path.isfile(eid_xor_path): - raise FileNotFoundError(f"Could not find {eid_xor_path} (needed for error pattern insertion)") + raise FileNotFoundError( + f"Could not find {eid_xor_path} (needed for error pattern insertion)" + ) if args["fer_file"]: fer_suffix = "fer_{}".format( diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index e57eb210da..ca4859ffd6 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -30,24 +30,24 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ -import re import fileinput +import json +import logging import os +import platform +import re import shutil import subprocess -import platform -import json +import urllib.parse import xml.etree.ElementTree -import logging from getpass import getpass -import urllib.parse from multiprocessing import cpu_count -from pyivastest.IvasModeRunner import * -from pyivastest.IvasModeAnalyzer import * +import pyivastest.constants as constants import pyivastest.ivas_svn as svn from pyivastest.IvasBaseClass import * -import pyivastest.constants as constants +from pyivastest.IvasModeAnalyzer import * +from pyivastest.IvasModeRunner import * class IvasBuilder(IvasBaseClass): @@ -60,7 +60,7 @@ class IvasBuilder(IvasBaseClass): enable_logging=False, console_logger_level="", logger_name="IvasBuilder", - log_level=logging.DEBUG + log_level=logging.DEBUG, ): super().__init__( enable_logging=enable_logging, @@ -307,45 +307,44 @@ class IvasBuilder(IvasBaseClass): # remove also in the target directory if it exists if os.path.abspath(make_dir) != os.path.abspath(sub_dir): if os.path.exists( - os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext])) + os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext])) ): os.remove(os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext]))) if os.path.exists( - os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext])) + os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext])) ): os.remove(os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext]))) if os.path.exists( - os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext])) + os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext])) ): os.remove(os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext]))) if os.path.exists( - os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext])) + os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext])) ): os.remove(os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext]))) - build_success = -1 if self.system == "Windows": - make_sln = os.path.join(make_dir, "Workspace_msvc", "Workspace_msvc.sln") - clean_cmd = [self.msbuild, make_sln, "/t:clean"] - build_log.write(" ".join(clean_cmd)) - build_log.write("\n") - make_cmd = [self.msbuild, make_sln] + make_options - build_result = subprocess.run( - clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(" ".join(make_cmd)) - build_log.write("\n") - build_result = subprocess.run( - list(filter(None, make_cmd)), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - build_success = build_result.returncode - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(build_result.stderr.decode("cp1252")) + make_sln = os.path.join(make_dir, "Workspace_msvc", "Workspace_msvc.sln") + clean_cmd = [self.msbuild, make_sln, "/t:clean"] + build_log.write(" ".join(clean_cmd)) + build_log.write("\n") + make_cmd = [self.msbuild, make_sln] + make_options + build_result = subprocess.run( + clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(" ".join(make_cmd)) + build_log.write("\n") + build_result = subprocess.run( + list(filter(None, make_cmd)), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + build_success = build_result.returncode + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(build_result.stderr.decode("cp1252")) else: clean_cmd = ["make", "-C", make_dir, "clean"] build_log.write(" ".join(clean_cmd)) @@ -477,7 +476,7 @@ class IvasSvnBuilder(IvasBuilder): console_logger_level=console_logger_level, logger_name=logger_name, log_level=log_level, - msbuild=msbuild + msbuild=msbuild, ) self.svn_url = svn_url # check if we have a complete url or just the path part @@ -705,7 +704,7 @@ class IvasBuilderAndRunner(IvasBaseClass): console_logger_level=console_logger_level, logger_name=".".join([logger_name, "builder"]), log_level=log_level, - msbuild=msbuild + msbuild=msbuild, ) elif svn_url: self.builder = IvasSvnBuilder( @@ -718,7 +717,7 @@ class IvasBuilderAndRunner(IvasBaseClass): console_logger_level=console_logger_level, logger_name=".".join([logger_name, "svnbuilder"]), log_level=log_level, - msbuild=msbuild + msbuild=msbuild, ) self.build_and_run_dict = {} self.site_config = site_config @@ -756,7 +755,7 @@ class IvasBuilderAndRunner(IvasBaseClass): console_logger_level=console_logger_level, logger_name=logger_name, log_level=log_level, - msbuild=msbuild + msbuild=msbuild, ) def add_build_and_run_config( @@ -1118,7 +1117,9 @@ class IvasBuilderAndRunner(IvasBaseClass): ret_val = 0 if self.build_and_run_dict[cfg_name]["analyzer"].get_errors: failed_modes = self.build_and_run_dict[cfg_name]["runner"].failed_modes - _, n_runtime_err = self.build_and_run_dict[cfg_name]["analyzer"].get_errors(failed_modes) + _, n_runtime_err = self.build_and_run_dict[cfg_name][ + "analyzer" + ].get_errors(failed_modes) ret_val = int(n_runtime_err > 0) return ret_val @@ -1189,7 +1190,7 @@ class IvasBuilderAndRunner(IvasBaseClass): n_cpus = cpu_count() # do not use all cores to avoid weird getting-stuck issues observed on Mac... - make_options = ["-j" ,f"{n_cpus - 2}"] + make_options = ["-j", f"{n_cpus - 2}"] run_tool = "" run_env = dict() if defines_to_enable is None: @@ -1207,7 +1208,9 @@ class IvasBuilderAndRunner(IvasBaseClass): # for undefined behaviou sanitizer, pass suppression file if given if clang_n == "3" and usan_supp_file is not None: - run_env["UBSAN_OPTIONS"] = f"suppressions={usan_supp_file},report_error_type=1" + run_env["UBSAN_OPTIONS"] = ( + f"suppressions={usan_supp_file},report_error_type=1" + ) elif check == "VALGRIND": defines_to_disable_check.extend(["RAM_COUNTING_TOOL"]) diff --git a/scripts/pyivastest/__init__.py b/scripts/pyivastest/__init__.py index 866d29f48d..5ab768973f 100644 --- a/scripts/pyivastest/__init__.py +++ b/scripts/pyivastest/__init__.py @@ -28,7 +28,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ - """ pyivastest ==== @@ -41,11 +40,13 @@ Imports functions class """ -from . import constants -from . import IvasBaseClass -from . import IvasModeAnalyzer -from . import IvasModeCollector -from . import IvasModeRunner -from . import IvasScriptsCommon -from . import IvasSvnBuilder -from . import ivas_svn +from . import ( + IvasBaseClass, + IvasModeAnalyzer, + IvasModeCollector, + IvasModeRunner, + IvasScriptsCommon, + IvasSvnBuilder, + constants, + ivas_svn, +) diff --git a/scripts/pyivastest/constants.py b/scripts/pyivastest/constants.py index 287dad73d9..5cdf733da1 100644 --- a/scripts/pyivastest/constants.py +++ b/scripts/pyivastest/constants.py @@ -41,7 +41,10 @@ SCRIPTS_BASE_DIR = os.path.realpath( ) SCRIPTS_CONFIGS_DIR = os.path.realpath(os.path.join(SCRIPTS_BASE_DIR, "config")) SW_FILES_BASE_DIR = os.path.realpath( - os.path.join(os.path.dirname(__file__), "../switchPaths/",) + os.path.join( + os.path.dirname(__file__), + "../switchPaths/", + ) ) OC_TO_NCHANNELS = { "MONO": 1, @@ -65,9 +68,23 @@ OC_TO_NCHANNELS = { "MASA1TC": 1, "MASA2TC": 2, } -DECODER_OUTPUT_CONFIGS = {"MONO", "STEREO", "BINAURAL", "BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB", "5_1", "7_1", "5_1_4", "5_1_2", - "7_1_4", "FOA", "HOA2", "HOA3", "EXT"} +DECODER_OUTPUT_CONFIGS = { + "MONO", + "STEREO", + "BINAURAL", + "BINAURAL_ROOM_IR", + "BINAURAL_ROOM_REVERB", + "5_1", + "7_1", + "5_1_4", + "5_1_2", + "7_1_4", + "FOA", + "HOA2", + "HOA3", + "EXT", +} LOG_FILE_EXT = ".txt" -LOG_FILE_DIR ="logs" +LOG_FILE_DIR = "logs" DEFAULT_IVAS_FORMAT_FILE = "ivas_modes.json" SPAR_BITRATES = [] diff --git a/scripts/pyivastest/ivas_svn.py b/scripts/pyivastest/ivas_svn.py index c7a2bd6899..a7b1b9eeb0 100644 --- a/scripts/pyivastest/ivas_svn.py +++ b/scripts/pyivastest/ivas_svn.py @@ -30,8 +30,8 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ -import urllib import subprocess +import urllib import xml.etree.ElementTree diff --git a/scripts/reverb/generate_acoustic_environments_metadata.py b/scripts/reverb/generate_acoustic_environments_metadata.py index 0982b0f7ae..58017d983b 100644 --- a/scripts/reverb/generate_acoustic_environments_metadata.py +++ b/scripts/reverb/generate_acoustic_environments_metadata.py @@ -37,40 +37,44 @@ # -from bitarray import bitarray import math from enum import Enum -import numpy as np +import numpy as np +from bitarray import bitarray # Set to True to print quantized values print_quantized = False max_quantization_error = { - 'duration' : 0, - 'frequency' : 0, - 'dsr' : 0, - 'distance' : 0, - 'absorption' : 0 + "duration": 0, + "frequency": 0, + "dsr": 0, + "distance": 0, + "absorption": 0, } def update_quantization_error(name, quantized_value, value): if value == 0: if quantized_value != 0: - print(' {}: value = 0, quantized value = {}'.format(name, quantized_value)) + print( + " {}: value = 0, quantized value = {}".format(name, quantized_value) + ) else: - max_quantization_error[name] = max(abs(quantized_value - value) / value, max_quantization_error[name]) + max_quantization_error[name] = max( + abs(quantized_value - value) / value, max_quantization_error[name] + ) if print_quantized: - print(' {}: {}'.format(name, quantized_value)) + print(" {}: {}".format(name, quantized_value)) def get_id_code(id): - code = format(id % 128, '07b') + '0' + code = format(id % 128, "07b") + "0" id //= 128 while id > 0: - code = format(id % 128, '07b') + '1' + code + code = format(id % 128, "07b") + "1" + code id = id // 128 return code @@ -78,79 +82,371 @@ def get_id_code(id): def get_count_or_index_code(n): # 0, 1, ... 63 countOrIndexLoCodes = [ - '0111', '100', '01100', '01101', '01010', '01011', '01000', '01001', '001111', '001110', - '001101', '001100', '001011', '001010', '001001', '001000', '000111', '000110', '000101', '000100', - '000011', '000010', '000001', '000000', '111111', '111110', '111101', '111100', '111011', '111010', - '111001', '111000', '1101111', '1101110', '1101101', '1101100', '1101011', '1101010', '1101001', '1101000', - '1100111', '1100110', '1100101', '1100100', '1100011', '1100010', '1100001', '1100000', '1011111', '1011110', - '1011101', '1011100', '1011011', '1011010', '1011001', '1011000', '1010111', '1010110', '1010101', '1010100', - '1010011', '1010010', '1010001', '1010000'] + "0111", + "100", + "01100", + "01101", + "01010", + "01011", + "01000", + "01001", + "001111", + "001110", + "001101", + "001100", + "001011", + "001010", + "001001", + "001000", + "000111", + "000110", + "000101", + "000100", + "000011", + "000010", + "000001", + "000000", + "111111", + "111110", + "111101", + "111100", + "111011", + "111010", + "111001", + "111000", + "1101111", + "1101110", + "1101101", + "1101100", + "1101011", + "1101010", + "1101001", + "1101000", + "1100111", + "1100110", + "1100101", + "1100100", + "1100011", + "1100010", + "1100001", + "1100000", + "1011111", + "1011110", + "1011101", + "1011100", + "1011011", + "1011010", + "1011001", + "1011000", + "1010111", + "1010110", + "1010101", + "1010100", + "1010011", + "1010010", + "1010001", + "1010000", + ] # 1, 2, ... 15 countOrIndexHiCode = [ - '001', '000', '110', '101', '100', '0111', '0101', '1111', '1110', '01101', - '01001', '01000', '011001', '0110001', '0110000'] + "001", + "000", + "110", + "101", + "100", + "0111", + "0101", + "1111", + "1110", + "01101", + "01001", + "01000", + "011001", + "0110001", + "0110000", + ] assert 0 <= n < 16 * 64 code = countOrIndexLoCodes[n % 64] if n < 64: - code += '0' + code += "0" else: - code += '1' + countOrIndexHiCode[n // 64 - 1] + code += "1" + countOrIndexHiCode[n // 64 - 1] return code def get_duration_code(duration): # 1, 2, ... 30 secondsCode = [ - '0011', '0001', '0000', '1111', '1101', '1100', '1011', '1001', '1000', '01110', - '01101', '01100', '01011', '01001', '01000', '00101', '11101', '11100', '10101', '011111', - '011110', '010101', '001001', '001000', '101001', '0101001', '0101000', '1010001', '10100001', '10100000' ] + "0011", + "0001", + "0000", + "1111", + "1101", + "1100", + "1011", + "1001", + "1000", + "01110", + "01101", + "01100", + "01011", + "01001", + "01000", + "00101", + "11101", + "11100", + "10101", + "011111", + "011110", + "010101", + "001001", + "001000", + "101001", + "0101001", + "0101000", + "1010001", + "10100001", + "10100000", + ] # 0, 0.1, ... 1.0 deciSecondsCode = [ - '110', '100', '101', '0110', '0111', '111', '0100', '0101', '0010', '0011', '000' ] + "110", + "100", + "101", + "0110", + "0111", + "111", + "0100", + "0101", + "0010", + "0011", + "000", + ] # 0, 1, ..., 99 millisecondsCode = [ - '1111010', '1111011', '1111000', '1111001', '1111110', '1111111', '1111100', '1111101', '1110010', '1110011', - '11001', '1110000', '1110001', '1110110', '1110111', '1110100', '1110101', '0101010', '0101011', '0101000', - '10010', '0101001', '0101110', '0101111', '0101100', '0101101', '0100010', '0100011', '0100000', '0100001', - '10011', '0100110', '0100111', '0100100', '0100101', '0111010', '0111011', '0111000', '0111001', '0111110', - '10000', '0111111', '0111100', '0111101', '0110010', '0110011', '0110000', '0110001', '0110110', '0110111', - '10001', '0110100', '0110101', '0001010', '0001011', '0001000', '0001001', '0001110', '0001111', '0001100', - '10110', '0001101', '0000010', '0000011', '0000000', '0000001', '0000110', '0000111', '0000100', '0000101', - '10111', '0011010', '0011011', '0011000', '0011001', '0011110', '0011111', '0011100', '0011101', '0010010', - '10100', '0010011', '0010000', '0010001', '0010110', '0010111', '0010100', '0010101', '1101010', '1101011', - '10101', '1101000', '1101001', '1101110', '1101111', '1101100', '1101101', '1100010', '1100011', '110000' ] + "1111010", + "1111011", + "1111000", + "1111001", + "1111110", + "1111111", + "1111100", + "1111101", + "1110010", + "1110011", + "11001", + "1110000", + "1110001", + "1110110", + "1110111", + "1110100", + "1110101", + "0101010", + "0101011", + "0101000", + "10010", + "0101001", + "0101110", + "0101111", + "0101100", + "0101101", + "0100010", + "0100011", + "0100000", + "0100001", + "10011", + "0100110", + "0100111", + "0100100", + "0100101", + "0111010", + "0111011", + "0111000", + "0111001", + "0111110", + "10000", + "0111111", + "0111100", + "0111101", + "0110010", + "0110011", + "0110000", + "0110001", + "0110110", + "0110111", + "10001", + "0110100", + "0110101", + "0001010", + "0001011", + "0001000", + "0001001", + "0001110", + "0001111", + "0001100", + "10110", + "0001101", + "0000010", + "0000011", + "0000000", + "0000001", + "0000110", + "0000111", + "0000100", + "0000101", + "10111", + "0011010", + "0011011", + "0011000", + "0011001", + "0011110", + "0011111", + "0011100", + "0011101", + "0010010", + "10100", + "0010011", + "0010000", + "0010001", + "0010110", + "0010111", + "0010100", + "0010101", + "1101010", + "1101011", + "10101", + "1101000", + "1101001", + "1101110", + "1101111", + "1101100", + "1101101", + "1100010", + "1100011", + "110000", + ] # 10, 20, ... 990 microsecondsCode = [ - '110111100', '10010', '110111101', '10011', '1101111110', '10000', '1101111111', '10001', '1101111100', '10110', - '1101111101', '10111', '110110010', '10100', '110110011', '10101', '110110000', '001010', '110110001', '001011', - '110110110', '001000', '110110111', '001001', '110110100', '001110', '110110101', '001111', '110011010', '001100', - '110011011', '001101', '110011000', '000010', '110011001', '000011', '110011110', '000000', '110011111', '000001', - '110011100', '000110', '110011101', '000111', '110010010', '000100', '110010011', '000101', '110010000', '011010', - '110010001', '011011', '110010110', '011000', '110010111', '011001', '110010100', '011110', '110010101', '011111', - '110101010', '011100', '110101011', '011101', '110101000', '010010', '110101001', '010011', '110101110', '010000', - '110101111', '010001', '110101100', '010110', '110101101', '010111', '110100010', '010100', '110100011', '010101', - '110100000', '111010', '110100001', '111011', '110100110', '111000', '110100111', '111001', '110100100', '111110', - '110100101', '111111', '110111010', '111100', '110111011', '111101', '110111000', '11000', '110111001' ] - - duration_dus = round(np.float32(duration) * np.float32(100000)) # [deca us] + "110111100", + "10010", + "110111101", + "10011", + "1101111110", + "10000", + "1101111111", + "10001", + "1101111100", + "10110", + "1101111101", + "10111", + "110110010", + "10100", + "110110011", + "10101", + "110110000", + "001010", + "110110001", + "001011", + "110110110", + "001000", + "110110111", + "001001", + "110110100", + "001110", + "110110101", + "001111", + "110011010", + "001100", + "110011011", + "001101", + "110011000", + "000010", + "110011001", + "000011", + "110011110", + "000000", + "110011111", + "000001", + "110011100", + "000110", + "110011101", + "000111", + "110010010", + "000100", + "110010011", + "000101", + "110010000", + "011010", + "110010001", + "011011", + "110010110", + "011000", + "110010111", + "011001", + "110010100", + "011110", + "110010101", + "011111", + "110101010", + "011100", + "110101011", + "011101", + "110101000", + "010010", + "110101001", + "010011", + "110101110", + "010000", + "110101111", + "010001", + "110101100", + "010110", + "110101101", + "010111", + "110100010", + "010100", + "110100011", + "010101", + "110100000", + "111010", + "110100001", + "111011", + "110100110", + "111000", + "110100111", + "111001", + "110100100", + "111110", + "110100101", + "111111", + "110111010", + "111100", + "110111011", + "111101", + "110111000", + "11000", + "110111001", + ] + + duration_dus = round(np.float32(duration) * np.float32(100000)) # [deca us] quantized_duration = round(np.float32(duration), 5) - update_quantization_error('duration', quantized_duration, duration) + update_quantization_error("duration", quantized_duration, duration) - dus = duration_dus # [deca us] - s = dus // 100000 # 0, 1, ... 30 [s] + dus = duration_dus # [deca us] + s = dus // 100000 # 0, 1, ... 30 [s] ms = (dus % 100000) // 100 # 0, 1, ... 999 [ms] - dus = (dus % 100) # 0, 1, ... 99 [deca us] - ds = ms // 100 # 0, 1, ... 9 [deci s] - ms = ms % 100 # 0, 1, ... 99 [ms] + dus = dus % 100 # 0, 1, ... 99 [deca us] + ds = ms // 100 # 0, 1, ... 9 [deci s] + ms = ms % 100 # 0, 1, ... 99 [ms] if s >= 1 and ds == 0: s -= 1 - ds = 10 # 0, 1, ... 10 [deci s] + ds = 10 # 0, 1, ... 10 [deci s] assert 0 <= s <= 30 assert 0 <= ds <= 10 @@ -160,50 +456,79 @@ def get_duration_code(duration): code = deciSecondsCode[ds] if ms > 0 or dus > 0: - code += '1' + millisecondsCode[ms] + code += "1" + millisecondsCode[ms] if dus > 0: - code += '1' + microsecondsCode[dus - 1] + code += "1" + microsecondsCode[dus - 1] else: - code += '0' + code += "0" else: - code += '0' + code += "0" if s > 0: # long range mode not implemented - code += '1' + secondsCode[s - 1] + code += "1" + secondsCode[s - 1] else: - code += '0' + code += "0" return code def get_frequency_code(frequency): frequencyCode = { - 16.0 : '100011', 20.0 : '001110', 25.0 : '001111', 31.5 : '1001', 40.0 : '001100', - 50.0 : '001101', 63.0 : '0000', 80.0 : '011010', 100.0 : '011011', 125.0 : '0001', - 160.0 : '011000', 200.0 : '011001', 250.0 : '1110', 315.0 : '011110', 400.0 : '011111', - 500.0 : '1111', 630.0 : '011100', 800.0 : '011101', 1000.0 : '1100', 1250.0 : '010010', - 1600.0 : '010011', 2000.0 : '1101', 2500.0 : '010000', 3150.0 : '010001', 4000.0 : '1010', - 5000.0 : '010110', 6300.0 : '010111', 8000.0 : '1011', 10000.0: '010100', 12500.0: '010101', - 16000.0: '0010', 20000.0: '10000', 25000.0: '10001010', 31500.0: '10001011', 40000.0: '1000100', } + 16.0: "100011", + 20.0: "001110", + 25.0: "001111", + 31.5: "1001", + 40.0: "001100", + 50.0: "001101", + 63.0: "0000", + 80.0: "011010", + 100.0: "011011", + 125.0: "0001", + 160.0: "011000", + 200.0: "011001", + 250.0: "1110", + 315.0: "011110", + 400.0: "011111", + 500.0: "1111", + 630.0: "011100", + 800.0: "011101", + 1000.0: "1100", + 1250.0: "010010", + 1600.0: "010011", + 2000.0: "1101", + 2500.0: "010000", + 3150.0: "010001", + 4000.0: "1010", + 5000.0: "010110", + 6300.0: "010111", + 8000.0: "1011", + 10000.0: "010100", + 12500.0: "010101", + 16000.0: "0010", + 20000.0: "10000", + 25000.0: "10001010", + 31500.0: "10001011", + 40000.0: "1000100", + } assert 16 <= frequency <= 40000 if frequency in frequencyCode.keys(): quantized_frequency = frequency - code = frequencyCode[quantized_frequency] + '0' + code = frequencyCode[quantized_frequency] + "0" else: # exact frequency not found, use frequency refinement to approximate f_low = max([k for k in frequencyCode.keys() if k < frequency]) refinement = round(51 * math.log(frequency / f_low, 2)) - 1 if 0 <= refinement <= 15: quantized_frequency = f_low * 2 ** ((refinement + 1) / 51) - code = frequencyCode[f_low] + '1' + format(refinement, '04b') + code = frequencyCode[f_low] + "1" + format(refinement, "04b") else: # choose next lower / higher frequency f_high = min([k for k in frequencyCode.keys() if k > frequency]) quantized_frequency = f_low if refinement < 0 else f_high - code = frequencyCode[quantized_frequency] + '0' + code = frequencyCode[quantized_frequency] + "0" - update_quantization_error('frequency', quantized_frequency, frequency) + update_quantization_error("frequency", quantized_frequency, frequency) return code @@ -211,67 +536,211 @@ def get_frequency_code(frequency): def get_frequency_hop_code(value): index = -1 tolerance = 1e-5 - hop_sizes = [2 ** (1/12), 2 ** (1/6), 2 ** (1/4), 2 ** (1/3), 2 ** (1/2), 2 ** (1), 2 ** (2)] + hop_sizes = [ + 2 ** (1 / 12), + 2 ** (1 / 6), + 2 ** (1 / 4), + 2 ** (1 / 3), + 2 ** (1 / 2), + 2 ** (1), + 2 ** (2), + ] for idx, hop in enumerate(hop_sizes): - if math.isclose(value, hop, rel_tol = tolerance): + if math.isclose(value, hop, rel_tol=tolerance): index = idx break assert 0 <= index <= 6 return [ - '0010', # 2^(1/12) - '0011', # 2^(1/6) - '0000', # 2^(1/4) - '01', # 2^(1/3) - '0001', # 2^(1/2) - '11', # 2^1 - '10'][index] # 2^2 + "0010", # 2^(1/12) + "0011", # 2^(1/6) + "0000", # 2^(1/4) + "01", # 2^(1/3) + "0001", # 2^(1/2) + "11", # 2^1 + "10", + ][ + index + ] # 2^2 def get_dsr_code(dsr): # -150.0, -149.0, ... -10.0 dsrCode = [ - '10001100', '10001101', '100011110', '100011111', '100011100', '100011101', '10000010', '10000011', '10000000', '10000001', - '10000110', '10000111', '10000100', '10000101', '011101010', '011101011', '011101000', '011101001', '011101110', '011101111', - '011101100', '011101101', '011100010', '011100011', '011100000', '011100001', '011100110', '011100111', '011100100', '011100101', - '011111010', '011111011', '011111000', '011111001', '011111110', '011111111', '011111100', '011111101', '011110010', '011110011', - '011110000', '011110001', '011110110', '011110111', '011110100', '011110101', '011001010', '011001011', '011001000', '011001001', - '011001110', '011001111', '011001100', '011001101', '011000010', '011000011', '011000000', '011000001', '011000110', '011000111', - '011000100', '011000101', '011011010', '011011011', '011011000', '011011001', '011011110', '011011111', '011011100', '011011101', - '010100', '010101', '100110', '100111', '100100', '100101', '111010', '111011', '111000', '111001', - '111110', '111111', '111100', '111101', '110010', '110011', '110000', '110001', '110110', '110111', - '110100', '110101', '001010', '001011', '001000', '001001', '001110', '001111', '001100', '001101', - '000010', '000011', '000000', '000001', '000110', '000111', '000100', '000101', '101010', '101011', - '101000', '101001', '101110', '101111', '101100', '101101', '010010', '010011', '010000', '010001', - '010110', '011010010', '011010011', '011010000', '011010001', '011010110', '011010111', '011010100', '011010101', '010111010', - '010111011', '010111000', '010111001', '010111110', '010111111', '010111100', '010111101', '10001010', '10001011', '10001000', - '10001001' ] + "10001100", + "10001101", + "100011110", + "100011111", + "100011100", + "100011101", + "10000010", + "10000011", + "10000000", + "10000001", + "10000110", + "10000111", + "10000100", + "10000101", + "011101010", + "011101011", + "011101000", + "011101001", + "011101110", + "011101111", + "011101100", + "011101101", + "011100010", + "011100011", + "011100000", + "011100001", + "011100110", + "011100111", + "011100100", + "011100101", + "011111010", + "011111011", + "011111000", + "011111001", + "011111110", + "011111111", + "011111100", + "011111101", + "011110010", + "011110011", + "011110000", + "011110001", + "011110110", + "011110111", + "011110100", + "011110101", + "011001010", + "011001011", + "011001000", + "011001001", + "011001110", + "011001111", + "011001100", + "011001101", + "011000010", + "011000011", + "011000000", + "011000001", + "011000110", + "011000111", + "011000100", + "011000101", + "011011010", + "011011011", + "011011000", + "011011001", + "011011110", + "011011111", + "011011100", + "011011101", + "010100", + "010101", + "100110", + "100111", + "100100", + "100101", + "111010", + "111011", + "111000", + "111001", + "111110", + "111111", + "111100", + "111101", + "110010", + "110011", + "110000", + "110001", + "110110", + "110111", + "110100", + "110101", + "001010", + "001011", + "001000", + "001001", + "001110", + "001111", + "001100", + "001101", + "000010", + "000011", + "000000", + "000001", + "000110", + "000111", + "000100", + "000101", + "101010", + "101011", + "101000", + "101001", + "101110", + "101111", + "101100", + "101101", + "010010", + "010011", + "010000", + "010001", + "010110", + "011010010", + "011010011", + "011010000", + "011010001", + "011010110", + "011010111", + "011010100", + "011010101", + "010111010", + "010111011", + "010111000", + "010111001", + "010111110", + "010111111", + "010111100", + "010111101", + "10001010", + "10001011", + "10001000", + "10001001", + ] d = math.log10(dsr) * 10 d = round(d + 150) assert 0 <= d <= 140 - quantized_dsr = np.float32(np.power(np.float32(10), np.float32(d - 150) / np.float32(10))) # C decoder uses float precision math - update_quantization_error('dsr', quantized_dsr, dsr) + quantized_dsr = np.float32( + np.power(np.float32(10), np.float32(d - 150) / np.float32(10)) + ) # C decoder uses float precision math + update_quantization_error("dsr", quantized_dsr, dsr) return dsrCode[d] -def usquant(x,qlow,delta,cbsize): - nbits = math.ceil(math.log2(cbsize)) # nextpow2 - index = max(0,min(cbsize-1, round( ( x - qlow ) / delta ))) - return format(index,'0'+ str(nbits) + 'b') + +def usquant(x, qlow, delta, cbsize): + nbits = math.ceil(math.log2(cbsize)) # nextpow2 + index = max(0, min(cbsize - 1, round((x - qlow) / delta))) + return format(index, "0" + str(nbits) + "b") + def get_angle_code(angle): assert 0 <= angle <= 360 return usquant(angle, 0, 20, 19) + def get_outer_attenuation_code(att): assert 0 <= att <= 1 return usquant(20 * math.log10(att), -90, 3, 31) + class fgdMethod(Enum): - Individual_Frequencies = '00' - Start_Hop_Amount = '01' - Default_Banding = '10' + Individual_Frequencies = "00" + Start_Hop_Amount = "01" + Default_Banding = "10" def get_default_grid_nr_bands(code): @@ -282,51 +751,253 @@ def get_default_grid_nr_bands(code): def get_distance_code(distance, isSmallScene): # 0, 1, ... 99 metersCode = [ - '111101', '110010', '110011', '110000', '110001', '110110', '110111', '110100', '110101', '001010', - '001011', '001000', '001001', '001110', '001111', '001100', '001101', '000010', '000011', '000000', - '000001', '000110', '000111', '000100', '000101', '011010', '011011', '011000', '011001', '011110', - '011111', '011100', '011101', '010010', '010011', '010000', '010001', '010110', '010111', '010100', - '010101', '101010', '101011', '101000', '101001', '101110', '101111', '101100', '101101', '10000', - '1000100', '1000101', '10001110', '10001111', '10001100', '10001101', '10011010', '10011011', '10011000', '10011001', - '10011110', '10011111', '10011100', '10011101', '10010010', '10010011', '10010000', '10010001', '10010110', '10010111', - '10010100', '10010101', '11101010', '11101011', '11101000', '11101001', '11101110', '11101111', '11101100', '11101101', - '11100010', '11100011', '11100000', '11100001', '11100110', '11100111', '11100100', '11100101', '11111010', '11111011', - '11111000', '11111001', '11111110', '11111111', '11111100', '11111101', '11110010', '11110011', '11110000', '11110001' ] + "111101", + "110010", + "110011", + "110000", + "110001", + "110110", + "110111", + "110100", + "110101", + "001010", + "001011", + "001000", + "001001", + "001110", + "001111", + "001100", + "001101", + "000010", + "000011", + "000000", + "000001", + "000110", + "000111", + "000100", + "000101", + "011010", + "011011", + "011000", + "011001", + "011110", + "011111", + "011100", + "011101", + "010010", + "010011", + "010000", + "010001", + "010110", + "010111", + "010100", + "010101", + "101010", + "101011", + "101000", + "101001", + "101110", + "101111", + "101100", + "101101", + "10000", + "1000100", + "1000101", + "10001110", + "10001111", + "10001100", + "10001101", + "10011010", + "10011011", + "10011000", + "10011001", + "10011110", + "10011111", + "10011100", + "10011101", + "10010010", + "10010011", + "10010000", + "10010001", + "10010110", + "10010111", + "10010100", + "10010101", + "11101010", + "11101011", + "11101000", + "11101001", + "11101110", + "11101111", + "11101100", + "11101101", + "11100010", + "11100011", + "11100000", + "11100001", + "11100110", + "11100111", + "11100100", + "11100101", + "11111010", + "11111011", + "11111000", + "11111001", + "11111110", + "11111111", + "11111100", + "11111101", + "11110010", + "11110011", + "11110000", + "11110001", + ] # 0, 1, ... 9 hectometersCode = [ - '000', '001', '110', '111', '100', '101', '0110', '0111', '0100', '0101' ] + "000", + "001", + "110", + "111", + "100", + "101", + "0110", + "0111", + "0100", + "0101", + ] # 1, 2, ... 10 kilometersCode = [ - '10', '011', '001', '000', '111', '0101', '0100', '1101', '11001', '11000' ] + "10", + "011", + "001", + "000", + "111", + "0101", + "0100", + "1101", + "11001", + "11000", + ] # 0, 1, ... 99 centimetersCode = [ - '110010', '110011', '110000', '110001', '110110', '110111', '110100', '110101', '0101010', '0101011', - '0101000', '0101001', '0101110', '0101111', '0101100', '0101101', '0100010', '0100011', '0100000', '0100001', - '0100110', '0100111', '0100100', '0100101', '0111010', '0111011', '0111000', '0111001', '0111110', '0111111', - '0111100', '0111101', '0110010', '0110011', '0110000', '0110001', '0110110', '0110111', '0110100', '0110101', - '0001010', '0001011', '0001000', '0001001', '0001110', '0001111', '0001100', '0001101', '0000010', '0000011', - '0000000', '0000001', '0000110', '0000111', '0000100', '0000101', '0011010', '0011011', '0011000', '0011001', - '0011110', '0011111', '0011100', '0011101', '0010010', '0010011', '0010000', '0010001', '0010110', '0010111', - '0010100', '0010101', '101010', '101011', '101000', '101001', '101110', '101111', '101100', '101101', - '100010', '100011', '100000', '100001', '100110', '100111', '100100', '100101', '1111010', '1111011', - '1111000', '1111001', '1111110', '1111111', '1111100', '1111101', '111010', '111011', '111000', '111001' ] - - distance_cm = round(np.float32(distance) * np.float32(100)) # distance in cm + "110010", + "110011", + "110000", + "110001", + "110110", + "110111", + "110100", + "110101", + "0101010", + "0101011", + "0101000", + "0101001", + "0101110", + "0101111", + "0101100", + "0101101", + "0100010", + "0100011", + "0100000", + "0100001", + "0100110", + "0100111", + "0100100", + "0100101", + "0111010", + "0111011", + "0111000", + "0111001", + "0111110", + "0111111", + "0111100", + "0111101", + "0110010", + "0110011", + "0110000", + "0110001", + "0110110", + "0110111", + "0110100", + "0110101", + "0001010", + "0001011", + "0001000", + "0001001", + "0001110", + "0001111", + "0001100", + "0001101", + "0000010", + "0000011", + "0000000", + "0000001", + "0000110", + "0000111", + "0000100", + "0000101", + "0011010", + "0011011", + "0011000", + "0011001", + "0011110", + "0011111", + "0011100", + "0011101", + "0010010", + "0010011", + "0010000", + "0010001", + "0010110", + "0010111", + "0010100", + "0010101", + "101010", + "101011", + "101000", + "101001", + "101110", + "101111", + "101100", + "101101", + "100010", + "100011", + "100000", + "100001", + "100110", + "100111", + "100100", + "100101", + "1111010", + "1111011", + "1111000", + "1111001", + "1111110", + "1111111", + "1111100", + "1111101", + "111010", + "111011", + "111000", + "111001", + ] + + distance_cm = round(np.float32(distance) * np.float32(100)) # distance in cm quantized_distance = round(np.float32(distance), 2) - update_quantization_error('distance', quantized_distance, distance) + update_quantization_error("distance", quantized_distance, distance) - cm = distance_cm # [cm] - m = cm // 100 # [m] - hm = m // 100 # [hm] - km = hm // 10 # [km] + cm = distance_cm # [cm] + m = cm // 100 # [m] + hm = m // 100 # [hm] + km = hm // 10 # [km] - cm = (cm % 100) # 0, 1, ... 99 [cm] - m = (m % 100) # 0, 1, ... 99 [m] - hm = (hm % 10) # 0, 1, ... 9 [hm] + cm = cm % 100 # 0, 1, ... 99 [cm] + m = m % 100 # 0, 1, ... 99 [m] + hm = hm % 10 # 0, 1, ... 9 [hm] assert 0 <= cm <= 99 assert 0 <= m <= 99 @@ -334,27 +1005,27 @@ def get_distance_code(distance, isSmallScene): assert distance_cm == km * 100000 + hm * 10000 + m * 100 + cm code = metersCode[m] - + if isSmallScene: - assert(hm == km == 0) + assert hm == km == 0 else: # large scenes if hm > 0 or km > 0: # hectometers - code += '1' + hectometersCode[hm] + code += "1" + hectometersCode[hm] while km > 0: # kilometers - code += '1' + kilometersCode[min(km, 10) - 1] + code += "1" + kilometersCode[min(km, 10) - 1] km = km - 10 - code += '0' + code += "0" else: - code += '0' - + code += "0" + # centimeters if cm > 0: - code += '1' + centimetersCode[cm] + code += "1" + centimetersCode[cm] else: - code += '0' + code += "0" return code @@ -365,54 +1036,111 @@ def get_absorption_code(absorption): index = round(absorption * 10.0) quantized_absorption = round(np.float32(absorption), 1) - update_quantization_error('absorption', quantized_absorption, absorption) + update_quantization_error("absorption", quantized_absorption, absorption) - return ['110', '100', '101', '0110', '0111', '111', '0100', '0101', '0010', '0011', '000' ][index] + return [ + "110", + "100", + "101", + "0110", + "0111", + "111", + "0100", + "0101", + "0010", + "0011", + "000", + ][index] # apply function to elements of list and concatenate the resulting strings def concatenate(function, data): - return ''.join([function(d) for d in data]) + return "".join([function(d) for d in data]) def test(): # exercise encoding functions over their supported ranges # save binary output to file so it can be compared against Matlab / C implementations - string = '' + string = "" # count or index encoding string += concatenate(get_count_or_index_code, [n for n in range(16 * 64)]) # duration encoding - string += concatenate(get_duration_code, [d / 1000 for d in range(30 * 1000)]) - string += concatenate(get_duration_code, [d / 10000 for d in range(30 * 1000)]) + string += concatenate(get_duration_code, [d / 1000 for d in range(30 * 1000)]) + string += concatenate(get_duration_code, [d / 10000 for d in range(30 * 1000)]) string += concatenate(get_duration_code, [d / 100000 for d in range(30 * 1000)]) # frequency encoding - string += concatenate(get_frequency_code, - [16 , 20 , 25 , 31.5 , 40 , 50 , 63 , 80 , 100 , 125 , - 160 , 200 , 250 , 315 , 400 , 500 , 630 , 800 , 1000 , 1250 , - 1600 , 2000 , 2500 , 3150 , 4000 , 5000 , 6300 , 8000, 10000, 12500, - 16000, 20000, 25000, 31500, 40000]) + string += concatenate( + get_frequency_code, + [ + 16, + 20, + 25, + 31.5, + 40, + 50, + 63, + 80, + 100, + 125, + 160, + 200, + 250, + 315, + 400, + 500, + 630, + 800, + 1000, + 1250, + 1600, + 2000, + 2500, + 3150, + 4000, + 5000, + 6300, + 8000, + 10000, + 12500, + 16000, + 20000, + 25000, + 31500, + 40000, + ], + ) # frequency hop encoding string += concatenate(get_frequency_hop_code, [index for index in range(7)]) # DSR encoding - string += concatenate(get_dsr_code, [math.pow(10, dsr / 10) for dsr in range(-150, -10 + 1)]) + string += concatenate( + get_dsr_code, [math.pow(10, dsr / 10) for dsr in range(-150, -10 + 1)] + ) # distance encoding - string += concatenate(lambda d : get_distance_code(d, False), [d for d in range(20 * 1000)]) - string += concatenate(lambda d : get_distance_code(d, False), [d / 10 for d in range(20 * 1000)]) - string += concatenate(lambda d : get_distance_code(d, False), [d / 100 for d in range(20 * 1000)]) - string += concatenate(lambda d : get_distance_code(d, True), [d / 100 for d in range(10 * 1000)]) + string += concatenate( + lambda d: get_distance_code(d, False), [d for d in range(20 * 1000)] + ) + string += concatenate( + lambda d: get_distance_code(d, False), [d / 10 for d in range(20 * 1000)] + ) + string += concatenate( + lambda d: get_distance_code(d, False), [d / 100 for d in range(20 * 1000)] + ) + string += concatenate( + lambda d: get_distance_code(d, True), [d / 100 for d in range(10 * 1000)] + ) # absorption encoding string += concatenate(get_absorption_code, [a / 100 for a in range(100 + 1)]) - data = bitarray(string, endian='big') + data = bitarray(string, endian="big") - file = open('test_python.dat', 'wb') + file = open("test_python.dat", "wb") data.tofile(file) file.close() @@ -421,93 +1149,272 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv (see IVAS acoustic environment payload syntax document) - + get_count_or_index_code(1) # fgdNrGrids + "1" # hasAcEnv (see IVAS acoustic environment payload syntax document) + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, - 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, - 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, - 0.60031 ]) - - + concatenate(get_dsr_code, # DSR - [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, - 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, - 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, - 2.511887e-08 ]) - + '0' # hasEarlyReflections - + '0' # hasDirectivity - , endian='big') - - file = open('rend_config_renderer.dat', 'wb') + + get_count_or_index_code(31) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 20.0, + 25.0, + 31.5, + 40.0, + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + 12500.0, + 16000.0, + 20000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 1.3622, + 1.4486, + 1.3168, + 1.5787, + 1.4766, + 1.3954, + 1.2889, + 1.3462, + 1.0759, + 1.0401, + 1.0970, + 1.0850, + 1.0910, + 1.0404, + 1.0499, + 1.0699, + 1.1028, + 1.1714, + 1.1027, + 1.0666, + 1.0550, + 1.0553, + 1.0521, + 1.0569, + 1.0421, + 0.97822, + 0.80487, + 0.75944, + 0.71945, + 0.61682, + 0.60031, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 1.9952632e-08, + 1.9952632e-08, + 1.2589251e-08, + 1.5848926e-08, + 1.2589251e-08, + 1.9952632e-08, + 2.511887e-08, + 3.9810708e-08, + 1e-07, + 1.9952633e-07, + 3.981071e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 6.3095763e-07, + 5.01187e-07, + 2.511887e-07, + 1.2589251e-07, + 1e-07, + 6.309576e-08, + 3.1622776e-08, + 2.511887e-08, + ], + ) + + "0" # hasEarlyReflections + + "0", # hasDirectivity + endian="big", + ) + + file = open("rend_config_renderer.dat", "wb") data.tofile(file) file.close() + def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_no_listener_origin(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(2) # fgdNrGrids + "1" + get_count_or_index_code(2) # hasAcEnv # fgdNrGrids # frequency grid #1 + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(1) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 10000.0 ]) - - # frequency grid #2 + + get_count_or_index_code(1) # fgdNrBands + + concatenate(get_frequency_code, [10000.0]) # fgdCenterFreq + # frequency grid #2 + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, - 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, - 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, - 0.60031 ]) - - + concatenate(get_dsr_code, # DSR - [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, - 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, - 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, - 2.511887e-08 ]) - - + '1' # hasEarlyReflections - + concatenate(lambda d : get_distance_code(d, True), - [ 3.0, 4.0, 2.5 ]) # erSize (room dimensions) - + concatenate(get_absorption_code, # erAbsCoeff - [ 0.8, 0.8, 0.8, 0.8, 0.2, 0.6 ]) - + '0' # hasListenerOrigin - + '0' # lowComplexity - - + '0' # hasDirectivity - , endian='big') - - file = open('rend_config_renderer_cfg_plus_early_reflections_no_listener_origin.dat', 'wb') + + get_count_or_index_code(31) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 20.0, + 25.0, + 31.5, + 40.0, + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + 12500.0, + 16000.0, + 20000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 1.3622, + 1.4486, + 1.3168, + 1.5787, + 1.4766, + 1.3954, + 1.2889, + 1.3462, + 1.0759, + 1.0401, + 1.0970, + 1.0850, + 1.0910, + 1.0404, + 1.0499, + 1.0699, + 1.1028, + 1.1714, + 1.1027, + 1.0666, + 1.0550, + 1.0553, + 1.0521, + 1.0569, + 1.0421, + 0.97822, + 0.80487, + 0.75944, + 0.71945, + 0.61682, + 0.60031, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 1.9952632e-08, + 1.9952632e-08, + 1.2589251e-08, + 1.5848926e-08, + 1.2589251e-08, + 1.9952632e-08, + 2.511887e-08, + 3.9810708e-08, + 1e-07, + 1.9952633e-07, + 3.981071e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 6.3095763e-07, + 5.01187e-07, + 2.511887e-07, + 1.2589251e-07, + 1e-07, + 6.309576e-08, + 3.1622776e-08, + 2.511887e-08, + ], + ) + + "1" # hasEarlyReflections + + concatenate( + lambda d: get_distance_code(d, True), [3.0, 4.0, 2.5] + ) # erSize (room dimensions) + + concatenate( + get_absorption_code, [0.8, 0.8, 0.8, 0.8, 0.2, 0.6] # erAbsCoeff + ) + + "0" # hasListenerOrigin + + "0" # lowComplexity + + "0", # hasDirectivity + endian="big", + ) + + file = open( + "rend_config_renderer_cfg_plus_early_reflections_no_listener_origin.dat", "wb" + ) data.tofile(file) file.close() @@ -516,164 +1423,431 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(2) # fgdNrGrids + "1" + get_count_or_index_code(2) # hasAcEnv # fgdNrGrids # frequency grid #1 + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(1) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 10000.0 ]) - - # frequency grid #2 + + get_count_or_index_code(1) # fgdNrBands + + concatenate(get_frequency_code, [10000.0]) # fgdCenterFreq + # frequency grid #2 + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, - 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, - 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, - 0.60031 ]) - - + concatenate(get_dsr_code, # DSR - [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, - 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, - 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, - 2.511887e-08 ]) - - + '1' # hasEarlyReflections - + concatenate(lambda code : get_distance_code(code, True), - [ 3.0, 4.0, 2.5 ]) # erSize (room dimensions) - + concatenate(get_absorption_code, # erAbsCoeff - [ 0.8, 0.8, 0.8, 0.8, 0.2, 0.6 ]) - - + '1' # hasListenerOrigin - + '1' # isPositiveX - + '0' # isPositiveY - + concatenate(lambda d : get_distance_code(d, True), - [ 0.5, 0.5, 1.5 ]) # erListenerOrigin (x, y, z) - + '1' # lowComplexity - + '0' # hasDirectivity - , endian='big') - - file = open('rend_config_renderer_cfg_plus_early_reflections_listener_origin.dat', 'wb') + + get_count_or_index_code(31) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 20.0, + 25.0, + 31.5, + 40.0, + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + 12500.0, + 16000.0, + 20000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 1.3622, + 1.4486, + 1.3168, + 1.5787, + 1.4766, + 1.3954, + 1.2889, + 1.3462, + 1.0759, + 1.0401, + 1.0970, + 1.0850, + 1.0910, + 1.0404, + 1.0499, + 1.0699, + 1.1028, + 1.1714, + 1.1027, + 1.0666, + 1.0550, + 1.0553, + 1.0521, + 1.0569, + 1.0421, + 0.97822, + 0.80487, + 0.75944, + 0.71945, + 0.61682, + 0.60031, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 1.9952632e-08, + 1.9952632e-08, + 1.2589251e-08, + 1.5848926e-08, + 1.2589251e-08, + 1.9952632e-08, + 2.511887e-08, + 3.9810708e-08, + 1e-07, + 1.9952633e-07, + 3.981071e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 6.3095763e-07, + 5.01187e-07, + 2.511887e-07, + 1.2589251e-07, + 1e-07, + 6.309576e-08, + 3.1622776e-08, + 2.511887e-08, + ], + ) + + "1" # hasEarlyReflections + + concatenate( + lambda code: get_distance_code(code, True), [3.0, 4.0, 2.5] + ) # erSize (room dimensions) + + concatenate( + get_absorption_code, [0.8, 0.8, 0.8, 0.8, 0.2, 0.6] # erAbsCoeff + ) + + "1" # hasListenerOrigin + + "1" # isPositiveX + + "0" # isPositiveY + + concatenate( + lambda d: get_distance_code(d, True), [0.5, 0.5, 1.5] + ) # erListenerOrigin (x, y, z) + + "1" # lowComplexity + + "0", # hasDirectivity + endian="big", + ) + + file = open( + "rend_config_renderer_cfg_plus_early_reflections_listener_origin.dat", "wb" + ) data.tofile(file) file.close() + def generate_reverb_payload_equivalent_to_rend_config_renderer_directivity_cfg(): # based on rend_config_renderer_directivity.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids + "1" # hasAcEnv + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 1.3622, 1.4486, 1.3168, 1.5787, - 1.4766, 1.3954, 1.2889, 1.3462, - 1.0759, 1.0401, 1.0970, 1.0850, - 1.0910, 1.0404, 1.0499, 1.0699, - 1.1028, 1.1714, 1.1027, 1.0666, - 1.0550, 1.0553, 1.0521, 1.0569, - 1.0421, 0.97822, 0.80487, 0.75944, - 0.71945, 0.61682, 0.60031 ]) - - + concatenate(get_dsr_code, # DSR - [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, - 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, - 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, - 2.511887e-08 ]) - - + '0' # hasEarlyReflections - + '1' # hasDirectivity - + get_id_code(1) # Number of directivity patterns - + get_id_code(0) # directivity ID + + get_count_or_index_code(31) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 20.0, + 25.0, + 31.5, + 40.0, + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + 12500.0, + 16000.0, + 20000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 1.3622, + 1.4486, + 1.3168, + 1.5787, + 1.4766, + 1.3954, + 1.2889, + 1.3462, + 1.0759, + 1.0401, + 1.0970, + 1.0850, + 1.0910, + 1.0404, + 1.0499, + 1.0699, + 1.1028, + 1.1714, + 1.1027, + 1.0666, + 1.0550, + 1.0553, + 1.0521, + 1.0569, + 1.0421, + 0.97822, + 0.80487, + 0.75944, + 0.71945, + 0.61682, + 0.60031, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 1.9952632e-08, + 1.9952632e-08, + 1.2589251e-08, + 1.5848926e-08, + 1.2589251e-08, + 1.9952632e-08, + 2.511887e-08, + 3.9810708e-08, + 1e-07, + 1.9952633e-07, + 3.981071e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 7.943284e-07, + 6.3095763e-07, + 5.01187e-07, + 6.3095763e-07, + 6.3095763e-07, + 6.3095763e-07, + 5.01187e-07, + 2.511887e-07, + 1.2589251e-07, + 1e-07, + 6.309576e-08, + 3.1622776e-08, + 2.511887e-08, + ], + ) + + "0" # hasEarlyReflections + + "1" # hasDirectivity + + get_id_code(1) # Number of directivity patterns + + get_id_code(0) # directivity ID + get_angle_code(0.0) + get_angle_code(360.0) - + get_outer_attenuation_code(0.2512) - , endian='big') + + get_outer_attenuation_code(0.2512), + endian="big", + ) - file = open('rend_config_renderer_directivity.dat', 'wb') + file = open("rend_config_renderer_directivity.dat", "wb") data.tofile(file) file.close() + def generate_reverb_payload_equivalent_to_config_directivity_cfg(): # based on config_directivity_cfg.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '0' # hasAcEnv - + '1' # hasDirectivity - + get_id_code(1) # Number of directivity patterns - + get_id_code(0) # directivity ID + "0" # hasAcEnv + + "1" # hasDirectivity + + get_id_code(1) # Number of directivity patterns + + get_id_code(0) # directivity ID + get_angle_code(0.0) + get_angle_code(360.0) - + get_outer_attenuation_code(0.2512) - , endian='big') + + get_outer_attenuation_code(0.2512), + endian="big", + ) - file = open('config_directivity.dat', 'wb') + file = open("config_directivity.dat", "wb") data.tofile(file) file.close() + def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg(): # based on config_hospital_patientroom.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids + "1" # hasAcEnv + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.08163) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 0.81275, 0.61888, 0.45111, 0.34672, 0.46683, 0.53987, 0.61874, 0.70291, 0.66657, 0.73037, - 0.75090, 0.72470, 0.75486, 0.75857, 0.76844, 0.74999, 0.77622, 0.78227, 0.77441, 0.74688, - 0.73521, 0.73782, 0.71928, 0.71708, 0.71465, 0.60592, 0.52031, 0.51768, 0.52102, 0.37956, - 0.30786 ]) - - + concatenate(get_dsr_code, # DSR - [ 0.00019952621, 0.00019952621, 7.9432844e-05, 5.0118702e-05, 7.943284e-06, 6.3095763e-06, 6.3095763e-06, 7.943284e-06, 1e-05, 1e-05, - 7.943284e-06, 1e-05, 1e-05, 1e-05, 7.943284e-06, 1e-05, 1e-05, 7.943284e-06, 7.943284e-06, 6.3095763e-06, - 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 3.1622776e-06, 3.1622776e-06, 3.1622776e-06, 6.3095763e-07, 3.1622776e-07, - 3.1622776e-07 ]) - + '0' # hasEarlyReflections - + '0' # hasDirectivity - , endian='big') - - file = open('rend_config_hospital_patientroom.dat', 'wb') + + get_count_or_index_code(31) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 20.0, + 25.0, + 31.5, + 40.0, + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + 12500.0, + 16000.0, + 20000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.08163) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 0.81275, + 0.61888, + 0.45111, + 0.34672, + 0.46683, + 0.53987, + 0.61874, + 0.70291, + 0.66657, + 0.73037, + 0.75090, + 0.72470, + 0.75486, + 0.75857, + 0.76844, + 0.74999, + 0.77622, + 0.78227, + 0.77441, + 0.74688, + 0.73521, + 0.73782, + 0.71928, + 0.71708, + 0.71465, + 0.60592, + 0.52031, + 0.51768, + 0.52102, + 0.37956, + 0.30786, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 0.00019952621, + 0.00019952621, + 7.9432844e-05, + 5.0118702e-05, + 7.943284e-06, + 6.3095763e-06, + 6.3095763e-06, + 7.943284e-06, + 1e-05, + 1e-05, + 7.943284e-06, + 1e-05, + 1e-05, + 1e-05, + 7.943284e-06, + 1e-05, + 1e-05, + 7.943284e-06, + 7.943284e-06, + 6.3095763e-06, + 6.3095763e-06, + 6.3095763e-06, + 6.3095763e-06, + 6.3095763e-06, + 6.3095763e-06, + 3.1622776e-06, + 3.1622776e-06, + 3.1622776e-06, + 6.3095763e-07, + 3.1622776e-07, + 3.1622776e-07, + ], + ) + + "0" # hasEarlyReflections + + "0", # hasDirectivity + endian="big", + ) + + file = open("rend_config_hospital_patientroom.dat", "wb") data.tofile(file) file.close() @@ -682,39 +1856,128 @@ def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): # based on config_recreation.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids + "1" # hasAcEnv + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.43031) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 4.51916, 4.89553, 4.83276, 5.00198, 5.34468, 5.76026, 6.36818, 6.95503, 7.27557, 7.62559, - 8.08892, 8.16002, 8.13900, 8.17919, 8.16280, 8.46226, 9.61806, 9.93048, 9.81353, 8.59340, - 8.38885, 8.36823, 6.51845, 3.76089, 3.75374, 3.57451, 1.28724, 1.22174, 1.22448, 1.71631, - 2.14343 ]) - - + concatenate(get_dsr_code, # DSR - [ 1e-06, 7.943284e-07, 1e-06, 1e-06, 1.5848925e-06, 1.9952631e-06, 3.1622776e-06, 3.9810707e-06, 6.3095763e-06, 7.943284e-06, - 1e-05, 7.943284e-06, 7.943284e-06, 7.943284e-06, 7.943284e-06, 7.943284e-06, 5.01187e-06, 5.01187e-06, 3.9810707e-06, 3.1622776e-06, - 3.1622776e-06, 2.511887e-06, 7.943284e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-08, 1.2589251e-08, 1.2589251e-08, 1.2589265e-09, 1.2589266e-11, - 3.981075e-12 ]) - + '0' # hasEarlyReflections - + '0' # hasDirectivity - , endian='big') - - file = open('rend_config_recreation.dat', 'wb') + + get_count_or_index_code(31) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 20.0, + 25.0, + 31.5, + 40.0, + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + 12500.0, + 16000.0, + 20000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.43031) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 4.51916, + 4.89553, + 4.83276, + 5.00198, + 5.34468, + 5.76026, + 6.36818, + 6.95503, + 7.27557, + 7.62559, + 8.08892, + 8.16002, + 8.13900, + 8.17919, + 8.16280, + 8.46226, + 9.61806, + 9.93048, + 9.81353, + 8.59340, + 8.38885, + 8.36823, + 6.51845, + 3.76089, + 3.75374, + 3.57451, + 1.28724, + 1.22174, + 1.22448, + 1.71631, + 2.14343, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 1e-06, + 7.943284e-07, + 1e-06, + 1e-06, + 1.5848925e-06, + 1.9952631e-06, + 3.1622776e-06, + 3.9810707e-06, + 6.3095763e-06, + 7.943284e-06, + 1e-05, + 7.943284e-06, + 7.943284e-06, + 7.943284e-06, + 7.943284e-06, + 7.943284e-06, + 5.01187e-06, + 5.01187e-06, + 3.9810707e-06, + 3.1622776e-06, + 3.1622776e-06, + 2.511887e-06, + 7.943284e-07, + 6.3095763e-07, + 6.3095763e-07, + 5.01187e-08, + 1.2589251e-08, + 1.2589251e-08, + 1.2589265e-09, + 1.2589266e-11, + 3.981075e-12, + ], + ) + + "0" # hasEarlyReflections + + "0", # hasDirectivity + endian="big", + ) + + file = open("rend_config_recreation.dat", "wb") data.tofile(file) file.close() @@ -723,56 +1986,120 @@ def generate_reverb_payload_ER_v0(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids - # frequency grid + "1" + get_count_or_index_code(1) # hasAcEnv # fgdNrGrids + # frequency grid + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(24) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [0.87, 0.66, 0.47, 0.41, - 0.32, 0.37, 0.28, 0.30, - 0.29, 0.29, 0.28, 0.30, - 0.31, 0.34, 0.34, 0.34, - 0.34, 0.33, 0.32, 0.29, - 0.28, 0.24, 0.24, 0.2]) - - + concatenate(get_dsr_code, # DSR - [2.511887e-07, 1e-07, 1.2589251e-07, 1e-07, - 5.01187e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 6.309576e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 5.01187e-08, 1e-07, 7.9432844e-08, 6.309576e-08, - 7.9432844e-08, 5.01187e-08, 6.309576e-08, 3.9810708e-08, - 3.9810708e-08, 2.511887e-08, 1.9952632e-08, 1.2589251e-08]) - - + '1' # hasEarlyReflections - + concatenate(lambda code : get_distance_code(code, True), - [ 2.0, 2.0, 3.0 ]) # room dimensions - + concatenate(get_absorption_code, # absorptionCode - [ 0.2, 0.1, 0.1, 0.1, 0.3, 0.1 ]) - + '1' # listener origin flag - + '1' # isPositiveX - + '1' # isPositiveY - + concatenate(lambda d : get_distance_code(d, True), - [ 0.0, 0.0, 1.5 ]) # listener origin (x, y, z) - + '1' # lowComplexity - + '0' # directivity - , endian='big') - - file = open('rend_config_ER_v0.dat', 'wb') + + get_count_or_index_code(24) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 0.87, + 0.66, + 0.47, + 0.41, + 0.32, + 0.37, + 0.28, + 0.30, + 0.29, + 0.29, + 0.28, + 0.30, + 0.31, + 0.34, + 0.34, + 0.34, + 0.34, + 0.33, + 0.32, + 0.29, + 0.28, + 0.24, + 0.24, + 0.2, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 2.511887e-07, + 1e-07, + 1.2589251e-07, + 1e-07, + 5.01187e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 6.309576e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 5.01187e-08, + 1e-07, + 7.9432844e-08, + 6.309576e-08, + 7.9432844e-08, + 5.01187e-08, + 6.309576e-08, + 3.9810708e-08, + 3.9810708e-08, + 2.511887e-08, + 1.9952632e-08, + 1.2589251e-08, + ], + ) + + "1" # hasEarlyReflections + + concatenate( + lambda code: get_distance_code(code, True), [2.0, 2.0, 3.0] + ) # room dimensions + + concatenate( + get_absorption_code, [0.2, 0.1, 0.1, 0.1, 0.3, 0.1] # absorptionCode + ) + + "1" # listener origin flag + + "1" # isPositiveX + + "1" # isPositiveY + + concatenate( + lambda d: get_distance_code(d, True), [0.0, 0.0, 1.5] + ) # listener origin (x, y, z) + + "1" # lowComplexity + + "0", # directivity + endian="big", + ) + + file = open("rend_config_ER_v0.dat", "wb") data.tofile(file) file.close() @@ -781,109 +2108,237 @@ def generate_reverb_payload_ER_v1(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids - # frequency grid + "1" + get_count_or_index_code(1) # hasAcEnv # fgdNrGrids + # frequency grid + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(24) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [0.87, 0.66, 0.47, 0.41, - 0.32, 0.37, 0.28, 0.30, - 0.29, 0.29, 0.28, 0.30, - 0.31, 0.34, 0.34, 0.34, - 0.34, 0.33, 0.32, 0.29, - 0.28, 0.24, 0.24, 0.2]) - - + concatenate(get_dsr_code, # DSR - [2.511887e-07, 1e-07, 1.2589251e-07, 1e-07, - 5.01187e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 6.309576e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 5.01187e-08, 1e-07, 7.9432844e-08, 6.309576e-08, - 7.9432844e-08, 5.01187e-08, 6.309576e-08, 3.9810708e-08, - 3.9810708e-08, 2.511887e-08, 1.9952632e-08, 1.2589251e-08]) - - + '1' # hasEarlyReflections - + concatenate(lambda code : get_distance_code(code, True), - [ 3.0, 3.0, 4.0 ]) # room dimensions - + concatenate(get_absorption_code, # absorptionCode - [ 0.3, 0.2, 0.2, 0.2, 0.3, 0.1 ]) - + '0' # listener origin flag - + '0' # lowComplexity - + '0' # directivity - , endian='big') - - file = open('rend_config_ER_v1.dat', 'wb') + + get_count_or_index_code(24) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 0.87, + 0.66, + 0.47, + 0.41, + 0.32, + 0.37, + 0.28, + 0.30, + 0.29, + 0.29, + 0.28, + 0.30, + 0.31, + 0.34, + 0.34, + 0.34, + 0.34, + 0.33, + 0.32, + 0.29, + 0.28, + 0.24, + 0.24, + 0.2, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 2.511887e-07, + 1e-07, + 1.2589251e-07, + 1e-07, + 5.01187e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 6.309576e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 5.01187e-08, + 1e-07, + 7.9432844e-08, + 6.309576e-08, + 7.9432844e-08, + 5.01187e-08, + 6.309576e-08, + 3.9810708e-08, + 3.9810708e-08, + 2.511887e-08, + 1.9952632e-08, + 1.2589251e-08, + ], + ) + + "1" # hasEarlyReflections + + concatenate( + lambda code: get_distance_code(code, True), [3.0, 3.0, 4.0] + ) # room dimensions + + concatenate( + get_absorption_code, [0.3, 0.2, 0.2, 0.2, 0.3, 0.1] # absorptionCode + ) + + "0" # listener origin flag + + "0" # lowComplexity + + "0", # directivity + endian="big", + ) + + file = open("rend_config_ER_v1.dat", "wb") data.tofile(file) file.close() + def generate_reverb_payload_ER_v2(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids - # frequency grid + "1" + get_count_or_index_code(1) # hasAcEnv # fgdNrGrids + # frequency grid + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(24) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [0.87, 0.66, 0.47, 0.41, - 0.32, 0.37, 0.28, 0.30, - 0.29, 0.29, 0.28, 0.30, - 0.31, 0.34, 0.34, 0.34, - 0.34, 0.33, 0.32, 0.29, - 0.28, 0.24, 0.24, 0.2]) - - + concatenate(get_dsr_code, # DSR - [2.511887e-07, 1e-07, 1.2589251e-07, 1e-07, - 5.01187e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 6.309576e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 5.01187e-08, 1e-07, 7.9432844e-08, 6.309576e-08, - 7.9432844e-08, 5.01187e-08, 6.309576e-08, 3.9810708e-08, - 3.9810708e-08, 2.511887e-08, 1.9952632e-08, 1.2589251e-08]) - - + '1' # hasEarlyReflections - + concatenate(lambda code : get_distance_code(code, True), - [ 3.0, 3.0, 4.0 ]) # room dimensions - + concatenate(get_absorption_code, # absorptionCode - [ 0.3, 0.2, 0.3, 0.4, 0.3, 0.4 ]) - + '1' # listener origin flag - + '1' # isPositiveX - + '0' # isPositiveY - + concatenate(lambda d : get_distance_code(d, True), - [ 0.5, 0.5, 1.5]) # listener origin (x, y, z) - + '0' # lowComplexity - + '0' # directivity - , endian='big') - - file = open('rend_config_ER_v2.dat', 'wb') + + get_count_or_index_code(24) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 0.87, + 0.66, + 0.47, + 0.41, + 0.32, + 0.37, + 0.28, + 0.30, + 0.29, + 0.29, + 0.28, + 0.30, + 0.31, + 0.34, + 0.34, + 0.34, + 0.34, + 0.33, + 0.32, + 0.29, + 0.28, + 0.24, + 0.24, + 0.2, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 2.511887e-07, + 1e-07, + 1.2589251e-07, + 1e-07, + 5.01187e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 6.309576e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 5.01187e-08, + 1e-07, + 7.9432844e-08, + 6.309576e-08, + 7.9432844e-08, + 5.01187e-08, + 6.309576e-08, + 3.9810708e-08, + 3.9810708e-08, + 2.511887e-08, + 1.9952632e-08, + 1.2589251e-08, + ], + ) + + "1" # hasEarlyReflections + + concatenate( + lambda code: get_distance_code(code, True), [3.0, 3.0, 4.0] + ) # room dimensions + + concatenate( + get_absorption_code, [0.3, 0.2, 0.3, 0.4, 0.3, 0.4] # absorptionCode + ) + + "1" # listener origin flag + + "1" # isPositiveX + + "0" # isPositiveY + + concatenate( + lambda d: get_distance_code(d, True), [0.5, 0.5, 1.5] + ) # listener origin (x, y, z) + + "0" # lowComplexity + + "0", # directivity + endian="big", + ) + + file = open("rend_config_ER_v2.dat", "wb") data.tofile(file) file.close() @@ -892,74 +2347,138 @@ def generate_reverb_payload_ER_v3(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - '1' # hasAcEnv - + get_count_or_index_code(1) # fgdNrGrids - # frequency grid + "1" + get_count_or_index_code(1) # hasAcEnv # fgdNrGrids + # frequency grid + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(24) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [0.87, 0.66, 0.47, 0.41, - 0.32, 0.37, 0.28, 0.30, - 0.29, 0.29, 0.28, 0.30, - 0.31, 0.34, 0.34, 0.34, - 0.34, 0.33, 0.32, 0.29, - 0.28, 0.24, 0.24, 0.2]) - - + concatenate(get_dsr_code, # DSR - [2.511887e-07, 1e-07, 1.2589251e-07, 1e-07, - 5.01187e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 6.309576e-08, 5.01187e-08, 7.9432844e-08, 1e-07, - 5.01187e-08, 1e-07, 7.9432844e-08, 6.309576e-08, - 7.9432844e-08, 5.01187e-08, 6.309576e-08, 3.9810708e-08, - 3.9810708e-08, 2.511887e-08, 1.9952632e-08, 1.2589251e-08]) - - + '1' # hasEarlyReflections - + concatenate(lambda code : get_distance_code(code, True), - [4.0, 4.0, 5.0]) # room dimensions - + concatenate(get_absorption_code, # absorptionCode - [0.1, 0.2, 0.2, 0.2, 0.1, 0.1]) - + '1' # listener origin flag - + '0' # isPositiveX - + '1' # isPositiveY - + concatenate(lambda d : get_distance_code(d, True), - [ 1.0, 0.5, 1.5]) # listener origin (x, y, z) - + '1' # lowComplexity - + '0' # directivity - , endian='big') - - file = open('rend_config_ER_v3.dat', 'wb') + + get_count_or_index_code(24) # fgdNrBands + + concatenate( + get_frequency_code, # fgdCenterFreq + [ + 50.0, + 63.0, + 80.0, + 100.0, + 125.0, + 160.0, + 200.0, + 250.0, + 315.0, + 400.0, + 500.0, + 630.0, + 800.0, + 1000.0, + 1250.0, + 1600.0, + 2000.0, + 2500.0, + 3150.0, + 4000.0, + 5000.0, + 6300.0, + 8000.0, + 10000.0, + ], + ) + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + concatenate( + get_duration_code, # RT60 + [ + 0.87, + 0.66, + 0.47, + 0.41, + 0.32, + 0.37, + 0.28, + 0.30, + 0.29, + 0.29, + 0.28, + 0.30, + 0.31, + 0.34, + 0.34, + 0.34, + 0.34, + 0.33, + 0.32, + 0.29, + 0.28, + 0.24, + 0.24, + 0.2, + ], + ) + + concatenate( + get_dsr_code, # DSR + [ + 2.511887e-07, + 1e-07, + 1.2589251e-07, + 1e-07, + 5.01187e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 6.309576e-08, + 5.01187e-08, + 7.9432844e-08, + 1e-07, + 5.01187e-08, + 1e-07, + 7.9432844e-08, + 6.309576e-08, + 7.9432844e-08, + 5.01187e-08, + 6.309576e-08, + 3.9810708e-08, + 3.9810708e-08, + 2.511887e-08, + 1.9952632e-08, + 1.2589251e-08, + ], + ) + + "1" # hasEarlyReflections + + concatenate( + lambda code: get_distance_code(code, True), [4.0, 4.0, 5.0] + ) # room dimensions + + concatenate( + get_absorption_code, [0.1, 0.2, 0.2, 0.2, 0.1, 0.1] # absorptionCode + ) + + "1" # listener origin flag + + "0" # isPositiveX + + "1" # isPositiveY + + concatenate( + lambda d: get_distance_code(d, True), [1.0, 0.5, 1.5] + ) # listener origin (x, y, z) + + "1" # lowComplexity + + "0", # directivity + endian="big", + ) + + file = open("rend_config_ER_v3.dat", "wb") data.tofile(file) file.close() if __name__ == "__main__": - #test() + # test() generate_reverb_payload_equivalent_to_rend_config_renderer_cfg() generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() generate_reverb_payload_equivalent_to_rend_config_recreation_cfg() generate_reverb_payload_equivalent_to_rend_config_renderer_directivity_cfg() generate_reverb_payload_equivalent_to_config_directivity_cfg() - + # generate_reverb_payload_aggressive_ER() - + generate_reverb_payload_ER_v0() generate_reverb_payload_ER_v1() generate_reverb_payload_ER_v2() generate_reverb_payload_ER_v3() # generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_no_listener_origin() - # generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_listener_origin() \ No newline at end of file + # generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_listener_origin() diff --git a/scripts/reverb/text_to_binary_payload.py b/scripts/reverb/text_to_binary_payload.py index b23b3a0c78..7eff404a7a 100644 --- a/scripts/reverb/text_to_binary_payload.py +++ b/scripts/reverb/text_to_binary_payload.py @@ -46,15 +46,16 @@ # -from bitarray import bitarray -from configparser import ConfigParser import ast +from configparser import ConfigParser + +from bitarray import bitarray from generate_acoustic_environments_metadata import * # convert text containing an option value to a Python value, if possible def eval_option(text): - text = text.replace(';', '') + text = text.replace(";", "") try: value = ast.literal_eval(text) except ValueError: @@ -63,8 +64,8 @@ def eval_option(text): def get_bool_code(b): - assert(isinstance(b, bool)) - return format(b, '01b') + assert isinstance(b, bool) + return format(b, "01b") def parse_reverb_text_configuration_and_generate_binary_payload(file): @@ -72,126 +73,185 @@ def parse_reverb_text_configuration_and_generate_binary_payload(file): # parse file config = ConfigParser() files_parsed = config.read(file) - assert len(files_parsed) == 1, 'file {} not successfully parsed'.format(file) + assert len(files_parsed) == 1, "file {} not successfully parsed".format(file) # collect dicts of frequency grid, acoustic environment and directivity sections - sections = { key : {} for key in ['roomAcoustics', 'frequencyGrid', 'acousticEnvironment', 'directivitySetting', 'directivityPattern']} + sections = { + key: {} + for key in [ + "roomAcoustics", + "frequencyGrid", + "acousticEnvironment", + "directivitySetting", + "directivityPattern", + ] + } for section_name in config.sections(): - if ':' in section_name: - section, index = section_name.split(':') - assert section in ['frequencyGrid', 'acousticEnvironment', 'directivityPattern'], f'unknown section name: {section}' + if ":" in section_name: + section, index = section_name.split(":") + assert section in [ + "frequencyGrid", + "acousticEnvironment", + "directivityPattern", + ], f"unknown section name: {section}" sections[section][index] = config[section_name] else: - assert section_name in ['roomAcoustics', 'directivitySetting'], f'unknown section name: {section_name}' + assert section_name in [ + "roomAcoustics", + "directivitySetting", + ], f"unknown section name: {section_name}" sections[section_name] = config[section_name] # parse room acoustics - if sections['roomAcoustics']: - frequencyGridCount = eval_option(sections['roomAcoustics']['frequencyGridCount']) - acousticEnvironmentCount = eval_option(sections['roomAcoustics']['acousticEnvironmentCount']) - assert frequencyGridCount == len(sections['frequencyGrid']) - assert acousticEnvironmentCount == len(sections['acousticEnvironment']) + if sections["roomAcoustics"]: + frequencyGridCount = eval_option( + sections["roomAcoustics"]["frequencyGridCount"] + ) + acousticEnvironmentCount = eval_option( + sections["roomAcoustics"]["acousticEnvironmentCount"] + ) + assert frequencyGridCount == len(sections["frequencyGrid"]) + assert acousticEnvironmentCount == len(sections["acousticEnvironment"]) - hasAcEnv = len(sections['roomAcoustics']) > 0 # hasAcEnv (see IVAS acoustic environment payload syntax document) + hasAcEnv = ( + len(sections["roomAcoustics"]) > 0 + ) # hasAcEnv (see IVAS acoustic environment payload syntax document) if hasAcEnv: - data = bitarray('1', endian='big') + data = bitarray("1", endian="big") else: - data = bitarray('0', endian='big') + data = bitarray("0", endian="big") if hasAcEnv: # parse frequency grids data += bitarray( - get_count_or_index_code(len(sections['frequencyGrid'])), # fgdNrGrids - endian='big') - for _, fg in sections['frequencyGrid'].items(): - method = eval_option(fg['method']) - if method == 'individualFrequencies': + get_count_or_index_code(len(sections["frequencyGrid"])), # fgdNrGrids + endian="big", + ) + for _, fg in sections["frequencyGrid"].items(): + method = eval_option(fg["method"]) + if method == "individualFrequencies": data += bitarray( - fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(len(eval_option(fg['frequencies']))) # fgdNrBands - + concatenate(get_frequency_code, eval_option(fg['frequencies']))) # fgdCenterFreq - elif method == 'startHopAmount': + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code( + len(eval_option(fg["frequencies"])) + ) # fgdNrBands + + concatenate(get_frequency_code, eval_option(fg["frequencies"])) + ) # fgdCenterFreq + elif method == "startHopAmount": data += bitarray( - fgdMethod.Start_Hop_Amount.value # fgdMethod - + get_count_or_index_code(eval_option(fg['nrBands'])) # fgdNrBands - + get_frequency_code(eval_option(fg['startFrequency'])) # fgdCenterFreq - + get_frequency_hop_code(eval_option(fg['frequencyHop']))) # frequencyHop - elif method == 'defaultBanding': + fgdMethod.Start_Hop_Amount.value # fgdMethod + + get_count_or_index_code(eval_option(fg["nrBands"])) # fgdNrBands + + get_frequency_code( + eval_option(fg["startFrequency"]) + ) # fgdCenterFreq + + get_frequency_hop_code(eval_option(fg["frequencyHop"])) + ) # frequencyHop + elif method == "defaultBanding": data += bitarray( - fgdMethod.Default_Banding.value # fgdMethod - + format(eval_option(fg['defaultGrid']), '04b') # fgdDefaultGrid - + get_bool_code('defaultGridOffset' in fg)) # fgdIsSubGrid - if 'defaultGridOffset' in fg: + fgdMethod.Default_Banding.value # fgdMethod + + format(eval_option(fg["defaultGrid"]), "04b") # fgdDefaultGrid + + get_bool_code("defaultGridOffset" in fg) + ) # fgdIsSubGrid + if "defaultGridOffset" in fg: data += bitarray( - format(eval_option(fg['defaultGridOffset']), '03b') # fgdDefaultGridOffset - + format(eval_option(fg['defaultGridNrBands']), '06b')) # fgdDefaultGridNrBands + format( + eval_option(fg["defaultGridOffset"]), "03b" + ) # fgdDefaultGridOffset + + format(eval_option(fg["defaultGridNrBands"]), "06b") + ) # fgdDefaultGridNrBands else: - assert False, 'unknow frequency grid method' + assert False, "unknow frequency grid method" # parse acoustic environments data += bitarray( - get_count_or_index_code(len(sections['acousticEnvironment']))) # revNrElements - for index, ae in sections['acousticEnvironment'].items(): + get_count_or_index_code(len(sections["acousticEnvironment"])) + ) # revNrElements + for index, ae in sections["acousticEnvironment"].items(): data += bitarray( - get_id_code(eval_option(index)) # revAcEnvID - + get_count_or_index_code(eval_option(ae['frequencyGridIndex'])) # revFreqGridIdx - + get_duration_code(eval_option(ae['predelay'])) # revPredelay - + concatenate(get_duration_code, eval_option(ae['rt60'])) # revRT60 - + concatenate(get_dsr_code, eval_option(ae['dsr'])) # revDSR - + get_bool_code('earlyReflectionsSize' in ae)) # hasEarlyReflections - if 'earlyReflectionsSize' in ae: - assert len(eval_option(ae['absorptionCoeffs'])) == 6, 'wrong number of absorption coefficients' + get_id_code(eval_option(index)) # revAcEnvID + + get_count_or_index_code( + eval_option(ae["frequencyGridIndex"]) + ) # revFreqGridIdx + + get_duration_code(eval_option(ae["predelay"])) # revPredelay + + concatenate(get_duration_code, eval_option(ae["rt60"])) # revRT60 + + concatenate(get_dsr_code, eval_option(ae["dsr"])) # revDSR + + get_bool_code("earlyReflectionsSize" in ae) + ) # hasEarlyReflections + if "earlyReflectionsSize" in ae: + assert ( + len(eval_option(ae["absorptionCoeffs"])) == 6 + ), "wrong number of absorption coefficients" data += bitarray( - concatenate(lambda d : get_distance_code(d, True), eval_option(ae['earlyReflectionsSize'])) # erSize - + concatenate(get_absorption_code, eval_option(ae['absorptionCoeffs'])) # erAbsCoeff - + get_bool_code('listenerOrigin' in ae)) # hasListenerOrigin - if 'listenerOrigin' in ae: - xyz = eval_option(ae['listenerOrigin']) - assert len(xyz) == 3, 'wrong number of listener origin coordinates' - assert xyz[2] >= 0, 'listener origin Z >= 0' + concatenate( + lambda d: get_distance_code(d, True), + eval_option(ae["earlyReflectionsSize"]), + ) # erSize + + concatenate( + get_absorption_code, eval_option(ae["absorptionCoeffs"]) + ) # erAbsCoeff + + get_bool_code("listenerOrigin" in ae) + ) # hasListenerOrigin + if "listenerOrigin" in ae: + xyz = eval_option(ae["listenerOrigin"]) + assert len(xyz) == 3, "wrong number of listener origin coordinates" + assert xyz[2] >= 0, "listener origin Z >= 0" data += bitarray( - get_bool_code(xyz[0] >= 0) # isPositiveX - - + get_bool_code(xyz[1] >= 0) # isPositiveY - + concatenate(lambda d : get_distance_code(d, True), [abs(v) for v in xyz])) # erListenerOrigin - lowComplexity = bool(eval_option(ae['lowComplexity'])) if 'lowComplexity' in ae else False - data += bitarray(get_bool_code(lowComplexity)) # lowComplexity - + get_bool_code(xyz[0] >= 0) # isPositiveX + + get_bool_code(xyz[1] >= 0) # isPositiveY + + concatenate( + lambda d: get_distance_code(d, True), [abs(v) for v in xyz] + ) + ) # erListenerOrigin + lowComplexity = ( + bool(eval_option(ae["lowComplexity"])) + if "lowComplexity" in ae + else False + ) + data += bitarray(get_bool_code(lowComplexity)) # lowComplexity # parse directivity settings - if sections['directivitySetting']: - directivityCount = eval_option(sections['directivitySetting']['directivityCount']) - assert directivityCount == len(sections['directivityPattern']) + if sections["directivitySetting"]: + directivityCount = eval_option( + sections["directivitySetting"]["directivityCount"] + ) + assert directivityCount == len(sections["directivityPattern"]) # parse directivity - hasDirectivity = len(sections['directivitySetting']) > 0 + hasDirectivity = len(sections["directivitySetting"]) > 0 data += get_bool_code(hasDirectivity) if hasDirectivity: - data += bitarray(get_id_code(len(sections['directivityPattern']))) - for index, dir_pattern in sections['directivityPattern'].items(): + data += bitarray(get_id_code(len(sections["directivityPattern"]))) + for index, dir_pattern in sections["directivityPattern"].items(): data += bitarray(get_id_code(eval_option(index))) - dir_values = eval_option(dir_pattern['directivity']) - data += bitarray(get_angle_code(dir_values[0]) # Directivity inner angle - + get_angle_code(dir_values[1]) # Directivity outer angle - + get_outer_attenuation_code(dir_values[2])) # Directivity outer attenuation + dir_values = eval_option(dir_pattern["directivity"]) + data += bitarray( + get_angle_code(dir_values[0]) # Directivity inner angle + + get_angle_code(dir_values[1]) # Directivity outer angle + + get_outer_attenuation_code(dir_values[2]) + ) # Directivity outer attenuation # generate binary file - data.tofile(open(file.split('.')[0] + '.dat', 'wb')) + data.tofile(open(file.split(".")[0] + ".dat", "wb")) if __name__ == "__main__": import argparse - parser = argparse.ArgumentParser(description='Reads a text-based configuration file and generates the equivalent binary payload file (.dat)') + + parser = argparse.ArgumentParser( + description="Reads a text-based configuration file and generates the equivalent binary payload file (.dat)" + ) parser.add_argument("configuration_file") args = parser.parse_args() parse_reverb_text_configuration_and_generate_binary_payload(args.configuration_file) - print("\nNote: the conversion algorithm uses quantization, which may lead to quantization errors.") + print( + "\nNote: the conversion algorithm uses quantization, which may lead to quantization errors." + ) # print maximum quantization errors exceeding float32 resolution epsilon = 2e-7 # slighly larger than float32 epsilon - text = '' + text = "" for name in max_quantization_error.keys(): if max_quantization_error[name] > epsilon: - text += '\n {:10s}: {:.1e}'.format(name, max_quantization_error[name]) + text += "\n {:10s}: {:.1e}".format(name, max_quantization_error[name]) if len(text) > 0: - print('Maximum relative quantization errors > {}:'.format(epsilon) + text) \ No newline at end of file + print("Maximum relative quantization errors > {}:".format(epsilon) + text) diff --git a/scripts/runIvasCodec.py b/scripts/runIvasCodec.py index 92fed75393..a4a4c1fef8 100755 --- a/scripts/runIvasCodec.py +++ b/scripts/runIvasCodec.py @@ -30,14 +30,14 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ +import logging import os.path import platform -import sys -import logging import shutil +import sys -from pyivastest import IvasScriptsCommon, IvasModeRunner import pyivastest.constants as constants +from pyivastest import IvasModeRunner, IvasScriptsCommon bin_ext = "" if platform.system() == "Windows": @@ -83,7 +83,7 @@ class RunIvasCodec(IvasScriptsCommon.IvasScript): default=default_dec, ) self.parser.add_argument( - "--fail_log_dir", + "--fail_log_dir", help="Move logs of failed modes to dir (default none)", default=None, ) @@ -144,18 +144,17 @@ class RunIvasCodec(IvasScriptsCommon.IvasScript): self.logger.console(" Encoder: {}".format(bin_enc), logging.INFO) self.logger.console(" Decoder: {}".format(bin_dec), logging.INFO) - runner.run() self.logger.console(" ") - fail_log_dir=None + fail_log_dir = None if self.args["fail_log_dir"] is not None: fail_log_dir = os.path.realpath(self.args["fail_log_dir"]) - if not(os.path.exists(fail_log_dir)): + if not (os.path.exists(fail_log_dir)): os.makedirs(fail_log_dir) for r in runner.results: self.logger.console(r[0]) if fail_log_dir is not None: - shutil.copy(r[3],fail_log_dir) + shutil.copy(r[3], fail_log_dir) self.logger.console(" ") diff --git a/scripts/self_test.py b/scripts/self_test.py index 42b6ce935b..f3d204155b 100755 --- a/scripts/self_test.py +++ b/scripts/self_test.py @@ -31,28 +31,28 @@ """ -import re -import os -import urllib -from pyivastest import IvasScriptsCommon -from pyivastest.IvasSvnBuilder import * -from pyivastest.IvasModeRunner import * -from pyivastest.IvasModeAnalyzer import * -from pyivastest.IvasModeCollector import * -import pyivastest.ivas_svn as svn -import pyivastest.constants as constants +import errno +import multiprocessing import operator -import sys -import pyaudio3dtools +import os import platform -import numpy -import multiprocessing +import re +import shutil +import sys import tempfile +import urllib import urllib.parse -import shutil -import prepare_combined_format_inputs -import errno +import numpy +import prepare_combined_format_inputs +import pyaudio3dtools +import pyivastest.constants as constants +import pyivastest.ivas_svn as svn +from pyivastest import IvasScriptsCommon +from pyivastest.IvasModeAnalyzer import * +from pyivastest.IvasModeCollector import * +from pyivastest.IvasModeRunner import * +from pyivastest.IvasSvnBuilder import * BW_TO_SR = {"nb": 8, "wb": 16, "swb": 32, "fb": 48} SR_TO_BW = {"8": "nb", "16": "wb", "32": "swb", "48": "fb"} @@ -503,12 +503,14 @@ class SelfTest(IvasScriptsCommon.IvasScript): SNR_id.ljust(7, " "), snr_report_ref[snr_chan][SNR_id], snr_report_test[snr_chan][SNR_id], - "identical" - if snr_report_ref[snr_chan][SNR_id] - == snr_report_test[snr_chan][SNR_id] - else "not identical ({0:+.3f})".format( - snr_report_test[snr_chan][SNR_id] - - snr_report_ref[snr_chan][SNR_id] + ( + "identical" + if snr_report_ref[snr_chan][SNR_id] + == snr_report_test[snr_chan][SNR_id] + else "not identical ({0:+.3f})".format( + snr_report_test[snr_chan][SNR_id] + - snr_report_ref[snr_chan][SNR_id] + ) ), ) ) @@ -1002,10 +1004,14 @@ class SelfTest(IvasScriptsCommon.IvasScript): prepare_combined_format_inputs.main() if not os.path.exists(in_file): self.logger.error(f"Test vector {in_file} does not exist!") - raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), in_file) + raise FileNotFoundError( + errno.ENOENT, os.strerror(errno.ENOENT), in_file + ) else: self.logger.error(f"Test vector {in_file} does not exist!") - raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), in_file) + raise FileNotFoundError( + errno.ENOENT, os.strerror(errno.ENOENT), in_file + ) # handle intermediate processing steps, e.g. networksimulator, eid-xor, ... in_file = bs_enc_file @@ -1021,9 +1027,7 @@ class SelfTest(IvasScriptsCommon.IvasScript): proc_cmd[0] = os.path.join(TOOLS_DIR, proc_cmd[0]) - proc_cmd = [ - "{in_file}" if x == in_file else x for x in proc_cmd - ] + proc_cmd = ["{in_file}" if x == in_file else x for x in proc_cmd] if mode[1]: for cmdline_arg in proc_cmd[1:]: if cmdline_arg in mode[1][0]: @@ -1573,7 +1577,7 @@ class SelfTest(IvasScriptsCommon.IvasScript): "corrupt_test_conditions": {"cnt": 0, "conditions": []}, "diff_nsamples_conditions": {"cnt": 0, "conditions": []}, "detailedResults": [], - "failed_modes":[], + "failed_modes": [], } self.run_pesq = self.args["pesq"] failed_ref_conditions = {} @@ -1987,7 +1991,9 @@ class SelfTest(IvasScriptsCommon.IvasScript): self.logger.info("---------------------\n") for mode in run_dict.keys(): if mode in self.fail_results["failed_modes"]: - self.logger.info(f"[FAIL] {run_dict[mode]['cmd']['table_name']}") + self.logger.info( + f"[FAIL] {run_dict[mode]['cmd']['table_name']}" + ) else: self.logger.info(f"[OK] {run_dict[mode]['cmd']['table_name']}") diff --git a/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py b/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py index d328cc6759..033c25bb60 100755 --- a/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py +++ b/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py @@ -14,8 +14,12 @@ TEMP_DIR = "tmp" # Config values to iterate over ISM_CONFIGS_NUM_OBJECTS = [1, 2, 3, 4] IVAS_BITRATES = [128000] -PRE_HEAD_ROT_FILES = ["Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv"] -POST_HEAD_ROT_FILES = ["Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv"] +PRE_HEAD_ROT_FILES = [ + "Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv" +] +POST_HEAD_ROT_FILES = [ + "Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv" +] RENDER_CONFIG_FILES = [ ####################################################### # Alternative 2 - LC3plus with CLDFB pose correction @@ -43,7 +47,9 @@ def basename(file_path): # Full chain: IVAS_cod -> IVAS_dec -> IVAS_rend(post) -def full_chain(num_objects, ivas_bitrate, pre_head_rot_file, render_config_file, post_head_rot_file): +def full_chain( + num_objects, ivas_bitrate, pre_head_rot_file, render_config_file, post_head_rot_file +): bs_name = f"{TEMP_DIR}/ism{num_objects}_b{ivas_bitrate}_full_chain.g192" cod = [ ENC_PATH, @@ -56,9 +62,15 @@ def full_chain(num_objects, ivas_bitrate, pre_head_rot_file, render_config_file, bs_name, ] - render_config_infix = f"##{basename(render_config_file)}" if render_config_file else "" - split_bs_name = bs_name.replace(".g192", f"##{basename(pre_head_rot_file)}{render_config_infix}##split.bs") - render_config_args = ["-render_config", render_config_file] if render_config_file else [] + render_config_infix = ( + f"##{basename(render_config_file)}" if render_config_file else "" + ) + split_bs_name = bs_name.replace( + ".g192", f"##{basename(pre_head_rot_file)}{render_config_infix}##split.bs" + ) + render_config_args = ( + ["-render_config", render_config_file] if render_config_file else [] + ) dec = [ DEC_PATH, "-T", @@ -70,7 +82,9 @@ def full_chain(num_objects, ivas_bitrate, pre_head_rot_file, render_config_file, split_bs_name, ] - binaural_output_name = split_bs_name.replace(".bs", f"##{basename(post_head_rot_file)}##binaural.wav") + binaural_output_name = split_bs_name.replace( + ".bs", f"##{basename(post_head_rot_file)}##binaural.wav" + ) rend = [ REND_PATH, "-i", @@ -92,11 +106,13 @@ def full_chain(num_objects, ivas_bitrate, pre_head_rot_file, render_config_file, # Renderer chain: IVAS_rend(pre) -> IVAS_rend(post) def rend_chain(num_objects, pre_head_rot_file, render_config_file, post_head_rot_file): - render_config_infix = f"##{basename(render_config_file)}" if render_config_file else "" - split_bs_name = ( - f"{TEMP_DIR}/ism{num_objects}_rend_chain##{basename(pre_head_rot_file)}{render_config_infix}##split.bs" + render_config_infix = ( + f"##{basename(render_config_file)}" if render_config_file else "" + ) + split_bs_name = f"{TEMP_DIR}/ism{num_objects}_rend_chain##{basename(pre_head_rot_file)}{render_config_infix}##split.bs" + render_config_args = ( + ["-render_config", render_config_file] if render_config_file else [] ) - render_config_args = ["-render_config", render_config_file] if render_config_file else [] pre = [ REND_PATH, "-i", @@ -116,7 +132,9 @@ def rend_chain(num_objects, pre_head_rot_file, render_config_file, post_head_rot split_bs_name, ] - binaural_output_name = split_bs_name.replace(".bs", f"##{basename(post_head_rot_file)}##binaural.wav") + binaural_output_name = split_bs_name.replace( + ".bs", f"##{basename(post_head_rot_file)}##binaural.wav" + ) post = [ REND_PATH, "-i", diff --git a/scripts/strip_split_rendering.py b/scripts/strip_split_rendering.py index 0016a7fe4f..16382b189c 100644 --- a/scripts/strip_split_rendering.py +++ b/scripts/strip_split_rendering.py @@ -30,94 +30,94 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # -import os import glob +import os # remove other split rendering files -sr_files_rend=[ - "lib_rend\\ivas_MSPred.c", - "lib_rend\\ivas_NoiseGen.c", - "lib_rend\\ivas_PerceptualModel.c", - "lib_rend\\ivas_PredDecoder.c", - "lib_rend\\ivas_PredEncoder.c", - "lib_rend\\ivas_RMSEnvGrouping.c", - "lib_rend\\ivas_lc3plus_common.c", - "lib_rend\\ivas_lc3plus_common.h", - "lib_rend\\ivas_lc3plus_dec.c", - "lib_rend\\ivas_lc3plus_dec.h", - "lib_rend\\ivas_lc3plus_enc.c", - "lib_rend\\ivas_lc3plus_enc.h", - "lib_rend\\ivas_lcld_decoder.c", - "lib_rend\\ivas_lcld_encoder.c", - "lib_rend\\ivas_lcld_prot.h", - "lib_rend\\ivas_lcld_rom_tables.c" - "lib_rend\\ivas_lcld_rom_tables.h" - "lib_rend\\ivas_splitRend_lcld_dec.c", - "lib_rend\\ivas_splitRend_lcld_enc.c", - "lib_rend\\ivas_splitRendererPLC.c", - "lib_rend\\ivas_splitRendererPost.c", - "lib_rend\\ivas_splitRendererPre.c", - "lib_rend\\ivas_splitRenderer_utils.c" +sr_files_rend = [ + "lib_rend\\ivas_MSPred.c", + "lib_rend\\ivas_NoiseGen.c", + "lib_rend\\ivas_PerceptualModel.c", + "lib_rend\\ivas_PredDecoder.c", + "lib_rend\\ivas_PredEncoder.c", + "lib_rend\\ivas_RMSEnvGrouping.c", + "lib_rend\\ivas_lc3plus_common.c", + "lib_rend\\ivas_lc3plus_common.h", + "lib_rend\\ivas_lc3plus_dec.c", + "lib_rend\\ivas_lc3plus_dec.h", + "lib_rend\\ivas_lc3plus_enc.c", + "lib_rend\\ivas_lc3plus_enc.h", + "lib_rend\\ivas_lcld_decoder.c", + "lib_rend\\ivas_lcld_encoder.c", + "lib_rend\\ivas_lcld_prot.h", + "lib_rend\\ivas_lcld_rom_tables.c" + "lib_rend\\ivas_lcld_rom_tables.h" + "lib_rend\\ivas_splitRend_lcld_dec.c", + "lib_rend\\ivas_splitRend_lcld_enc.c", + "lib_rend\\ivas_splitRendererPLC.c", + "lib_rend\\ivas_splitRendererPost.c", + "lib_rend\\ivas_splitRendererPre.c", + "lib_rend\\ivas_splitRenderer_utils.c", ] -sr_files_util=[ - "lib_util\\split_rend_bfi_file_reader.c", - "lib_util\\split_rend_bfi_file_reader.h", - "lib_util\\split_render_file_read_write.c", - "lib_util\\split_render_file_read_write.h" +sr_files_util = [ + "lib_util\\split_rend_bfi_file_reader.c", + "lib_util\\split_rend_bfi_file_reader.h", + "lib_util\\split_render_file_read_write.c", + "lib_util\\split_render_file_read_write.h", ] if __name__ == "__main__": - wsfile = '.\Workspace_msvc\Workspace_msvc.sln' - rendproj = '.\Workspace_msvc\lib_rend.vcxproj' - utilproj = '.\Workspace_msvc\lib_util.vcxproj' - lc3proj = '.\Workspace_msvc\lib_lc3plus.vcxproj' - + wsfile = ".\Workspace_msvc\Workspace_msvc.sln" + rendproj = ".\Workspace_msvc\lib_rend.vcxproj" + utilproj = ".\Workspace_msvc\lib_util.vcxproj" + lc3proj = ".\Workspace_msvc\lib_lc3plus.vcxproj" + # Remove lc3plus project os.remove(lc3proj) - + # Patch Workspace_msvc.sln - with open(wsfile,'r') as f: + with open(wsfile, "r") as f: lines = f.readlines() - with open(wsfile,'w') as f: + with open(wsfile, "w") as f: skip = 0 for line in lines: - if 'lib_lc3plus.vcxproj' in line: + if "lib_lc3plus.vcxproj" in line: skip = 1 else: if skip == 0: f.write(line) else: skip = skip - 1 - - # Patch lib_rend.vcxproj - with open(rendproj,'r') as f: + + # Patch lib_rend.vcxproj + with open(rendproj, "r") as f: lines = f.readlines() - with open(rendproj,'w') as f: + with open(rendproj, "w") as f: skip = 0 for line in lines: if any([x in line for x in sr_files_rend]): skip = 1 - if 'lib_lc3plus.vcxproj' in line: + if "lib_lc3plus.vcxproj" in line: skip = 4 - if skip == 0: + if skip == 0: f.write(line) else: skip = skip - 1 - - # Patch lib_util.vcxproj - with open(utilproj,'r') as f: + + # Patch lib_util.vcxproj + with open(utilproj, "r") as f: lines = f.readlines() - with open(utilproj,'w') as f: + with open(utilproj, "w") as f: for line in lines: if not any([x in line for x in sr_files_util]): f.write(line) - + # Remove include libraries - for proj in glob.glob('.\Workspace_msvc\*.vcxproj'): - with open(proj,'r') as f: + for proj in glob.glob(".\Workspace_msvc\*.vcxproj"): + with open(proj, "r") as f: lines = f.readlines() - with open(proj,'w') as f: + with open(proj, "w") as f: for line in lines: - f.write(line.replace("..\lib_lc3plus;","")) + f.write(line.replace("..\lib_lc3plus;", "")) diff --git a/tests/cmp_pcm.py b/tests/cmp_pcm.py index 9db7ccd39e..13a1c1ba5a 100755 --- a/tests/cmp_pcm.py +++ b/tests/cmp_pcm.py @@ -1,18 +1,18 @@ #!/usr/bin/env python3 +import argparse import os import sys -import argparse THIS_PATH = os.path.join(os.getcwd(), __file__) sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) +import numpy as np import pyaudio3dtools import pyivastest -import numpy as np -def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, str): +def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0) -> (int, str): """ Compare 2 PCM files for bitexactness """ @@ -34,7 +34,9 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, s1, _ = pyaudio3dtools.audiofile.readfile(file1, nchannels, fs, outdtype=np.int16) s2, _ = pyaudio3dtools.audiofile.readfile(file2, nchannels, fs, outdtype=np.int16) - nchannels = s1.shape[1] # In case of wav input, override the nchannels with the one from the wav header + nchannels = s1.shape[ + 1 + ] # In case of wav input, override the nchannels with the one from the wav header if s1.shape != s2.shape: print( @@ -43,7 +45,9 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, ) return 1, "FAIL: File lengths differ" - cmp_result = pyaudio3dtools.audioarray.compare(s1, s2, fs, per_frame=False, get_mld=get_mld) + cmp_result = pyaudio3dtools.audioarray.compare( + s1, s2, fs, per_frame=False, get_mld=get_mld + ) if cmp_result["bitexact"]: return 0, "SUCCESS: Files are bitexact" @@ -55,9 +59,9 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld = False, mld_lim = 0) -> (int, if get_mld: mld_msg = f"MLD: {cmp_result['MLD']}" print(mld_msg) - if cmp_result['MLD'] <= mld_lim: + if cmp_result["MLD"] <= mld_lim: return 0, f"MLD: {cmp_result['MLD']} <= {mld_lim}" - else: + else: return 1, f"MLD: {cmp_result['MLD']} > {mld_lim}" return 1, "Non-BE" diff --git a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py index da51049da3..8122074bc8 100644 --- a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py @@ -33,14 +33,15 @@ __doc__ = """ The outputs are compared with C generated references. """ -import os import errno -import pytest -from typing import Optional +import os from filecmp import cmp +from typing import Optional + +import pytest -from tests.conftest import EncoderFrontend, DecoderFrontend from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend # params # output_mode_list = ['MONO', 'STEREO', '5_1', '7_1', '5_1_2', '5_1_4', '7_1_4', 'FOA', 'HOA2', 'HOA3', 'BINAURAL', 'BINAURAL_ROOM', 'EXT'] @@ -203,17 +204,22 @@ def test_masa_enc_dec( # Compare audio outputs pcmcmp_res, reason = cmp_pcm( - dec_output_dut, dec_output_ref, output_mode, int(out_fs * 1000), get_mld=get_mld, mld_lim=get_mld_lim + dec_output_dut, + dec_output_ref, + output_mode, + int(out_fs * 1000), + get_mld=get_mld, + mld_lim=get_mld_lim, ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) if get_mld and get_mld_lim > 0: if pcmcmp_res != 0: - pytest.fail(reason) + pytest.fail(reason) else: # Fail if compare fails compare result if metacmp_res == False and pcmcmp_res != 0: @@ -230,19 +236,24 @@ def test_masa_enc_dec( filecmp_res = cmp(dec_output_ref, dec_output_dut) if filecmp_res == False: cmp_result, reason = cmp_pcm( - dec_output_dut, dec_output_ref, output_mode, int(out_fs * 1000), get_mld=get_mld, mld_lim=get_mld_lim + dec_output_dut, + dec_output_ref, + output_mode, + int(out_fs * 1000), + get_mld=get_mld, + mld_lim=get_mld_lim, ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) # Report compare result if cmp_result != 0: - pytest.fail(reason) + pytest.fail(reason) else: if get_mld: - record_property("MLD","0") + record_property("MLD", "0") print("Comparison bit exact") # remove_output( diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 34138c4b07..c020f84dfb 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -32,19 +32,20 @@ __doc__ = """ Execute tests specified via a parameter file. """ -import os -from pathlib import Path import errno -import platform import filecmp +import os +import platform +from pathlib import Path from subprocess import run + import pytest + from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend from tests.cut_pcm import cut_samples -from tests.conftest import EncoderFrontend, DecoderFrontend from tests.testconfig import PARAM_FILE - VALID_DEC_OUTPUT_CONF = [ "MONO", "STEREO", @@ -200,7 +201,7 @@ def test_param_file_tests( is_exist = os.path.exists(cut_file) if is_exist: os.remove(cut_file) - + # check for networkSimulator_g192 command line if sim_opts != "": sim_split = sim_opts.split() @@ -230,7 +231,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # check for eid-xor command line if eid_opts != "": eid_split = eid_opts.split() @@ -255,7 +256,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # evaluate decoder options dec_split = dec_opts.split() assert len(dec_split) >= 3 @@ -302,7 +303,6 @@ def test_param_file_tests( assert bitstream_file_dec == "bit" # in the parameter file, only "bit" is used as bitstream file name # -> re-use bitstream filename from encoder call - # the output file is not the real output filename # -> construct output filename @@ -321,21 +321,26 @@ def test_param_file_tests( update_ref, tracefile_dec, ) - + if update_ref in [0, 2]: dut_output_file = f"{dut_base_path}/param_file/dec/{output_file}" ref_output_file = f"{reference_path}/param_file/dec/{output_file}" fs = int(sampling_rate) * 1000 output_differs, reason = cmp_pcm( - dut_output_file, ref_output_file, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim + dut_output_file, + ref_output_file, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, ) md_out_files = get_expected_md_files(ref_output_file, enc_split, output_config) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) metadata_differs = False for md_file in md_out_files: @@ -354,7 +359,7 @@ def test_param_file_tests( if get_mld and get_mld_lim > 0: if output_differs: - pytest.fail(reason) + pytest.fail(reason) else: if output_differs or metadata_differs: msg = "Difference between ref and dut in " @@ -378,7 +383,6 @@ def test_param_file_tests( os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") - def encode( dut_encoder_frontend, ref_encoder_frontend, @@ -490,7 +494,8 @@ def simulate( cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file cmd_opts[3] = f"{dut_out_dir}/{netsim_tracefile}" run(netsim + cmd_opts, check=False) - + + def error_insertion( reference_path, dut_base_path, @@ -501,7 +506,7 @@ def error_insertion( """ Call eid-xor to insert frame erasure on REF and/or DUT encoder output. """ - + # directories dut_out_dir = f"{dut_base_path}/param_file/enc" ref_out_dir = f"{reference_path}/param_file/enc" @@ -511,28 +516,21 @@ def error_insertion( ref_out_file = f"{ref_out_dir}/{eid_xor_outfile}" if platform.system() == "Windows": - eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", "Win32", "eid-xor.exe" - ) - ] + eid_xor = [os.path.join(rootdir, "scripts", "tools", "Win32", "eid-xor.exe")] elif platform.system() in ["Linux", "Darwin"]: eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", platform.system(), "eid-xor" - ) + os.path.join(rootdir, "scripts", "tools", platform.system(), "eid-xor") ] else: assert False, f"eid-xor not available for {platform.system()}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): # call eid-xor on REF encoder output cmd_opts = eid_opts_list cmd_opts[-3] = f"{ref_out_dir}/{eid_xor_infile}" cmd_opts[-1] = f"{ref_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) - + if update_ref in [0, 2]: # call eid-xor on DUT encoder output cmd_opts = eid_opts_list @@ -540,6 +538,7 @@ def error_insertion( cmd_opts[-1] = f"{dut_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) + def decode( decoder_frontend, ref_decoder_frontend, diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py index 55c1e40a8f..a049c8453f 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py @@ -1,5 +1,4 @@ -__copyright__ = \ - """ +__copyright__ = """ (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, @@ -29,27 +28,27 @@ __copyright__ = \ the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ - """ +__doc__ = """ Execute SBA decoder tests using different PLC patterns. """ -import os import errno +import os + import pytest from tests.cmp_pcm import cmp_pcm from tests.conftest import DecoderFrontend # params -tag_list = ['stvFOA'] -plc_patterns = ['PLperc12mblen5', 'PLperc40mblen50', 'PLperc42mblen2'] -dtx_set = ['0', '1'] -ivas_br_list = ['13200','16400','32000', '64000', '96000', '256000'] -sampling_rate_list = ['48', '32', '16'] +tag_list = ["stvFOA"] +plc_patterns = ["PLperc12mblen5", "PLperc40mblen50", "PLperc42mblen2"] +dtx_set = ["0", "1"] +ivas_br_list = ["13200", "16400", "32000", "64000", "96000", "256000"] +sampling_rate_list = ["48", "32", "16"] gain_list = [0, 1] -AbsTol = '0' +AbsTol = "0" def check_and_makedir(dir_path): @@ -93,17 +92,22 @@ def test_sba_plc_system( get_mld_lim, ): SID = 0 - if dtx == '1' and ivas_br not in ['13200','16400','24400','32000', '64000']: + if dtx == "1" and ivas_br not in ["13200", "16400", "24400", "32000", "64000"]: # skip high bitrates for DTX until DTX issue is resolved pytest.skip() - if ivas_br == '13200' or ivas_br == '16400': - if dtx == '1' and gain_flag == 0 and fs != '16' and plc_pattern == 'PLperc12mblen5': + if ivas_br == "13200" or ivas_br == "16400": + if ( + dtx == "1" + and gain_flag == 0 + and fs != "16" + and plc_pattern == "PLperc12mblen5" + ): SID = 1 else: pytest.skip() - if gain_flag == 1 and ivas_br not in ['13200','16400','24400','32000']: + if gain_flag == 1 and ivas_br not in ["13200", "16400", "24400", "32000"]: pytest.skip() - tag = tag + fs + 'c' + tag = tag + fs + "c" # dec sba_dec_plc( @@ -153,7 +157,7 @@ def sba_dec_plc( tag_out = f"{tag}_ivasbr{ivas_br[:-3]}k_DTX{dtx}" if gain_flag != -1: - tag_out += f'_Gain{gain_flag}' + tag_out += f"_Gain{gain_flag}" plc_tag_out = f"{tag_out}_{plc_pattern}" dut_out_dir = f"{dut_base_path}/sba_bs/raw" @@ -197,12 +201,19 @@ def sba_dec_plc( # -------------- compare cmd -------------- fs = int(sampling_rate) * 1000 - cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim) + cmp_result, reason = cmp_pcm( + dut_out_raw, + ref_out_raw, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) # report compare result if cmp_result != 0: diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index 00a6a54db1..4fdde6e9ae 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -33,14 +33,15 @@ __doc__ = """ The outputs are compared with C generated references. """ -import os import errno +import os + import pytest +from cut_bs import cut_from_start from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend from tests.cut_pcm import cut_samples -from tests.conftest import EncoderFrontend, DecoderFrontend -from cut_bs import cut_from_start # params @@ -190,10 +191,15 @@ def test_sba_enc_system( # skip high bitrates for DTX until DTX issue is resolved pytest.skip() if SID == 1: - if ivas_br not in ["13200", "16400", "64000"] or fs == "16" or gain_flag == 1 or dtx == "0": + if ( + ivas_br not in ["13200", "16400", "64000"] + or fs == "16" + or gain_flag == 1 + or dtx == "0" + ): pytest.skip() else: - if ivas_br in ["13200","16400"]: + if ivas_br in ["13200", "16400"]: pytest.skip() if ivas_br == "sw_24k4_256k.bin" and gain_flag != 1: pytest.skip() @@ -249,7 +255,7 @@ def test_sba_enc_system( gain_flag, keep_files, get_mld=get_mld, - get_mld_lim=get_mld_lim + get_mld_lim=get_mld_lim, ) @@ -685,12 +691,19 @@ def sba_dec( ) fs = int(sampling_rate) * 1000 - cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim ) + cmp_result, reason = cmp_pcm( + dut_out_raw, + ref_out_raw, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + ) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) # report compare result if cmp_result != 0: diff --git a/tests/codec_be_on_mr_selection/__init__.py b/tests/codec_be_on_mr_selection/__init__.py index c6cbd866ac..2ee63a30a5 100644 --- a/tests/codec_be_on_mr_selection/__init__.py +++ b/tests/codec_be_on_mr_selection/__init__.py @@ -28,14 +28,16 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -import tempfile -import pytest -import os import filecmp -from pathlib import Path +import os import subprocess -from .constants import OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT, DTX_ON, FER_5PERC +import tempfile +from pathlib import Path + +import pytest + from ..testconfig import MD5_REF_DICT +from .constants import DTX_ON, FER_5PERC, OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT HERE = Path(__file__).parent # set environment variables in CI job @@ -95,7 +97,14 @@ def apply_error_pattern_on_bitstream( if in_bitstream == out_bitstream: in_bitstream = Path(tmpdir).joinpath(in_bitstream.name) - cmd = ["eid-xor", "-vbr", "-fer", str(in_bitstream), str(error_pattern), str(out_bitstream)] + cmd = [ + "eid-xor", + "-vbr", + "-fer", + str(in_bitstream), + str(error_pattern), + str(out_bitstream), + ] subprocess.run(cmd) diff --git a/tests/codec_be_on_mr_selection/constants.py b/tests/codec_be_on_mr_selection/constants.py index 4116ca73e7..8f01cf9332 100644 --- a/tests/codec_be_on_mr_selection/constants.py +++ b/tests/codec_be_on_mr_selection/constants.py @@ -29,8 +29,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ from itertools import product -from typing import Union, List - +from typing import List, Union DTX_ON = "DTXon" DTX_OFF = "DTXoff" diff --git a/tests/codec_be_on_mr_selection/test_experiments.py b/tests/codec_be_on_mr_selection/test_experiments.py index 991b7350a6..35152955e9 100644 --- a/tests/codec_be_on_mr_selection/test_experiments.py +++ b/tests/codec_be_on_mr_selection/test_experiments.py @@ -29,13 +29,14 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest + from . import run_check from .constants import ( - P800_CATEGORIES, + BS1534_MASA_PARAMS_UNIFIED, BS1534_N_FILES, - P800_PARAMS_UNIFIED, BS1534_PARAMS_UNIFIED, - BS1534_MASA_PARAMS_UNIFIED, + P800_CATEGORIES, + P800_PARAMS_UNIFIED, ) diff --git a/tests/conftest.py b/tests/conftest.py index d3d21aa903..221d61e63c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -33,15 +33,17 @@ Pytest customization (configuration and fixtures) for the IVAS codec test suite. """ import logging -from pathlib import Path +import os import platform -from subprocess import run, TimeoutExpired, CalledProcessError, STDOUT +import tempfile import textwrap +from pathlib import Path +from subprocess import STDOUT, CalledProcessError, TimeoutExpired, run from typing import Optional, Union -import os -from tests import testconfig + import pytest -import tempfile + +from tests import testconfig logger = logging.getLogger(__name__) USE_LOGGER_FOR_DBG = False # current tests do not make use of the logger feature @@ -49,6 +51,7 @@ USE_LOGGER_FOR_DBG = False # current tests do not make use of the logger featur HERE = Path(__file__).parent SCRIPTS_DIR = str(HERE.parent.joinpath("scripts").absolute()) import sys + sys.path.append(SCRIPTS_DIR) import prepare_combined_format_inputs @@ -171,6 +174,7 @@ def pytest_addoption(parser): default="0", ) + @pytest.fixture(scope="session", autouse=True) def update_ref(request): """ @@ -181,6 +185,7 @@ def update_ref(request): """ return int(request.config.getoption("--update_ref")) + @pytest.fixture(scope="session", autouse=True) def create_combined_formats_testvectors(request): """ @@ -189,6 +194,7 @@ def create_combined_formats_testvectors(request): prepare_combined_format_inputs.main() + @pytest.fixture(scope="session", autouse=True) def get_mld(request): """ @@ -196,6 +202,7 @@ def get_mld(request): """ return request.config.option.mld + @pytest.fixture(scope="session", autouse=True) def get_mld_lim(request): """ @@ -203,6 +210,7 @@ def get_mld_lim(request): """ return float(request.config.getoption("--mld-lim")) + @pytest.fixture(scope="session") def keep_files(request) -> bool: """ @@ -445,7 +453,7 @@ class DecoderFrontend: command.extend(["-q"]) if plc_file is not None: - + system = platform.system() if system == "Windows": @@ -466,7 +474,7 @@ class DecoderFrontend: eid_command += [ str(input_bitstream_path), str(plc_file), - str(input_bitstream_path) + eid_output_suffix + str(input_bitstream_path) + eid_output_suffix, ] try: @@ -495,7 +503,9 @@ class DecoderFrontend: log_dbg_msg(f"{self._type} decoder command:\n{cmd_str}") try: - result = run(command, capture_output=True, check=False, timeout=self.timeout) + result = run( + command, capture_output=True, check=False, timeout=self.timeout + ) except TimeoutExpired: pytest.fail(f"{self._type} decoder run timed out after {self.timeout}s.") diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index a7c1b55212..0b8ee79c81 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (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, @@ -31,13 +30,13 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ Create short (5sec) testvectors. """ import sys from pathlib import Path + from cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() @@ -49,17 +48,23 @@ CUT_LEN = "5.0" def create_short_testvectors(): - for fs in ['48', '32', '16']: + for fs in ["48", "32", "16"]: in_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c.wav" cut_gain = "1.0" cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + cut_samples( + in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain + ) cut_gain = "16.0" cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + cut_samples( + in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain + ) cut_gain = ".004" cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples(in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain) + cut_samples( + in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain + ) if __name__ == "__main__": diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index 420dc9ce02..60bac699cb 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -__copyright__ = \ -""" +__copyright__ = """ (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, @@ -31,8 +30,7 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ Script to cut samples from a 16-bit PCM file. USAGE : cut_pcm.py in_file_pcm out_file_pcm num_channels sample_rate start duration [gain] @@ -45,11 +43,12 @@ duration: duration in seconds gain: optional gain value to apply to the copied samples """ -import sys import platform -import numpy as np +import sys from pathlib import Path +import numpy as np + HERE = Path(__file__).parent.resolve() SCRIPTS_DIR = str(HERE.joinpath("../scripts").resolve()) sys.path.append(SCRIPTS_DIR) @@ -61,14 +60,19 @@ def usage(): return 1 -def cut_samples(in_file, out_file, num_channels, sample_rate, start, duration, gain="1.0"): +def cut_samples( + in_file, out_file, num_channels, sample_rate, start, duration, gain="1.0" +): """ Function to cut samples from an audio file (wav or pcm) """ # check for python >= 3.7 if sys.version_info[0] < 3 or sys.version_info[1] < 7: - sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + sys.exit( + "This script is written for Python >= 3.7. Found: " + + platform.python_version() + ) # all input parameters are strings - convert some fs = int(sample_rate) @@ -87,10 +91,10 @@ def cut_samples(in_file, out_file, num_channels, sample_rate, start, duration, g + f" - input is too short ({num_in_samples})" ) - s_out = s[num_samples_to_skip:num_samples_to_skip + dur_samples, :] * gain_f + s_out = s[num_samples_to_skip : num_samples_to_skip + dur_samples, :] * gain_f audiofile.writefile(out_file, s_out, fs) - + def main(argv): if len(argv) < 7: diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 1895443007..ab5ae13fe2 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -33,11 +33,7 @@ import re from pathlib import Path -from tests.renderer.constants import ( - OUTPUT_FORMATS_BINAURAL, - SCRIPTS_DIR, - TESTV_DIR, -) +from tests.renderer.constants import OUTPUT_FORMATS_BINAURAL, SCRIPTS_DIR, TESTV_DIR TESTS_DIR = Path(__file__).parent diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index a02b7b7c2d..5adcc5ae73 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -33,15 +33,14 @@ import pytest from tests.hrtf_binary_loading.utils import * - from tests.renderer.constants import ( - INPUT_FORMATS_AMBI, - INPUT_FORMATS_ISM, - INPUT_FORMATS_MC, - CUSTOM_LS_TO_TEST, CUSTOM_LAYOUT_DIR, + CUSTOM_LS_TO_TEST, FRAMING_TO_TEST, HR_TRAJECTORY_DIR, + INPUT_FORMATS_AMBI, + INPUT_FORMATS_ISM, + INPUT_FORMATS_MC, ) """ Ambisonics """ diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 577ca2ed3f..3ce3702d8d 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -38,7 +38,7 @@ from typing import Dict, Optional import pytest from tests.renderer.compare_audio import compare_audio_arrays -from tests.renderer.utils import check_BE, run_cmd, test_info, run_renderer +from tests.renderer.utils import check_BE, run_cmd, run_renderer, test_info from .constants import * diff --git a/tests/prepare_pytests.py b/tests/prepare_pytests.py index b3cd5bf6ef..4cd6d07120 100755 --- a/tests/prepare_pytests.py +++ b/tests/prepare_pytests.py @@ -34,13 +34,13 @@ __doc__ = """ Script to prepare the pytest tests. """ -import os -import sys import argparse -import subprocess +import os import platform - +import subprocess +import sys from pathlib import Path + from create_short_testvectors import create_short_testvectors BIN_EXT = ".exe" if platform.system() == "Windows" else "" @@ -58,7 +58,10 @@ def main(argv): """ # check for python >= 3.7 if sys.version_info[0] < 3 or sys.version_info[1] < 7: - sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + sys.exit( + "This script is written for Python >= 3.7. Found: " + + platform.python_version() + ) parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( @@ -78,15 +81,21 @@ def main(argv): use_dut_binaries = False # check for DUT binaries - if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists(DEFAULT_DECODER_DUT): + if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists( + DEFAULT_DECODER_DUT + ): sys.exit( f"Need DUT binaries {DEFAULT_ENCODER_DUT} and {DEFAULT_DECODER_DUT}.\n" "Please create the binaries." ) # check for REF binaries - if not os.path.exists(DEFAULT_ENCODER_REF) or not os.path.exists(DEFAULT_DECODER_REF): - print(f"REF binaries {DEFAULT_ENCODER_REF} and {DEFAULT_DECODER_REF} not found.") + if not os.path.exists(DEFAULT_ENCODER_REF) or not os.path.exists( + DEFAULT_DECODER_REF + ): + print( + f"REF binaries {DEFAULT_ENCODER_REF} and {DEFAULT_DECODER_REF} not found." + ) print("DUT binaries will be used for reference generation.") use_dut_binaries = True @@ -98,7 +107,11 @@ def main(argv): else: base_cmd = ["python3", "-m", "pytest"] if args.param_file: - base_cmd += ["tests/codec_be_on_mr_nonselection/test_param_file.py", "--param_file", args.param_file] + base_cmd += [ + "tests/codec_be_on_mr_nonselection/test_param_file.py", + "--param_file", + args.param_file, + ] else: base_cmd += ["tests/codec_be_on_mr_nonselection"] base_cmd += [ diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 27b6c73020..9718f710d8 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -42,19 +42,22 @@ from .utils import * ############################################################################## """ Ambisonics """ + @pytest.mark.create_ref @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ambisonics( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -62,15 +65,17 @@ def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ambisonics_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ambisonics_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -80,17 +85,24 @@ def test_ambisonics_binaural_static(record_property, test_info, in_fmt, out_fmt, @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) def test_ambisonics_binaural_headrotation( - record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, ): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -101,15 +113,17 @@ def test_ambisonics_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_multichannel(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_multichannel( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -117,18 +131,20 @@ def test_multichannel(record_property, test_info, in_fmt, out_fmt, frame_size, g @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_multichannel_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_multichannel_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -138,7 +154,14 @@ def test_multichannel_binaural_static(record_property, test_info, in_fmt, out_fm @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) def test_multichannel_binaural_headrotation( - record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -150,7 +173,7 @@ def test_multichannel_binaural_headrotation( out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, - get_mld=get_mld, + get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -162,7 +185,9 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ism( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( record_property, test_info, @@ -170,7 +195,7 @@ def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, g out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, + get_mld=get_mld, mld_lim=get_mld_lim, ) @@ -179,21 +204,23 @@ def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, g @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_ism_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] except KeyError: in_meta_files = None run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, in_meta_files=in_meta_files, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -202,22 +229,31 @@ def test_ism_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_ @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim): +def test_ism_binaural_headrotation( + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, +): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] except KeyError: in_meta_files = None run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -228,16 +264,18 @@ def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_masa( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -245,19 +283,21 @@ def test_masa(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_masa_binaural_static( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -266,20 +306,29 @@ def test_masa_binaural_static(record_property, test_info, in_fmt, out_fmt, frame @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim): +def test_masa_binaural_headrotation( + record_property, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, +): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -287,13 +336,13 @@ def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt, @pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim): run_renderer( - record_property, + record_property, test_info, "META", "MASA2", metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -304,43 +353,49 @@ def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_custom_ls_input(record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim): +def test_custom_ls_input( + record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @pytest.mark.create_ref @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("in_fmt", OUTPUT_FORMATS) -def test_custom_ls_output(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_custom_ls_output( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @pytest.mark.create_ref @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("in_fmt", CUSTOM_LS_TO_TEST) -def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_custom_ls_input_output( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"), CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -348,15 +403,17 @@ def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_custom_ls_input_binaural(record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim): +def test_custom_ls_input_binaural( + record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -366,17 +423,24 @@ def test_custom_ls_input_binaural(record_property, test_info, in_layout, out_fmt @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) def test_custom_ls_input_binaural_headrotation( - record_property, test_info, in_layout, out_fmt, trj_file, frame_size, get_mld, get_mld_lim + record_property, + test_info, + in_layout, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, ): run_renderer( - record_property, + record_property, test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -387,16 +451,18 @@ def test_custom_ls_input_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim): +def test_metadata( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, "META", out_fmt, metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), frame_size=frame_size, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -407,15 +473,17 @@ def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_m @pytest.mark.parametrize("out_fmt", ["STEREO"]) @pytest.mark.parametrize("in_fmt", ["MONO"]) @pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) -def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim): +def test_non_diegetic_pan_static( + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -423,15 +491,17 @@ def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, no @pytest.mark.parametrize("out_fmt", ["STEREO"]) @pytest.mark.parametrize("in_fmt", ["ISM1"]) @pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) -def test_non_diegetic_pan_ism_static(record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim): +def test_non_diegetic_pan_ism_static( + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim +): run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan, - get_mld=get_mld, - mld_lim=get_mld_lim, + get_mld=get_mld, + mld_lim=get_mld_lim, ) @@ -455,7 +525,7 @@ def test_ambisonics_binaural_headrotation_refrotzero( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -477,12 +547,14 @@ def test_ambisonics_binaural_headrotation_refrotzero( # Note that reference rotation is supplied per 4 subframes; head rotation per subframe. @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refrotequal(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ambisonics_binaural_headrotation_refrotequal( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -516,7 +588,7 @@ def test_ambisonics_binaural_headrotation_refveczero( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -539,7 +611,9 @@ def test_ambisonics_binaural_headrotation_refveczero( # looking-direction of the head rotation and therefore compensates it (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvecequal(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ambisonics_binaural_headrotation_refvecequal( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -548,7 +622,7 @@ def test_ambisonics_binaural_headrotation_refvecequal(record_property, test_info pytest.xfail("WIP : minor differences to be resolved") else: compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -574,7 +648,9 @@ def test_ambisonics_binaural_headrotation_refvecequal(record_property, test_info # in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_headrotation_refvec_rotating(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ambisonics_binaural_headrotation_refvec_rotating( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -583,7 +659,7 @@ def test_ambisonics_binaural_headrotation_refvec_rotating(record_property, test_ pytest.xfail("WIP : minor differences to be resolved") else: compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -619,7 +695,7 @@ def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -654,7 +730,7 @@ def test_ambisonics_binaural_headrotation_refveclev_vs_refvec( pytest.skip("OTR tests only run for smoke test") compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -680,7 +756,9 @@ def test_ambisonics_binaural_headrotation_refveclev_vs_refvec( # in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel_binaural_headrotation_refvec_rotating(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_multichannel_binaural_headrotation_refvec_rotating( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -715,7 +793,9 @@ def test_multichannel_binaural_headrotation_refvec_rotating(record_property, tes # in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_headrotation_refvec_rotating(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim): +def test_ism_binaural_headrotation_refvec_rotating( + record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim +): if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") @@ -725,7 +805,7 @@ def test_ism_binaural_headrotation_refvec_rotating(record_property, test_info, i in_meta_files = None compare_renderer_args( - record_property, + record_property, test_info, in_fmt, out_fmt, diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 2f83decc0f..82847599b3 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -110,8 +110,8 @@ def run_renderer( binary_suffix: str = "", frame_size: Optional[str] = "20ms", hrtf_file: Optional[str] = None, - get_mld = False, - mld_lim = 0, + get_mld=False, + mld_lim=0, ) -> str: # prepare arguments and filepaths if trj_file is not None: @@ -230,11 +230,18 @@ def run_renderer( out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem)) if get_mld: - output_differs, reason = cmp_pcm(out_file, out_file_ref, out_fmt, ref_fs, get_mld=get_mld, mld_lim=get_mld_lim) + output_differs, reason = cmp_pcm( + out_file, + out_file_ref, + out_fmt, + ref_fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + ) mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) if output_differs: pytest.fail(f"Output differs: ({reason})") else: @@ -263,7 +270,7 @@ def compare_renderer_args( record_property, test_info, in_fmt, out_fmt, ref_kwargs: Dict, cut_kwargs: Dict ): out_file_ref = run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, @@ -271,7 +278,7 @@ def compare_renderer_args( ) ref, ref_fs = readfile(out_file_ref) out_file_cut = run_renderer( - record_property, + record_property, test_info, in_fmt, out_fmt, diff --git a/tests/run_pytests.py b/tests/run_pytests.py index 6ef8d94676..ccac5e1436 100755 --- a/tests/run_pytests.py +++ b/tests/run_pytests.py @@ -37,11 +37,11 @@ Test prerequisites are checked for and check failures are reported. When prerequisites are met, the pytest test is executed. """ -import os -import sys import argparse -import subprocess +import os import platform +import subprocess +import sys from pathlib import Path BIN_EXT = ".exe" if platform.system() == "Windows" else "" @@ -57,7 +57,10 @@ def main(argv): """ # check for python >= 3.7 if sys.version_info[0] < 3 or sys.version_info[1] < 7: - sys.exit("This script is written for Python >= 3.7. Found: " + platform.python_version()) + sys.exit( + "This script is written for Python >= 3.7. Found: " + + platform.python_version() + ) parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( @@ -81,7 +84,9 @@ def main(argv): ) # check for DUT binaries - if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists(DEFAULT_DECODER_DUT): + if not os.path.exists(DEFAULT_ENCODER_DUT) or not os.path.exists( + DEFAULT_DECODER_DUT + ): sys.exit( f"Need DUT binaries {DEFAULT_ENCODER_DUT} and {DEFAULT_DECODER_DUT}.\n" "Please create the binaries." @@ -93,7 +98,11 @@ def main(argv): else: cmd = ["python3", "-m", "pytest"] if args.param_file: - cmd += ["tests/codec_be_on_mr_nonselection/test_param_file.py", "--param_file", args.param_file] + cmd += [ + "tests/codec_be_on_mr_nonselection/test_param_file.py", + "--param_file", + args.param_file, + ] else: cmd += ["tests/codec_be_on_mr_nonselection"] cmd += ["-n", args.numprocesses] diff --git a/tests/scale_pcm.py b/tests/scale_pcm.py index 9aef914da1..7b6d7f1ec7 100755 --- a/tests/scale_pcm.py +++ b/tests/scale_pcm.py @@ -1,17 +1,18 @@ #!/usr/bin/env python3 -import os -import sys import argparse +import os import pathlib +import sys THIS_PATH = os.path.join(os.getcwd(), __file__) sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) +import concurrent.futures + +import numpy as np import pyaudio3dtools import pyivastest -import numpy as np -import concurrent.futures def scale_folder(folder, factor): @@ -20,14 +21,16 @@ def scale_folder(folder, factor): with concurrent.futures.ThreadPoolExecutor() as executor: executor.map(scale_file, files, files, [factor] * len(files)) -def scale_file(file1, file2, factor = 1.0) -> None: + +def scale_file(file1, file2, factor=1.0) -> None: """ Scale file1 to file2 """ s1, fs = pyaudio3dtools.audiofile.readfile(file1) - s2 = s1 * factor; + s2 = s1 * factor pyaudio3dtools.audiofile.writefile(file2, s2, fs) + if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("folder", type=pathlib.Path) diff --git a/tests/test_26444.py b/tests/test_26444.py index 262e04b778..2d1771e6a0 100644 --- a/tests/test_26444.py +++ b/tests/test_26444.py @@ -32,21 +32,28 @@ __doc__ = """ Execute tests specified via a parameter file. """ -import os -from pathlib import Path import filecmp +import os import subprocess +from pathlib import Path + import pytest test_dict = {} -TEST_DIR = "evs_be_test" -scripts=["Readme_AMRWB_IO_dec.txt", "Readme_AMRWB_IO_enc.txt", "Readme_EVS_dec.txt","Readme_EVS_enc.txt", "Readme_JBM_dec.txt"] +TEST_DIR = "evs_be_test" +scripts = [ + "Readme_AMRWB_IO_dec.txt", + "Readme_AMRWB_IO_enc.txt", + "Readme_EVS_dec.txt", + "Readme_EVS_enc.txt", + "Readme_JBM_dec.txt", +] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: tag = "" enc_opts = "" dec_opts = "" - diff_opts = "" + diff_opts = "" for line in fp.readlines(): if line.startswith("$ENC_BIN"): enc_opts = line @@ -54,15 +61,16 @@ for s in scripts: dec_opts = line if line.startswith("$DIFF_BIN"): diff_opts = line[9:] - tag = s + "--" + diff_opts.split()[1].split('/')[-1] + tag = s + "--" + diff_opts.split()[1].split("/")[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") - continue + continue test_dict[tag] = (enc_opts, dec_opts, diff_opts) tag = "" enc_opts = "" dec_opts = "" - diff_opts = "" + diff_opts = "" + @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_evs_26444(test_tag): @@ -71,16 +79,16 @@ def test_evs_26444(test_tag): if enc_opts: enc_opts = enc_opts.replace("./", TEST_DIR + "/") - subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:]) + subprocess.run(["./IVAS_cod", "-q"] + enc_opts.split()[1:]) if dec_opts: dec_opts = dec_opts.replace("./", TEST_DIR + "/") - subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:]) - + subprocess.run(["./IVAS_dec", "-q"] + dec_opts.split()[1:]) + diff_opts = diff_opts.replace("./", TEST_DIR + "/") - if ';' in diff_opts: - cmd1, cmd2 = diff_opts.split(';') + if ";" in diff_opts: + cmd1, cmd2 = diff_opts.split(";") cmd1 = cmd1.split() - cmd2 = cmd2.split() + cmd2 = cmd2.split() result1 = filecmp.cmp(cmd1[0], cmd1[1]) result2 = filecmp.cmp(cmd2[2], cmd2[3]) else: @@ -89,6 +97,3 @@ def test_evs_26444(test_tag): result2 = True if not (result1 and result2): pytest.fail("Output differs") - - - \ No newline at end of file diff --git a/tests/test_param_file_ltv.py b/tests/test_param_file_ltv.py index bef9049be5..dd1831c517 100644 --- a/tests/test_param_file_ltv.py +++ b/tests/test_param_file_ltv.py @@ -32,17 +32,20 @@ __doc__ = """ Execute tests specified via a parameter file. """ -import os -from pathlib import Path import errno -import platform import filecmp +import os +import platform +from pathlib import Path from subprocess import run + import pytest + from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend, EncoderFrontend from tests.cut_pcm import cut_samples -from tests.conftest import EncoderFrontend, DecoderFrontend -#from tests.testconfig import PARAM_FILE + +# from tests.testconfig import PARAM_FILE VALID_DEC_OUTPUT_CONF = [ @@ -201,7 +204,7 @@ def test_param_file_tests( is_exist = os.path.exists(cut_file) if is_exist: os.remove(cut_file) - + # check for networkSimulator_g192 command line if sim_opts != "": sim_split = sim_opts.split() @@ -231,7 +234,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # check for eid-xor command line if eid_opts != "": eid_split = eid_opts.split() @@ -256,7 +259,7 @@ def test_param_file_tests( update_ref, rootdir, ) - + # evaluate decoder options dec_split = dec_opts.split() assert len(dec_split) >= 3 @@ -303,7 +306,6 @@ def test_param_file_tests( assert bitstream_file_dec == "bit" # in the parameter file, only "bit" is used as bitstream file name # -> re-use bitstream filename from encoder call - # the output file is not the real output filename # -> construct output filename @@ -322,21 +324,26 @@ def test_param_file_tests( update_ref, tracefile_dec, ) - + if update_ref in [0, 2]: dut_output_file = f"{dut_base_path}/param_file/dec/{output_file}" ref_output_file = f"{reference_path}/param_file/dec/{output_file}" fs = int(sampling_rate) * 1000 output_differs, reason = cmp_pcm( - dut_output_file, ref_output_file, output_config, fs, get_mld=get_mld, mld_lim=get_mld_lim + dut_output_file, + ref_output_file, + output_config, + fs, + get_mld=get_mld, + mld_lim=get_mld_lim, ) md_out_files = get_expected_md_files(ref_output_file, enc_split, output_config) if get_mld: mld = 0 if "MLD" in reason: - mld = float(reason.split(':')[1].split()[0]) - record_property("MLD",mld) + mld = float(reason.split(":")[1].split()[0]) + record_property("MLD", mld) metadata_differs = False for md_file in md_out_files: @@ -375,7 +382,6 @@ def test_param_file_tests( os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") - def encode( dut_encoder_frontend, ref_encoder_frontend, @@ -487,7 +493,8 @@ def simulate( cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file cmd_opts[3] = f"{dut_out_dir}/{netsim_tracefile}" run(netsim + cmd_opts, check=False) - + + def error_insertion( reference_path, dut_base_path, @@ -498,7 +505,7 @@ def error_insertion( """ Call eid-xor to insert frame erasure on REF and/or DUT encoder output. """ - + # directories dut_out_dir = f"{dut_base_path}/param_file/enc" ref_out_dir = f"{reference_path}/param_file/enc" @@ -508,28 +515,21 @@ def error_insertion( ref_out_file = f"{ref_out_dir}/{eid_xor_outfile}" if platform.system() == "Windows": - eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", "Win32", "eid-xor.exe" - ) - ] + eid_xor = [os.path.join(rootdir, "scripts", "tools", "Win32", "eid-xor.exe")] elif platform.system() in ["Linux", "Darwin"]: eid_xor = [ - os.path.join( - rootdir, "scripts", "tools", platform.system(), "eid-xor" - ) + os.path.join(rootdir, "scripts", "tools", platform.system(), "eid-xor") ] else: assert False, f"eid-xor not available for {platform.system()}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): # call eid-xor on REF encoder output cmd_opts = eid_opts_list cmd_opts[-3] = f"{ref_out_dir}/{eid_xor_infile}" cmd_opts[-1] = f"{ref_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) - + if update_ref in [0, 2]: # call eid-xor on DUT encoder output cmd_opts = eid_opts_list @@ -537,6 +537,7 @@ def error_insertion( cmd_opts[-1] = f"{dut_out_dir}/{eid_xor_outfile}" # ref_out_file run(eid_xor + cmd_opts, check=False) + def decode( decoder_frontend, ref_decoder_frontend, diff --git a/tests/testconfig.py b/tests/testconfig.py index 0c9cba4623..6a60c9de04 100644 --- a/tests/testconfig.py +++ b/tests/testconfig.py @@ -1,5 +1,4 @@ -__copyright__ = \ -""" +__copyright__ = """ (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, @@ -29,11 +28,10 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -__doc__ = \ -""" +__doc__ = """ To configure test modules. """ PARAM_FILE = "scripts/config/self_test.prm" -MD5_REF_DICT = dict() \ No newline at end of file +MD5_REF_DICT = dict() -- GitLab From e80cfb8a921ec991ac4226cb9177c255125a5157 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Feb 2024 12:58:01 +0100 Subject: [PATCH 322/498] in new code accept an already accepted switch (namely NONBE_UNIFIED_DECODING_PATHS) --- apps/decoder.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index d28a0e9a35..3af33307ff 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3443,9 +3443,7 @@ static ivas_error decodeVoIP( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; -#endif frame++; if ( !arg.quietModeEnabled ) { @@ -3458,7 +3456,6 @@ static ivas_error decodeVoIP( #endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* reference vector */ if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) { @@ -3577,8 +3574,6 @@ static ivas_error decodeVoIP( } } } -#endif - } while ( nSamplesFlushed > 0 ); #endif -- GitLab From b122041f4688941315b59833262b579b768281fd Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 13:19:29 +0100 Subject: [PATCH 323/498] fix command lines in self_test_ltv.prm --- scripts/config/self_test_ltv.prm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 1ab13ef151..6b96662939 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -536,8 +536,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stv+4ISM48s.wav_brate_sw_48-48_DTX_EXT.tst // 4 ISM with extended metadata and non diegetic pan object switching bitrate 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out -../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM_with_no_diegetic_switch.csv testv/ltvISM4.csv 256000 48 testv/ltv4ISM48n.wav bit -../IVAS_dec BINAURAL 48 bit testv/ltv+4ISM48n+non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst +../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM_with_no_diegetic_switch.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit +../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching @@ -1241,7 +1241,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC714_512000_48-48_MC_binaural_ht_fr5.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC714.wav bit +../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC51_512000_48-48_MC_binaural_ht_fr5.tst // Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5% @@ -1696,8 +1696,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // OSBA 3ISM 3OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, BINAURAL ROOM REVERB out -../IVAS_cod -ism_sba 3 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit -../IVAS_dec BINAURAL_ROOM_REVERB 32 bit testv/ltv48_OSBA_4ISM_HOA3.wav_BINAURAL_ROOM_REVERB_sw_48-32.tst +../IVAS_cod -ism_sba 3 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_3ISM_HOA3.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 32 bit testv/ltv48_OSBA_3ISM_HOA3.wav_BINAURAL_ROOM_REVERB_sw_48-32.tst // OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out ../IVAS_cod -ism_sba 1 -1 testv/ltvISM1.csv 256000 48 testv/ltv48_OSBA_1ISM_FOA.wav bit @@ -1713,4 +1713,4 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out ../IVAS_cod -ism_sba 4 -2 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_OSBA_4ISM_HOA2.wav bit -../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OSBA_4ISM_pHOA2.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst \ No newline at end of file +../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OSBA_4ISM_pHOA2.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst -- GitLab From 202957360f511c9a0233e89e1bd63683fc945058 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 13:37:23 +0100 Subject: [PATCH 324/498] issue 997: remove obsolete function ivas_spar_dec_upmixer(); under FIX_997_REMOVE_SPAR_DEC_UPMIXER --- lib_com/ivas_prot.h | 3 ++- lib_com/options.h | 2 +- lib_dec/ivas_spar_decoder.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 64226d3b72..24483de0dd 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4360,13 +4360,14 @@ void ivas_spar_dec_upmixer_sf( const int16_t nchan_internal /* i : number of internal channels */ ); +#ifndef FIX_997_REMOVE_SPAR_DEC_UPMIXER void ivas_spar_dec_upmixer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float *output[], /* i/o: input/output audio channels */ const int16_t nchan_internal, /* i : number of internal channels */ const int16_t output_frame /* i : output frame length */ ); - +#endif /* MD module */ ivas_error ivas_spar_md_enc_open( ivas_spar_md_enc_state_t **hMdEnc, /* i/o: SPAR MD encoder handle */ diff --git a/lib_com/options.h b/lib_com/options.h index ec62289ea9..4c9219efc0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ - +#define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 9eddbf7e4d..58dcdb6dc7 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1252,7 +1252,7 @@ void ivas_spar_dec_set_render_map( /*-------------------------------------------------------------------* - * ivas_spar_dec_upmixer() + * ivas_spar_dec_set_render_params() * * IVAS SPAR upmixer *-------------------------------------------------------------------*/ @@ -1362,7 +1362,7 @@ void ivas_spar_dec_digest_tc( return; } - +#ifndef FIX_997_REMOVE_SPAR_DEC_UPMIXER /*-------------------------------------------------------------------* * ivas_spar_dec_upmixer() * @@ -1487,7 +1487,7 @@ void ivas_spar_dec_upmixer( return; } - +#endif /*-------------------------------------------------------------------* * ivas_spar_dec_upmixer_sf() -- GitLab From 1c2e8020c35b87cd634b6e0f3564ab978ba49532 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 14:10:00 +0100 Subject: [PATCH 325/498] fix other two conditions --- scripts/config/self_test_ltv.prm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 6b96662939..b9d765b97f 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -185,7 +185,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // stereo at 32 kbps, 48kHz in, 32kHz out, random FER at 5% ../IVAS_cod -stereo 32000 48 testv/ltv48_STEREO.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec STEREO 32 bit testv/ltv48_STEREO.wav_stereo_32000_48-32_FER5.tst +../IVAS_dec STEREO 32 bit_error testv/ltv48_STEREO.wav_stereo_32000_48-32_FER5.tst // stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -stereo -dtx 32000 48 testv/ltv48_STEREO.wav bit @@ -875,7 +875,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot.tst // SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation -../IVAS_cod -sba 2 128000 32 testv/ltv48_HOA2.wav bit +../IVAS_cod -sba 2 128000 32 testv/ltv32_HOA2.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/ltv32_HOA2.pcm_SBA_12800032-16_BinauralRoomReverb_Headrot_BinauralFile.tst // Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation -- GitLab From 7c075640b36b92869d09dab9854b0ab226c93b54 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 15 Feb 2024 15:37:34 +0100 Subject: [PATCH 326/498] [formatting] run formatting again - partially reverted due to automatic merge --- .../test_param_file.py | 4 +--- tests/create_short_testvectors.py | 21 +++++++++++++++---- tests/cut_pcm.py | 4 +++- tests/hrtf_binary_loading/constants.py | 2 +- .../test_codec_ROM_vs_file.py | 9 ++++++-- .../test_renderer_ROM_vs_file.py | 16 +++++++++++--- tests/renderer/utils.py | 2 +- tests/test_param_file_ltv.py | 4 +--- 8 files changed, 44 insertions(+), 18 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 5183c6cd29..e9863bb91c 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -439,9 +439,7 @@ def pre_proc_input(testv_file, fs): elif "stv3OA" in testv_file: num_channel = "16" cut_file = testv_file.replace(".wav", num_channel + "chn_" + cut_gain + ".wav") - cut_samples( - testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain - ) + cut_samples(testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain) return cut_file diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 2097349f60..f31750d87f 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -34,8 +34,8 @@ __doc__ = """ Create short (5sec) testvectors. """ -import sys import argparse +import sys from pathlib import Path from cut_pcm import cut_samples @@ -46,14 +46,28 @@ TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() NUM_CHANNELS = "4" # currently only FOA CUT_FROM = "0.0" -FILE_IDS = ["stvFOA", "stv2OA", "stv3OA", "stv51MC", "stv71MC", "stv512MC", "stv514MC", "stv714MC", "ISM", "MASA"] +FILE_IDS = [ + "stvFOA", + "stv2OA", + "stv3OA", + "stv51MC", + "stv71MC", + "stv512MC", + "stv514MC", + "stv714MC", + "ISM", + "MASA", +] GAINS = ["1.0", "16.0", ".004"] + def collect_files(file_ids): files = [ f.absolute() for f in TEST_VECTOR_DIR.iterdir() - if f.suffix == ".wav" and any([id in f.name for id in file_ids]) and not "_cut" in f.name + if f.suffix == ".wav" + and any([id in f.name for id in file_ids]) + and not "_cut" in f.name ] return files @@ -93,4 +107,3 @@ if __name__ == "__main__": which = args.which cut_len = args.cut_len sys.exit(create_short_testvectors(which=args.which, cut_len=cut_len)) - diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index 77a49fd933..93c529e583 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -86,7 +86,9 @@ def cut_samples( num_samples_to_skip = int(start_sec * fs) dur_samples = int(dur_sec * fs) if num_samples_to_skip > dur_samples: - raise ValueError(f"Requested to skip {num_samples_to_skip}, but file only has {dur_samples} samples") + raise ValueError( + f"Requested to skip {num_samples_to_skip}, but file only has {dur_samples} samples" + ) s_out = s[num_samples_to_skip : num_samples_to_skip + dur_samples, :] * gain_f diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 8c2a6cca8b..2fa8104cdf 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -52,7 +52,7 @@ RENDERER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_rend"))] HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin" HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin" -HRTF_FILES= [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM] +HRTF_FILES = [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM] SAMPLE_RATE = ["16", "32", "48"] diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index b774d21476..cde59241bf 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -32,6 +32,7 @@ import pytest from tests.hrtf_binary_loading.utils import * + from .constants import HRTF_FILES """ Binary file """ @@ -197,7 +198,9 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): @pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) @pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) -def test_masa_binaural_headrotation(test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file): +def test_masa_binaural_headrotation( + test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file +): # -masa Ch File : MASA format # where Ch specifies the number of MASA input/transport channels (1 or 2) # and File specifies input file containing parametric MASA metadata @@ -263,7 +266,9 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) -def test_ism_binaural_headrotation(test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file): +def test_ism_binaural_headrotation( + test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file +): # -ism [+]Ch Files : ISM format # where Ch specifies the number of ISMs (1-4) # and Files specify input files containing metadata, one file per object diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index d1cafe9c96..7781885fae 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -42,6 +42,7 @@ from tests.renderer.constants import ( INPUT_FORMATS_ISM, INPUT_FORMATS_MC, ) + from .constants import HRTF_FILES """ Ambisonics """ @@ -123,14 +124,21 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) -def test_ism_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_size, hrtf_file): +def test_ism_binaural_static_with_binary_hrir( + test_info, in_fmt, out_fmt, frame_size, hrtf_file +): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] except: in_meta_files = None compare_renderer_vs_renderer_with_binary_hrir( - test_info, in_fmt, out_fmt, hrtf_file, in_meta_files=in_meta_files, frame_size=frame_size + test_info, + in_fmt, + out_fmt, + hrtf_file, + in_meta_files=in_meta_files, + frame_size=frame_size, ) @@ -165,7 +173,9 @@ def test_ism_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) -def test_masa_binaural_static_with_binary_hrir(test_info, in_fmt, out_fmt, frame_size, hrtf_file): +def test_masa_binaural_static_with_binary_hrir( + test_info, in_fmt, out_fmt, frame_size, hrtf_file +): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 09e0cb7751..ed8476a7f0 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -55,7 +55,7 @@ def test_info(request): def run_cmd(cmd, env=None): logging.info(f"\nRunning command\n{' '.join(cmd)}\n") - cmdJoin = ' '.join(cmd) + cmdJoin = " ".join(cmd) try: sp.run(cmd, check=True, capture_output=True, text=True, env=env) except sp.CalledProcessError as e: diff --git a/tests/test_param_file_ltv.py b/tests/test_param_file_ltv.py index 058f80cabc..b8be81b5dd 100644 --- a/tests/test_param_file_ltv.py +++ b/tests/test_param_file_ltv.py @@ -438,9 +438,7 @@ def pre_proc_input(testv_file, fs): elif "stv3OA" in testv_file: num_channel = "16" cut_file = testv_file.replace(".wav", num_channel + "chn_" + cut_gain + ".wav") - cut_samples( - testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain - ) + cut_samples(testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain) return cut_file -- GitLab From 9a1a4b1c1097634535158c9401433bf8a5d6763b Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 15:44:46 +0100 Subject: [PATCH 327/498] add new parametrization for having XPASS'es fail --- .../test_codec_ROM_vs_file.py | 223 +++++++++++------- 1 file changed, 137 insertions(+), 86 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index cde59241bf..7ce51ae175 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -30,10 +30,11 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest +import itertools from tests.hrtf_binary_loading.utils import * -from .constants import HRTF_FILES +from .constants import HRTF_FILES, HRTF_BINARY_FILE_DIFF_FROM_ROM """ Binary file """ @@ -47,17 +48,18 @@ def test_binary_file(test_info, hrtf_file, out_fs): """ Multichannel """ -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("out_fmt", "out_fs", "in_fmt", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_FILES + ) + ], +) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_file): - # if in_fmt in ["MONO", "STEREO"]: - # pytest.skip("MONO or STEREO to Binaural rendering unsupported") - - # -mc InputConf : Multi-channel format - # where InputConf specifies the channel configuration (5_1, 7_1, 5_1_2, 5_1_4, 7_1_4) - bitrate = 512000 in_fs = 48 option_list = ["-mc", in_fmt] @@ -75,20 +77,24 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f ) -@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + [HR_TRAJECTORIES_TO_TEST[0]], + OUTPUT_FORMATS_BINAURAL[:-1], + SAMPLE_RATE, + INPUT_FORMATS_MC, + HRTF_FILES, + ) + ], +) def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_file ): - # if in_fmt in ["MONO", "STEREO"]: - # pytest.skip("MONO or STEREO to Binaural rendering unsupported") - - # -mc InputConf : Multi-channel format - # where InputConf specifies the channel configuration (5_1, 7_1, 5_1_2, 5_1_4, 7_1_4) - bitrate = 512000 in_fs = 48 option_list = ["-mc", in_fmt] @@ -110,14 +116,18 @@ def test_multichannel_binaural_headrotation( """ Ambisonics """ -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_fmt", "fs", "out_fmt", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_FILES + ) + ], +) def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): - # -sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D) - # where Order specifies the Ambisionics order (1-3) - bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -134,15 +144,22 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): ) -@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_SBA, + SAMPLE_RATE[1:], + OUTPUT_FORMATS_BINAURAL[:-1], + [HR_TRAJECTORIES_TO_TEST[0]], + HRTF_FILES, + ) + ], +) def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_file): - # -sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D) - # where Order specifies the Ambisionics order (1-3) - bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -163,16 +180,22 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt """ MASA """ -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("fs", SAMPLE_RATE[-1:]) -@pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) -@pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + OUTPUT_FORMATS_BINAURAL[:-1], + SAMPLE_RATE[-1:], + INPUT_FORMATS_MASA["dir"], + INPUT_FORMATS_MASA["tc"], + HRTF_FILES, + ) + ], +) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): - # -masa Ch File : MASA format - # where Ch specifies the number of MASA input/transport channels (1 or 2) - # and File specifies input file containing parametric MASA metadata - bitrate = 256000 metadata_file = str( TESTV_DIR.joinpath(FORMAT_TO_METADATA_FILES["MASA"].format(in_dir, in_tc, fs)) @@ -192,19 +215,25 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): ) -@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[1]]) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("fs", SAMPLE_RATE[-1:]) -@pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) -@pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_MASA["tc"], + INPUT_FORMATS_MASA["dir"], + OUTPUT_FORMATS_BINAURAL[:-1], + SAMPLE_RATE[-1:], + [HR_TRAJECTORIES_TO_TEST[1]], + HRTF_FILES, + ) + ], +) def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file ): - # -masa Ch File : MASA format - # where Ch specifies the number of MASA input/transport channels (1 or 2) - # and File specifies input file containing parametric MASA metadata - bitrate = 256000 metadata_file = str( TESTV_DIR.joinpath(FORMAT_TO_METADATA_FILES["MASA"].format(in_dir, in_tc, fs)) @@ -228,15 +257,18 @@ def test_masa_binaural_headrotation( """ ISM """ -@pytest.mark.parametrize("out_fmt", [OUTPUT_FORMATS_BINAURAL[0]]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_FILES + ) + ], +) def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): - # -ism [+]Ch Files : ISM format - # where Ch specifies the number of ISMs (1-4) - # and Files specify input files containing metadata, one file per object - in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -261,18 +293,24 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): ) -@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) -@pytest.mark.parametrize("out_fmt", [OUTPUT_FORMATS_BINAURAL[0]]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_ISM, + SAMPLE_RATE, + [OUTPUT_FORMATS_BINAURAL[0]], + [HR_TRAJECTORIES_TO_TEST[0]], + HRTF_FILES, + ) + ], +) def test_ism_binaural_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file ): - # -ism [+]Ch Files : ISM format - # where Ch specifies the number of ISMs (1-4) - # and Files specify input files containing metadata, one file per object - in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -301,15 +339,18 @@ def test_ism_binaural_headrotation( """ ISM - Room Reverb """ -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[-1:]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_FILES + ) + ], +) def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): - # -ism [+]Ch Files : ISM format - # where Ch specifies the number of ISMs (1-4) - # and Files specify input files containing metadata, one file per object - in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -334,11 +375,21 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf ) -@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[-1:]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize( + ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), + [ + pytest.param(*x, marks=pytest.mark.xfail(strict=True)) + if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM + else x + for x in itertools.product( + INPUT_FORMATS_ISM, + SAMPLE_RATE, + OUTPUT_FORMATS_BINAURAL[-1:], + [HR_TRAJECTORIES_TO_TEST[0]], + HRTF_FILES, + ) + ], +) def test_ism_binaural_roomreverb_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file ): -- GitLab From 760220698eba9622a6d2ce6df492136229498d2a Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 16:02:19 +0100 Subject: [PATCH 328/498] revert reverts from bad merge --- tests/create_short_testvectors.py | 33 ++++++++++++++----------------- tests/cut_pcm.py | 15 +++++++++++++- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index f31750d87f..d80a328c14 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -72,24 +72,21 @@ def collect_files(file_ids): return files -def create_short_testvectors(): - for fs in ["48", "32", "16"]: - in_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c.wav" - cut_gain = "1.0" - cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut.wav" - cut_samples( - in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain - ) - cut_gain = "16.0" - cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples( - in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain - ) - cut_gain = ".004" - cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.wav" - cut_samples( - in_file, cut_file, NUM_CHANNELS, fs + "000", CUT_FROM, CUT_LEN, cut_gain - ) +def create_short_testvectors(which="foa", cut_len=5.0): + file_ids = [] + if which == "all": + file_ids = FILE_IDS + elif which == "foa": + file_ids = FILE_IDS[:1] + + for f in collect_files(file_ids): + for g in GAINS: + suffix = "_cut" + if g != "1.0": + suffix += f"_{g}" + + out_file = f.parent.joinpath(f.stem + suffix + f.suffix) + cut_samples(f, out_file, NUM_CHANNELS, CUT_FROM, f"{cut_len}", g) if __name__ == "__main__": diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index 93c529e583..ea47fb31e3 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -61,7 +61,14 @@ def usage(): def cut_samples( - in_file, out_file, num_channels, sample_rate, start, duration, gain="1.0" + in_file, + out_file, + num_channels, + sample_rate, + start, + duration, + gain="1.0", + sample_rate=None, ): """ Function to cut samples from an audio file (wav or pcm) @@ -74,6 +81,12 @@ def cut_samples( + platform.python_version() ) + if sample_rate is None and not str(in_file).endswith(".wav"): + raise ValueError(f"For non-wav files, samplerate must be explicitly given") + elif sample_rate is None: + # set to default of pyaudio3dtools.audiofile.readfile -> for wav files it will be ignored anyway + sample_rate = 48000 + # all input parameters are strings - convert some fs = int(sample_rate) start_sec = float(start) -- GitLab From 0f1b3d76beb3411a10346eb17d4e6a97fcee6c2f Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 16:08:48 +0100 Subject: [PATCH 329/498] fix function signature --- tests/cut_pcm.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cut_pcm.py b/tests/cut_pcm.py index ea47fb31e3..644a2ba1bc 100755 --- a/tests/cut_pcm.py +++ b/tests/cut_pcm.py @@ -64,7 +64,6 @@ def cut_samples( in_file, out_file, num_channels, - sample_rate, start, duration, gain="1.0", -- GitLab From 6000b47a55fb4dfdf3beb77bbb335eda638d2a7b Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 15 Feb 2024 16:19:04 +0100 Subject: [PATCH 330/498] set shd_rot_max_order to 1 for nchan_internal == 4 || nchan_internal == 3 --- lib_dec/ivas_output_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index c93b16dcdb..221492abfb 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -188,7 +188,7 @@ void ivas_renderer_select( } else if ( nchan_internal == 4 || nchan_internal == 3 ) { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } else if ( nchan_internal == 6 || nchan_internal == 5 ) { -- GitLab From 6c0c1130e533dd9aeed373975fb51b6dc7438bd3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 15 Feb 2024 16:31:00 +0100 Subject: [PATCH 331/498] update lib_lc3plus to v.1.4.3 --- lib_lc3plus/adjust_global_gain.c | 22 +- lib_lc3plus/al_fec_fl.c | 2 +- lib_lc3plus/apply_global_gain.c | 4 +- lib_lc3plus/ari_codec.c | 961 +++++-- lib_lc3plus/attack_detector.c | 38 +- lib_lc3plus/clib.h | 3 +- lib_lc3plus/constants.c | 2555 +++++++++++++++++- lib_lc3plus/constants.h | 54 +- lib_lc3plus/cutoff_bandwidth.c | 4 +- lib_lc3plus/dct4.c | 17 +- lib_lc3plus/dec_entropy.c | 10 +- lib_lc3plus/dec_lc3_fl.c | 17 +- lib_lc3plus/defines.h | 146 +- lib_lc3plus/detect_cutoff_warped.c | 17 +- lib_lc3plus/enc_entropy.c | 23 +- lib_lc3plus/enc_lc3_fl.c | 26 +- lib_lc3plus/estimate_global_gain.c | 15 +- lib_lc3plus/fft/cfft.c | 3 +- lib_lc3plus/fft/cfft.h | 3 +- lib_lc3plus/fft/fft_15_16.h | 2 +- lib_lc3plus/fft/fft_240_480.h | 2 +- lib_lc3plus/fft/fft_2_9.h | 2 +- lib_lc3plus/fft/fft_32.h | 2 +- lib_lc3plus/fft/fft_384_768.h | 2 +- lib_lc3plus/fft/fft_60_128.h | 2 +- lib_lc3plus/fft/fft_generic.h | 2 +- lib_lc3plus/fft/iis_fft.c | 5 +- lib_lc3plus/fft/iis_fft.h | 3 +- lib_lc3plus/fft/iisfft.c | 4 +- lib_lc3plus/fft/iisfft.h | 3 +- lib_lc3plus/functions.h | 72 +- lib_lc3plus/imdct.c | 8 +- lib_lc3plus/lc3.c | 10 +- lib_lc3plus/lc3.h | 5 +- lib_lc3plus/lc3plus_fft.c | 21 +- lib_lc3plus/license.h | 5 +- lib_lc3plus/ltpf_coder.c | 102 +- lib_lc3plus/ltpf_decoder.c | 163 +- lib_lc3plus/mdct.c | 35 +- lib_lc3plus/mdct_shaping.c | 10 +- lib_lc3plus/near_nyquist_detector.c | 78 +- lib_lc3plus/noise_factor.c | 119 +- lib_lc3plus/noise_filling.c | 59 +- lib_lc3plus/olpa.c | 134 +- lib_lc3plus/pc_apply.c | 2 +- lib_lc3plus/pc_classify.c | 2 +- lib_lc3plus/pc_main.c | 2 +- lib_lc3plus/pc_update.c | 2 +- lib_lc3plus/per_band_energy.c | 11 +- lib_lc3plus/plc_classify.c | 145 +- lib_lc3plus/plc_compute_stab_fac.c | 2 +- lib_lc3plus/plc_damping_scrambling.c | 227 +- lib_lc3plus/plc_main.c | 129 +- lib_lc3plus/plc_noise_substitution.c | 2 +- lib_lc3plus/plc_phecu_f0_refine_first.c | 2 +- lib_lc3plus/plc_phecu_fec_hq.c | 2 +- lib_lc3plus/plc_phecu_hq_ecu.c | 34 +- lib_lc3plus/plc_phecu_lf_peak_analysis.c | 2 +- lib_lc3plus/plc_phecu_rec_frame.c | 9 +- lib_lc3plus/plc_phecu_setf0hz.c | 2 +- lib_lc3plus/plc_phecu_spec_ana.c | 2 +- lib_lc3plus/plc_phecu_subst_spec.c | 253 +- lib_lc3plus/plc_phecu_tba_per_band_gain.c | 9 +- lib_lc3plus/plc_phecu_tba_spect_Xavg.c | 2 +- lib_lc3plus/plc_phecu_tba_trans_dect_gains.c | 126 +- lib_lc3plus/plc_phecu_trans_burst_ana_sub.c | 25 +- lib_lc3plus/plc_tdc.c | 47 +- lib_lc3plus/plc_tdc_tdac.c | 2 +- lib_lc3plus/plc_update.c | 4 +- lib_lc3plus/quantize_spec.c | 212 +- lib_lc3plus/reorder_bitstream.c | 2 +- lib_lc3plus/resamp12k8.c | 23 +- lib_lc3plus/residual_coding.c | 4 +- lib_lc3plus/residual_decoding.c | 6 +- lib_lc3plus/setup_com_lc3.c | 4 +- lib_lc3plus/setup_dec_lc3.c | 101 +- lib_lc3plus/setup_dec_lc3.h | 6 +- lib_lc3plus/setup_enc_lc3.c | 128 +- lib_lc3plus/setup_enc_lc3.h | 10 +- lib_lc3plus/sns_compute_scf.c | 85 +- lib_lc3plus/sns_interpolate_scf.c | 23 +- lib_lc3plus/sns_quantize_scf.c | 17 +- lib_lc3plus/structs.h | 27 +- lib_lc3plus/tns_coder.c | 176 +- lib_lc3plus/tns_decoder.c | 20 +- lib_lc3plus/util.h | 35 +- 86 files changed, 5751 insertions(+), 943 deletions(-) diff --git a/lib_lc3plus/adjust_global_gain.c b/lib_lc3plus/adjust_global_gain.c index e7674dd710..e4ccd48a73 100644 --- a/lib_lc3plus/adjust_global_gain.c +++ b/lib_lc3plus/adjust_global_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,11 +15,14 @@ void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_ , LC3_INT16 hrmode, LC3_INT16 frame_dms ) { - LC3_FLOAT delta = 0; - LC3_INT delta2 = 0; + LC3_FLOAT delta; + LC3_INT delta2; LC3_INT gg_idx_inc; +#ifdef CR8_G_ADD_75MS + LC3_FLOAT factor; +#else LC3_INT factor; - +#endif if (frame_dms == 25) { @@ -32,7 +35,14 @@ void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_ } else if (frame_dms == 50) { factor = 2; - } else + } +#ifdef CR8_G_ADD_75MS + else if (frame_dms == 75) + { + factor = 1.2; + } +#endif + else { factor = 1; } @@ -60,7 +70,7 @@ void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_ if (hrmode) { if (nBits > target) { - gg_idx_inc = (int) factor * (((nBits - target)/ delta) + 1); + gg_idx_inc = (int) (factor * (((nBits - target)/ delta) + 1)); gg_idx_inc = MIN(gg_idx_inc, 10 * factor); *gg_idx += gg_idx_inc; diff --git a/lib_lc3plus/al_fec_fl.c b/lib_lc3plus/al_fec_fl.c index 0cae36dade..dc233ceb28 100644 --- a/lib_lc3plus/al_fec_fl.c +++ b/lib_lc3plus/al_fec_fl.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/apply_global_gain.c b/lib_lc3plus/apply_global_gain.c index c67432e2c3..43cdcd6fac 100644 --- a/lib_lc3plus/apply_global_gain.c +++ b/lib_lc3plus/apply_global_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,7 +13,7 @@ void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off) { - LC3_FLOAT gg = 0; + LC3_FLOAT gg; gg = LC3_POW(10, (LC3_FLOAT)(global_gain_idx + global_gain_off) / 28); diff --git a/lib_lc3plus/ari_codec.c b/lib_lc3plus/ari_codec.c index 80c75fcf0c..4ced06e9a1 100644 --- a/lib_lc3plus/ari_codec.c +++ b/lib_lc3plus/ari_codec.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,26 +13,126 @@ static void ac_shift_fl(Encoder_State_fl* st); static void ac_encode_fl(Encoder_State_fl* st, LC3_INT sym_freq, LC3_INT cum_freq); -static void tns_order_freq_enc(LC3_INT enable_lpc_weighting, LC3_INT order, LC3_INT* symfreq, LC3_INT* cumfreq); -static void tns_coef_freq_enc(LC3_INT k, LC3_INT idx, LC3_INT* symfreq, LC3_INT* cumfreq); -static void ac_freq_fl(LC3_INT pki, LC3_INT s, LC3_INT* symfreq, LC3_INT* cumfreq); static void ac_finalize_fl(Encoder_State_fl* st); static void write_uint_forward_fl(Encoder_State_fl* st, LC3_INT val, LC3_INT numbits); static void ari_enc_init(Encoder_State_fl* st, LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side); static LC3_INT sign(LC3_INT x); + +#ifdef CR9_SIMPLIFY_ARI_DECODER +static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit); +#else static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit, LC3_INT *bp, Decoder_State_fl* st_fl, LC3_INT from_left); +#endif + +#ifdef CR9_SIMPLIFY_ARI_DECODER static void ac_dec_init_fl(LC3_UINT8* ptr, LC3_INT* bp, Decoder_State_fl* st_fl, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side); -static void tns_order_freq(LC3_INT enable_lpc_weighting, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym); -static void tns_coef_freq(LC3_INT k, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym); +#else +static void ac_dec_init_fl(LC3_UINT8* ptr, LC3_INT* bp, Decoder_State_fl* st_fl, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side); +#endif + +#ifdef CR9_SIMPLIFY_ARI_DECODER +static LC3_INT32 ac_decode_fl(Decoder_State_fl* st, const LC3_INT16* sym_freq, LC3_INT32 num_sym, LC3_UINT8* ptr, LC3_INT32* bp, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32 *bp_side, LC3_INT16 cur_bin); +#else static LC3_INT ac_decode_fl(Decoder_State_fl* st, LC3_INT* sym_freq, LC3_INT* cum_freq, LC3_INT num_sym, LC3_UINT8* ptr, LC3_INT* bp, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side); -static void ac_freq(LC3_INT pki, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym); -static void findNonZero(LC3_INT* in, LC3_INT* out, LC3_INT len, LC3_INT* outLen); +#endif + +#ifdef CR9_SIMPLIFY_ARI_DECODER +static LC3_INT16 pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32 *bp_side, LC3_INT16 cur_bin); +#else static void pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32 *bp_side); +#endif + static void calculate_nfseed(LC3_INT *x, LC3_INT L_spec, LC3_INT *nf_seed); +static void findNonZero(LC3_INT* in, LC3_INT len, LC3_INT* outLen); + +#ifndef CR9_SIMPLIFY_ARI_DECODER +static void ac_freq(LC3_INT pki, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym); + +static void tns_coef_freq(LC3_INT k, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym); + +static void tns_order_freq(LC3_INT enable_lpc_weighting, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym); + +void ac_freq(LC3_INT pki, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym) +{ + LC3_INT i = 0, j = 0; + + *numsym = 18 - 1; + + j = 0; + for (i = 1; i <= *numsym; i++) { + symfreq[j] = ari_spec_cumfreq_fl[pki][i]; + j++; + } + + for (i = 0; i < *numsym; i++) { + symfreq[i] -= ari_spec_cumfreq_fl[pki][i]; + } + + for (i = 0; i < *numsym; i++) { + cumfreq[i] = ari_spec_cumfreq_fl[pki][i]; + } +} + +void tns_coef_freq(LC3_INT k, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym) +{ + LC3_INT i = 0, j = 0; + + *numsym = 18 - 1; + + j = 0; + for (i = 1; i <= *numsym; i++) { + symfreq[j] = ari_tns_freq_cf[k][i]; + j++; + } + + for (i = 0; i < *numsym; i++) { + symfreq[i] -= ari_tns_freq_cf[k][i]; + } + + for (i = 0; i < *numsym; i++) { + cumfreq[i] = ari_tns_freq_cf[k][i]; + } +} + +void tns_order_freq(LC3_INT enable_lpc_weighting, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym) +{ + LC3_INT i = 0, j = 0; + + *numsym = 8; + + j = 0; + for (i = 1; i < 9; i++) { + symfreq[j] = ari_tns_order_cf[enable_lpc_weighting][i]; + j++; + } + + for (i = 0; i < *numsym; i++) { + symfreq[i] -= ari_tns_order_cf[enable_lpc_weighting][i]; + } + + for (i = 0; i < *numsym; i++) { + cumfreq[i] = ari_tns_order_cf[enable_lpc_weighting][i]; + } +} + +#endif + +void findNonZero(LC3_INT* in, LC3_INT len, LC3_INT* outLen) +{ + LC3_INT i = 0, j = 0; + + for (i = 0; i < len; i++) { + if (in[i] != 0) { + j++; + } + } + + *outLen = j; +} void calculate_nfseed(LC3_INT *x, LC3_INT L_spec, LC3_INT *nf_seed) { - LC3_INT k = 0; + LC3_INT k; *nf_seed = 0; @@ -46,6 +146,102 @@ void calculate_nfseed(LC3_INT *x, LC3_INT L_spec, LC3_INT *nf_seed) } } +#ifdef CR9_SIMPLIFY_ARI_DECODER +static LC3_INT16 pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32 *bp_side, LC3_INT16 cur_bin) +{ + LC3_INT32 bp_local, bp_side_local, offset; +#ifdef WMOPS + push_wmops("pc_check_bytes"); +#endif + + if (st_fl->pc_bytes > 0) + { + if (!from_left && mask_side != 1) + { + return 0; + } + + if (st_fl->pc_c_bp_side > 0 && *bp_side < 0) + { + assert(mask_side == 1); + assert(st_fl->pc_b_right != -1); + *bp_side = st_fl->pc_b_right; + + return 0; + } + + bp_local = *bp; + bp_side_local = *bp_side; + + if (from_left) + { + if (mask_side == 1) + { + bp_side_local = bp_side_local + 1; + } + } else { + bp_local = bp_local - 1; + } + + if (st_fl->pc_b_right == -1) + { + offset = -1; + if (!st_fl->pc_enc) + { + offset = offset + st_fl->pc_bytes; + } + + if ((bp_side_local + offset - bp_local) == st_fl->pc_bytes) + { + st_fl->pc_b_left = bp_local + 1; + st_fl->pc_b_right = bp_side_local - 1; + + if (st_fl->pc_enc) + { + assert(st_fl->pc_b_right - st_fl->pc_b_left + 1 == st_fl->pc_bytes); + return 1; + } + } + } + + if (!st_fl->pc_enc && st_fl->pc_b_right > -1) + { + if (from_left && *bp == st_fl->pc_b_left) + { + *bp = 0; + st_fl->pc_c_bp = 1; + } + + if (!from_left && bp_side_local == st_fl->pc_b_right) + { + *bp_side = st_fl->pc_bytes - 1; + st_fl->pc_c_bp_side = 1; + } + + if (st_fl->pc_bfi == 2) + { + + if ((st_fl->pc_c_bp && (*bp + 1) >= st_fl->pc_be_bp_left) || (st_fl->pc_c_bp_side && (*bp_side + 1) <= st_fl->pc_be_bp_right)) + { + st_fl->pc_inv_bin = cur_bin; + return 1; + } else if ((st_fl->pc_c_bp && *bp >= 0) || (st_fl->pc_c_bp_side && *bp_side <= (st_fl->pc_bytes - 1))) + { + st_fl->pc_inv_bin = MIN(st_fl->pc_inv_bin, cur_bin); + return 0; + } + } + } + } + +#ifdef WMOPS + pop_wmops(); +#endif + return 0; +} + +#else + static void pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32 *bp_side) { LC3_INT32 bp_local, bp_side_local, offset; @@ -130,6 +326,35 @@ static void pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT32 fro return; } +#endif + +#ifdef CR9_SIMPLIFY_ARI_DECODER +void ac_dec_init_fl(LC3_UINT8* ptr, LC3_INT* bp, Decoder_State_fl* st_fl, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side) +{ + LC3_INT i; + + if (!st_fl->pc_enc) + { + *bp = *bp + st_fl->pc_bytes; + } + + st_fl->ac_low_fl = 0; + + st_fl->ac_range_fl = (LC3_UINT32) 16777215; /* 2^24 -1 */ + for (i = 0; i < 3; i++) { + if(pc_check_bytes(bp, st_fl, from_left, mask_side, bp_side, 0) != 0) + { + return; + } + + st_fl->ac_low_fl = (st_fl->ac_low_fl << 8) + (LC3_UINT32)ptr[*bp]; + *bp = *bp + 1; + } + + st_fl->BER_detect = 0; +} + +#else void ac_dec_init_fl(LC3_UINT8* ptr, LC3_INT* bp, Decoder_State_fl* st_fl, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side) { @@ -153,145 +378,573 @@ void ac_dec_init_fl(LC3_UINT8* ptr, LC3_INT* bp, Decoder_State_fl* st_fl, LC3_IN st_fl->BER_detect = 0; } -void tns_order_freq(LC3_INT enable_lpc_weighting, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym) -{ - LC3_INT i = 0, j = 0; +#endif + +/* Returns val */ +#ifdef CR9_SIMPLIFY_ARI_DECODER +LC3_INT32 ac_decode_fl(Decoder_State_fl* st, const LC3_INT16* freq, LC3_INT32 num_sym, LC3_UINT8* ptr, LC3_INT32* bp, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32 *bp_side, LC3_INT16 cur_bin) +{ + LC3_INT val, tmp, symfreq_loc; +#ifdef WMOPS + push_wmops("ac_decode_fl"); +#endif + + tmp = st->ac_range_fl >> 10; + + if (st->ac_low_fl >= (LC3_UINT32)(tmp << 10)) { + st->BER_detect = 1; + } + + val = num_sym - 1; + + while (st->ac_low_fl < (LC3_UINT32)(tmp * freq[val])) { + val--; + } + + symfreq_loc = freq[val + 1] - freq[val]; + + st->ac_low_fl = st->ac_low_fl - tmp * freq[val]; + st->ac_range_fl = tmp * symfreq_loc; + + while (st->ac_range_fl < 65536) { + st->ac_low_fl = ((LC3_INT32)st->ac_low_fl) & ((LC3_INT32)(16777215)); + + if(pc_check_bytes(bp, st, from_left, mask_side, bp_side, cur_bin) != 0) + { + st->BER_detect = 1; + return 1; + } + + st->ac_low_fl = st->ac_low_fl << 8; + st->ac_low_fl = st->ac_low_fl + ptr[*bp]; + *bp = *bp + 1; + st->ac_range_fl = st->ac_range_fl << 8; + } + +#ifdef WMOPS + pop_wmops(); +#endif + return val; +} + +#else + +LC3_INT ac_decode_fl(Decoder_State_fl* st, LC3_INT* sym_freq, LC3_INT* cum_freq, LC3_INT num_sym, LC3_UINT8* ptr, LC3_INT* bp, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side) +{ + LC3_INT val = 0, tmp = 0; + + + tmp = st->ac_range_fl >> 10; + + if (st->ac_low_fl >= (LC3_UINT32)(tmp << 10)) { + st->BER_detect = 1; + } + + val = num_sym - 1; + + while (st->ac_low_fl < (LC3_UINT32)(tmp * cum_freq[val])) { + val--; + } + + st->ac_low_fl = st->ac_low_fl - tmp * cum_freq[val]; + st->ac_range_fl = tmp * sym_freq[val]; + + while (st->ac_range_fl < pow(2, 16)) { + st->ac_low_fl = st->ac_low_fl << 8; + st->ac_low_fl = ((LC3_INT)st->ac_low_fl) & ((LC3_INT)(pow(2, 24) - 1)); + + pc_check_bytes(bp, st, from_left, mask_side, bp_side); + + st->ac_low_fl = st->ac_low_fl + ptr[*bp]; + *bp = *bp + 1; + st->ac_range_fl = st->ac_range_fl << 8; + } + + return val; +} + + +#endif + +#ifdef CR9_SIMPLIFY_ARI_DECODER +void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit) +{ + if (ptr[*bp_side] & *mask_side) { + *bit = 1; + } else { + *bit = 0; + } + + if (*mask_side == 128) { + *mask_side = 1; + *bp_side = *bp_side - 1; + } else { + *mask_side = *mask_side * 2; + } +} + +#else + +void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit, LC3_INT *bp, Decoder_State_fl* st_fl, LC3_INT from_left) +{ + *bit = 0; + + UNUSED(bp); + UNUSED(st_fl); + UNUSED(from_left); + + if (ptr[*bp_side] & *mask_side) { + *bit = 1; + } else { + *bit = 0; + } + + if (*mask_side == 128) { + *mask_side = 1; + *bp_side = *bp_side - 1; + } else { + *mask_side = *mask_side * 2; + } +} + +#endif + +#ifdef CR9_SIMPLIFY_ARI_DECODER +void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, LC3_INT L_spec, LC3_INT fs_idx, LC3_INT enable_lpc_weighting, + LC3_INT tns_numfilters, LC3_INT lsbMode, LC3_INT lastnz, LC3_INT* bfi, LC3_INT* tns_order, LC3_INT fac_ns_idx, + LC3_INT gg_idx, uint8_t * resBits, LC3_INT* x, LC3_INT* nf_seed, LC3_INT* tns_idx, LC3_INT* zero_frame, LC3_INT numbytes, + LC3_INT* nbits_residual, LC3_INT* residualPresent, LC3_INT frame_dms, + LC3_INT32 n_pc, LC3_INT32 be_bp_left, LC3_INT32 be_bp_right, LC3_INT32 enc, LC3_INT32 *b_left, LC3_INT32 *spec_inv_idx, + LC3_INT hrmode +) +{ + Decoder_State_fl st; + LC3_INT a, b, t, bp; + LC3_INT c; + LC3_INT nbits_side, extra_bits; + LC3_UINT8* ptr; + LC3_INT n, k, lev; + LC3_INT max_lev, tmp; + LC3_INT bit, lev1, pki, sym, save_lev[MAX_LEN], idx_len, total_bits, nbits_ari, rateFlag; + +#ifdef WMOPS + push_wmops("processAriDecoder_fl"); +#endif + + total_bits = 8 * numbytes; + rateFlag = 0; + + memset(&st, 0, sizeof(st)); + + st.pc_bytes = (n_pc + 1) >> 1; + st.pc_b_left = numbytes + 1; + st.pc_b_right = -1; + st.pc_enc = enc; + st.pc_bfi = *bfi; + st.pc_be_bp_left = floor(be_bp_left / 8); + st.pc_be_bp_right = floor(be_bp_right / 8) - 1; + *spec_inv_idx = L_spec + 1; + assert(st.pc_be_bp_right < st.pc_bytes || st.pc_bytes == 0); + + /* Rate flag */ + if (fs_idx != 5) + { + if (total_bits > (160 + fs_idx * 160)) { + rateFlag = 512; + } + } + + /* Init */ + c = 0; + t = 0; + bp = 0; + + *b_left = -1; + + ptr = bytes; + + /* Start Decoding */ + ac_dec_init_fl(ptr, &bp, &st, 1, mask_side, &bp_side); + + /* Decode TNS data */ + tmp = MAXLAG; + + + if (frame_dms <= 50) + { + tmp /= 2; + } + + /* Decode TNS data */ + for (n = 0; n < tns_numfilters; n++) { + + if (tns_order[n] > 0) { + tns_order[n] = ac_decode_fl(&st, &ari_tns_order_cf[enable_lpc_weighting][0], 8, ptr, &bp, 1, mask_side, &bp_side, 0); + + tns_order[n] = tns_order[n] + 1; + + if (tns_order[n] > tmp || st.BER_detect > 0) + { + goto ber_detect; + } + + for (k = 0; k < tns_order[n]; k++) { + if (bp_side < bp) + { + *bfi = 1; + return; + } + + tns_idx[n * 8 + k] = ac_decode_fl(&st, &ari_tns_freq_cf[k][0], 17, ptr, &bp, 1, mask_side, &bp_side, 0); + + if (st.BER_detect > 0) + { + goto ber_detect; + } + } + } + } + + /* Spectral data */ + for (k = 0; k < lastnz; k = k + 2) { + /* Context */ + t = c + rateFlag; + + if (k > (L_spec >> 1)) { + t = t + 256; + } + + /* Decode amplitude */ + x[k] = 0; + x[k + 1] = 0; + + if (hrmode == 1) { + max_lev = 13 + 8; + } else { + max_lev = 13; + } + + for (lev = 0; lev <= max_lev; lev++) { + lev1 = MIN(lev, 3); + pki = ari_spec_lookup_fl[t + lev1 * 1024]; + + sym = ac_decode_fl(&st, &ari_spec_cumfreq_fl[pki][0], 17, ptr, &bp, 1, mask_side, &bp_side, k); + + if (sym < 16) { + break; + } + + if (lsbMode == 0 || lev > 0) { + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + x[k] = x[k] + (bit << lev); + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + x[k + 1] = x[k + 1] + (bit << lev); + } + } + + if ((lev - 1) == 13 && sym == 16) + { + goto ber_detect; + } + + if (hrmode == 0) { + lev = MIN(lev, 13); + } + + if (lsbMode == 1) { + save_lev[k] = lev; + } + + a = sym & 3; + b = sym >> 2; + + x[k] = x[k] + (a << lev); + x[k + 1] = x[k + 1] + (b << lev); + + /* Decode signs */ + if (x[k] > 0) { + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + if (bit == 1) { + x[k] = -x[k]; + } + } + + if (x[k + 1] > 0) { + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + if (bit == 1) { + x[k + 1] = -x[k + 1]; + } + } + + /* Context */ + lev1 = MIN(lev, 3); + if (lev1 <= 1) { + t = 1 + (a + b) * (lev1 + 1); + } else { + t = 12 + lev1; + } + + c = (c & 15) * 16 + t; + + if (((bp - bp_side) > 3 && (st.pc_c_bp == st.pc_c_bp_side))) { - *numsym = 8; + if ((0 < *spec_inv_idx) && (*spec_inv_idx < (L_spec + 1))) + { + *bfi = 2; + calculate_nfseed(x, k, nf_seed); + return; + } - j = 0; - for (i = 1; i < 9; i++) { - symfreq[j] = ari_tns_order_cf[enable_lpc_weighting][i]; - j++; + *bfi = 1; + return; + } + + if (st.BER_detect > 0) + { + goto ber_detect; + } } - for (i = 0; i < *numsym; i++) { - symfreq[i] -= ari_tns_order_cf[enable_lpc_weighting][i]; - } + /* Residual bits */ + nbits_side = total_bits - (8 * bp_side + 8 - (31 - clz_func(mask_side))); + nbits_ari = (bp - 3) * 8; + extra_bits = 25 - (31 - clz_func(st.ac_range_fl)); - for (i = 0; i < *numsym; i++) { - cumfreq[i] = ari_tns_order_cf[enable_lpc_weighting][i]; + if (enc == 0) + { + if (st.pc_c_bp == 0) + { + nbits_ari = (bp - st.pc_bytes - 3) * 8; + } else { + nbits_ari = (bp + st.pc_b_left - st.pc_bytes - 3) * 8; + } + + if (st.pc_c_bp_side != 0) + { + nbits_side = total_bits - 8 * (st.pc_b_left) + 8 * (st.pc_bytes - bp_side) - (8 - LC3_LOGTWO(mask_side)); + } } -} -/* Returns val */ -LC3_INT ac_decode_fl(Decoder_State_fl* st, LC3_INT* sym_freq, LC3_INT* cum_freq, LC3_INT num_sym, LC3_UINT8* ptr, LC3_INT* bp, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side) -{ - LC3_INT val = 0, tmp = 0; + *nbits_residual = total_bits - (nbits_side + nbits_ari + extra_bits); - tmp = st->ac_range_fl >> 10; - - if (st->ac_low_fl >= (LC3_UINT32)(tmp << 10)) { - st->BER_detect = 1; + if (*nbits_residual < 0) { + if ((0 < *spec_inv_idx) && (*spec_inv_idx < (L_spec + 1))) + { + *bfi = 2; + calculate_nfseed(x, k, nf_seed); + return; + } + + *bfi = 1; + return; } - val = num_sym - 1; + if (lsbMode == 0) { + findNonZero(x, L_spec, &idx_len); - while (st->ac_low_fl < (LC3_UINT32)(tmp * cum_freq[val])) { - val--; - } + if (hrmode) + { + idx_len *= EXT_RES_ITER_MAX; + } + *nbits_residual = MIN(*nbits_residual, idx_len); + *residualPresent = 1; - st->ac_low_fl = st->ac_low_fl - tmp * cum_freq[val]; - st->ac_range_fl = tmp * sym_freq[val]; + memset(resBits, 0, MAX_RESBITS_LEN); - while (st->ac_range_fl < pow(2, 16)) { - st->ac_low_fl = st->ac_low_fl << 8; - st->ac_low_fl = ((LC3_INT)st->ac_low_fl) & ((LC3_INT)(pow(2, 24) - 1)); - - pc_check_bytes(bp, st, from_left, mask_side, bp_side); - - st->ac_low_fl = st->ac_low_fl + ptr[*bp]; - *bp = *bp + 1; - st->ac_range_fl = st->ac_range_fl << 8; - } + for (k = 0; k < *nbits_residual; k++) { + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect_res; + } + read_bit_fl(ptr, &mask_side, &bp_side, &tmp); + + resBits[k >> 3] |= tmp << (k & 7); + } + } else { + for (k = 0; k < lastnz; k = k + 2) { + if (save_lev[k] > 0) { + if (*nbits_residual == 0) { + break; + } - return val; -} + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect_res; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + *nbits_residual = *nbits_residual - 1; -void tns_coef_freq(LC3_INT k, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym) -{ - LC3_INT i = 0, j = 0; + if (bit == 1) { + if (x[k] > 0) { + x[k] = x[k] + 1; + } else if (x[k] < 0) { + x[k] = x[k] - 1; + } else { + if (*nbits_residual == 0) { + break; + } - *numsym = 18 - 1; + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect_res; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + *nbits_residual = *nbits_residual - 1; - j = 0; - for (i = 1; i <= *numsym; i++) { - symfreq[j] = ari_tns_freq_cf[k][i]; - j++; - } + if (bit == 0) { + x[k] = 1; + } else { + x[k] = -1; + } + } + } - for (i = 0; i < *numsym; i++) { - symfreq[i] -= ari_tns_freq_cf[k][i]; - } + if (*nbits_residual == 0) { + break; + } - for (i = 0; i < *numsym; i++) { - cumfreq[i] = ari_tns_freq_cf[k][i]; - } -} + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect_res; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + *nbits_residual = *nbits_residual - 1; -void ac_freq(LC3_INT pki, LC3_INT* symfreq, LC3_INT* cumfreq, LC3_INT* numsym) -{ - LC3_INT i = 0, j = 0; + if (bit == 1) { + if (x[k + 1] > 0) { + x[k + 1] = x[k + 1] + 1; + } else if (x[k + 1] < 0) { + x[k + 1] = x[k + 1] - 1; + } else { + if (*nbits_residual == 0) { + break; + } - *numsym = 18 - 1; + if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) + { + goto ber_detect_res; + } + read_bit_fl(ptr, &mask_side, &bp_side, &bit); + + *nbits_residual = *nbits_residual - 1; - j = 0; - for (i = 1; i <= *numsym; i++) { - symfreq[j] = ari_spec_cumfreq_fl[pki][i]; - j++; + if (bit == 0) { + x[k + 1] = 1; + } else { + x[k + 1] = -1; + } + } + } + } + } } - for (i = 0; i < *numsym; i++) { - symfreq[i] -= ari_spec_cumfreq_fl[pki][i]; - } + /* Noise-filling seed */ + calculate_nfseed(x, L_spec, nf_seed); - for (i = 0; i < *numsym; i++) { - cumfreq[i] = ari_spec_cumfreq_fl[pki][i]; + /* Zero frame flag */ + if (lastnz == 2 && x[0] == 0 && x[1] == 0 && gg_idx == 0 && fac_ns_idx == 7) { + *zero_frame = 1; + } else { + *zero_frame = 0; } -} - -void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit, LC3_INT *bp, Decoder_State_fl* st_fl, LC3_INT from_left) -{ - *bit = 0; - UNUSED(bp); - UNUSED(st_fl); - UNUSED(from_left); - - if (ptr[*bp_side] & *mask_side) { - *bit = 1; + if (enc) + { + if (st.pc_bytes > 0) + { + if (st.pc_b_left > numbytes) + { + *b_left = bp_side - st.pc_bytes; + } + } } else { - *bit = 0; + if (st.pc_bytes > 0) + { + if (st.pc_b_left > numbytes) + { + *b_left = bp_side; + } + } } - - if (*mask_side == 128) { - *mask_side = 1; - *bp_side = *bp_side - 1; - } else { - *mask_side = *mask_side * 2; + + if ((*bfi == 2) && (*spec_inv_idx == (L_spec + 1))) + { + *bfi = 0; } -} + + *spec_inv_idx = *spec_inv_idx - 1; -void findNonZero(LC3_INT* in, LC3_INT* out, LC3_INT len, LC3_INT* outLen) -{ - LC3_INT i = 0, j = 0; + goto bail; - for (i = 0; i < len; i++) { - if (in[i] != 0) { - out[j] = i; - j++; - } - } +/* goto for bit error handling */ +ber_detect: + *bfi = 1; + *b_left = st.pc_b_left; - *outLen = j; + if (st.pc_inv_bin > 0 && (st.pc_inv_bin - L_spec) <= 0) + { + *spec_inv_idx = st.pc_inv_bin; + *bfi = 2; + *resBits = 0; + *zero_frame = 0; + /* Noise Filling seed */ + calculate_nfseed(x, *spec_inv_idx, nf_seed); + } + goto bail; + +/* goto for bit error handling in residual signal */ +ber_detect_res: + *b_left = st.pc_b_left; + *resBits = 0; + *bfi = 0; + *zero_frame = 0; + /* Noise Filling seed */ + calculate_nfseed(x, *spec_inv_idx, nf_seed); + goto bail; + +/* goto, because of dynmem out */ +bail: + +#ifdef WMOPS + pop_wmops(); +#endif + /* Avoid warning "label at end of compound statement" when WMOPS is inactive */ + (void)0; } +#else + + void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, LC3_INT L_spec, LC3_INT fs_idx, LC3_INT enable_lpc_weighting, LC3_INT tns_numfilters, LC3_INT lsbMode, LC3_INT lastnz, LC3_INT* bfi, LC3_INT* tns_order, LC3_INT fac_ns_idx, LC3_INT gg_idx, uint8_t * resBits, LC3_INT* x, LC3_INT* nf_seed, LC3_INT* tns_idx, LC3_INT* zero_frame, LC3_INT numbytes, LC3_INT* nbits_residual, LC3_INT* residualPresent, LC3_INT frame_dms, - LC3_INT32 n_pc, LC3_INT32 be_bp_left, LC3_INT32 be_bp_right, LC3_INT32 enc, LC3_INT32 *b_left, LC3_INT32 *spec_inv_idx, + LC3_INT32 n_pc, LC3_INT32 be_bp_left, LC3_INT32 be_bp_right, LC3_INT32 enc, LC3_INT32 *b_left, LC3_INT32 *spec_inv_idx, LC3_INT hrmode ) { @@ -303,7 +956,7 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, LC3_INT n = 0, k = 0, lev = 0; LC3_INT max_lev = 0, tmp = 0; LC3_INT sym_freq[MAX_LEN] = {0}, cum_freq[MAX_LEN] = {0}, numsym = 0, bit = 0, lev1 = 0, pki = 0, sym = 0, - save_lev[MAX_LEN] = {0}, idx_len = 0, total_bits = 0, nbits_ari = 0, idx[MAX_LEN] = {0}, rateFlag = 0; + save_lev[MAX_LEN] = {0}, idx_len = 0, total_bits = 0, nbits_ari = 0, rateFlag = 0; total_bits = 8 * numbytes; @@ -641,7 +1294,7 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, } if (lsbMode == 0) { - findNonZero(x, idx, L_spec, &idx_len); + findNonZero(x, L_spec, &idx_len); if (hrmode) { idx_len *= EXT_RES_ITER_MAX; @@ -826,22 +1479,24 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, *spec_inv_idx = *spec_inv_idx - 1; } +#endif + void ac_encode_fl(Encoder_State_fl* st, LC3_INT sym_freq, LC3_INT cum_freq) { - LC3_INT r = 0; + LC3_INT r; r = st->range >> 10; - st->low = st->low + r * cum_freq; + st->low += r * cum_freq; if ((st->low >> 24) == 1) { st->carry = 1; } - st->low = (st->low) & ((LC3_INT)pow(2, 24) - 1); + st->low &= (16777215); /* 2^24 -1 */ st->range = r * sym_freq; - while (st->range < (LC3_INT)pow(2, 16)) { - st->range = st->range << 8; + while (st->range < 65536) { /* 2^16 */ + st->range <<= 8; ac_shift_fl(st); } } @@ -867,47 +1522,30 @@ void ac_shift_fl(Encoder_State_fl* st) } st->low = st->low << 8; - st->low = (st->low) & ((LC3_INT)pow(2, 24) - 1); -} - -void tns_order_freq_enc(LC3_INT enable_lpc_weighting, LC3_INT order, LC3_INT* symfreq, LC3_INT* cumfreq) -{ - *symfreq = tns_freq_cf[enable_lpc_weighting][order] - tns_freq_cf[enable_lpc_weighting][order - 1]; - *cumfreq = tns_freq_cf[enable_lpc_weighting][order - 1]; -} - -void tns_coef_freq_enc(LC3_INT k, LC3_INT idx, LC3_INT* symfreq, LC3_INT* cumfreq) -{ - *symfreq = tns_cf[k][idx + 1] - tns_cf[k][idx]; - *cumfreq = tns_cf[k][idx]; + st->low = (st->low) & (16777215); /* 2^24 - 1 */ } -void ac_freq_fl(LC3_INT pki, LC3_INT s, LC3_INT* symfreq, LC3_INT* cumfreq) -{ - *symfreq = ari_spec_cumfreq_fl[pki][s + 1] - ari_spec_cumfreq_fl[pki][s]; - *cumfreq = ari_spec_cumfreq_fl[pki][s]; -} void ac_finalize_fl(Encoder_State_fl* st) { LC3_INT bits = 0, mask = 0, val = 0, over1 = 0, high = 0, over2 = 0, c = 0, b = 0; - bits = 24 - floor(LC3_LOGTWO(st->range)); - mask = ((LC3_INT)pow(2, 24) - 1) >> bits; + bits = 24 - (31 - clz_func(st->range)); + mask = 16777215 >> bits; val = st->low + mask; over1 = val >> 24; - val = (val) & ((LC3_INT)pow(2, 24) - 1); + val = (val) & 16777215; high = st->low + st->range; over2 = high >> 24; - high = high & ((LC3_INT)pow(2, 24) - 1); - val = val & (((LC3_INT)pow(2, 24) - 1) - mask); + high = high & 16777215; + val = val & (16777215 - mask); if (over1 == over2) { if (val + mask >= high) { bits = bits + 1; mask = mask >> 1; - val = ((st->low + mask) & ((LC3_INT)pow(2, 24) - 1)) & (((LC3_INT)pow(2, 24) - 1) - mask); + val = ((st->low + mask) & (16777215)) & (16777215 - mask); } if (val < st->low) { @@ -949,7 +1587,7 @@ void ac_finalize_fl(Encoder_State_fl* st) void write_uint_forward_fl(Encoder_State_fl* st, LC3_INT val, LC3_INT numbits) { - LC3_INT k = 0, bit = 0, mask = 128; + LC3_INT k, bit, mask = 128; for (k = 0; k < numbits; k++) { bit = val & mask; @@ -971,7 +1609,7 @@ void ari_enc_init(Encoder_State_fl* st, LC3_UINT8* bytes, LC3_INT* bp_side, LC3_ st->mask_side = mask_side; st->bp = 0; st->low = 0; - st->range = (LC3_INT)pow(2, 24) - 1; + st->range = 16777215; st->cache = -1; st->carry = 0; st->carry_count = 0; @@ -992,11 +1630,16 @@ void processAriEncoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, LC3_INT* tns_idx, LC3_INT lastnz, LC3_INT* codingdata, uint8_t* res_bits, LC3_INT resBitsLen, LC3_INT lsbMode, LC3_INT nbbits, LC3_INT enable_lpc_weighting) { - LC3_INT total_bits = 0, cumfreq = 0, symfreq = 0, k = 0, i = 0, j = 0, lev = 0, lev1 = 0; - LC3_INT bit1 = 0, bit2 = 0, lsb1 = 0, lsb2 = 0, a = 0, b = 0, bit = 0, pki = 0, nbits_side = 0; - LC3_INT nbits_residual_enc = 0, nbits_ari = 0, lsbs[MAX_LEN] = {0}, lsbsLen = 0; + LC3_INT total_bits, cumfreq, symfreq, k, i, j, lev, lev1; + LC3_INT bit1, bit2, lsb1, lsb2, a, b, bit, pki, nbits_side; + LC3_INT nbits_residual_enc, nbits_ari, lsbs[MAX_LEN], lsbsLen = 0; + LC3_INT abs_x_k, abs_x_kp1; Encoder_State_fl st; +#ifdef WMOPS + push_wmops("processAriEncoder_fl"); +#endif + ari_enc_init(&st, bytes, &bp_side, &mask_side); total_bits = nbbits; @@ -1004,11 +1647,13 @@ void processAriEncoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, /* TNS data */ for (i = 0; i < tns_numfilters; i++) { if (tns_order[i] > 0) { - tns_order_freq_enc(enable_lpc_weighting, tns_order[i], &symfreq, &cumfreq); + symfreq = tns_freq_cf[enable_lpc_weighting][tns_order[i]] - tns_freq_cf[enable_lpc_weighting][tns_order[i] - 1]; + cumfreq = tns_freq_cf[enable_lpc_weighting][tns_order[i] - 1]; ac_encode_fl(&st, symfreq, cumfreq); for (j = 0; j < tns_order[i]; j++) { - tns_coef_freq_enc(j, tns_idx[i * 8 + j], &symfreq, &cumfreq); + symfreq = tns_cf[j][tns_idx[i * 8 + j] + 1] - tns_cf[j][tns_idx[i * 8 + j]]; + cumfreq = tns_cf[j][tns_idx[i * 8 + j]]; ac_encode_fl(&st, symfreq, cumfreq); } } @@ -1016,14 +1661,18 @@ void processAriEncoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, /* Spectral data */ for (k = 0; k < lastnz; k = k + 2) { + abs_x_k = abs(x[k]); + abs_x_kp1 = abs(x[k + 1]); for (lev = 0; lev < codingdata[1]; lev++) { lev1 = MIN(lev, 3); pki = ari_spec_lookup_fl[codingdata[0] + lev1 * 1024]; - ac_freq_fl(pki, 16, &symfreq, &cumfreq); + symfreq = ari_spec_cumfreq_fl[pki][17] - ari_spec_cumfreq_fl[pki][16]; + cumfreq = ari_spec_cumfreq_fl[pki][16]; ac_encode_fl(&st, symfreq, cumfreq); - bit1 = (abs(x[k]) >> lev) & 1; - bit2 = (abs(x[k + 1]) >> lev) & 1; + bit1 = (abs_x_k >> lev) & 1; + bit2 = (abs_x_kp1 >> lev) & 1; + if (lsbMode == 1 && lev == 0) { lsb1 = bit1; @@ -1037,11 +1686,12 @@ void processAriEncoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, lev1 = MIN(MAX(codingdata[1], 0), 3); pki = ari_spec_lookup_fl[codingdata[0] + lev1 * 1024]; - ac_freq_fl(pki, codingdata[2], &symfreq, &cumfreq); + symfreq = ari_spec_cumfreq_fl[pki][codingdata[2] + 1] - ari_spec_cumfreq_fl[pki][codingdata[2]]; + cumfreq = ari_spec_cumfreq_fl[pki][codingdata[2]]; ac_encode_fl(&st, symfreq, cumfreq); - a = abs(x[k]); - b = abs(x[k + 1]); + a = abs_x_k; + b = abs_x_kp1; if (lsbMode == 1 && codingdata[1] > 0) { a = a >> 1; @@ -1079,8 +1729,8 @@ void processAriEncoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, } /* Residual bits */ - nbits_side = total_bits - (8 * (*(st.bp_side) + 1) + 8 - LC3_LOGTWO(*(st.mask_side))); - nbits_ari = (st.bp + 1) * 8 + 25 - floor(LC3_LOGTWO(st.range)); + nbits_side = total_bits - (8 * (*(st.bp_side) + 1) + 8 - (31 - clz_func(*(st.mask_side)))); + nbits_ari = 8 * (st.bp + 1) + 25 - (31 - clz_func(st.range )) ; if (st.cache >= 0) { nbits_ari = nbits_ari + 8; @@ -1118,5 +1768,8 @@ void processAriEncoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, } ac_finalize_fl(&st); +#ifdef WMOPS + pop_wmops(); +#endif } diff --git a/lib_lc3plus/attack_detector.c b/lib_lc3plus/attack_detector.c index c9f7c0a94c..ec70b63b67 100644 --- a/lib_lc3plus/attack_detector.c +++ b/lib_lc3plus/attack_detector.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -14,26 +14,19 @@ void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* lastAttackPosition, LC3_FLOAT* accNrg, LC3_INT* attackFlag, LC3_FLOAT* attdec_filter_mem, LC3_INT attackHandlingOn, LC3_INT attdec_nblocks, LC3_INT attdec_hangover_threshold) { - LC3_FLOAT f_sig[160] = {0}, block_nrg[4] = {0}, sum = 0, tmpEne = 0, *ptr = NULL, tmp[162] = {0}; - LC3_INT i = 0, j = 0, attackPosition = 0; - LC3_FLOAT mval = 0; - LC3_INT frame_size_16k = attdec_nblocks * 40; - - - ptr = &tmp[2]; - - + LC3_FLOAT f_sig[160], block_nrg[4], sum, tmpEne, *ptr, tmp[162]; + LC3_INT i, j, attackPosition; + LC3_FLOAT mval; + LC3_INT frame_size_16k; if (attackHandlingOn) { - /* Decimate 96, 48 and 32 kHz signals to 16 kHz */ - if (fs == 96000) { - for (i = 0; i < frame_size;) { - ptr[j] = in[i] + in[i + 1] + in[i + 2] + in[i + 3] + in[i + 4] + in[i + 5]; - i = i + 6; - j++; - } - mval = 1e-5; - } else if (fs == 48000) { + + mval = 0; j = 0; + frame_size_16k = attdec_nblocks * 40; + ptr = &tmp[2]; + + /* Decimate 48 and 32 kHz signals to 16 kHz */ + if (fs == 48000) { j = 0; for (i = 0; i < frame_size;) { ptr[j] = (in[i] + in[i + 1] + in[i + 2]); @@ -47,13 +40,6 @@ void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* i = i + 2; j++; } - } else if (fs == 24000) { - j = 0; - for (i = 0; i < frame_size;) { - ptr[j] = (in[i] + (in[i + 1] + in[i + 2]) / 2.0); - i = i + 3; - j++; - } } /* Filter */ diff --git a/lib_lc3plus/clib.h b/lib_lc3plus/clib.h index bd70927808..6588af717d 100644 --- a/lib_lc3plus/clib.h +++ b/lib_lc3plus/clib.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef CLIB_H #define CLIB_H +#include "options.h" #include #include #include diff --git a/lib_lc3plus/constants.c b/lib_lc3plus/constants.c index 8189761a04..306a892564 100644 --- a/lib_lc3plus/constants.c +++ b/lib_lc3plus/constants.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -48,10 +48,10 @@ ENTRY_DCT2_15, ENTRY_DCT2_16 }; -const LC3_INT ari_tns_order_cf[2][9] = {{0, 3, 12, 35, 89, 200, 390, 658, 1024}, +const LC3_INT16 ari_tns_order_cf[2][9] = {{0, 3, 12, 35, 89, 200, 390, 658, 1024}, {0, 14, 56, 156, 313, 494, 672, 839, 1024}}; -const LC3_INT ari_tns_freq_cf[8][18] = { +const LC3_INT16 ari_tns_freq_cf[8][18] = { {0, 1, 6, 21, 52, 106, 192, 289, 409, 568, 720, 831, 935, 994, 1016, 1022, 1023, 1024}, {0, 1, 2, 3, 4, 17, 60, 154, 293, 466, 626, 780, 911, 989, 1016, 1022, 1023, 1024}, {0, 1, 2, 3, 4, 13, 56, 162, 361, 578, 788, 929, 1003, 1020, 1021, 1022, 1023, 1024}, @@ -279,7 +279,7 @@ const LC3_INT ari_spec_lookup_fl[4096] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -const LC3_INT ari_spec_cumfreq_fl[64][18] = { +const LC3_INT16 ari_spec_cumfreq_fl[64][18] = { {0, 1, 2, 177, 225, 226, 227, 336, 372, 543, 652, 699, 719, 768, 804, 824, 834, 1024}, {0, 18, 44, 61, 71, 98, 135, 159, 175, 197, 229, 251, 265, 282, 308, 328, 341, 1024}, {0, 71, 163, 212, 237, 318, 420, 481, 514, 556, 613, 652, 675, 697, 727, 749, 764, 1024}, @@ -653,6 +653,22 @@ const LC3_FLOAT quants_thr_tns[18] = {-1, 1}; /* SNS */ +const LC3_FLOAT sns_W[6] = {0.0833333333333333, 0.166666666666667, 0.250000000000000, 0.250000000000000, 0.166666666666667, 0.0833333333333333}; + +const LC3_FLOAT sns_preemph_8[64] = {1, 1.05250028527773, 1.10775685050971, 1.16591440117983, 1.22712523985119, 1.29154966501488, 1.35935639087853, 1.43072298919376, 1.50583635427984, 1.58489319246111, 1.66810053720006, 1.75567629127500, 1.84784979742229, 1.94486243893736, 2.04696827180752, 2.15443469003188, 2.26754312587080, 2.38658978685858, 2.51188643150958, 2.64376118574910, 2.78255940220713, 2.92864456462524, 3.08239923974514, 3.24422607917163, 3.41454887383360, 3.59381366380463, 3.78248990638938, 3.98107170553497, 4.19007910578667, 4.41005945417674, 4.64158883361278, 4.88527357151939, 5.14175182768393, 5.41169526546464, 5.69581081073769, 5.99484250318941, 6.30957344480193, 6.64082785063484, 6.98947320727349, 7.35642254459641, 7.74263682681127, 8.14912746902074, 8.57695898590894, 9.02725177948457, 9.50118507318144, 10, 10.5250028527773, 11.0775685050971, 11.6591440117983, 12.2712523985119, 12.9154966501488, 13.5935639087853, 14.3072298919376, 15.0583635427984, 15.8489319246111, 16.6810053720006, 17.5567629127500, 18.4784979742229, 19.4486243893736, 20.4696827180752, 21.5443469003188, 22.6754312587080, 23.8658978685858, 25.1188643150958}; + +const LC3_FLOAT sns_preemph_16[64] = {1, 1.06800043251458, 1.14062492385132, 1.21818791201012, 1.30102521691083, 1.38949549437314, 1.48398178896757, 1.58489319246111, 1.69266661503788, 1.80776867696343, 1.93069772888325, 2.06198600950222, 2.20220194998738, 2.35195263507096, 2.51188643150958, 2.68269579527973, 2.86512026966378, 3.05994968720720, 3.26802758941013, 3.49025487895958, 3.72759372031494, 3.98107170553497, 4.25178630338289, 4.54090961097248, 4.84969342852820, 5.17947467923121, 5.53168119761723, 5.90783791158795, 6.30957344480193, 6.73862716803095, 7.19685673001152, 7.68624610039774, 8.20891415963826, 8.76712387296868, 9.36329208823941, 10, 10.6800043251458, 11.4062492385132, 12.1818791201012, 13.0102521691083, 13.8949549437314, 14.8398178896756, 15.8489319246111, 16.9266661503788, 18.0776867696343, 19.3069772888325, 20.6198600950222, 22.0220194998738, 23.5195263507096, 25.1188643150958, 26.8269579527973, 28.6512026966378, 30.5994968720720, 32.6802758941013, 34.9025487895958, 37.2759372031494, 39.8107170553497, 42.5178630338289, 45.4090961097248, 48.4969342852820, 51.7947467923121, 55.3168119761723, 59.0783791158795, 63.0957344480193}; + +const LC3_FLOAT sns_preemph_24[64] = {1, 1.08372885005949, 1.17446822045126, 1.27280509398106, 1.37937560084995, 1.49486913370923, 1.62003280726413, 1.75567629127500, 1.90267704822016, 2.06198600950222, 2.23463372691659, 2.42173703917547, 2.62450629661210, 2.84425319080132, 3.08239923974514, 3.34048498351325, 3.62017994982380, 3.92329345403096, 4.25178630338289, 4.60778348126382, 4.99358789347315, 5.41169526546464, 5.86481028691437, 6.35586410805477, 6.88803330095657, 7.46476040841712, 8.08977621338348, 8.76712387296868, 9.50118507318144, 10.2967083735613, 11.1588399250775, 12.0931567600021, 13.1057028691062, 14.2030282995578, 15.3922315264422, 16.6810053720006, 18.0776867696343, 19.5913106945915, 21.2316686102078, 23.0093718077846, 24.9359200498416, 27.0237759607902, 29.2864456462524, 31.7385660625428, 34.3959997014966, 37.2759372031494, 40.3970085600588, 43.7794036326358, 47.4450027550866, 51.4175182768393, 55.7226479550717, 60.3882411906196, 65.4444791826252, 70.9240701673285, 76.8624610039774, 83.2980664765827, 90.2725177948458, 97.8309319017829, 106.022203330167, 114.899320495775, 124.519708473503, 134.945600473732, 146.244440421985, 158.489319246111}; + +const LC3_FLOAT sns_preemph_32[64] = {1, 1.09968889964399, 1.20931567600021, 1.32987102506290, 1.46244440421985, 1.60823387766704, 1.76855694330186, 1.94486243893736, 2.13874363543396, 2.35195263507096, 2.58641620527597, 2.84425319080132, 3.12779366170121, 3.43959997014966, 3.78248990638938, 4.15956216307185, 4.57422433810926, 5.03022372910014, 5.53168119761723, 6.08312840938905, 6.68954878691415, 7.35642254459641, 8.08977621338348, 8.89623710246182, 9.78309319017829, 10.7583589854218, 11.8308479546535, 13.0102521691083, 14.3072298919376, 15.7335018968185, 17.3019573884589, 19.0267704822017, 20.9235282953511, 23.0093718077846, 25.3031507648021, 27.8255940220712, 30.5994968720720, 33.6499270449086, 37.0044512451161, 40.6933842716715, 44.7500629725045, 49.2111475092328, 54.1169526546464, 59.5118121168741, 65.4444791826252, 71.9685673001152, 79.1430345832182, 87.0327166153056, 95.7089123677128, 105.250028527773, 115.742288059206, 127.280509398106, 139.968963326130, 153.922315264422, 169.266661503788, 186.140668735512, 204.696827180752, 225.102828643018, 247.543081937190, 272.220379389991, 299.357729472049, 329.200372123041, 362.017994982380, 398.107170553497}; + +const LC3_FLOAT sns_preemph_48[64] = {1, 1.11588399250775, 1.24519708473503, 1.38949549437314, 1.55051577983262, 1.73019573884589, 1.93069772888325, 2.15443469003188, 2.40409918350997, 2.68269579527973, 2.99357729472049, 3.34048498351325, 3.72759372031494, 4.15956216307185, 4.64158883361278, 5.17947467923121, 5.77969288415331, 6.44946677103762, 7.19685673001152, 8.03085722139151, 8.96150501946605, 10, 11.1588399250775, 12.4519708473503, 13.8949549437314, 15.5051577983262, 17.3019573884589, 19.3069772888325, 21.5443469003188, 24.0409918350997, 26.8269579527973, 29.9357729472049, 33.4048498351324, 37.2759372031494, 41.5956216307185, 46.4158883361278, 51.7947467923121, 57.7969288415332, 64.4946677103762, 71.9685673001152, 80.3085722139151, 89.6150501946605, 100, 111.588399250775, 124.519708473503, 138.949549437314, 155.051577983263, 173.019573884589, 193.069772888325, 215.443469003188, 240.409918350997, 268.269579527972, 299.357729472049, 334.048498351324, 372.759372031494, 415.956216307185, 464.158883361278, 517.947467923121, 577.969288415331, 644.946677103762, 719.685673001152, 803.085722139151, 896.150501946605, 1000}; + +const LC3_FLOAT sns_preemph_96[64] = {1, 1.13231759012767, 1.28214312491253, 1.45179321339972, 1.64389099276047, 1.86140668735512, 2.10770353447348, 2.38658978685858, 2.70237759607902, 3.05994968720720, 3.46483485573037, 3.92329345403096, 4.44241418923200, 5.03022372910014, 5.69581081073769, 6.44946677103762, 7.30284467178980, 8.26913947983772, 9.36329208823941, 10.6022203330167, 12.0050805774841, 13.5935639087853, 15.3922315264422, 17.4288945087081, 19.7350438286898, 22.3463372691659, 25.3031507648021, 28.6512026966378, 32.4422607917163, 36.7349425579696, 41.5956216307185, 47.0994540447575, 53.3315403002887, 60.3882411906196, 68.3786677370108, 77.4263682681127, 87.6712387296868, 99.2716857619066, 112.407075989833, 127.280509398106, 144.121959671886, 163.191830060146, 184.784979742229, 209.235282953511, 236.920791363601, 268.269579527972, 303.766363795677, 343.959997014966, 389.471954920307, 441.005945417674, 499.358789347315, 565.432740962822, 640.249438626305, 724.965701425931, 820.891415963825, 929.509789880649, 1052.50028527773, 1191.76458663437, 1349.45600473732, 1528.01277126748, 1730.19573884589, 1959.13106945914, 2218.35857131422, 2511.88643150958}; + +const LC3_FLOAT *sns_preemph_all[6] = {sns_preemph_8, sns_preemph_16, sns_preemph_24, sns_preemph_32, sns_preemph_48, sns_preemph_96}; + const LC3_FLOAT sns_vq_far_adj_gains_fl[8] = {1.05859375000000, 1.23706054687500, 1.43920898437500, 1.98950195312500, 2.49877929687500, 3.13110351562500, 4.11816406250000, 4.85400390625000}; @@ -983,6 +999,31 @@ const LC3_INT BW_cutoff_bits_all[MAX_BW_BANDS_NUMBER] = {0, 1, 2, 2, 3, 0}; const LC3_INT BW_cutoff_bin_all_5ms[MAX_BW_BANDS_NUMBER] = {40, 80, 120, 160, 200, 200}; const LC3_INT BW_cutoff_bin_all_2_5ms[MAX_BW_BANDS_NUMBER] = {20, 40, 60, 80, 100, 100}; +#ifdef CR8_G_ADD_75MS +const LC3_INT BW_cutoff_bin_all_7_5ms[] = {60, 120, 180, 240, 300, 300}; +const LC3_INT bands_number_7_5ms_HR [] = {60, 64, 64, 64, 64, 64}; +const LC3_INT bands_number_7_5ms [] = {60, 64, 64, 64, 64}; + +const LC3_INT BW_warp_idx_start_16k_7_5ms[4] = {51, 0, 0, 0}; +const LC3_INT BW_warp_idx_stop_16k_7_5ms[4] = {63, 0, 0, 0}; + +const LC3_INT BW_warp_idx_start_24k_7_5ms[4] = {45, 58, 0, 0}; +const LC3_INT BW_warp_idx_stop_24k_7_5ms[4] = {55, 63, 0, 0}; + +const LC3_INT BW_warp_idx_start_32k_7_5ms[4] = {42, 53, 60, 0}; +const LC3_INT BW_warp_idx_stop_32k_7_5ms[4] = {51, 58, 63, 0}; + +const LC3_INT BW_warp_idx_start_48k_7_5ms[4] = {40, 51, 57, 61}; +const LC3_INT BW_warp_idx_stop_48k_7_5ms[4] = {48, 55, 60, 63}; + +const LC3_INT brickwall_dist_7_5ms[4] = {4, 4, 3, 2}; + +const LC3_INT* BW_warp_idx_start_all_7_5ms[4] = {BW_warp_idx_start_16k_7_5ms, BW_warp_idx_start_24k_7_5ms, + BW_warp_idx_start_32k_7_5ms, BW_warp_idx_start_48k_7_5ms}; +const LC3_INT* BW_warp_idx_stop_all_7_5ms[4] = {BW_warp_idx_stop_16k_7_5ms, BW_warp_idx_stop_24k_7_5ms, + BW_warp_idx_stop_32k_7_5ms, BW_warp_idx_stop_48k_7_5ms}; +#endif + /* Arithmetic coding */ const LC3_INT tns_cf[8][18] = {{0, 1, 6, 21, 52, 106, 192, 289, 409, 568, 720, 831, 935, 994, 1016, 1022, 1023, 1024}, {0, 1, 2, 3, 4, 17, 60, 154, 293, 466, 626, 780, 911, 989, 1016, 1022, 1023, 1024}, @@ -998,6 +1039,2372 @@ const LC3_INT tns_freq_cf[2][9] = {{0, 3, 12, 35, 89, 200, 390, 658, 1024}, {0, /* MDCT Windows */ +#ifdef CR8_G_ADD_75MS + +const LC3_FLOAT MDCT_HRA_WINDOW_480_7_5ms[720] = { + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 6.809599915345237e-08, 2.716186708704376e-07, 6.424371293934969e-07, + 1.260808101892957e-06, 2.229378921489615e-06, 3.679074029772919e-06, 5.774505277720125e-06, 8.719889849723028e-06, + 1.276556063788606e-05, 1.821508881356302e-05, 2.543302196376427e-05, 3.485323086760931e-05, 4.698784831976895e-05, + 6.243677337396717e-05, 8.189770380196378e-05, 1.061766484618177e-04, 1.361988597286949e-04, 1.730201142776986e-04, + 2.178382584565609e-04, 2.720049223973359e-04, 3.370372950540977e-04, 4.146298406925523e-04, 5.066658261806472e-04, + 6.152285179265661e-04, 7.426118976760646e-04, 8.913307378108167e-04, 1.064129869478226e-03, 1.263992471022180e-03, + 1.494147199957892e-03, 1.758073989316892e-03, 2.059508328742228e-03, 2.402443852384859e-03, 2.791133059566779e-03, + 3.230086000439834e-03, 3.724066767561293e-03, 4.278087645481125e-03, 4.897400784114414e-03, 5.587487277846723e-03, + 6.354043550947961e-03, 7.202964970873775e-03, 8.140326634299601e-03, 9.172361296110928e-03, 1.030543443887801e-02, + 1.154601650935216e-02, 1.290065237897715e-02, 1.437592811702264e-02, 1.597843519739845e-02, 1.771473229314812e-02, + 1.959130484567766e-02, 2.161452262855616e-02, 2.379059555782150e-02, 2.612552803171593e-02, 2.862507211224012e-02, + 3.129467988842215e-02, 3.413945538633399e-02, 3.716410641324389e-02, 4.037289674248027e-02, 4.376959906123697e-02, + 4.735744911533900e-02, 5.113910149261011e-02, 5.511658748968899e-02, 5.929127550571237e-02, 6.366383440006920e-02, + 6.823420024032127e-02, 7.300154685033973e-02, 7.796426054773728e-02, 8.311991943385708e-02, 8.846527756905853e-02, + 9.399625433100661e-02, 9.970792921440458e-02, 1.055945422874181e-01, 1.116495004733158e-01, 1.178654910777398e-01, + 1.242343970754217e-01, 1.307472697698447e-01, 1.373944835632858e-01, 1.441657329773458e-01, 1.510500827600614e-01, + 1.580360226424669e-01, 1.651115279124688e-01, 1.722641255794418e-01, 1.794809657536407e-01, 1.867488977915941e-01, + 1.940545506994020e-01, 2.013844172328433e-01, 2.087249410855671e-01, 2.160626065146083e-01, 2.233840297164879e-01, + 2.306760512375861e-01, 2.379258286796330e-01, 2.451209289452065e-01, 2.522494192591140e-01, 2.592999561994307e-01, + 2.662618719765588e-01, 2.731252572097561e-01, 2.798810394677779e-01, 2.865210568632502e-01, 2.930381260187334e-01, + 2.994261037557683e-01, 3.056799418961772e-01, 3.117957346072421e-01, 3.177707577688937e-01, 3.236034998916132e-01, + 3.292936841683654e-01, 3.348422813026286e-01, 3.402515128176158e-01, 3.455248446193337e-01, 3.506669706583936e-01, + 3.556837866127393e-01, 3.605823535957678e-01, 3.653708519817664e-01, 3.700585255329578e-01, 3.746556161093967e-01, + 3.791732893437698e-01, 3.836235517669143e-01, 3.880191599752360e-01, 3.923735225365686e-01, 3.967005954344419e-01, + 4.010147719499705e-01, 4.053307679732117e-01, 4.096635038192941e-01, 4.140279836962412e-01, 4.184391740286457e-01, + 4.229118818818259e-01, 4.274606347526876e-01, 4.320995629945984e-01, 4.368422861229869e-01, 4.417018042055877e-01, + 4.466903954763946e-01, 4.518195212263102e-01, 4.570997389177666e-01, 4.625406243474134e-01, 4.681507035432432e-01, + 4.739373949335071e-01, 4.799069621682588e-01, 4.860644778142650e-01, 4.924137979843949e-01, 4.989575478073994e-01, + 5.056971174969224e-01, 5.126326686429926e-01, 5.197631502279640e-01, 5.270863237641458e-01, 5.345987968637925e-01, + 5.422960644846202e-01, 5.501725570458306e-01, 5.582216945803693e-01, 5.664359460778171e-01, 5.748068931775395e-01, + 5.833252973915712e-01, 5.919811700691291e-01, 6.007638443572958e-01, 6.096620484629849e-01, 6.186639795774059e-01, + 6.277573778837434e-01, 6.369296001295948e-01, 6.461676923061090e-01, 6.554584610342162e-01, 6.647885433136285e-01, + 6.741444743414929e-01, 6.835127531540456e-01, 6.928799058859592e-01, 7.022325464781733e-01, 7.115574346958600e-01, + 7.208415313440352e-01, 7.300720505895358e-01, 7.392365093150189e-01, 7.483227734438597e-01, 7.573191011847887e-01, + 7.662141831523945e-01, 7.749971793247219e-01, 7.836577528026495e-01, 7.921861003379914e-01, 8.005729795988183e-01, + 8.088097331417404e-01, 8.168883090622450e-01, 8.248012782960292e-01, 8.325418485469714e-01, 8.401038748212752e-01, + 8.474818665528070e-01, 8.546709913119690e-01, 8.616670751000000e-01, 8.684665992426276e-01, 8.750666939117441e-01, + 8.814651283214563e-01, 8.876602976655703e-01, 8.936512068873075e-01, 8.994374513987017e-01, 9.050191948964271e-01, + 9.103971444522861e-01, 9.155725230896603e-01, 9.205470400910444e-01, 9.253228593153561e-01, 9.299025658359243e-01, + 9.342891312395554e-01, 9.384858779525852e-01, 9.424964429799174e-01, 9.463247414564011e-01, 9.499749304154305e-01, + 9.534513731762839e-01, 9.567586047388893e-01, 9.599012985520849e-01, 9.628842349891718e-01, 9.657122718232282e-01, + 9.683903169452684e-01, 9.709233035123621e-01, 9.733161676521148e-01, 9.755738287865520e-01, 9.777011725747500e-01, + 9.797030364119408e-01, 9.815841973655319e-01, 9.833493623777330e-01, 9.850031605220572e-01, 9.865501370683191e-01, + 9.879947490888552e-01, 9.893413623279752e-01, 9.905942490570202e-01, 9.917575866483249e-01, 9.928354566216883e-01, + 9.938318439453252e-01, 9.947506364078684e-01, 9.955956239169538e-01, 9.963704976211798e-01, 9.970788487938620e-01, + 9.977241674570765e-01, 9.983098407613983e-01, 9.988391511690631e-01, 9.993152745149454e-01, 9.997412780400421e-01, + 1.000120118505655e+00, 1.000454640503141e+00, 1.000747575074179e+00, 1.001001538750552e+00, 1.001219033111063e+00, + 1.001402444937498e+00, 1.001554047032278e+00, 1.001675999738891e+00, 1.001770353183267e+00, 1.001839050231077e+00, + 1.001883930133431e+00, 1.001906732812431e+00, 1.001909103719272e+00, 1.001892599181639e+00, 1.001858692144366e+00, + 1.001808778198111e+00, 1.001744181785080e+00, 1.001666162468790e+00, 1.001575921156133e+00, 1.001474606164513e+00, + 1.001363319034069e+00, 1.001243119994661e+00, 1.001115033008877e+00, 1.000980050325283e+00, 1.000839136490102e+00, + 1.000693231779806e+00, 1.000543255031507e+00, 1.000390105861922e+00, 1.000234666278804e+00, 1.000077801700791e+00, + 9.999203614123487e-01, 9.997631784897281e-01, 9.996070692418051e-01, 9.994528322168238e-01, 9.993012468388005e-01, + 9.991530718675707e-01, 9.990090391528494e-01, 9.988698631596843e-01, 9.987362319429512e-01, 9.986087958497237e-01, + 9.984881744259831e-01, 9.983749534239558e-01, 9.982696819855041e-01, 9.981728700145615e-01, 9.980849857504854e-01, + 9.980064535530436e-01, 9.979376519085494e-01, 9.978789116654476e-01, 9.978305145064250e-01, 9.977926916628833e-01, + 9.977656228763698e-01, 9.977494356103552e-01, 9.977442045145120e-01, 9.977499511424820e-01, 9.977666439229387e-01, + 9.977941983826280e-01, 9.978324776189644e-01, 9.978812930187096e-01, 9.979404052182159e-01, 9.980095252997591e-01, + 9.980883162175314e-01, 9.981763944459758e-01, 9.982733318422902e-01, 9.983786577141155e-01, 9.984918610826710e-01, + 9.986123931308583e-01, 9.987396698251857e-01, 9.988730746997222e-01, 9.990119617896823e-01, 9.991556587016854e-01, + 9.993034698072086e-01, 9.994546795452566e-01, 9.996085558198406e-01, 9.997643534774231e-01, 9.999213178491362e-01, + 1.000078688342232e+00, 1.000235702064949e+00, 1.000391597468710e+00, 1.000545617991395e+00, 1.000697015685261e+00, + 1.000845054812993e+00, 1.000989015395319e+00, 1.001128196693676e+00, 1.001261920611439e+00, 1.001389534997449e+00, + 1.001510416835741e+00, 1.001623975305719e+00, 1.001729654697400e+00, 1.001826937166789e+00, 1.001915345317049e+00, + 1.001994444591742e+00, 1.002063845467139e+00, 1.002123205431461e+00, 1.002172230739781e+00, 1.002210677934335e+00, + 1.002238355121073e+00, 1.002255122994435e+00, 1.002260895603584e+00, 1.002255640854628e+00, 1.002239380744737e+00, + 1.002212191325473e+00, 1.002174202394129e+00, 1.002125596913369e+00, 1.002066610160972e+00, 1.001997528613025e+00, + 1.001918688565458e+00, 1.001830474500286e+00, 1.001733317204479e+00, 1.001627691650788e+00, 1.001514114651268e+00, + 1.001393142295620e+00, 1.001265367187681e+00, 1.001131415494648e+00, 1.000991943824643e+00, 1.000847635949292e+00, + 1.000699199388794e+00, 1.000547361877802e+00, 1.000392867731002e+00, 1.000236474127865e+00, 1.000078947336370e+00, + 9.999210588958194e-01, 9.997635817789274e-01, 9.996072865534386e-01, 9.994529375633210e-01, 9.993012891494056e-01, + 9.991530819289113e-01, 9.990090391528497e-01, 9.988698631596844e-01, 9.987362319429512e-01, 9.986087958497240e-01, + 9.984881744259831e-01, 9.983749534239558e-01, 9.982696819855044e-01, 9.981728700145615e-01, 9.980849857504854e-01, + 9.980064535530438e-01, 9.979376519085497e-01, 9.978789116654476e-01, 9.978305145064252e-01, 9.977926916628833e-01, + 9.977656228763698e-01, 9.977494356103552e-01, 9.977442045145120e-01, 9.977499511424820e-01, 9.977666439229387e-01, + 9.977941983826278e-01, 9.978324776189643e-01, 9.978812930187095e-01, 9.979404052182158e-01, 9.980095252997588e-01, + 9.980883162175312e-01, 9.981763944459756e-01, 9.982733318422901e-01, 9.983786577141153e-01, 9.984918610826709e-01, + 9.986123931308580e-01, 9.987396698251855e-01, 9.988730746997220e-01, 9.990119617896820e-01, 9.991556587016851e-01, + 9.993034698072083e-01, 9.994546795452562e-01, 9.996085558198403e-01, 9.997643534774228e-01, 9.999213178491358e-01, + 1.000078688342232e+00, 1.000235702064949e+00, 1.000391597468709e+00, 1.000545617991395e+00, 1.000697015685261e+00, + 1.000845054812992e+00, 1.000989015395319e+00, 1.001128196693676e+00, 1.001261920611439e+00, 1.001389534997449e+00, + 1.001510416835740e+00, 1.001623975305719e+00, 1.001729654697400e+00, 1.001826937166789e+00, 1.001915345317049e+00, + 1.001994444591742e+00, 1.002063845467139e+00, 1.002123205431461e+00, 1.002172230739781e+00, 1.002210677934335e+00, + 1.002238355121073e+00, 1.002255122994435e+00, 1.002260895603584e+00, 1.002255640854628e+00, 1.002239380744737e+00, + 1.002212191325473e+00, 1.002174202394129e+00, 1.002125596913369e+00, 1.002066610160972e+00, 1.001997528613026e+00, + 1.001918688565458e+00, 1.001830474500286e+00, 1.001733317204480e+00, 1.001627691650788e+00, 1.001514114651269e+00, + 1.001393142295620e+00, 1.001265367187681e+00, 1.001131415494648e+00, 1.000991943824644e+00, 1.000847625870882e+00, + 1.000699157018909e+00, 1.000547256415431e+00, 1.000392650246594e+00, 1.000236070641674e+00, 1.000078249725773e+00, + 9.999199133992033e-01, 9.997617746889341e-01, 9.996045266479927e-01, 9.994488347910435e-01, 9.992953290608048e-01, + 9.991445953265840e-01, 9.989971664237720e-01, 9.988535127515954e-01, 9.987140324557005e-01, 9.985790412319091e-01, + 9.984487617975299e-01, 9.983233130864525e-01, 9.982026992336113e-01, 9.980867984227458e-01, 9.979753516783147e-01, + 9.978679516874593e-01, 9.977640317406775e-01, 9.976628548799390e-01, 9.975635033400763e-01, 9.974648683632181e-01, + 9.973656404566504e-01, 9.972643001519088e-01, 9.971591093072504e-01, 9.970481029773169e-01, 9.969290818533281e-01, + 9.967996052552075e-01, 9.966569846345418e-01, 9.964982775252248e-01, 9.963202818581681e-01, 9.961195305388424e-01, + 9.958922861728758e-01, 9.956345358167873e-01, 9.953419856293327e-01, 9.950100553049441e-01, 9.946338721852209e-01, + 9.942082649678485e-01, 9.937277569649872e-01, 9.931865589047922e-01, 9.925785613196768e-01, 9.918973266220812e-01, + 9.911360810312226e-01, 9.902877065805247e-01, 9.893447335026750e-01, 9.882993333547356e-01, 9.871433133064559e-01, + 9.858681120677728e-01, 9.844647979734713e-01, 9.829240697712801e-01, 9.812362606719703e-01, 9.793913462143841e-01, + 9.773789564736696e-01, 9.751883930968924e-01, 9.728086515871036e-01, 9.702284491761823e-01, 9.674362585304656e-01, + 9.644203474241703e-01, 9.611688243973939e-01, 9.576696902919403e-01, 9.539108954335166e-01, 9.498804021071905e-01, + 9.455662518583811e-01, 9.409566370477763e-01, 9.360399759985500e-01, 9.308049910005284e-01, 9.252407883802984e-01, + 9.193369398095318e-01, 9.130835640061534e-01, 9.064714079838252e-01, 8.994919270231900e-01, 8.921373625716933e-01, + 8.844008173252615e-01, 8.762763268021769e-01, 8.677589267845028e-01, 8.588447160727389e-01, 8.495309140724763e-01, + 8.398159128053756e-01, 8.296993230087498e-01, 8.191820140566964e-01, 8.082661474997362e-01, 7.969552040782567e-01, + 7.852540041171052e-01, 7.731687212540459e-01, 7.607068894934714e-01, 7.478774036088883e-01, 7.346905129436833e-01, + 7.211578086800342e-01, 7.072922046612431e-01, 6.931079118639383e-01, 6.786204066243602e-01, 6.638463927281081e-01, + 6.488037574761728e-01, 6.335115218426407e-01, 6.179897848420400e-01, 6.022596622277155e-01, 5.863432196477422e-01, + 5.702634003925362e-01, 5.540439478792599e-01, 5.377093230331162e-01, 5.212846167453395e-01, 5.047954576127168e-01, + 4.882679151942771e-01, 4.717283990576996e-01, 4.552035539311637e-01, 4.387201513257116e-01, 4.223049780484175e-01, + 4.059847220871455e-01, 3.897858564125437e-01, 3.737345213109408e-01, 3.578564059314520e-01, 3.421766298000327e-01, + 3.267196251203117e-01, 3.115090207434621e-01, 2.965675287446095e-01, 2.819168345887702e-01, 2.675774919024606e-01, + 2.535688228855250e-01, 2.399088253991666e-01, 2.266140877488131e-01, 2.136997121429473e-01, 2.011792477505556e-01, + 1.890646342002475e-01, 1.773661562639070e-01, 1.660924103481652e-01, 1.552502832800154e-01, 1.448449437210769e-01, + 1.348798463815727e-01, 1.253567490336474e-01, 1.162757421482153e-01, 1.076352908043133e-01, 9.943228834915691e-02, + 9.166212112492260e-02, 8.431874342855604e-02, 7.739476173713079e-02, 7.088152711641457e-02, 6.476923463670382e-02, + 5.904702854937628e-02, 5.370311193097759e-02, 4.872485947931735e-02, 4.409893214762228e-02, 3.981139232728093e-02, + 3.584781833555012e-02, 3.219341702973252e-02, 2.883313345136149e-02, 2.575175650013100e-02, 2.293401974481060e-02, + 2.036469659423059e-02, 1.802868917267256e-02, 1.591111036782373e-02, 1.399735864319379e-02, 1.227318532813230e-02, + 1.072475421518567e-02, 9.338693404676062e-03, 8.102139438575821e-03, 7.002773858835369e-03, 6.028852408470130e-03, + 5.169227166401885e-03, 4.413361969047579e-03, 3.751341522971312e-03, 3.173874653799314e-03, 2.672292167462025e-03, + 2.238539821235712e-03, 1.865166914682179e-03, 1.545311015180633e-03, 1.272679330109336e-03, 1.041527228687644e-03, + 8.466344018536364e-04, 6.832791291344422e-04, 5.472110980420254e-04, 4.346231948339177e-04, 3.421226562082296e-04, + 2.667019402979896e-04, 2.057096427837635e-04, 1.568217505967225e-04, 1.180134920282553e-04, 8.753200853960576e-05, + 6.387004057159679e-05, 4.574078753977487e-05, 3.205407126647298e-05, 2.189390259660641e-05, 1.449752303895666e-05, + 9.235966977587421e-06, 5.596164823995474e-06, 3.164580913106852e-06, 1.612338255148207e-06, 6.816185333295410e-07, + 1.708705677347936e-07, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00 +}; + +const LC3_FLOAT MDCT_HRA_WINDOW_960_7_5ms[1440] = { + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 4.814997152662380e-08, + 1.190718835543930e-07, 2.207853347953071e-07, 3.606855997228003e-07, 5.473208818980691e-07, 7.905197136719171e-07, + 1.101521714920831e-06, 1.493116418344220e-06, 1.979790786588690e-06, 2.577885657879143e-06, 3.305761290579034e-06, + 4.183972154098288e-06, 5.235451095160501e-06, 6.485702988281604e-06, 7.963007956558409e-06, 9.698634223646832e-06, + 1.172706063036777e-05, 1.408620881991443e-05, 1.681768506430009e-05, 1.996703167159834e-05, 2.358398787878628e-05, + 2.772276009869224e-05, 3.244230135176009e-05, 3.780659967415316e-05, 4.388497525322647e-05, 5.075238599968363e-05, + 5.848974122290910e-05, 6.718422303212972e-05, 7.692961504132544e-05, 8.782663791029826e-05, 9.998329120814524e-05, + 1.135152010387006e-04, 1.285459728204526e-04, 1.452075485661517e-04, 1.636405679599540e-04, 1.839947324826567e-04, + 2.064291717885308e-04, 2.311128114906271e-04, 2.582247414653769e-04, 2.879545837420285e-04, 3.205028589981173e-04, + 3.560813506389657e-04, 3.949134653973109e-04, 4.372345893487853e-04, 4.832924382002834e-04, 5.333474006714636e-04, + 5.876728737549225e-04, 6.465555886081460e-04, 7.102959258003701e-04, 7.792082186101814e-04, 8.536210430451991e-04, + 9.338774932337428e-04, 1.020335440820132e-03, 1.113367776980400e-03, 1.213362635663867e-03, 1.320723596658401e-03, + 1.435869867073428e-03, 1.559236439835012e-03, 1.691274227791697e-03, 1.832450172038491e-03, 1.983247323079433e-03, + 2.144164893466752e-03, 2.315718280576775e-03, 2.498439058209637e-03, 2.692874935731413e-03, 2.899589683513746e-03, + 3.119163023467312e-03, 3.352190483511667e-03, 3.599283214875066e-03, 3.861067771173851e-03, 4.138185848281871e-03, + 4.431293984066133e-03, 4.741063217135362e-03, 5.068178703823501e-03, 5.413339292709984e-03, 5.777257056063160e-03, + 6.160656777682084e-03, 6.564275396705108e-03, 6.988861407050997e-03, 7.435174212259442e-03, 7.903983435603223e-03, + 8.396068185452360e-03, 8.912216275983018e-03, 9.453223403438580e-03, 1.001989227826831e-02, 1.061303171358943e-02, + 1.123345567054105e-02, 1.188198226122286e-02, 1.255943271003813e-02, 1.326663027438758e-02, 1.400439912578959e-02, + 1.477356319263120e-02, 1.557494496588335e-02, 1.640936426924359e-02, 1.727763699529732e-02, 1.818057380941704e-02, + 1.911897882324480e-02, 2.009364823972783e-02, 2.110536897180007e-02, 2.215491723692114e-02, 2.324305712980262e-02, + 2.437053917576323e-02, 2.553809886726559e-02, 2.674645518629135e-02, 2.799630911531313e-02, 2.928834213971679e-02, + 3.062321474461790e-02, 3.200156490910068e-02, 3.342400660098604e-02, 3.489112827530663e-02, 3.640349137973180e-02, + 3.796162887024292e-02, 3.956604374040874e-02, 4.121720756765420e-02, 4.291555907994722e-02, 4.466150274635713e-02, + 4.645540739495172e-02, 4.829760486151040e-02, 5.018838867252923e-02, 5.212801276598264e-02, 5.411669025328793e-02, + 5.615459222588953e-02, 5.824184660984119e-02, 6.037853707171543e-02, 6.256470197911304e-02, 6.480033341897713e-02, + 6.708537627683842e-02, 6.941972738003349e-02, 7.180323470784016e-02, 7.423569667136878e-02, 7.671686146593476e-02, + 7.924642649851196e-02, 8.182403789273630e-02, 8.444929007378586e-02, 8.712172543531613e-02, 8.984083409047044e-02, + 9.260605370882179e-02, 9.541676944092861e-02, 9.827231393200973e-02, 1.011719674260564e-01, 1.041149579615082e-01, + 1.071004616594233e-01, 1.101276031048689e-01, 1.131954558220525e-01, 1.163031145055895e-01, 1.194495144788202e-01, + 1.226335917234308e-01, 1.258542330378917e-01, 1.291102796186627e-01, 1.324005282765081e-01, 1.357237327475410e-01, + 1.390786051045917e-01, 1.424638172681925e-01, 1.458780026156580e-01, 1.493197576864202e-01, 1.527876439815144e-01, + 1.562801898548664e-01, 1.597958924937929e-01, 1.633332199858745e-01, 1.668906134691307e-01, 1.704664893621876e-01, + 1.740592416709001e-01, 1.776672443676665e-01, 1.812888538394568e-01, 1.849224114003725e-01, 1.885662458643452e-01, + 1.922186761734047e-01, 1.958780140767561e-01, 1.995425668557404e-01, 2.032106400895931e-01, 2.068805404567710e-01, + 2.105505785664793e-01, 2.142190718149099e-01, 2.178843472605934e-01, 2.215447445131696e-01, 2.251986186298022e-01, + 2.288443430133839e-01, 2.324803123066372e-01, 2.361049452761597e-01, 2.397166876804412e-01, 2.433140151158676e-01, + 2.468954358347107e-01, 2.504594935291377e-01, 2.540047700752680e-01, 2.575298882313734e-01, 2.610335142843411e-01, + 2.645143606385947e-01, 2.679711883417369e-01, 2.714028095412598e-01, 2.748080898667649e-01, 2.781859507322435e-01, + 2.815353715530788e-01, 2.848553918725547e-01, 2.881451133928004e-01, 2.914037019052332e-01, 2.946303891157192e-01, + 2.978244743598311e-01, 3.009853262037530e-01, 3.041123839265586e-01, 3.072051588797733e-01, 3.102632357203233e-01, + 3.132862735131834e-01, 3.162740067002296e-01, 3.192262459320352e-01, 3.221428787595638e-01, 3.250238701829489e-01, + 3.278692630547906e-01, 3.306791783356554e-01, 3.334538151997121e-01, 3.361934509887193e-01, 3.388984410128472e-01, + 3.415692181971050e-01, 3.442062925724498e-01, 3.468102506109446e-01, 3.493817544046665e-01, 3.519215406883794e-01, + 3.544304197063321e-01, 3.569092739238819e-01, 3.593590565850064e-01, 3.617807901171322e-01, 3.641755643850764e-01, + 3.665445347962969e-01, 3.688889202600189e-01, 3.712100010032212e-01, 3.735091162468620e-01, 3.757876617461321e-01, + 3.780470871989401e-01, 3.802888935272475e-01, 3.825146300362834e-01, 3.847258914570857e-01, 3.869243148782224e-01, + 3.891115765729500e-01, 3.912893887284619e-01, 3.934594960842652e-01, 3.956236724870978e-01, 3.977837173701507e-01, + 3.999414521646988e-01, 4.020987166525755e-01, 4.042573652681952e-01, 4.064192633591230e-01, 4.085862834144205e-01, + 4.107603012702034e-01, 4.129431923020324e-01, 4.151368276138986e-01, 4.173430702336651e-01, 4.195637713248997e-01, + 4.218007664250568e-01, 4.240558717199467e-01, 4.263308803643829e-01, 4.286275588587793e-01, 4.309476434913423e-01, + 4.332928368553010e-01, 4.356648044503836e-01, 4.380651713774884e-01, 4.404955191351588e-01, 4.429573825261284e-01, + 4.454522466818012e-01, 4.479815442120949e-01, 4.505466524876126e-01, 4.531488910606020e-01, 4.557895192306389e-01, + 4.584697337604117e-01, 4.611906667464130e-01, 4.639533836487439e-01, 4.667588814836276e-01, 4.696080871816153e-01, + 4.725018561138271e-01, 4.754409707879499e-01, 4.784261397150824e-01, 4.814579964478883e-01, 4.845370987899071e-01, + 4.876639281752684e-01, 4.908388892174636e-01, 4.940623094252686e-01, 4.973344390833572e-01, 5.006554512946366e-01, + 5.040254421808312e-01, 5.074444312373949e-01, 5.109123618383964e-01, 5.144291018866259e-01, 5.179944446038284e-01, + 5.216081094556281e-01, 5.252697432054461e-01, 5.289789210914528e-01, 5.327351481204011e-01, 5.365378604720108e-01, + 5.403864270074484e-01, 5.442801508753474e-01, 5.482182712087564e-01, 5.521999649063806e-01, 5.562243484914785e-01, + 5.602904800418288e-01, 5.643973611842344e-01, 5.685439391471354e-01, 5.727291088650085e-01, 5.769517151283868e-01, + 5.812105547734755e-01, 5.855043789055335e-01, 5.898318951503732e-01, 5.941917699285435e-01, 5.985826307469763e-01, + 6.030030685030957e-01, 6.074516397966441e-01, 6.119268692446796e-01, 6.164272517954765e-01, 6.209512550372698e-01, + 6.254973214980470e-01, 6.300638709328106e-01, 6.346493025949689e-01, 6.392519974887557e-01, 6.438703205997779e-01, + 6.485026231010093e-01, 6.531472445317767e-01, 6.578025149474425e-01, 6.624667570377041e-01, 6.671382882115985e-01, + 6.718154226474637e-01, 6.764964733062689e-01, 6.811797539068755e-01, 6.858635808619125e-01, 6.905462751730997e-01, + 6.952261642849390e-01, 6.999015838958201e-01, 7.045708797256799e-01, 7.092324092394289e-01, 7.138845433254541e-01, + 7.185256679285629e-01, 7.231541856368034e-01, 7.277685172216439e-01, 7.323671031310492e-01, 7.369484049350288e-01, + 7.415109067232617e-01, 7.460531164544494e-01, 7.505735672570528e-01, 7.550708186811053e-01, 7.595434579008099e-01, + 7.639901008676322e-01, 7.684093934136257e-01, 7.728000123047261e-01, 7.771606662437623e-01, 7.814900968229372e-01, + 7.857870794255352e-01, 7.900504240766176e-01, 7.942789762424746e-01, 7.984716175785987e-01, 8.026272666259650e-01, + 8.067448794553850e-01, 8.108234502597368e-01, 8.148620118938579e-01, 8.188596363619152e-01, 8.228154352520715e-01, + 8.267285601182841e-01, 8.305982028090957e-01, 8.344235957432927e-01, 8.382040121323370e-01, 8.419387661495058e-01, + 8.456272130457134e-01, 8.492687492120119e-01, 8.528628121888369e-01, 8.564088806220885e-01, 8.599064741662098e-01, + 8.633551533344737e-01, 8.667545192967644e-01, 8.701042136252025e-01, 8.734039179880492e-01, 8.766533537923937e-01, + 8.798522817762424e-01, 8.830005015507004e-01, 8.860978510930465e-01, 8.891442061916122e-01, 8.921394798434883e-01, + 8.950836216061893e-01, 8.979766169045416e-01, 9.008184862941767e-01, 9.036092846831453e-01, 9.063491005132949e-01, + 9.090380549031886e-01, 9.116763007544754e-01, 9.142640218237603e-01, 9.168014317621422e-01, 9.192887731247262e-01, + 9.217263163525492e-01, 9.241143587294502e-01, 9.264532233165643e-01, 9.287432578672022e-01, 9.309848337249814e-01, + 9.331783447081556e-01, 9.353242059831766e-01, 9.374228529305666e-01, 9.394747400062335e-01, 9.414803396013999e-01, + 9.434401409043077e-01, 9.453546487668929e-01, 9.472243825795639e-01, 9.490498751572118e-01, 9.508316716394957e-01, + 9.525703284083868e-01, 9.542664120258422e-01, 9.559204981943715e-01, 9.575331707431241e-01, 9.591050206419620e-01, + 9.606366450458275e-01, 9.621286463715110e-01, 9.635816314087369e-01, 9.649962104672655e-01, 9.663729965614801e-01, + 9.677126046337026e-01, 9.690156508172226e-01, 9.702827517397986e-01, 9.715145238681151e-01, 9.727115828934468e-01, + 9.738745431585201e-01, 9.750040171253210e-01, 9.761006148833546e-01, 9.771649436976386e-01, 9.781976075954760e-01, + 9.791992069908698e-01, 9.801703383452239e-01, 9.811115938628175e-01, 9.820235612193683e-01, 9.829068233218750e-01, + 9.837619580977977e-01, 9.845895383115438e-01, 9.853901314061559e-01, 9.861642993680373e-01, 9.869125986125210e-01, + 9.876355798880896e-01, 9.883337881970466e-01, 9.890077627304957e-01, 9.896580368155167e-01, 9.902851378725152e-01, + 9.908895873808024e-01, 9.914719008505681e-01, 9.920325877995377e-01, 9.925721517327187e-01, 9.930910901238019e-01, + 9.935898943969245e-01, 9.940690499076552e-01, 9.945290359222332e-01, 9.949703255942541e-01, 9.953933859381526e-01, + 9.957986777990047e-01, 9.961866558183331e-01, 9.965577683957455e-01, 9.969124576463969e-01, 9.972511593543985e-01, + 9.975743029224325e-01, 9.978823113179629e-01, 9.981756010165178e-01, 9.984545819426528e-01, 9.987196574092618e-01, + 9.989712240559885e-01, 9.992096717875499e-01, 9.994353837128311e-01, 9.996487360856312e-01, 9.998500982479841e-01, + 1.000039832576952e+00, 1.000218294435816e+00, 1.000385832130536e+00, 1.000542786872366e+00, 1.000689492747415e+00, + 1.000826276693953e+00, 1.000953458488153e+00, 1.001071350738924e+00, 1.001180258892415e+00, 1.001280481246664e+00, + 1.001372308976828e+00, 1.001456026171296e+00, 1.001531909878933e+00, 1.001600230167594e+00, 1.001661250193955e+00, + 1.001715226284630e+00, 1.001762408028438e+00, 1.001803038379606e+00, 1.001837353771603e+00, 1.001865584241233e+00, + 1.001887953562516e+00, 1.001904679389828e+00, 1.001915973409726e+00, 1.001922041500763e+00, 1.001923083900631e+00, + 1.001919295379834e+00, 1.001910865421132e+00, 1.001897978403901e+00, 1.001880813792572e+00, 1.001859546328272e+00, + 1.001834346222781e+00, 1.001805379353926e+00, 1.001772807461511e+00, 1.001736788342922e+00, 1.001697476047539e+00, + 1.001655021069100e+00, 1.001609570535228e+00, 1.001561268393305e+00, 1.001510255591984e+00, 1.001456670257582e+00, + 1.001400647864737e+00, 1.001342321400680e+00, 1.001281821522569e+00, 1.001219276707368e+00, 1.001154813393807e+00, + 1.001088556116027e+00, 1.001020627628542e+00, 1.000951149022254e+00, 1.000880239831253e+00, 1.000808018130249e+00, + 1.000734600622500e+00, 1.000660102718162e+00, 1.000584638603047e+00, 1.000508321297830e+00, 1.000431262707766e+00, + 1.000353573663063e+00, 1.000275363950073e+00, 1.000196742333506e+00, 1.000117816569928e+00, 1.000038693412811e+00, + 9.999594786094657e-01, 9.998802768901784e-01, 9.998011919499361e-01, 9.997223264231200e-01, 9.996437818515729e-01, + 9.995656586464663e-01, 9.994880560443949e-01, 9.994110720581462e-01, 9.993348034225887e-01, 9.992593455361456e-01, + 9.991847923983630e-01, 9.991112365446738e-01, 9.990387692132843e-01, 9.989674755310745e-01, 9.988974493950561e-01, + 9.988287760995599e-01, 9.987615392519850e-01, 9.986958206712464e-01, 9.986317002885794e-01, 9.985692560508309e-01, + 9.985085638263473e-01, 9.984496973135677e-01, 9.983927279524338e-01, 9.983377248387103e-01, 9.982847546413267e-01, + 9.982338815228151e-01, 9.981851670629547e-01, 9.981386701856864e-01, 9.980944470893998e-01, 9.980525511806362e-01, + 9.980130330113137e-01, 9.979759402195160e-01, 9.979413174739102e-01, 9.979092064218532e-01, 9.978796456412409e-01, + 9.978526705961338e-01, 9.978283135962164e-01, 9.978066037601111e-01, 9.977875669825975e-01, 9.977712259057413e-01, + 9.977575998939762e-01, 9.977467050131418e-01, 9.977385540135004e-01, 9.977331563167335e-01, 9.977305180069234e-01, + 9.977306418255271e-01, 9.977335271703227e-01, 9.977391700983312e-01, 9.977475633326937e-01, 9.977586962734870e-01, + 9.977725550124530e-01, 9.977891223516203e-01, 9.978083778257809e-01, 9.978302977287913e-01, 9.978548551436590e-01, + 9.978820199763681e-01, 9.979117589934062e-01, 9.979440358629286e-01, 9.979788111995230e-01, 9.980160426125044e-01, + 9.980556847576850e-01, 9.980976893925572e-01, 9.981420054348167e-01, 9.981885790241626e-01, 9.982373535872919e-01, + 9.982882699060266e-01, 9.983412661884745e-01, 9.983962781431597e-01, 9.984532390560278e-01, 9.985120798702389e-01, + 9.985727292686638e-01, 9.986351137589832e-01, 9.986991577612992e-01, 9.987647836981626e-01, 9.988319120869124e-01, + 9.989004616342260e-01, 9.989703493327806e-01, 9.990414905599119e-01, 9.991137991781697e-01, 9.991871876376540e-01, + 9.992615670800187e-01, 9.993368474440421e-01, 9.994129375726286e-01, 9.994897453211379e-01, 9.995671776669227e-01, + 9.996451408199485e-01, 9.997235403343790e-01, 9.998022812210010e-01, 9.998812680603694e-01, 9.999604051165407e-01, + 1.000039596451276e+00, 1.000118746038578e+00, 1.000197757879446e+00, 1.000276536116704e+00, 1.000354985149791e+00, + 1.000433009749368e+00, 1.000510515171617e+00, 1.000587407272111e+00, 1.000663592619100e+00, 1.000738978606112e+00, + 1.000813473563716e+00, 1.000886986870324e+00, 1.000959429061901e+00, 1.001030711940457e+00, 1.001100748681180e+00, + 1.001169453938098e+00, 1.001236743948124e+00, 1.001302536633371e+00, 1.001366751701609e+00, 1.001429310744728e+00, + 1.001490137335098e+00, 1.001549157119701e+00, 1.001606297911910e+00, 1.001661489780803e+00, 1.001714665137891e+00, + 1.001765758821160e+00, 1.001814708176293e+00, 1.001861453134992e+00, 1.001905936290265e+00, 1.001948102968611e+00, + 1.001987901298963e+00, 1.002025282278336e+00, 1.002060199834045e+00, 1.002092610882449e+00, 1.002122475384096e+00, + 1.002149756395215e+00, 1.002174420115472e+00, 1.002196435931912e+00, 1.002215776459027e+00, 1.002232417574884e+00, + 1.002246338453259e+00, 1.002257521591717e+00, 1.002265952835595e+00, 1.002271621397855e+00, 1.002274519874744e+00, + 1.002274644257259e+00, 1.002271993938374e+00, 1.002266571716010e+00, 1.002258383791734e+00, 1.002247439765192e+00, + 1.002233752624241e+00, 1.002217338730821e+00, 1.002198217802551e+00, 1.002176412890066e+00, 1.002151950350129e+00, + 1.002124859814529e+00, 1.002095174154815e+00, 1.002062929442886e+00, 1.002028164907501e+00, 1.001990922886739e+00, + 1.001951248776490e+00, 1.001909190975020e+00, 1.001864800823684e+00, 1.001818132543870e+00, 1.001769243170239e+00, + 1.001718192480350e+00, 1.001665042920779e+00, 1.001609859529789e+00, 1.001552709856694e+00, 1.001493663877992e+00, + 1.001432793910387e+00, 1.001370174520822e+00, 1.001305882433629e+00, 1.001239996434927e+00, 1.001172597274394e+00, + 1.001103767564540e+00, 1.001033591677623e+00, 1.000962155640339e+00, 1.000889547026422e+00, 1.000815854847318e+00, + 1.000741169441052e+00, 1.000665582359457e+00, 1.000589186253905e+00, 1.000512074759701e+00, 1.000434342379282e+00, + 1.000356084364390e+00, 1.000277396597363e+00, 1.000198375471716e+00, 1.000119117772151e+00, 1.000039720554179e+00, + 9.999602810234808e-01, 9.998808964152024e-01, 9.998016638733073e-01, 9.997226803301702e-01, 9.996440423865509e-01, + 9.995658461921156e-01, 9.994881873266507e-01, 9.994111606821270e-01, 9.993348603457636e-01, 9.992593794842417e-01, + 9.991848102292076e-01, 9.991112435642227e-01, 9.990387692132843e-01, 9.989674755310747e-01, 9.988974493950561e-01, + 9.988287760995599e-01, 9.987615392519850e-01, 9.986958206712466e-01, 9.986317002885796e-01, 9.985692560508309e-01, + 9.985085638263473e-01, 9.984496973135679e-01, 9.983927279524338e-01, 9.983377248387103e-01, 9.982847546413269e-01, + 9.982338815228151e-01, 9.981851670629547e-01, 9.981386701856864e-01, 9.980944470893998e-01, 9.980525511806362e-01, + 9.980130330113137e-01, 9.979759402195162e-01, 9.979413174739102e-01, 9.979092064218532e-01, 9.978796456412409e-01, + 9.978526705961338e-01, 9.978283135962164e-01, 9.978066037601111e-01, 9.977875669825975e-01, 9.977712259057413e-01, + 9.977575998939762e-01, 9.977467050131418e-01, 9.977385540135004e-01, 9.977331563167335e-01, 9.977305180069234e-01, + 9.977306418255271e-01, 9.977335271703227e-01, 9.977391700983312e-01, 9.977475633326937e-01, 9.977586962734870e-01, + 9.977725550124529e-01, 9.977891223516203e-01, 9.978083778257809e-01, 9.978302977287912e-01, 9.978548551436589e-01, + 9.978820199763679e-01, 9.979117589934061e-01, 9.979440358629285e-01, 9.979788111995229e-01, 9.980160426125043e-01, + 9.980556847576849e-01, 9.980976893925571e-01, 9.981420054348165e-01, 9.981885790241625e-01, 9.982373535872917e-01, + 9.982882699060264e-01, 9.983412661884743e-01, 9.983962781431595e-01, 9.984532390560276e-01, 9.985120798702387e-01, + 9.985727292686636e-01, 9.986351137589830e-01, 9.986991577612990e-01, 9.987647836981624e-01, 9.988319120869121e-01, + 9.989004616342257e-01, 9.989703493327803e-01, 9.990414905599115e-01, 9.991137991781693e-01, 9.991871876376537e-01, + 9.992615670800183e-01, 9.993368474440417e-01, 9.994129375726283e-01, 9.994897453211377e-01, 9.995671776669224e-01, + 9.996451408199482e-01, 9.997235403343787e-01, 9.998022812210007e-01, 9.998812680603690e-01, 9.999604051165404e-01, + 1.000039596451276e+00, 1.000118746038578e+00, 1.000197757879445e+00, 1.000276536116703e+00, 1.000354985149791e+00, + 1.000433009749367e+00, 1.000510515171617e+00, 1.000587407272111e+00, 1.000663592619099e+00, 1.000738978606111e+00, + 1.000813473563715e+00, 1.000886986870324e+00, 1.000959429061901e+00, 1.001030711940456e+00, 1.001100748681180e+00, + 1.001169453938098e+00, 1.001236743948123e+00, 1.001302536633371e+00, 1.001366751701609e+00, 1.001429310744728e+00, + 1.001490137335098e+00, 1.001549157119701e+00, 1.001606297911910e+00, 1.001661489780802e+00, 1.001714665137891e+00, + 1.001765758821160e+00, 1.001814708176293e+00, 1.001861453134991e+00, 1.001905936290265e+00, 1.001948102968610e+00, + 1.001987901298963e+00, 1.002025282278336e+00, 1.002060199834045e+00, 1.002092610882449e+00, 1.002122475384096e+00, + 1.002149756395215e+00, 1.002174420115472e+00, 1.002196435931912e+00, 1.002215776459027e+00, 1.002232417574884e+00, + 1.002246338453259e+00, 1.002257521591717e+00, 1.002265952835595e+00, 1.002271621397855e+00, 1.002274519874744e+00, + 1.002274644257259e+00, 1.002271993938374e+00, 1.002266571716010e+00, 1.002258383791734e+00, 1.002247439765192e+00, + 1.002233752624241e+00, 1.002217338730821e+00, 1.002198217802551e+00, 1.002176412890066e+00, 1.002151950350129e+00, + 1.002124859814529e+00, 1.002095174154815e+00, 1.002062929442886e+00, 1.002028164907501e+00, 1.001990922886739e+00, + 1.001951248776490e+00, 1.001909190975020e+00, 1.001864800823684e+00, 1.001818132543870e+00, 1.001769243170239e+00, + 1.001718192480350e+00, 1.001665042920779e+00, 1.001609859529789e+00, 1.001552709856694e+00, 1.001493663877992e+00, + 1.001432793910387e+00, 1.001370174520822e+00, 1.001305882433629e+00, 1.001239996434927e+00, 1.001172597274394e+00, + 1.001103767564540e+00, 1.001033591677624e+00, 1.000962155640339e+00, 1.000889539994377e+00, 1.000815836987349e+00, + 1.000741135442554e+00, 1.000665525360320e+00, 1.000589097525086e+00, 1.000511943342175e+00, 1.000434154669159e+00, + 1.000355823641039e+00, 1.000277042489024e+00, 1.000197903352750e+00, 1.000118498085805e+00, 1.000038918054429e+00, + 9.999592539292592e-01, 9.998795954700279e-01, 9.998000313030908e-01, 9.997206486917303e-01, 9.996415332991556e-01, + 9.995627689441696e-01, 9.994844373494816e-01, 9.994066178826749e-01, 9.993293872898719e-01, 9.992528194221602e-01, + 9.991769849548788e-01, 9.991019510999088e-01, 9.990277813111228e-01, 9.989545349832153e-01, 9.988822671441485e-01, + 9.988110281415057e-01, 9.987408633230653e-01, 9.986718127119733e-01, 9.986039106768975e-01, 9.985371855976206e-01, + 9.984716595265433e-01, 9.984073478466060e-01, 9.983442589261942e-01, 9.982823937715852e-01, 9.982217456775688e-01, + 9.981622998768528e-01, 9.981040331889378e-01, 9.980469136691089e-01, 9.979909002582600e-01, 9.979359424342189e-01, + 9.978819798653003e-01, 9.978289420667763e-01, 9.977767480609429e-01, 9.977253060414770e-01, 9.976745130427335e-01, + 9.976242546146024e-01, 9.975744045035392e-01, 9.975248243403034e-01, 9.974753633349420e-01, 9.974258579794437e-01, + 9.973761317584910e-01, 9.973259948686257e-01, 9.972752439461025e-01, 9.972236618036201e-01, 9.971710171760355e-01, + 9.971170644751025e-01, 9.970615435531658e-01, 9.970041794756773e-01, 9.969446823022998e-01, 9.968827468762742e-01, + 9.968180526216487e-01, 9.967502633478675e-01, 9.966790270611490e-01, 9.966039757819899e-01, 9.965247253680732e-01, + 9.964408753417748e-01, 9.963520087214246e-01, 9.962576918554058e-01, 9.961574742581648e-01, 9.960508884471466e-01, + 9.959374497796830e-01, 9.958166562888472e-01, 9.956879885173003e-01, 9.955509093482032e-01, 9.954048638322855e-01, + 9.952492790102677e-01, 9.950835637298708e-01, 9.949071084567831e-01, 9.947192850790569e-01, 9.945194467045426e-01, + 9.943069274511299e-01, 9.940810422297355e-01, 9.938410865201561e-01, 9.935863361401250e-01, 9.933160470081145e-01, + 9.930294549006624e-01, 9.927257752052461e-01, 9.924042026699723e-01, 9.920639111516145e-01, 9.917040533637881e-01, + 9.913237606273204e-01, 9.909221426251413e-01, 9.904982871642726e-01, 9.900512599477517e-01, 9.895801043595820e-01, + 9.890838412660165e-01, 9.885614688367104e-01, 9.880119623894829e-01, 9.874342742625883e-01, 9.868273337185698e-01, + 9.861900468838825e-01, 9.855212967285775e-01, 9.848199430904010e-01, 9.840848227476926e-01, 9.833147495454723e-01, + 9.825085145790535e-01, 9.816648864394526e-01, 9.807826115247470e-01, 9.798604144213754e-01, 9.788969983591844e-01, + 9.778910457438047e-01, 9.768412187696544e-01, 9.757461601165864e-01, 9.746044937328510e-01, 9.734148257066850e-01, + 9.721757452284399e-01, 9.708858256447525e-01, 9.695436256058197e-01, 9.681476903063706e-01, 9.666965528204767e-01, + 9.651887355298391e-01, 9.636227516447159e-01, 9.619971068161570e-01, 9.603103008377231e-01, 9.585608294343847e-01, + 9.567471861358257e-01, 9.548678642309127e-01, 9.529213587996556e-01, 9.509061688185575e-01, 9.488207993348687e-01, + 9.466637637048801e-01, 9.444335858910574e-01, 9.421288028125191e-01, 9.397479667430725e-01, 9.372896477508165e-01, + 9.347524361730808e-01, 9.321349451203507e-01, 9.294358130026688e-01, 9.266537060719486e-01, 9.237873209735582e-01, + 9.208353873005455e-01, 9.177966701438771e-01, 9.146699726321402e-01, 9.114541384542267e-01, 9.081480543586499e-01, + 9.047506526232865e-01, 9.012609134895138e-01, 8.976778675548984e-01, 8.940005981188177e-01, 8.902282434756291e-01, + 8.863599991502473e-01, 8.823951200712559e-01, 8.783329226769567e-01, 8.741727869500308e-01, 8.699141583767795e-01, + 8.655565498272043e-01, 8.610995433524644e-01, 8.565427918965455e-01, 8.518860209192624e-01, 8.471290299279841e-01, + 8.422716939157602e-01, 8.373139647037767e-01, 8.322558721863335e-01, 8.270975254767841e-01, 8.218391139531005e-01, + 8.164809082019563e-01, 8.110232608604324e-01, 8.054666073546400e-01, 7.998114665347398e-01, 7.940584412060114e-01, + 7.882082185557775e-01, 7.822615704761332e-01, 7.762193537825687e-01, 7.700825103286711e-01, 7.638520670172276e-01, + 7.575291357081170e-01, 7.511149130234813e-01, 7.446106800507299e-01, 7.380178019439980e-01, 7.313377274247339e-01, + 7.245719881821328e-01, 7.177221981741801e-01, 7.107900528300912e-01, 7.037773281549656e-01, 6.966858797374927e-01, + 6.895176416615646e-01, 6.822746253226608e-01, 6.749589181498854e-01, 6.675726822345424e-01, 6.601181528661474e-01, + 6.525976369767750e-01, 6.450135114946609e-01, 6.373682216079785e-01, 6.296642789397278e-01, 6.219042596346939e-01, + 6.140908023594462e-01, 6.062266062163840e-01, 5.983144285728536e-01, 5.903570828064187e-01, 5.823574359673894e-01, + 5.743184063597853e-01, 5.662429610419641e-01, 5.581341132482169e-01, 5.499949197327134e-01, 5.418284780372742e-01, + 5.336379236845493e-01, 5.254264272982935e-01, 5.171971916525543e-01, 5.089534486517354e-01, 5.006984562436330e-01, + 4.924354952677195e-01, 4.841678662411154e-01, 4.758988860848792e-01, 4.676318847934465e-01, 4.593702020502552e-01, + 4.511171837928217e-01, 4.428761787307617e-01, 4.346505348204885e-01, 4.264435957005810e-01, 4.182586970920628e-01, + 4.100991631681045e-01, 4.019683028979270e-01, 3.938694063699639e-01, 3.858057410996029e-01, 3.777805483271167e-01, + 3.697970393116528e-01, 3.618583916274267e-01, 3.539677454685226e-01, 3.461281999689568e-01, 3.383428095449016e-01, + 3.306145802661934e-01, 3.229464662644602e-01, 3.153413661853912e-01, 3.078021196928487e-01, 3.003315040326600e-01, + 2.929322306640503e-01, 2.856069419667691e-01, 2.783582080320176e-01, 2.711885235453130e-01, 2.641003047694161e-01, + 2.570958866354019e-01, 2.501775199498664e-01, 2.433473687261406e-01, 2.366075076472159e-01, 2.299599196678819e-01, + 2.234064937633224e-01, 2.169490228311333e-01, 2.105892017533920e-01, 2.043286256250337e-01, 1.981687881543829e-01, + 1.921110802412354e-01, 1.861567887374030e-01, 1.803070953941089e-01, 1.745630760000725e-01, 1.689256997135387e-01, + 1.633958285908989e-01, 1.579742173139196e-01, 1.526615131169428e-01, 1.474582559147575e-01, 1.423648786311610e-01, + 1.373817077275422e-01, 1.325089639301291e-01, 1.277467631538520e-01, 1.230951176200877e-01, 1.185539371648735e-01, + 1.141230307335134e-01, 1.098021080568559e-01, 1.055907815038885e-01, 1.014885681047006e-01, 9.749489173728383e-02, + 9.360908547110176e-02, 8.983039405984916e-02, 8.615797657535108e-02, 8.259090917411954e-02, 7.912818798769637e-02, + 7.576873212756439e-02, 7.251138679510837e-02, 6.935492648685226e-02, 6.629805828499362e-02, 6.333942522309385e-02, + 6.047760971667378e-02, 5.771113704839873e-02, 5.503847889751997e-02, 5.245805690326935e-02, 4.996824625197753e-02, + 4.756737927780486e-02, 4.525374906713279e-02, 4.302561305686507e-02, 4.088119661712488e-02, 3.881869660910822e-02, + 3.683628490916042e-02, 3.493211189048053e-02, 3.310430985422298e-02, 3.135099640215624e-02, 2.967027774345144e-02, + 2.806025192860465e-02, 2.651901200394490e-02, 2.504464908064207e-02, 2.363525531259980e-02, 2.228892677809941e-02, + 2.100376626054477e-02, 1.977788592414561e-02, 1.860940988086348e-02, 1.749647664542867e-02, 1.643724147571549e-02, + 1.542987859623567e-02, 1.447258330297169e-02, 1.356357394822445e-02, 1.270109380458789e-02, 1.188341280758823e-02, + 1.110882917693435e-02, 1.037567091671765e-02, 9.682297195274189e-03, 9.027099605776615e-03, 8.408503308959755e-03, + 7.824968059698375e-03, 7.274989119451309e-03, 6.757098056859764e-03, 6.269863439040749e-03, 5.811891416348594e-03, + 5.381826203588412e-03, 4.978350460855568e-03, 4.600185577345007e-03, 4.246091861623697e-03, 3.914868641989499e-03, + 3.605354280650456e-03, 3.316426105550754e-03, 3.047000263743920e-03, 2.796031500270941e-03, 2.562512866541615e-03, + 2.345475362242355e-03, 2.143987514803593e-03, 1.957154900455791e-03, 1.784119610885449e-03, 1.624059669472490e-03, + 1.476188401048562e-03, 1.339753759063066e-03, 1.214037613980937e-03, 1.098355006663937e-03, 9.920533704065749e-04, + 8.945117252091245e-04, 8.051398477746440e-04, 7.233774206148687e-04, 6.486931635421752e-04, 5.805839507121312e-04, + 5.185739162640836e-04, 4.622135514864277e-04, 4.110787963092279e-04, 3.647701278002823e-04, 3.229116482121258e-04, + 2.851501749972799e-04, 2.511543350778764e-04, 2.206136655240024e-04, 1.932377226631928e-04, 1.687552015118974e-04, + 1.469130672888079e-04, 1.274757006400757e-04, 1.102240580780130e-04, 9.495484900818888e-05, 8.147973059522124e-05, + 6.962452159532738e-05, 5.922843616409273e-05, 5.014333853121625e-05, 4.223301932042882e-05, 3.537249418257647e-05, + 2.944732530322636e-05, 2.435296624327736e-05, 1.999413047212912e-05, 1.628418385815330e-05, 1.314456129070047e-05, + 1.050420752185282e-05, 8.299042234809909e-06, 6.471449269445341e-06, 4.969789864549787e-06, 3.747939711067031e-06, + 2.764849551822885e-06, 1.984129011158285e-06, 1.373653290393152e-06, 9.051923062411747e-07, 5.540616821452014e-07, + 2.987940262820261e-07, 1.208186781658135e-07, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00 +}; + +const LC3_FLOAT MDCT_WINDOW_80_7_5ms[120] = {0.00295060859318731, + 0.00717541131643851, + 0.0137695373537175, + 0.0230953556487727, + 0.0354036229832600, + 0.0508289303571015, + 0.0694696292595147, + 0.0913884277813343, + 0.116604574829623, + 0.145073545983920, + 0.176711174053461, + 0.211342952955480, + 0.248768614459915, + 0.288701101746986, + 0.330823871149994, + 0.374814544406725, + 0.420308013047231, + 0.466904917964874, + 0.514185341357833, + 0.561710040666941, + 0.609026346152434, + 0.655671016213410, + 0.701218384229819, + 0.745240678762236, + 0.787369206048433, + 0.827223833436804, + 0.864513675018828, + 0.898977414612621, + 0.930407517984552, + 0.958599937397485, + 0.983447719378423, + 1.00488283328902, + 1.02285380727854, + 1.03740494796704, + 1.04859791420260, + 1.05656184342744, + 1.06149370624356, + 1.06362578371698, + 1.06325972797388, + 1.06074504835117, + 1.05643589789450, + 1.05069500101126, + 1.04392434506884, + 1.03647724602858, + 1.02872867366600, + 1.02106485991803, + 1.01400658226217, + 1.00727455010293, + 1.00172249743714, + 0.997309591666583, + 0.993985158260167, + 0.991683334808959, + 0.990325325024913, + 0.989822612537615, + 0.990074733989367, + 0.990975314368959, + 0.992412851225652, + 0.994273149357862, + 0.996439157431590, + 0.998791615753409, + 1.00120984620569, + 1.00357356747961, + 1.00575983636472, + 1.00764515369282, + 1.00910687229055, + 1.01002476446464, + 1.01028203168272, + 1.00976918870054, + 1.00838641217324, + 1.00605123898466, + 1.00269766615693, + 0.998280464458421, + 0.992777986793980, + 0.986186892168957, + 0.977634164392255, + 0.967447269570116, + 0.955129725416117, + 0.940389877411592, + 0.922959279964298, + 0.902607349937268, + 0.879202688562948, + 0.852641749726566, + 0.822881271616311, + 0.789971715171577, + 0.754030327670636, + 0.715255741732847, + 0.673936911240907, + 0.630414716229245, + 0.585078857908467, + 0.538398518296620, + 0.490833753173281, + 0.442885823257372, + 0.395091024053755, + 0.348004343198510, + 0.302196710240947, + 0.258227430580528, + 0.216641416438901, + 0.177922121520115, + 0.142480547128767, + 0.110652194335372, + 0.0826995966952829, + 0.0588334516201313, + 0.0392030848454565, + 0.0238629107447942, + 0.0126976223424625, + 0.00535665361021599, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0}; + +const LC3_FLOAT MDCT_WINDOW_160_7_5ms[240] = {0.00220824874304665, + 0.00381014419509035, + 0.00591552473428981, + 0.00858361456803004, + 0.0118759722608345, + 0.0158335301409709, + 0.0204918651551601, + 0.0258883592892154, + 0.0320415894481754, + 0.0389616721239547, + 0.0466742169139349, + 0.0551849337276135, + 0.0645038384438376, + 0.0746411071480673, + 0.0856000161887899, + 0.0973846702504817, + 0.109993602538973, + 0.123419277472281, + 0.137655456547628, + 0.152690437463956, + 0.168513362640497, + 0.185093104613143, + 0.202410419487986, + 0.220450365133188, + 0.239167940620308, + 0.258526168288333, + 0.278498538773636, + 0.299038431599591, + 0.320104862365552, + 0.341658622243036, + 0.363660034025212, + 0.386062695189504, + 0.408815272459443, + 0.431871045845866, + 0.455176987704814, + 0.478676592635263, + 0.502324813138104, + 0.526060916224847, + 0.549831282885023, + 0.573576882777006, + 0.597241338441034, + 0.620770242419397, + 0.644099662433612, + 0.667176381676395, + 0.689958853765865, + 0.712379980093130, + 0.734396371869479, + 0.755966688050532, + 0.777036981101517, + 0.797558113689794, + 0.817490855531114, + 0.836796949640853, + 0.855447309567916, + 0.873400798399116, + 0.890635718969808, + 0.907128770123878, + 0.922848783570288, + 0.937763322534182, + 0.951860206252747, + 0.965130600153629, + 0.977556540546725, + 0.989126208677996, + 0.999846919168316, + 1.00970072970387, + 1.01868228690835, + 1.02681455085919, + 1.03408981275172, + 1.04051195662940, + 1.04610836852236, + 1.05088564953428, + 1.05486288757866, + 1.05807220584955, + 1.06053413867011, + 1.06227661751764, + 1.06333815026019, + 1.06375556676696, + 1.06356632061806, + 1.06282155753012, + 1.06155995891758, + 1.05981709158148, + 1.05765876038451, + 1.05512005736540, + 1.05223985071955, + 1.04908778571338, + 1.04569859514623, + 1.04210830682439, + 1.03838098558867, + 1.03455276253936, + 1.03067199718128, + 1.02679166694268, + 1.02295558402234, + 1.01920733213785, + 1.01587288719722, + 1.01221017459353, + 1.00884559103696, + 1.00577851248622, + 1.00300261849896, + 1.00051460180915, + 0.998309228756053, + 0.996378601374572, + 0.994718132279737, + 0.993316215711850, + 0.992166956964939, + 0.991258602708851, + 0.990581103872326, + 0.990123118186375, + 0.989873711994700, + 0.989818706664725, + 0.989946800178719, + 0.990243175367708, + 0.990695563551443, + 0.991288540103593, + 0.992009469063567, + 0.992842692750141, + 0.993775066630664, + 0.994790397982872, + 0.995875533622126, + 0.997014367015673, + 0.998192870684212, + 0.999394506476233, + 1.00060586036830, + 1.00181040094441, + 1.00299457368229, + 1.00414154805357, + 1.00523688409909, + 1.00626392589064, + 1.00720890358777, + 1.00805489381465, + 1.00878801634839, + 1.00939182206005, + 1.00985295821773, + 1.01015529301117, + 1.01028601830489, + 1.01022987870331, + 1.00997540773688, + 1.00950845528029, + 1.00881848315592, + 1.00789488400120, + 1.00672875785417, + 1.00530991398353, + 1.00363456081898, + 1.00169363479295, + 0.999485662869670, + 0.997006370229165, + 0.994254686877395, + 0.991231967393677, + 0.987937115334337, + 0.984375124686103, + 0.979890963312768, + 0.975269878842859, + 0.970180498004025, + 0.964580026820328, + 0.958425533515528, + 0.951684013845583, + 0.944320232231505, + 0.936290624169877, + 0.927580506944232, + 0.918153413723035, + 0.907976524013806, + 0.897050058479312, + 0.885351360384818, + 0.872857926504400, + 0.859579818650462, + 0.845502615038655, + 0.830619943301480, + 0.814946648157534, + 0.798489377529441, + 0.781262449660145, + 0.763291769255088, + 0.744590843420388, + 0.725199287080917, + 0.705153668360855, + 0.684490544603819, + 0.663245209931378, + 0.641477161661819, + 0.619235333635541, + 0.596559132542786, + 0.573519989364814, + 0.550173851023454, + 0.526568538230013, + 0.502781158663802, + 0.478860889056198, + 0.454877894349081, + 0.430898122898976, + 0.406993964205627, + 0.383234030582781, + 0.359680098334456, + 0.336408100091304, + 0.313496418152647, + 0.291010565493871, + 0.269019585108746, + 0.247584347561867, + 0.226788433385199, + 0.206677770653849, + 0.187310343238419, + 0.168739644125069, + 0.151012382058898, + 0.134171842279709, + 0.118254662325635, + 0.103290733977460, + 0.0893117360272552, + 0.0763429786604178, + 0.0644077291458590, + 0.0535243714739393, + 0.0437084452819923, + 0.0349667099153409, + 0.0272984629264830, + 0.0206895808034878, + 0.0151125125235276, + 0.0105228753811890, + 0.00685547314312078, + 0.00402351119094097, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0}; + +const LC3_FLOAT MDCT_WINDOW_240_7_5ms[360] = {0.00197084907651299, + 0.00295060859318731, + 0.00412447721346795, + 0.00552688663943736, + 0.00717541131643851, + 0.00908757730429167, + 0.0112819105170366, + 0.0137695373537175, + 0.0165600266160529, + 0.0196650894549232, + 0.0230953556487727, + 0.0268612893898298, + 0.0309632559743172, + 0.0354036229832600, + 0.0401915610110090, + 0.0453331403333732, + 0.0508289303571015, + 0.0566815447853484, + 0.0628935304464015, + 0.0694696292595147, + 0.0764106313680933, + 0.0837160015651998, + 0.0913884277813343, + 0.0994294007679240, + 0.107834724972307, + 0.116604574829623, + 0.125736502786435, + 0.135226811339595, + 0.145073545983920, + 0.155273818664872, + 0.165822194234144, + 0.176711174053461, + 0.187928775884881, + 0.199473179818881, + 0.211342952955480, + 0.223524554031808, + 0.236003099651800, + 0.248768614459915, + 0.261813810748989, + 0.275129160854431, + 0.288701101746986, + 0.302514033630995, + 0.316558805236645, + 0.330823871149994, + 0.345295566673095, + 0.359963991566213, + 0.374814544406725, + 0.389831816553239, + 0.405001009601585, + 0.420308013047231, + 0.435739515285996, + 0.451277817354750, + 0.466904917964874, + 0.482609040567348, + 0.498375466266412, + 0.514185341357833, + 0.530021478313683, + 0.545869351788699, + 0.561710040666941, + 0.577528151441720, + 0.593304696426258, + 0.609026346152434, + 0.624674188938691, + 0.640227554714632, + 0.655671016213410, + 0.670995934643907, + 0.686184558797250, + 0.701218384229819, + 0.716078448562218, + 0.730756084155059, + 0.745240678762236, + 0.759515121573879, + 0.773561955408612, + 0.787369206048433, + 0.800923137730798, + 0.814211386313193, + 0.827223833436804, + 0.839952374193807, + 0.852386102361013, + 0.864513675018828, + 0.876324078835538, + 0.887814288392476, + 0.898977414612621, + 0.909803318928109, + 0.920284311925309, + 0.930407517984552, + 0.940169652216635, + 0.949567794930265, + 0.958599937397485, + 0.967260260011783, + 0.975545165941725, + 0.983447719378423, + 0.990971957260661, + 0.998119268644039, + 1.00488283328902, + 1.01125773114014, + 1.01724436218938, + 1.02285380727854, + 1.02808733870912, + 1.03293706325880, + 1.03740494796704, + 1.04150164119898, + 1.04523235573095, + 1.04859791420260, + 1.05160339500287, + 1.05425505026848, + 1.05656184342744, + 1.05853400282251, + 1.06017413540787, + 1.06149370624356, + 1.06249943033024, + 1.06320577147234, + 1.06362578371698, + 1.06376486534444, + 1.06363777833448, + 1.06325972797388, + 1.06264695324506, + 1.06180496269951, + 1.06074504835117, + 1.05948491573959, + 1.05804533277758, + 1.05643589789450, + 1.05466217871738, + 1.05274047445925, + 1.05069500101126, + 1.04853893535431, + 1.04627898264892, + 1.04392434506884, + 1.04149539738413, + 1.03901002688052, + 1.03647724602858, + 1.03390792836167, + 1.03131989375422, + 1.02872867366600, + 1.02614831936266, + 1.02358988084027, + 1.02106485991803, + 1.01856261937655, + 1.01655770337597, + 1.01400658226217, + 1.01162952586308, + 1.00938590180064, + 1.00727455010293, + 1.00529616458224, + 1.00344525988730, + 1.00172249743714, + 1.00012792446354, + 0.998657533466906, + 0.997309591666583, + 0.996083571092922, + 0.994976568981429, + 0.993985158260167, + 0.993107530052222, + 0.992341305231054, + 0.991683334808959, + 0.991130069631426, + 0.990678325164172, + 0.990325325024913, + 0.990067562181601, + 0.989901281872290, + 0.989822612537615, + 0.989827845401607, + 0.989913241125937, + 0.990074733989367, + 0.990308255838731, + 0.990609851788114, + 0.990975314368959, + 0.991400330446183, + 0.991880966170107, + 0.992412851225652, + 0.992991779075812, + 0.993613381385812, + 0.994273149357862, + 0.994966957785808, + 0.995690370111366, + 0.996439157431590, + 0.997208572194836, + 0.997994274967679, + 0.998791615753409, + 0.999596061975986, + 1.00040410125588, + 1.00120984620569, + 1.00200975605034, + 1.00279924168624, + 1.00357356747961, + 1.00432828318722, + 1.00505850186763, + 1.00575983636472, + 1.00642766968907, + 1.00705768272393, + 1.00764515369282, + 1.00818549211731, + 1.00867426536962, + 1.00910687229055, + 1.00947915891906, + 1.00978659331994, + 1.01002476446464, + 1.01018953828983, + 1.01027669068480, + 1.01028203168272, + 1.01020174265116, + 1.01003208083751, + 1.00976918870054, + 1.00940938607321, + 1.00894931012624, + 1.00838641217324, + 1.00771780306692, + 1.00694030579691, + 1.00605123898466, + 1.00504879328336, + 1.00393182763047, + 1.00269766615693, + 1.00134427117215, + 0.999872091899038, + 0.998280464458421, + 0.996566569174198, + 0.994731737005642, + 0.992777986793980, + 0.990701374188107, + 0.988504165244528, + 0.986186892168957, + 0.983711988683984, + 0.980584643109501, + 0.977634164392255, + 0.974455033150736, + 0.971062915561309, + 0.967447269570116, + 0.963593926287407, + 0.959491398347322, + 0.955129725416117, + 0.950501325912076, + 0.945592810314402, + 0.940389877411592, + 0.934886760414132, + 0.929080558710635, + 0.922959279964298, + 0.916509579192867, + 0.909724456073370, + 0.902607349937268, + 0.895155083757719, + 0.887356154208250, + 0.879202688562948, + 0.870699697841629, + 0.861847424457935, + 0.852641749726566, + 0.843077833241503, + 0.833154904680532, + 0.822881271616311, + 0.812257596919709, + 0.801285439243471, + 0.789971715171577, + 0.778318177172464, + 0.766337710411639, + 0.754030327670636, + 0.741407990945757, + 0.728477500803539, + 0.715255741732847, + 0.701751739457159, + 0.687975631811811, + 0.673936911240907, + 0.659652573201310, + 0.645139489066839, + 0.630414716229245, + 0.615483621927165, + 0.600365851941398, + 0.585078857908467, + 0.569649536456405, + 0.554084809831234, + 0.538398518296620, + 0.522614737753751, + 0.506756804966295, + 0.490833753173273, + 0.474866032652527, + 0.458876565810813, + 0.442885823257372, + 0.426906539230033, + 0.410970973391487, + 0.395091024053754, + 0.379291327017083, + 0.363587416985863, + 0.348004343198509, + 0.332563200617546, + 0.317287484882341, + 0.302196710240947, + 0.287309402575471, + 0.272643991600386, + 0.258227430580528, + 0.244072856174013, + 0.230208977382347, + 0.216641416438901, + 0.203398480689705, + 0.190486161546394, + 0.177922121520115, + 0.165726674483589, + 0.153906396679985, + 0.142480547128767, + 0.131453980101158, + 0.120841778238095, + 0.110652194335372, + 0.100891734193622, + 0.0915718850864754, + 0.0826995966952829, + 0.0742815528886268, + 0.0663242381533172, + 0.0588334516201312, + 0.0518140676237795, + 0.0452698345565108, + 0.0392030848454564, + 0.0336144159421411, + 0.0285023308156286, + 0.0238629107447942, + 0.0196894226553178, + 0.0159720527024086, + 0.0126976223424625, + 0.00984937739446455, + 0.00740724463299836, + 0.00535665361021599, + 0.00383226551874691, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0}; + +const LC3_FLOAT MDCT_WINDOW_320_7_5ms[480] = {0.00184833037060189, + 0.00256481839443054, + 0.00336762117525576, + 0.00428736617294702, + 0.00533830142913148, + 0.00652679222980445, + 0.00786112587274496, + 0.00934628179329417, + 0.0109916867707302, + 0.0128011172432759, + 0.0147805910526259, + 0.0169307043075075, + 0.0192592307040902, + 0.0217696937210109, + 0.0244685982614465, + 0.0273556542738590, + 0.0304319230257638, + 0.0336980463900663, + 0.0371583577255157, + 0.0408148179520755, + 0.0446708068423474, + 0.0487262995262562, + 0.0529820632544155, + 0.0574382469666485, + 0.0620968579875224, + 0.0669609766608529, + 0.0720298363678982, + 0.0773039146477137, + 0.0827825574095362, + 0.0884682101593173, + 0.0943607566451845, + 0.100460272003600, + 0.106763823750452, + 0.113273679440610, + 0.119986420273010, + 0.126903520680586, + 0.134020853127777, + 0.141339556870128, + 0.148857211288972, + 0.156573685338126, + 0.164484622056357, + 0.172589076538143, + 0.180879089820471, + 0.189354319600685, + 0.198012243528402, + 0.206854140994642, + 0.215875318757054, + 0.225068672370813, + 0.234427407249969, + 0.243948313710515, + 0.253627992837806, + 0.263464060987933, + 0.273450494478137, + 0.283582188986510, + 0.293853469478657, + 0.304257373461563, + 0.314790914011331, + 0.325449123426950, + 0.336227409661803, + 0.347118760290707, + 0.358120176960450, + 0.369224663378337, + 0.380427792871280, + 0.391720022741618, + 0.403097022154837, + 0.414551955216869, + 0.426081718612424, + 0.437676318481682, + 0.449330195657235, + 0.461034855039307, + 0.472786043282829, + 0.484576777178737, + 0.496401706766520, + 0.508252457556495, + 0.520122078483965, + 0.532002077000542, + 0.543888089744156, + 0.555771601181136, + 0.567645738774683, + 0.579502786315012, + 0.591335034592786, + 0.603138367473440, + 0.614904171685981, + 0.626623941105601, + 0.638288834425202, + 0.649893374776772, + 0.661432360150173, + 0.672902513906348, + 0.684293749833449, + 0.695600459535883, + 0.706811783648976, + 0.717923424519233, + 0.728931385727289, + 0.739832772797360, + 0.750618982371933, + 0.761284053417755, + 0.771818918701624, + 0.782220991963992, + 0.792481330455120, + 0.802599447723046, + 0.812565229501908, + 0.822377128920089, + 0.832030518374920, + 0.841523207674513, + 0.850848312948314, + 0.860002411781952, + 0.868979880825105, + 0.877778346729487, + 0.886395903955835, + 0.894829420791081, + 0.903077625660289, + 0.911132652155618, + 0.918993585364937, + 0.926652936933657, + 0.934111420416517, + 0.941364344292899, + 0.948412967370989, + 0.955255629597394, + 0.961892013137868, + 0.968316362908677, + 0.974530156362119, + 0.980528338141726, + 0.986313927767294, + 0.991886048619893, + 0.997246344766401, + 1.00239189664458, + 1.00731946437583, + 1.01202707343585, + 1.01651654151239, + 1.02079430268870, + 1.02486081579449, + 1.02871470580975, + 1.03235170271917, + 1.03577375047282, + 1.03898431507401, + 1.04198785539891, + 1.04478564357336, + 1.04737818412200, + 1.04976743149521, + 1.05195404554314, + 1.05394289856216, + 1.05573463147380, + 1.05734176732398, + 1.05875726493872, + 1.05998674447371, + 1.06103671687069, + 1.06190651084450, + 1.06260369490638, + 1.06313289329257, + 1.06350237394105, + 1.06370980806189, + 1.06376322346189, + 1.06366764604617, + 1.06343011818702, + 1.06305656438567, + 1.06255421036890, + 1.06192234666436, + 1.06116701778323, + 1.06029468923457, + 1.05931468949374, + 1.05823464730377, + 1.05705890752753, + 1.05578948247366, + 1.05442978686656, + 1.05298792590271, + 1.05147505164534, + 1.04989930053323, + 1.04826212949578, + 1.04656690601558, + 1.04481699264239, + 1.04302124919620, + 1.04118768090749, + 1.03932339102548, + 1.03743168416508, + 1.03551757331127, + 1.03358510598971, + 1.03164370854303, + 1.02969954597728, + 1.02775943851786, + 1.02582718703711, + 1.02390791088663, + 1.02200805068553, + 1.02013910120702, + 1.01826310081338, + 1.01687901084998, + 1.01492194818759, + 1.01309662336946, + 1.01134205244082, + 1.00965912296053, + 1.00805036388672, + 1.00651754025099, + 1.00505799251731, + 1.00366956090429, + 1.00235327309256, + 1.00110980844711, + 0.999937523064020, + 0.998834523778354, + 0.997800605926859, + 0.996835755847371, + 0.995938881156864, + 0.995108458955550, + 0.994343411090332, + 0.993642921198198, + 0.993005832427090, + 0.992430983777039, + 0.991917492640328, + 0.991463898014730, + 0.991068213957297, + 0.990729218448801, + 0.990446224564421, + 0.990217818551850, + 0.990041963066712, + 0.989917085260000, + 0.989841974698949, + 0.989815048293785, + 0.989834329137160, + 0.989898210724722, + 0.990005403060575, + 0.990154189263867, + 0.990342426919530, + 0.990568458991084, + 0.990830952741348, + 0.991128037927190, + 0.991457565684290, + 0.991817880927468, + 0.992207558971979, + 0.992624757299280, + 0.993067358412365, + 0.993533398279548, + 0.994021410066004, + 0.994529685133772, + 0.995055963618118, + 0.995598350543474, + 0.996155580104219, + 0.996725626776922, + 0.997306092208332, + 0.997895213854288, + 0.998491440631921, + 0.999092889987779, + 0.999697062575683, + 1.00030302922321, + 1.00090793360789, + 1.00151083855774, + 1.00210922561456, + 1.00270118453373, + 1.00328512996467, + 1.00385925649825, + 1.00442110963133, + 1.00496860132761, + 1.00550040380694, + 1.00601454845283, + 1.00650869083178, + 1.00698103862634, + 1.00743004105679, + 1.00785364005500, + 1.00824961843285, + 1.00861603623935, + 1.00895137836214, + 1.00925389667459, + 1.00952134193584, + 1.00975175133162, + 1.00994371466878, + 1.01009549736651, + 1.01020487679019, + 1.01027007304515, + 1.01028975233683, + 1.01026226969627, + 1.01018561543197, + 1.01005819682879, + 1.00987881783672, + 1.00964593048934, + 1.00935753319733, + 1.00901228181564, + 1.00860959436079, + 1.00814836659263, + 1.00762674316571, + 1.00704343050616, + 1.00639774980144, + 1.00568876793126, + 1.00491558583432, + 1.00407767878127, + 1.00317428837606, + 1.00220424207009, + 1.00116683614142, + 1.00006248083959, + 0.998891421862267, + 0.997652251800105, + 0.996343855540476, + 0.994967462022130, + 0.993524663018428, + 0.992013926907702, + 0.990433283134003, + 0.988785147009912, + 0.987072680860489, + 0.985297442611976, + 0.983401161131380, + 0.980949417765551, + 0.978782729044635, + 0.976468238349044, + 0.974042850200711, + 0.971498848279787, + 0.968829967901758, + 0.966030973927894, + 0.963095103865114, + 0.960018197689881, + 0.956795738404679, + 0.953426266696235, + 0.949903482303963, + 0.946222115168414, + 0.942375819502639, + 0.938361701514345, + 0.934177797863119, + 0.929823123908876, + 0.925292319504672, + 0.920580120066111, + 0.915679792968200, + 0.910590604293827, + 0.905315030158709, + 0.899852756107195, + 0.894199497118493, + 0.888350152427933, + 0.882301631337498, + 0.876054874152525, + 0.869612384940706, + 0.862972799329697, + 0.856135197574920, + 0.849098178607312, + 0.841857024342112, + 0.834414055019111, + 0.826774616875239, + 0.818939244026861, + 0.810904891487294, + 0.802675318450619, + 0.794253750525830, + 0.785641661592052, + 0.776838608661742, + 0.767853193256071, + 0.758685180670574, + 0.749330657713362, + 0.739809171155050, + 0.730109944357775, + 0.720247780620101, + 0.710224160990164, + 0.700044325846151, + 0.689711889540493, + 0.679231154104663, + 0.668608178924739, + 0.657850996784250, + 0.646965718233652, + 0.635959616622744, + 0.624840335899161, + 0.613603502679100, + 0.602265090642188, + 0.590829083373282, + 0.579309407943056, + 0.567711124002091, + 0.556037415675143, + 0.544293664349262, + 0.532489768053648, + 0.520636084113626, + 0.508743272768040, + 0.496811166041365, + 0.484849880708936, + 0.472868107365031, + 0.460875918379489, + 0.448881080632702, + 0.436891038772751, + 0.424912022350783, + 0.412960603164169, + 0.401035896287704, + 0.389157866744938, + 0.377322198811674, + 0.365543766863001, + 0.353832356425067, + 0.342196115433984, + 0.330644820108683, + 0.319187558989871, + 0.307833309339190, + 0.296588181651645, + 0.285463716536022, + 0.274462408857763, + 0.263609584476890, + 0.252883101143323, + 0.242323488971182, + 0.231925746284170, + 0.221690837369583, + 0.211638057695031, + 0.201766920294530, + 0.192082235818342, + 0.182589160013263, + 0.173305996740759, + 0.164229200045030, + 0.155362654247925, + 0.146717078597741, + 0.138299391415146, + 0.130105078076731, + 0.122145309929155, + 0.114423458192169, + 0.106941075992303, + 0.0997025893446062, + 0.0927124283374869, + 0.0859737427062027, + 0.0794893311195214, + 0.0732616579460535, + 0.0672934102310889, + 0.0615874081007633, + 0.0561458002593222, + 0.0509700747035652, + 0.0460617047145777, + 0.0414220116926541, + 0.0370514188750623, + 0.0329494666227939, + 0.0291153326941312, + 0.0255476401323823, + 0.0222437711282860, + 0.0192000658979791, + 0.0164122204526698, + 0.0138747611120131, + 0.0115806352990988, + 0.00952213664221592, + 0.00769137379581469, + 0.00607207833119310, + 0.00462581216874268, + 0.00360685164162597, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0}; + +const LC3_FLOAT MDCT_WINDOW_480_7_5ms[720] = {0.00172152668161197, + 0.00220824874304665, + 0.00268901752259534, + 0.00322613341770658, + 0.00381014419509035, + 0.00445371931718418, + 0.00515369239968132, + 0.00591552473428981, + 0.00673869158441088, + 0.00762861840690755, + 0.00858361456803004, + 0.00960938437461376, + 0.0107060753216012, + 0.0118759722608345, + 0.0131190129731594, + 0.0144390107858867, + 0.0158335301409709, + 0.0173063081075865, + 0.0188584711217331, + 0.0204918651551601, + 0.0222061476414017, + 0.0240057166241995, + 0.0258883592892154, + 0.0278552325915007, + 0.0299059145401639, + 0.0320415894481754, + 0.0342610013298592, + 0.0365680972732117, + 0.0389616721239547, + 0.0414435823556703, + 0.0440140795515652, + 0.0466742169139349, + 0.0494214624989609, + 0.0522588488991433, + 0.0551849337276135, + 0.0582005142844991, + 0.0613059844876918, + 0.0645038384438376, + 0.0677913922780715, + 0.0711707832894713, + 0.0746411071480673, + 0.0782028053093391, + 0.0818549520793733, + 0.0856000161887899, + 0.0894357617466231, + 0.0933642589167916, + 0.0973846702504817, + 0.101496717842215, + 0.105698760137915, + 0.109993602538973, + 0.114378287000688, + 0.118853507644691, + 0.123419277472281, + 0.128075996686182, + 0.132820580592162, + 0.137655456547628, + 0.142578647864983, + 0.147590521689500, + 0.152690437463956, + 0.157878852729327, + 0.163152528516638, + 0.168513362640497, + 0.173957968965553, + 0.179484736541084, + 0.185093104613143, + 0.190784835080141, + 0.196556497277956, + 0.202410419487986, + 0.208345433427595, + 0.214359824832231, + 0.220450365133188, + 0.226617296379634, + 0.232856279279332, + 0.239167940620308, + 0.245550641734726, + 0.252003950801656, + 0.258526168288333, + 0.265118407626359, + 0.271775911320379, + 0.278498538773636, + 0.285284606228892, + 0.292132459126393, + 0.299038431599591, + 0.306004255968647, + 0.313026529044311, + 0.320104862365552, + 0.327237324371911, + 0.334423209544169, + 0.341658622243036, + 0.348944976164519, + 0.356279251911600, + 0.363660034025212, + 0.371085146360032, + 0.378554326716481, + 0.386062695189504, + 0.393610553614044, + 0.401195224753282, + 0.408815272459443, + 0.416468460349459, + 0.424155411395509, + 0.431871045845866, + 0.439614743914448, + 0.447384019490353, + 0.455176987704814, + 0.462990137501968, + 0.470824618788539, + 0.478676592635263, + 0.486545433113577, + 0.494428714400322, + 0.502324813138104, + 0.510229471464589, + 0.518142926555815, + 0.526060916224847, + 0.533982817654487, + 0.541906816785495, + 0.549831282885023, + 0.557751233747995, + 0.565667636233856, + 0.573576882777006, + 0.581476665547768, + 0.589364661090802, + 0.597241338441034, + 0.605102013194533, + 0.612946170296527, + 0.620770242419397, + 0.628572093800007, + 0.636348526182129, + 0.644099662433612, + 0.651820973301216, + 0.659513821705787, + 0.667176381676395, + 0.674806795170392, + 0.682400710845902, + 0.689958853765865, + 0.697475722348889, + 0.704950144755303, + 0.712379980093130, + 0.719765434054233, + 0.727103832924324, + 0.734396371869479, + 0.741638560666120, + 0.748829639427782, + 0.755966688050532, + 0.763049259441822, + 0.770072273456679, + 0.777036981101517, + 0.783941107955561, + 0.790781256570410, + 0.797558113689794, + 0.804271380965317, + 0.810914900592988, + 0.817490855531114, + 0.823997093771197, + 0.830432785018494, + 0.836796949640853, + 0.843089297972628, + 0.849305847142233, + 0.855447309567916, + 0.861511036513329, + 0.867496280683677, + 0.873400798399116, + 0.879227518344298, + 0.884972438304695, + 0.890635718969808, + 0.896217172709751, + 0.901716413868111, + 0.907128770123878, + 0.912456578161017, + 0.917697260839682, + 0.922848783570288, + 0.927909917257080, + 0.932882596476862, + 0.937763322534182, + 0.942553355949148, + 0.947252428176398, + 0.951860206252747, + 0.956376059930715, + 0.960800601653643, + 0.965130600153629, + 0.969366688856792, + 0.973508812191284, + 0.977556540546725, + 0.981507226076202, + 0.985364580290061, + 0.989126208677996, + 0.992794200680601, + 0.996367545084978, + 0.999846919168316, + 1.00322812484515, + 1.00651341182191, + 1.00970072970387, + 1.01279028960634, + 1.01578293436089, + 1.01868228690835, + 1.02148657041020, + 1.02419771842881, + 1.02681455085919, + 1.02933598109997, + 1.03176042993634, + 1.03408981275172, + 1.03632325851578, + 1.03846360765363, + 1.04051195662940, + 1.04246831469554, + 1.04433331015458, + 1.04610836852236, + 1.04779018315657, + 1.04938333555913, + 1.05088564953428, + 1.05229923461622, + 1.05362521849064, + 1.05486288757866, + 1.05601520650228, + 1.05708745929907, + 1.05807220584955, + 1.05897524171920, + 1.05979446723066, + 1.06053413867011, + 1.06119411863264, + 1.06177365556482, + 1.06227661751764, + 1.06270323725515, + 1.06305568550874, + 1.06333815026019, + 1.06354799718407, + 1.06368606790043, + 1.06375556676696, + 1.06375743495314, + 1.06369358352060, + 1.06356632061806, + 1.06337707389149, + 1.06312781969919, + 1.06282155753012, + 1.06245781539243, + 1.06203634281998, + 1.06155995891758, + 1.06102951018466, + 1.06044796508355, + 1.05981709158148, + 1.05914162811841, + 1.05842135887536, + 1.05765876038451, + 1.05685377407703, + 1.05600761436100, + 1.05512005736540, + 1.05419504543825, + 1.05323345555133, + 1.05223985071955, + 1.05121667551754, + 1.05016636928704, + 1.04908778571338, + 1.04798366418119, + 1.04685333764799, + 1.04569859514623, + 1.04452056473031, + 1.04332348168164, + 1.04210830682439, + 1.04087907347658, + 1.03963603298779, + 1.03838098558867, + 1.03711402960368, + 1.03583813453316, + 1.03455276253936, + 1.03326200062149, + 1.03196749756726, + 1.03067199718128, + 1.02937563931250, + 1.02808243736505, + 1.02679166694268, + 1.02550635249346, + 1.02422655030626, + 1.02295558402234, + 1.02169298956325, + 1.02044474846015, + 1.01920733213785, + 1.01799991915642, + 1.01716021719396, + 1.01587288719722, + 1.01461782929950, + 1.01339738080134, + 1.01221017459353, + 1.01105651618772, + 1.00993443649479, + 1.00884559103696, + 1.00778955760958, + 1.00676790147273, + 1.00577851248622, + 1.00482173369676, + 1.00389592016124, + 1.00300261849896, + 1.00214090725866, + 1.00131212703156, + 1.00051460180915, + 0.999748987566388, + 0.999013486065174, + 0.998309228756053, + 0.997634933573802, + 0.996991885118110, + 0.996378601374572, + 0.995795982324256, + 0.995242217431553, + 0.994718132279737, + 0.994222121603521, + 0.993755313270097, + 0.993316215711850, + 0.992905809264804, + 0.992522421568056, + 0.992166956964939, + 0.991837703847481, + 0.991535508409853, + 0.991258602708851, + 0.991007878425042, + 0.990781722666477, + 0.990581103872326, + 0.990404336010644, + 0.990252266515061, + 0.990123118186375, + 0.990017725942080, + 0.989934325251675, + 0.989873711994700, + 0.989834110063609, + 0.989816358516333, + 0.989818706664725, + 0.989841997633560, + 0.989884437608375, + 0.989946800178719, + 0.990027287179467, + 0.990126680433027, + 0.990243175367708, + 0.990377593567359, + 0.990528133732004, + 0.990695563551443, + 0.990878043253865, + 0.991076301696221, + 0.991288540103593, + 0.991515601979036, + 0.991755665863857, + 0.992009469063567, + 0.992275155432533, + 0.992553486464066, + 0.992842692750141, + 0.993143533338714, + 0.993454079661184, + 0.993775066630664, + 0.994104689071308, + 0.994443741563539, + 0.994790397982872, + 0.995145361143570, + 0.995506799575831, + 0.995875533622126, + 0.996249681496846, + 0.996629918576519, + 0.997014367015673, + 0.997403799406302, + 0.997796404470102, + 0.998192870684212, + 0.998591285561368, + 0.998992436297826, + 0.999394506476233, + 0.999798247074188, + 1.00020179363827, + 1.00060586036830, + 1.00100857991068, + 1.00141070171451, + 1.00181040094441, + 1.00220846208708, + 1.00260295839583, + 1.00299457368229, + 1.00338147727724, + 1.00376443633841, + 1.00414154805357, + 1.00451348039620, + 1.00487832134478, + 1.00523688409909, + 1.00558730293553, + 1.00593027172440, + 1.00626392589064, + 1.00658905174666, + 1.00690380235195, + 1.00720890358777, + 1.00750238011098, + 1.00778498234605, + 1.00805489381465, + 1.00831286819921, + 1.00855699900640, + 1.00878801634839, + 1.00900404770905, + 1.00920593286756, + 1.00939182206005, + 1.00956244042490, + 1.00971589673993, + 1.00985295821773, + 1.00997177407911, + 1.01007316964863, + 1.01015529301117, + 1.01021893264234, + 1.01026224628852, + 1.01028601830489, + 1.01028841501360, + 1.01027029664166, + 1.01022987870331, + 1.01016802275824, + 1.01008292457433, + 1.00997540773688, + 1.00984368712353, + 1.00968863285475, + 1.00950845528029, + 1.00930404459694, + 1.00907371350998, + 1.00881848315592, + 1.00853675084589, + 1.00822946750346, + 1.00789488400120, + 1.00753391386376, + 1.00714487786153, + 1.00672875785417, + 1.00628392789102, + 1.00581145628420, + 1.00530991398353, + 1.00478052727780, + 1.00422176605486, + 1.00363456081898, + 1.00301719093886, + 1.00237067322585, + 1.00169363479295, + 1.00098748810560, + 1.00025107545667, + 0.999485662869670, + 0.998689592389690, + 0.997863666433377, + 0.997006370229165, + 0.996119199129118, + 0.995201403855962, + 0.994254686877395, + 0.993277595101281, + 0.992270650602836, + 0.991231967393677, + 0.990163285718553, + 0.989064393522322, + 0.987937115334337, + 0.986779736108308, + 0.985592773084236, + 0.984375124686103, + 0.983129287890062, + 0.981348462911328, + 0.979890963312768, + 0.978400458984906, + 0.976860435411572, + 0.975269878842859, + 0.973627353241612, + 0.971931340983223, + 0.970180498004025, + 0.968372651965257, + 0.966506952259707, + 0.964580026820328, + 0.962592317588312, + 0.960540986343273, + 0.958425533515528, + 0.956244393275019, + 0.953998415902893, + 0.951684013845583, + 0.949301185363779, + 0.946846884329832, + 0.944320232231505, + 0.941718404323327, + 0.939042579646710, + 0.936290624169877, + 0.933464049736310, + 0.930560853876881, + 0.927580506944232, + 0.924519591719516, + 0.921378471441385, + 0.918153413723035, + 0.914844695613022, + 0.911451651601712, + 0.907976524013806, + 0.904417545083186, + 0.900776307727862, + 0.897050058479312, + 0.893238397854931, + 0.889338680564778, + 0.885351360384818, + 0.881274022956677, + 0.877109637913966, + 0.872857926504400, + 0.868519505092655, + 0.864092796449043, + 0.859579818650462, + 0.854976006559576, + 0.850285220126345, + 0.845502615038655, + 0.840630470320405, + 0.835667925492783, + 0.830619943301480, + 0.825482006990559, + 0.820258908705916, + 0.814946648157534, + 0.809546695921391, + 0.804059977858176, + 0.798489377529441, + 0.792831417318078, + 0.787090668112010, + 0.781262449660145, + 0.775353946896531, + 0.769363612973808, + 0.763291769255088, + 0.757139016438538, + 0.750901711179744, + 0.744590843420388, + 0.738205135983222, + 0.731738075019976, + 0.725199287080917, + 0.718588225289593, + 0.711905686689260, + 0.705153668360855, + 0.698332634155137, + 0.691444101223867, + 0.684490544603819, + 0.677470119276872, + 0.670388375375255, + 0.663245209931378, + 0.656045780075394, + 0.648788626910908, + 0.641477161661819, + 0.634114322697443, + 0.626702000288600, + 0.619235333635541, + 0.611720595766813, + 0.604161612008372, + 0.596559132542786, + 0.588914400742527, + 0.581234783414194, + 0.573519989364814, + 0.565770615838341, + 0.557988067156798, + 0.550173851023454, + 0.542330193938633, + 0.534460798055783, + 0.526568538230013, + 0.518656324106017, + 0.510728812610530, + 0.502781158663802, + 0.494819490990687, + 0.486845139248642, + 0.478860889056187, + 0.470869928237011, + 0.462875144056541, + 0.454877894349081, + 0.446882512027806, + 0.438889324991181, + 0.430898122898976, + 0.422918322377786, + 0.414950877976117, + 0.406993964205624, + 0.399052648395750, + 0.391134613511556, + 0.383234030582781, + 0.375354652658444, + 0.367502059648862, + 0.359680098334456, + 0.351887311977221, + 0.344130165828257, + 0.336408100091303, + 0.328728966167385, + 0.321090505163296, + 0.313496418152647, + 0.305951564939720, + 0.298454318724068, + 0.291010565493870, + 0.283621109377504, + 0.276285415057373, + 0.269019585108745, + 0.261812445205796, + 0.254659232371968, + 0.247584347561867, + 0.240578694191260, + 0.233647008666278, + 0.226788433385199, + 0.220001991767835, + 0.213301325170393, + 0.206677770653848, + 0.200140409104345, + 0.193683630277597, + 0.187310343238419, + 0.181027383883625, + 0.174839476062309, + 0.168739644125069, + 0.162737273481917, + 0.156825277050683, + 0.151012382058898, + 0.145298229536747, + 0.139687469382981, + 0.134171842279709, + 0.128762544136019, + 0.123455562073148, + 0.118254662325635, + 0.113159676766305, + 0.108171439273590, + 0.103290733977459, + 0.0985202977906343, + 0.0938600022604814, + 0.0893117360272552, + 0.0848752102882993, + 0.0805523737322188, + 0.0763429786604177, + 0.0722489245608881, + 0.0682699119548786, + 0.0644077291458590, + 0.0606620002841447, + 0.0570343711147243, + 0.0535243714739393, + 0.0501334689685108, + 0.0468610789607730, + 0.0437084452819923, + 0.0406748365259497, + 0.0377612269065632, + 0.0349667099153408, + 0.0322919274833124, + 0.0297357668703102, + 0.0272984629264830, + 0.0249787185611126, + 0.0227762541832071, + 0.0206895808034878, + 0.0187178169347065, + 0.0168593417528780, + 0.0151125125235276, + 0.0134757094495118, + 0.0119462709121848, + 0.0105228753811890, + 0.00920130941284003, + 0.00798124316373271, + 0.00685547314312078, + 0.00582657334385164, + 0.00487838525422656, + 0.00402351119094097, + 0.00315418662758696, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0}; +#endif /* #ifdef CR8_G_ADD_75MS */ + const LC3_FLOAT MDCT_WINDOW_80_2_5ms[40] = { 6.737914289329320e-03, 2.732289618100209e-02, 6.163560962361236e-02, 1.119125037883055e-01, 1.787053464784875e-01, 2.607525136824537e-01, 3.549776504187033e-01, 4.567696724165073e-01, 5.605239559005871e-01, 6.603665285212146e-01, @@ -3080,6 +5487,12 @@ const LC3_FLOAT* MDCT_WINS_10ms[2][6] = { {NULL, NULL, NULL, NULL, MDCT_HRA_WINDOW_480_10ms, MDCT_HRA_WINDOW_960_10ms}}; const LC3_INT MDCT_la_zeroes[6] = {30, 60, 90, 120, 180, 360}; +#ifdef CR8_G_ADD_75MS +const LC3_FLOAT* MDCT_WINS_7_5ms[2][6] = { + {MDCT_WINDOW_80_7_5ms, MDCT_WINDOW_160_7_5ms, MDCT_WINDOW_240_7_5ms, MDCT_WINDOW_320_7_5ms, MDCT_WINDOW_480_7_5ms, NULL}, + {NULL , NULL , NULL , NULL , MDCT_HRA_WINDOW_480_7_5ms, MDCT_HRA_WINDOW_960_7_5ms}}; +const LC3_INT32 MDCT_la_zeroes_7_5ms[6] = {14, 28, 42, 56, 84, 168}; +#endif const LC3_FLOAT* MDCT_WINS_2_5ms[2][6] = { {MDCT_WINDOW_80_2_5ms, MDCT_WINDOW_160_2_5ms, MDCT_WINDOW_240_2_5ms, MDCT_WINDOW_320_2_5ms, MDCT_WINDOW_480_2_5ms, @@ -3094,11 +5507,12 @@ const LC3_INT MDCT_la_zeroes_5ms[6] = {10, 20, 30, 40, 60, 120}; const LC3_INT MDCT_WINDOWS_LENGTHS_10ms[6] = {160, 320, 480, 640, 960, 1920}; /* Last 960 dummy */ -const LC3_INT MDCT_WINDOWS_LENGTHS_2_5ms[6] = {40, 80, 120, 160, 240, 480}; - +const LC3_INT MDCT_WINDOWS_LENGTHS_7_5ms[6] = {120, 240, 360, 480, 720, 1440}; /* Last 960 dummy */ const LC3_INT MDCT_WINDOWS_LENGTHS_5ms[6] = {80, 160, 240, 320, 480, 960}; +const LC3_INT MDCT_WINDOWS_LENGTHS_2_5ms[6] = {40, 80, 120, 160, 240, 480}; + /* Per band energy */ const LC3_INT ACC_COEFF_PER_BAND_8[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, @@ -3209,8 +5623,97 @@ const LC3_INT* ACC_COEFF_PER_BAND_5ms[5] = {ACC_COEFF_PER_BAND_8_5ms, ACC_COEFF_ ACC_COEFF_PER_BAND_24_5ms, ACC_COEFF_PER_BAND_32_5ms, ACC_COEFF_PER_BAND_48_5ms}; +#ifdef CR8_G_ADD_75MS +const LC3_INT ACC_COEFF_PER_BAND_8_7_5ms[61] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60}; + +const LC3_INT ACC_COEFF_PER_BAND_16_7_5ms[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 65, 68, + 71, 74, 77, 80, 83, 86, 90, 94, 98, 102, 106, 110, 115, 120}; + +const LC3_INT ACC_COEFF_PER_BAND_24_7_5ms[65] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 52, 55, 58, 61, 64, + 67, 70, 74, 78, 82, 86, 90, 95, 100, 105, 110, 115, 121, 127, 134, 141, 148, 155, 163, 171, 180}; + +const LC3_INT ACC_COEFF_PER_BAND_32_7_5ms[65] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 45, 48, 51, 54, 57, 60, 63, 67, 71, 75, + 79, 84, 89, 94, 99, 105, 111, 117, 124, 131, 138, 146, 154, 163, 172, 182, 192, 203, 215, 227, 240}; + +const LC3_INT ACC_COEFF_PER_BAND_48_7_5ms[65] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 43, 46, 49, 52, 55, 59, 63, 67, 71, 75, 80, 85, + 90, 96, 102, 108, 115, 122, 129, 137, 146, 155, 165, 175, 186, 197, 209, 222, 236, 251, 266, 283, 300}; + +const LC3_INT ACC_COEFF_PER_BAND_48_7_5ms_HR[65] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, + 24, 26, 28, 30, 32, 34, 36, 38, 41, 44, 47, 50, 53, 56, 60, 64, 68, 73, 78, 83, 89, 95, + 101, 108, 115, 122, 130, 139, 148, 158, 168, 179, 191, 203, 217, 231, 246, 262, 279, 298, 317, 338, 360}; + +const LC3_INT ACC_COEFF_PER_BAND_96_7_5ms_HR[65] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 35, 38, 41, 44, 48, 52, 56, 61, 66, 71, 77, 83, 90, 97, 105, + 114, 123, 132, 143, 155, 167, 180, 195, 210, 227, 245, 265, 286, 309, 334, 360, 389, 420, 454, 490, + 529, 572, 617, 667, 720}; + +const LC3_INT* ACC_COEFF_PER_BAND_7_5ms_HR[6] = {NULL, NULL, + NULL, NULL, + ACC_COEFF_PER_BAND_48_7_5ms_HR, ACC_COEFF_PER_BAND_96_7_5ms_HR}; + +const LC3_INT* ACC_COEFF_PER_BAND_7_5ms[5] = {ACC_COEFF_PER_BAND_8_7_5ms , ACC_COEFF_PER_BAND_16_7_5ms, + ACC_COEFF_PER_BAND_24_7_5ms, ACC_COEFF_PER_BAND_32_7_5ms, + ACC_COEFF_PER_BAND_48_7_5ms}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_8_7_5ms[61] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_16_7_5ms[61] = { + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, + 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, + 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_24_7_5ms[61] = { + 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, + 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, + 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_32_7_5ms[81] = { + 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, + 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, + 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, + 189, 192, 195, 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_48_7_5ms[61] = { + 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102, 108, 114, 120, + 126, 132, 138, 144, 150, 156, 162, 168, 174, 180, 186, 192, 198, 204, 210, 216, 222, 228, 234, 240, 246, + 252, 258, 264, 270, 276, 282, 288, 294, 300, 306, 312, 318, 324, 330, 336, 342, 348, 354, 360}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_96_7_5ms[81] = { + 0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 108, 117, 126, 135, 144, 153, 162, 171, 180, + 189, 198, 207, 216, 225, 234, 243, 252, 261, 270, 279, 288, 297, 306, 315, 324, 333, 342, 351, 360, 369, + 378, 387, 396, 405, 414, 423, 432, 441, 450, 459, 468, 477, 486, 495, 504, 513, 522, 531, 540, 549, 558, + 567, 576, 585, 594, 603, 612, 621, 630, 639, 648, 657, 666, 675, 684, 693, 702, 711, 720}; + +const LC3_INT* ACC_COEFF_PER_BAND_PLC_7_5ms[] = { + ACC_COEFF_PER_BAND_PLC_8_7_5ms, ACC_COEFF_PER_BAND_PLC_16_7_5ms, ACC_COEFF_PER_BAND_PLC_24_7_5ms, + ACC_COEFF_PER_BAND_PLC_32_7_5ms, ACC_COEFF_PER_BAND_PLC_48_7_5ms, ACC_COEFF_PER_BAND_PLC_96_7_5ms}; +#endif + /* Near Nyquist detector */ const LC3_INT NN_thresh = 30; +/* Tone detector */ +#ifdef CR8_E_TONE_DETECTOR +const LC3_INT32 TD_HR_thresh_10ms = 83402; +const LC3_INT32 TD_HR_thresh_7_5ms = 743496; +const LC3_INT32 TD_HR_thresh_5ms = 382564; +const LC3_INT32 TD_HR_thresh_2_5ms = 301695; +#endif // CR8_E_TONE_DETECTOR const LC3_INT32 xavg_N_grp[5] = { 4, 5, 6, 7, 8 }; @@ -3219,6 +5722,42 @@ const LC3_INT32 xavg_N_grp[5] = { 4, 5, 6, 7, 8 }; const LC3_INT32 gwlpr[MAX_LGW+1] = { 1, 3*QUOT_LPR_LTR, 5*QUOT_LPR_LTR, 9*QUOT_LPR_LTR, 17*QUOT_LPR_LTR, 33*QUOT_LPR_LTR, 49*QUOT_LPR_LTR, 65*QUOT_LPR_LTR, 81*QUOT_LPR_LTR, 97*QUOT_LPR_LTR}; +#ifdef CR8_A_PLC_FADEOUT_TUNING +/* PLC_FADEOUT_TUNING, extended table ranging from 30 ms to 140 ms */ +const LC3_INT16 fade_scheme_tab[24 / 2][3] = { +#if 0 + /* burst_att_thresh indicates when muting POW_ATT_TABLE[att_per_frame_idx] should be used first time it is 1.0 though */ + /* burst_att_thresh ==2 --> gains [ 1.0, 32767/32768.0(first table value used) , first muted, .... ]*/ + /* burst_att_thresh ==5 --> gains [ 1.0, 1.0, 1,0 1,0, 32767/32768.0(first table value used) , first muted,... ]*/ + /* beta_mute_thr ==4 --> start of final attenuation attenuate AvgMix */ +#endif + /* tabled {att_per_frame_idx_p3dB , burst_att_thresh, beta_mute_thr } */ + { 1, 2, 0 + 2 + 2 }, /* 30 ms, 0.3 dB delta att in slow mutephase nominal_fadeout=0 */ + { 1, 3, 0 + 3 + 2 }, /* 40 ms, 0.3 dB delta att in slow mutephase */ + { 3, 3, 1 + 3 + 1 }, /* 50 ms, 0.3 dB delta att in slow mutephase */ + { 3, 4, 1 + 4 + 1}, /* 60 ms, 0.3 dB delta att in slow mutephase */ + { 5, 4, 3 + 4 + 1 }, /* 70 ms, 0.3 dB delta att in slow mutephase */ + { 5, 5, 3 + 5 + 1 }, /* 80 ms, 0.3 dB delta att in slow mutephase */ + { 7, 5, 7 + 5 }, /* 90 ms, 0.3 dB delta att in slow mutephase */ + { 7, 5, 7 + 5 + 1}, /* 100 ms, 0.3 dB delta att in slow mutephase */ + { 9, 5, 9 + 5 }, /* 110 ms, 0.3 dB delta att in slow mutephase */ + { 9, 5, 9 + 5 + 1}, /* 120 ms, 0.3 dB delta att in slow mutephase nominal_fadeout=1 */ + { 11, 5, 15 + 5 },/* 130 ms, 0.3 dB delta att in slow mutephase */ + { 11, 6, 15 + 6 },/* 140 ms, 0.3 dB delta att in slow mutephase nominal 3GPP */ + +}; +#if 0 +/*fade_scheme_tab[ind][0] att_per _fram_index , "points" to first column in POW_ATT TABLES */ +/*fade_scheme_tab[ind][1] is burst_att_thresh, the number of non_muted 1.0 gain frames */ +/*fade_scheme_tab[ind][2] is beta_mute_thr, the location of the start of final muting */ +#endif + + + +/*compressed ATH Abolute hearing THreshold function weights at band borders */ +const LC3_FLOAT scATHFx[MAX_LGW - 2] = { .455444335937500 , 0.930755615234375 , 0.973083496093750 , 0.999969482421875 , 0.908508300781250 , 0.775665283203125 , 0.5 }; +#endif + const LC3_FLOAT PhECU_whr16ms_NB[128]={ 8.000000000000002e-02, 8.393536376804722e-02, 9.567411990702857e-02, 1.150154150448081e-01, 1.416283142591582e-01, 1.750574634660318e-01, 2.147308806541882e-01, 2.599697426559885e-01, 3.099999999999999e-01, 3.639656211120587e-01, @@ -3801,3 +6340,7 @@ const LC3_INT* ACC_COEFF_PER_BAND_PLC_5ms[] = { const LC3_INT32 mdct_grp_bins[10] = { 4, 14, 24, 44, 84, 164, 244, 324, 404, 484 }; +#if defined(CR8_A_PLC_FADEOUT_TUNING) +const LC3_INT16 plc_fadeout_param_maxlen[4] = {800, 400, 266, 200}; +const LC3_INT16 plc_fadeout_param_maxbytes[4] = {27, 14, 9, 7}; +#endif diff --git a/lib_lc3plus/constants.h b/lib_lc3plus/constants.h index c0c9e286e5..6d58a5798a 100644 --- a/lib_lc3plus/constants.h +++ b/lib_lc3plus/constants.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef CONSTANTS_H #define CONSTANTS_H +#include "options.h" #include "defines.h" #include "structs.h" @@ -18,13 +19,15 @@ extern const Complex dct2_16[16]; /* Ari coder */ -extern const LC3_INT ari_tns_order_cf[2][9]; -extern const LC3_INT ari_tns_freq_cf[8][18]; +extern const LC3_INT16 ari_tns_order_cf[2][9]; +extern const LC3_INT16 ari_tns_freq_cf[8][18]; extern const LC3_INT ari_spec_lookup_fl[4096]; -extern const LC3_INT ari_spec_cumfreq_fl[64][18]; +extern const LC3_INT16 ari_spec_cumfreq_fl[64][18]; extern const LC3_INT ari_spec_bits_fl[64][17]; /* SNS */ +extern const LC3_FLOAT sns_W[6]; +extern const LC3_FLOAT *sns_preemph_all[6]; extern const LC3_FLOAT sns_LFCB[8][32]; extern const LC3_FLOAT sns_HFCB[8][32]; extern const LC3_INT pvq_enc_A[16][11]; @@ -128,6 +131,16 @@ extern const LC3_INT BW_cutoff_bin_all_5ms_HR[MAX_BW_BANDS_NUMBER]; extern const LC3_INT BW_cutoff_bin_all[MAX_BW_BANDS_NUMBER]; extern const LC3_INT BW_cutoff_bits_all[MAX_BW_BANDS_NUMBER]; +#ifdef CR8_G_ADD_75MS +extern const LC3_INT BW_cutoff_bin_all_7_5ms[MAX_BW_BANDS_NUMBER]; +extern const LC3_INT bands_number_7_5ms[6]; +extern const LC3_INT bands_number_7_5ms_HR[6]; +extern const LC3_INT* BW_warp_idx_start_all_7_5ms[4]; +extern const LC3_INT* BW_warp_idx_stop_all_7_5ms[4]; +extern const LC3_INT brickwall_dist_7_5ms[4]; +extern const LC3_INT* ACC_COEFF_PER_BAND_PLC_7_5ms[]; +#endif + /* Arithmetic coding */ extern const LC3_INT tns_cf[8][18]; extern const LC3_INT tns_freq_cf[2][9]; @@ -150,7 +163,6 @@ extern const LC3_FLOAT MDCT_WINDOW_480_2_5ms[240]; extern const LC3_FLOAT* MDCT_WINS_2_5ms[2][6]; extern const LC3_INT MDCT_la_zeroes_2_5ms[6]; - extern const LC3_FLOAT MDCT_WINDOW_80_5ms[80]; extern const LC3_FLOAT MDCT_WINDOW_160_5ms[160]; extern const LC3_FLOAT MDCT_WINDOW_240_5ms[240]; @@ -159,12 +171,15 @@ extern const LC3_FLOAT MDCT_WINDOW_480_5ms[480]; extern const LC3_FLOAT* MDCT_WINS_5ms[2][6]; extern const LC3_INT MDCT_la_zeroes_5ms[6]; -extern const LC3_INT MDCT_WINDOWS_LENGTHS_10ms[6]; - -extern const LC3_INT MDCT_WINDOWS_LENGTHS_2_5ms[6]; - +#ifdef CR8_G_ADD_75MS +extern const LC3_FLOAT* MDCT_WINS_7_5ms[2][6]; +extern const LC3_INT32 MDCT_la_zeroes_7_5ms[6]; +#endif +extern const LC3_INT MDCT_WINDOWS_LENGTHS_10ms[6]; +extern const LC3_INT MDCT_WINDOWS_LENGTHS_7_5ms[6]; extern const LC3_INT MDCT_WINDOWS_LENGTHS_5ms[6]; +extern const LC3_INT MDCT_WINDOWS_LENGTHS_2_5ms[6]; /* Per band energy */ extern const LC3_INT* ACC_COEFF_PER_BAND[6]; @@ -173,17 +188,31 @@ extern const LC3_INT* ACC_COEFF_PER_BAND_HR[6]; extern const LC3_INT* ACC_COEFF_PER_BAND_2_5ms_HR[6]; extern const LC3_INT* ACC_COEFF_PER_BAND_2_5ms[5]; +#ifdef CR8_G_ADD_75MS +extern const LC3_INT* ACC_COEFF_PER_BAND_7_5ms_HR[6]; +extern const LC3_INT* ACC_COEFF_PER_BAND_7_5ms[5]; +#endif extern const LC3_INT* ACC_COEFF_PER_BAND_5ms_HR[6]; extern const LC3_INT* ACC_COEFF_PER_BAND_5ms[5]; /* Near Nyquist detector */ extern const LC3_INT NN_thresh; - +/* Tone detector */ +#ifdef CR8_E_TONE_DETECTOR +extern const LC3_INT32 TD_HR_thresh_10ms; +extern const LC3_INT32 TD_HR_thresh_7_5ms; +extern const LC3_INT32 TD_HR_thresh_5ms; +extern const LC3_INT32 TD_HR_thresh_2_5ms; +#endif // CR8_E_TONE_DETECTOR extern const LC3_INT32 xavg_N_grp[5]; extern const LC3_FLOAT *hannOla_wins[5]; extern const LC3_INT32 gwlpr[MAX_LGW+1]; +#ifdef CR8_A_PLC_FADEOUT_TUNING +extern const LC3_INT16 fade_scheme_tab[24 / 2][3]; +extern const LC3_FLOAT scATHFx[MAX_LGW - 2]; +#endif extern const LC3_INT32 mdct_grp_bins[10]; extern const LC3_FLOAT* PhECU_whr16ms_wins[5]; @@ -200,4 +229,9 @@ extern const LC3_FLOAT plc_tdc_lpc_48[17]; extern const LC3_FLOAT plc_tdc_lpc_96[17]; extern const LC3_FLOAT plc_tdc_lpc_8_25ms[9]; +#if defined(CR8_A_PLC_FADEOUT_TUNING) +extern const LC3_INT16 plc_fadeout_param_maxlen[4]; +extern const LC3_INT16 plc_fadeout_param_maxbytes[4]; #endif + +#endif /* CONSTANTS_H */ diff --git a/lib_lc3plus/cutoff_bandwidth.c b/lib_lc3plus/cutoff_bandwidth.c index 642b2afda2..c2d37312eb 100644 --- a/lib_lc3plus/cutoff_bandwidth.c +++ b/lib_lc3plus/cutoff_bandwidth.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,7 +13,7 @@ void process_cutoff_bandwidth(LC3_FLOAT *d_fl, LC3_INT len, LC3_INT bw_bin) { - LC3_INT i = 0; + LC3_INT i; if (len > bw_bin){ for (i = -1; i < 3; i++) { diff --git a/lib_lc3plus/dct4.c b/lib_lc3plus/dct4.c index 8fd5784b28..9b12627d71 100644 --- a/lib_lc3plus/dct4.c +++ b/lib_lc3plus/dct4.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -30,18 +30,17 @@ void dct2_apply(Dct2* dct, const LC3_FLOAT* input, LC3_FLOAT* output) { Complex tmp1[MAX_LEN]; Complex tmp2[MAX_LEN]; - int i = 0; - const int len = dct->length; + int i; assert(input != output); - for (i = 0; i < len / 2; i++) { + for (i = 0; i < 8; i++) { tmp1[i] = cmplx(input[i * 2], 0); - tmp1[len - i - 1] = cmplx(input[i * 2 + 1], 0); + tmp1[16 - i - 1] = cmplx(input[i * 2 + 1], 0); } fft_apply(&dct->fft, tmp1, tmp2); - for (i = 0; i < len; i++) { + for (i = 0; i < 16; i++) { output[i] = cmul(tmp2[i], dct2_16[i]).r; } output[0] /= (LC3_FLOAT)1.414213562373095; /* SQRT(2) */ @@ -50,7 +49,7 @@ void dct2_apply(Dct2* dct, const LC3_FLOAT* input, LC3_FLOAT* output) void dct4_init(Dct4* dct, int length) { - int i = 0; + int i; assert(length <= MAX_LEN); dct->length = length; dct->twid1 = calloc(sizeof(*dct->twid1), length / 2); @@ -81,13 +80,13 @@ void dct4_apply(Dct4* dct, const LC3_FLOAT* input, LC3_FLOAT* output) const LC3_FLOAT norm = (LC3_FLOAT)1.0 / LC3_SQRT((LC3_FLOAT)(len >> 1)); assert(input != output); - for (i = 0; i < len / 2; i++) { + for (i = 0; i < len >> 1; i++) { tmp1[i] = cmul(cmplx(input[i * 2], input[len - i * 2 - 1]), dct->twid1[i]); } fft_apply(&dct->fft, tmp1, tmp2); - for (i = 0; i < len / 2; i++) { + for (i = 0; i < len >> 1; i++) { Complex t = cmul(tmp2[i], dct->twid2[i]); output[i * 2] = t.r * norm; output[len - i * 2 - 1] = -t.i * norm; diff --git a/lib_lc3plus/dec_entropy.c b/lib_lc3plus/dec_entropy.c index d8512a1068..f072b82d6f 100644 --- a/lib_lc3plus/dec_entropy.c +++ b/lib_lc3plus/dec_entropy.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -32,7 +32,7 @@ void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* void read_uint_fl(LC3_INT nbits, LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* val) { - LC3_INT bit = 0, i = 0; + LC3_INT bit, i; read_bit_fl(ptr, mask_side, bp_side, val); @@ -131,8 +131,8 @@ void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_ LC3_INT* lsbMode, LC3_INT frame_dms) { - LC3_INT plc_trigger_bw = 0, plc_trigger_last_nz = 0, plc_trigger_SNS1 = 0, plc_trigger_SNS2 = 0, tmp = 0, bit = 0, - submodeMSB = 0, i = 0, ltpf_tmp[3] = {0}, ind = 0, submodeLSB = 0, bp_side_local = 0, mask_side_local = 0; + LC3_INT plc_trigger_bw, plc_trigger_last_nz, plc_trigger_SNS1, plc_trigger_SNS2, tmp, bit, + submodeMSB, i, ltpf_tmp[3], ind, submodeLSB, bp_side_local, mask_side_local; LC3_UINT8* ptr; LC3_INT gainMSBbits[4] = {1, 1, 2, 2}; @@ -174,7 +174,7 @@ void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_ } /* Last non-zero tuple */ - read_uint_fl(ceil(LC3_LOGTWO(N / 2)), ptr, &mask_side_local, &bp_side_local, lastnz); + read_uint_fl(ceil(LC3_LOGTWO(N >> 1)), ptr, &mask_side_local, &bp_side_local, lastnz); *lastnz = (*lastnz + 1) * 2; if (*lastnz > N) { diff --git a/lib_lc3plus/dec_lc3_fl.c b/lib_lc3plus/dec_lc3_fl.c index 88c528b0f6..7389ffa53e 100644 --- a/lib_lc3plus/dec_lc3_fl.c +++ b/lib_lc3plus/dec_lc3_fl.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -58,17 +58,13 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs bfi = 2; switch (decoder->frame_dms) { -# ifdef ENABLE_025_DMS_MODE case 25: max_bw_stopband = max_bw_stopband >> 2; break; -# endif -# ifdef ENABLE_050_DMS_MODE case 50: max_bw_stopband = max_bw_stopband >> 1; break; -# endif -# ifdef ENABLE_075_DMS_MODE +# ifdef CR8_G_ADD_75MS case 75: max_bw_stopband = 3 * (max_bw_stopband >> 2); break; @@ -151,7 +147,11 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs &h_DecSetup->PlcAdvSetup->cum_fading_slow, &h_DecSetup->PlcAdvSetup->cum_fading_fast, h_DecSetup->PlcSetup.q_d_prev, h_DecSetup->sqQdec_fl, h_DecSetup->spec_inv_idx, decoder->yLen, bfi, decoder->frame_dms, h_DecSetup->concealMethod, h_DecSetup->ltpf_mem_pitch, h_DecSetup->ltpf_param[0], - &h_DecSetup->PlcAdvSetup->cum_fflcAtten); + &h_DecSetup->PlcAdvSetup->cum_fflcAtten +#ifdef CR8_A_PLC_FADEOUT_TUNING + , h_DecSetup->PlcAdvSetup->plc_fadeout_type +#endif + ); /* IMDCT */ if (h_DecSetup->concealMethod == 4 || bfi != 1 ) @@ -171,6 +171,9 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs bfi, h_DecSetup->ltpf_param, h_DecSetup->ltpf_param_mem, h_DecSetup->ltpf_conf_beta_idx, h_DecSetup->ltpf_conf_beta, h_DecSetup->concealMethod, h_DecSetup->alpha , &h_DecSetup->ltpf_mem_active +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + , &h_DecSetup->rel_pitch_change, decoder->hrmode, decoder->frame_dms +#endif ); { diff --git a/lib_lc3plus/defines.h b/lib_lc3plus/defines.h index d978fa4e15..d9251c0181 100644 --- a/lib_lc3plus/defines.h +++ b/lib_lc3plus/defines.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef DEFINES_H #define DEFINES_H +#include "options.h" #include "stdint.h" @@ -24,13 +25,14 @@ typedef int8_t LC3_INT8; typedef uint32_t LC3_UINT32; /* Release defines */ -// #define ENABLE_2_5MS_MODE +#define ENABLE_2_5MS_MODE #define ENABLE_5MS_MODE +#define ENABLE_075_DMS_MODE #define ENABLE_10_MS_MODE #define ENABLE_ADVANCED_PLC_FL #define ENABLE_ADVANCED_PLC_FL_DEFAULT #define ENABLE_BW_CONTROLLER -//#define ENABLE_HR_MODE_FL +#define ENABLE_HR_MODE_FL #define ENABLE_PADDING #define ENABLE_RFRAME_FL #define ENABLE_PLC @@ -41,20 +43,89 @@ typedef uint32_t LC3_UINT32; #define ENABLE_FRAME_MS_FLAG #define ENABLE_HR_MODE_FL_FLAG +#define CR8_G_ADD_75MS + #ifndef NO_POST_REL_CHANGES /* Post-release non-bitexact changes */ +#define CR8_A_PLC_FADEOUT_TUNING /* Adapt PLC fadeout to avoid gaps in signal */ +#define CR9_D_FLOATING_POINT_CODE_SIMPLIFICATIONS +#define CR9_F_PITCH_WIN_LEN_FIX /* Increase window length for pitch calculation */ +#define CR9_G_IMPROVE_TDC /* summarize G,H,J,L,N */ +#ifdef CR9_G_IMPROVE_TDC +# define CR9_G_PLC_NS_TDC_FIX /* Always use TDC if pitch > 0 */ +# define CR9_H_REMOVE_SWITCH_TO_PLC_NS +# define CR9_J_SLOW_TDC_FADEOUT +# define CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +# ifdef ENABLE_HR_MODE_FL +# ifdef PLC_TUNING_SHORT_FADEOUT +# define CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH +# endif +# endif +#endif /* CR9_G_IMPROVE_TDC */ +#define CR9_I_INC_TDC_FADEOUT_LEN +#define CR9_K_REDUCE_NORM_CORR_TH #endif /* NO_POST_REL_CHANGES */ +#ifdef CR9_D_FLOATING_POINT_CODE_SIMPLIFICATIONS +# define CR9_SIMPLIFY_LOOP +# define CR9_LTPF_REWRITE +# define CR9_QUANT_SPEC_REWRITE +# define CR9_SIMPLIFY_ARI_DECODER +#endif + +#ifdef CR8_A_PLC_FADEOUT_TUNING +#define MAX_UINT8 255 +# ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +# ifdef CR9_K_REDUCE_NORM_CORR_TH +# define THRESH_100_DMS_TDC_CNT 9 +# define THRESH_100_DMS_NS_CNT 7 +# define THRESH_100_DMS_TDC_NS_CNT 73 +# define THRESH_075_DMS_TDC_CNT 7 +# define THRESH_075_DMS_NS_CNT 7 +# define THRESH_075_DMS_TDC_NS_CNT 87 +# define THRESH_050_DMS_TDC_CNT 22 +# define THRESH_050_DMS_NS_CNT 15 +# define THRESH_050_DMS_TDC_NS_CNT 141 +# define THRESH_025_DMS_TDC_CNT 20 +# define THRESH_025_DMS_NS_CNT 21 +# define THRESH_025_DMS_TDC_NS_CNT 278 +# else +# define THRESH_100_DMS_TDC_CNT 3 +# define THRESH_100_DMS_NS_CNT 35 +# define THRESH_100_DMS_TDC_NS_CNT 114 +# define THRESH_075_DMS_TDC_CNT 6 +# define THRESH_075_DMS_NS_CNT 37 +# define THRESH_075_DMS_TDC_NS_CNT 130 +# define THRESH_050_DMS_TDC_CNT 12 +# define THRESH_050_DMS_NS_CNT 55 +# define THRESH_050_DMS_TDC_NS_CNT 227 +# define THRESH_025_DMS_TDC_CNT 10 +# define THRESH_025_DMS_NS_CNT 138 +# define THRESH_025_DMS_TDC_NS_CNT 431 +# endif +# else +# define FAC1_FADEOUT 0.2 +# define FAC2_FADEOUT 1.5 +# define FAC3_FADEOUT 1.75 +# endif +#define REL_PITCH_THRESH 0.36 +#define PLC_LONGTERM_ANALYSIS_MS 200 /* Analysis window 2000 ms / 10 ms */ + +#define PLC_LONGTERM_ANALYSIS_STARTUP_FILL 0.5f /* required buffer fill amount, set to 0.0 to not require any fill at all */ + + +#endif + /* Precision Defines */ -#define LC3_FABS(x) (fabsf(x)) -#define LC3_POW(x, y) (powf(x, y)) +#define LC3_FABS(x) (fabsf(x)) +#define LC3_POW(x, y) (powf(x, y)) #define LC3_LOGTEN(x) (log10f(x)) -#define LC3_LOGTWO(x) (log2f(x)) -# define LC3_COS(x) (cos(x)) -# define LC3_SIN(x) (sin(x)) -#define LC3_SQRT(x) (sqrtf(x)) -#define LC3_EXP(x) (expf(x)) +#define LC3_LOGTWO(x) (log2f(x)) +#define LC3_COS(x) (cos(x)) +#define LC3_SIN(x) (sin(x)) +#define LC3_SQRT(x) (sqrtf(x)) +#define LC3_EXP(x) (expf(x)) # define MAX_BR 320000 /* 400 * 800 */ # define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ @@ -62,10 +133,20 @@ typedef uint32_t LC3_UINT32; # define MIN_BR_050DMS 32000 /* 20 * 800 * 100/ 50 */ # define MAX_BR_050DMS_NB 260800 /* 163 * 800 * 100/ 50 */ # define MAX_BR_100DMS_NB 114400 /* for 100ms at 8kHz */ - # define MAX_BR_100DMS_WB 221600 /* for 100ms at 16kHz */ # define MAX_BR_100DMS_SSWB 314400 /* for 100ms at 24kHz */ +#ifdef CR8_G_ADD_75MS +# define MIN_BR_075DMS_48KHZ_HR ((int)124800/ 800/2)* 800 +# define MIN_BR_075DMS_96KHZ_HR ((int)149600/ 800/2)* 800 +# define MIN_BR_075DMS 21334 /* ceil( 20 * 800 * 100/ 75) */ +# define MAX_BR_075DMS 426667 /* ceil(400 * 800 * 100/ 75) */ +# define MAX_BR_075DMS_NB 152534 /* ceil(143 * 800 * 100/ 75) */ +# define MAX_BR_075DMS_WB 295467 /* ceil(277 * 800 * 100/ 75) */ +# define MAX_BR_075DMS_SSWB 419200 /* ceil(393 * 800 * 100/ 75) */ +#endif +# define CR8_E_TONE_DETECTOR /* Tone detector for hrmode to deactivate TNS - improves SNR and THD+N */ + typedef int32_t LC3_INT32; # if defined(__xtensa__) @@ -76,7 +157,26 @@ typedef int32_t LC3_INT32; # define ALIGNMENT_BALLOC_RED 7 # endif +#ifndef CR8_A_PLC_FADEOUT_TUNING # define PLC2_FADEOUT_IN_MS 30 +#endif + +#ifdef CR8_A_PLC_FADEOUT_TUNING +/* PLC2/PhEcu fading settings */ +/* PLC2/PHEcu muting Table setup settings */ +# define PLC2_FADEOUT_IN_MS_MIN 30 /* Table min */ +# define PLC2_FADEOUT_IN_MS_MAX 140 /* Table max */ +# define PLC2_FADEOUT_RES 10 /* 10 ms steps used in fadeout constant tables */ + +/* current active settings */ +# define PLC2_FADEOUT_IN_MS 30 /* 30 P800 fadeout optimized */ +#if 0 +# define PLC2_FADEOUT_LONG_IN_MS 50 /* 50 ABBA test */ +#endif +# define PLC2_FADEOUT_LONG_IN_MS 120 /* 120 MUSHRA, && stable tonal fadeout optimized */ + +#endif + # define PHECU_FRES 62.5 # define PHECU_C_JACOB 1.1429 # define MAX_LGW 9 /* LGW48K + 1 !! */ @@ -108,16 +208,21 @@ typedef int32_t LC3_INT32; # define TDC_L_FIR_HP 11 # define PLC3_HPBLENDTHROTTLE 30 /* higher numbers increase throttled blending from hp filtered to unfiltered uv excitation (0 is no throttle) */ +#ifdef CR9_I_INC_TDC_FADEOUT_LEN +# define PLC_FADEOUT_TYPE_1_IN_MS 200 +#endif # define PLC_FADEOUT_IN_MS 60 /* fade-out to zero in ms for TD-PLC and NS, minimum value is 20 */ # define PLC4_TRANSIT_START_IN_MS 20 /* begin of transition time for noise substitution for voiced signals */ # define PLC4_TRANSIT_END_IN_MS PLC_FADEOUT_IN_MS /* end of transition time for noise substitution */ # define PLC34_ATTEN_FAC_100 0.5000 /* attenuation factor for NS and TDC @ 10 ms*/ +#ifdef CR8_G_ADD_75MS +# define PLC34_ATTEN_FAC_075 0.5946 /* attenuation factor for NS and TDC @ 7.5 ms */ +#endif # define PLC34_ATTEN_FAC_050 0.7071 /* attenuation factor for NS and TDC @ 5.0 ms*/ # define PLC34_ATTEN_FAC_025 0.8409 /* attenuation factor for NS and TDC @ 2.5 ms*/ # define FEC_SLOT_BYTES_MIN 40 -# define FEC_SLOT_BYTES_MAX 400 - +# define FEC_SLOT_BYTES_MAX 400 # define LC3_CONST_POW_2_M15 3.051757812500000e-05 # define LC3_CONST_POW_2_23 8388608 @@ -134,16 +239,30 @@ typedef int32_t LC3_INT32; #define G192_ONE 0x0081 #define READ_G192FER /* Allow C executable to also read G192 formatted FER files */ +#ifdef DEBUG +#ifdef READ_G192FER +# define READ_G192_FER_BYTE /* Allow C executable to also read G192 byte formatted FER files 0x20=BAD , 0x21=Good */ +#endif +#endif + + # define LC3_EPS (1.1e-7f) #define M_PI 3.14159265358979323846 /* FUNCTION MACROS */ #define CEILING(x, y) (((x) + (y)-1) / (y)) + + +#ifdef CR8_A_PLC_FADEOUT_TUNING +#define FRAME2FS_IDX_10MS(x) (x<500 ? (x/100) : 5) /* 80 -> 0, 160 -> 1, 240 -> 2, 320 -> 3, 480 -> 4 , 960 -> 5*/ +#define FS2FS_IDX(x) ((x) == 96000 ? 5 : (x) / 10000) /* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4, 96000 -> 5 */ +#else #define FRAME2FS_IDX(x) (x / 100) /* 80 -> 0, 160 -> 1, 240 -> 2, 320 -> 3, 480 -> 4*/ #define FS2FS_IDX(x) \ (x / 10000) /* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4 \ */ +#endif #define UNUSED(x) (void)(x) /* silence unused parameter warning */ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -159,6 +278,7 @@ typedef int32_t LC3_INT32; /* OPTIONS */ +#define MAX_LEN_NR 480 #define MAX_SR 96000 #define EXT_RES_ITER_MAX 20 #define MAX_BW_BANDS_NUMBER 6 diff --git a/lib_lc3plus/detect_cutoff_warped.c b/lib_lc3plus/detect_cutoff_warped.c index 9392867208..239da4255f 100644 --- a/lib_lc3plus/detect_cutoff_warped.c +++ b/lib_lc3plus/detect_cutoff_warped.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,10 +13,10 @@ void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx) { - const LC3_INT *warp_idx_start = NULL, *warp_idx_stop = NULL; - LC3_INT counter = 0, brickwall = 0, i = 0, stop = 0, dist = 0; - LC3_FLOAT d2_mean = 0, d2_sum = 0, e_diff = 0, thr = 0; - const LC3_INT *bw_dist = NULL; + const LC3_INT *warp_idx_start, *warp_idx_stop; + LC3_INT counter, brickwall = 0, i, stop, dist; + LC3_FLOAT d2_mean, d2_sum, e_diff, thr; + const LC3_INT *bw_dist; warp_idx_start = BW_warp_idx_start_all[fs_idx - 1]; warp_idx_stop = BW_warp_idx_stop_all[fs_idx - 1]; @@ -33,6 +33,13 @@ void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_d warp_idx_stop = BW_warp_idx_stop_all_5ms[fs_idx - 1]; bw_dist = brickwall_dist; break; +#ifdef CR8_G_ADD_75MS + case 75: + warp_idx_start = BW_warp_idx_start_all_7_5ms[fs_idx - 1]; + warp_idx_stop = BW_warp_idx_stop_all_7_5ms[fs_idx - 1]; + bw_dist = brickwall_dist_7_5ms; + break; +#endif case 100: warp_idx_start = BW_warp_idx_start_all[fs_idx - 1]; warp_idx_stop = BW_warp_idx_stop_all[fs_idx - 1]; diff --git a/lib_lc3plus/enc_entropy.c b/lib_lc3plus/enc_entropy.c index a7ff8cd700..23423b5d80 100644 --- a/lib_lc3plus/enc_entropy.c +++ b/lib_lc3plus/enc_entropy.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,9 @@ #include "options.h" #include "functions.h" +static const LC3_INT gainMSBbits[4] = {1, 1, 2, 2}; +static const LC3_INT gainLSBbits[4] = {0, 1, 0, 1}; + void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits, LC3_INT bw_cutoff_idx, LC3_INT lastnz, LC3_INT N, LC3_INT lsbMode, LC3_INT gg_idx, LC3_INT num_tns_filters, LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* scf_idx, LC3_INT fac_ns_idx @@ -18,8 +21,8 @@ void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_ ) { LC3_UINT8* ptr; - LC3_INT i = 0, submodeMSB = 0, submodeLSB = 0, tmp = 0, gainMSB = 0, gainLSB = 0; - LC3_INT gainMSBbits[4] = {1, 1, 2, 2}, gainLSBbits[4] = {0, 1, 0, 1}; + LC3_INT i, submodeMSB, submodeLSB, tmp, gainMSB, gainLSB; + LC3_INT16 lastnzTrigger[5] = {63, 127, 127, 255, 255}; @@ -38,7 +41,7 @@ void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_ } else { - write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOGTWO(N / 2))); + write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOGTWO(N >> 1))); } /* LSB mode bit */ @@ -100,27 +103,25 @@ void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_ void write_uint_backward_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT val, LC3_INT numbits) { - LC3_INT k = 0, bit = 0; + LC3_INT k, bit; for (k = 0; k < numbits; k++) { bit = val & 1; write_bit_backward_fl(ptr, bp_side, mask_side, bit); - val = val / 2; + val = val >> 1; } } void write_bit_backward_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT bit) { - if (bit == 0) { - ptr[*bp_side] = ptr[*bp_side] & (255 - *mask_side); - } else { + if (bit != 0) { ptr[*bp_side] = ptr[*bp_side] | *mask_side; - } + } if (*mask_side == 128) { *mask_side = 1; *bp_side = *bp_side - 1; } else { - *mask_side = *mask_side * 2; + *mask_side = *mask_side << 1; } } diff --git a/lib_lc3plus/enc_lc3_fl.c b/lib_lc3plus/enc_lc3_fl.c index c89f7244ca..404b80fb4b 100644 --- a/lib_lc3plus/enc_lc3_fl.c +++ b/lib_lc3plus/enc_lc3_fl.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -62,14 +62,22 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s /* Pitch estimation */ processOlpa_fl(h_EncSetup->s_12k8, h_EncSetup->olpa_mem_s12k8, h_EncSetup->olpa_mem_s6k4, - &h_EncSetup->olpa_mem_pitch, &T0_out, &normcorr, s_12k8_len, encoder->frame_dms); + &h_EncSetup->olpa_mem_pitch, +#ifdef CR9_F_PITCH_WIN_LEN_FIX + &h_EncSetup->pitch_flag, +#endif + &T0_out, &normcorr, s_12k8_len, encoder->frame_dms); /* LTPF encoder */ process_ltpf_coder_fl(h_EncSetup->s_12k8, s_12k8_len + 1, h_EncSetup->ltpf_enable, T0_out, normcorr, encoder->frame_dms, h_EncSetup->ltpf_mem_in, encoder->ltpf_mem_in_len, &h_EncSetup->ltpf_mem_normcorr, &h_EncSetup->ltpf_mem_ltpf_on, &h_EncSetup->ltpf_mem_pitch, h_EncSetup->ltpf_param, &h_EncSetup->ltpf_mem_mem_normcorr, - <pfBits); + <pfBits +#ifdef CR9_K_REDUCE_NORM_CORR_TH + ,encoder->hrmode +#endif +); /* Attack detector */ attack_detector_fl(h_EncSetup->s_in_scaled, encoder->frame_length, encoder->fs, &h_EncSetup->attdec_position, @@ -79,8 +87,12 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s /* Per-band energy */ processPerBandEnergy_fl(encoder->bands_number, encoder->bands_offset, encoder->hrmode, encoder->frame_dms, h_EncSetup->ener, d_fl); /* Near Nyquist detector */ - processNearNyquistdetector_fl(&encoder->near_nyquist_flag, encoder->fs_idx, encoder->near_nyquist_index, encoder->bands_number, h_EncSetup->ener); - + processNearNyquistdetector_fl(&encoder->near_nyquist_flag, encoder->fs_idx, encoder->near_nyquist_index, encoder->bands_number, h_EncSetup->ener +#ifdef CR8_E_TONE_DETECTOR + , encoder->frame_dms, encoder->hrmode ); +#else + ); +#endif /* Disable LTPF if nyquist detector triggers or -lfe mode is active*/ if (encoder->near_nyquist_flag != 0 || h_EncSetup->lfe == 1) { @@ -100,8 +112,8 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s BW_cutoff_idx = 0; } - processSnsComputeScf_fl(h_EncSetup->ener, encoder->tilt, encoder->bands_number, h_EncSetup->scf, - h_EncSetup->attdec_detected, encoder->sns_damping, encoder->attdec_damping); + processSnsComputeScf_fl(h_EncSetup->ener, encoder->bands_number, h_EncSetup->scf, + h_EncSetup->attdec_detected, encoder->sns_damping, encoder->attdec_damping, encoder->fs_idx); /* SNS Quantizer */ process_snsQuantizesScf_Enc(h_EncSetup->scf, h_EncSetup->L_scf_idx, h_EncSetup->scf_q, h_EncSetup->dct2StructSNS); diff --git a/lib_lc3plus/estimate_global_gain.c b/lib_lc3plus/estimate_global_gain.c index df9b1f5f23..fdaa977c06 100644 --- a/lib_lc3plus/estimate_global_gain.c +++ b/lib_lc3plus/estimate_global_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -19,9 +19,9 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC ) { - LC3_INT i = 0, N = 0, offset = 0, j = 0, iszero = 0; - LC3_FLOAT g_min = 0, x_max = 0, tmp = 0, ind = 0, ind_min = 0, target = 0, fac = 0, ener = 0; - LC3_FLOAT en[MAX_LEN / 4] = {0}; + LC3_INT i, N, offset, j, iszero, fac; + LC3_FLOAT g_min, x_max, tmp, ind, ind_min, target, ener; + LC3_FLOAT en[MAX_LEN / 4]; LC3_FLOAT reg_val = 4.656612873077393e-10; if (*old_targetBits < 0) { @@ -61,7 +61,7 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC } else { g_min = x_max / (32767 - 0.375); } - /* Prevent positive rounding errors from LC3_LOGTEN function */ + /* Prevent positive rounding errors from LC3_LOG10 function */ ind_min = 28.0 * LC3_LOGTEN(g_min); ind_min = ceil(ind_min + LC3_FABS(ind_min) * LC3_EPS); @@ -85,8 +85,9 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC fac = 256; offset = 255 + quantizedGainOff; - for (i = 0; i < 8; i++) { - fac = fac * 0.5; + for (i = 0; i < 8; i++) + { + fac = fac >> 1; offset = offset - fac; ener = 0; iszero = 1; diff --git a/lib_lc3plus/fft/cfft.c b/lib_lc3plus/fft/cfft.c index 4bd8d29ade..e8a6304ee1 100644 --- a/lib_lc3plus/fft/cfft.c +++ b/lib_lc3plus/fft/cfft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -8,6 +8,7 @@ ******************************************************************************/ + #include "options.h" #include "cfft.h" #include "iisfft.h" /* for M_PIl */ diff --git a/lib_lc3plus/fft/cfft.h b/lib_lc3plus/fft/cfft.h index 3902b4c396..6ba8dfccd3 100644 --- a/lib_lc3plus/fft/cfft.h +++ b/lib_lc3plus/fft/cfft.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -9,6 +9,7 @@ +#include "options.h" #include "../functions.h" #ifndef CFFT_H diff --git a/lib_lc3plus/fft/fft_15_16.h b/lib_lc3plus/fft/fft_15_16.h index 83ca77353b..c527f1bf56 100644 --- a/lib_lc3plus/fft/fft_15_16.h +++ b/lib_lc3plus/fft/fft_15_16.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_240_480.h b/lib_lc3plus/fft/fft_240_480.h index c1d96c87b8..18a0c8707a 100644 --- a/lib_lc3plus/fft/fft_240_480.h +++ b/lib_lc3plus/fft/fft_240_480.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_2_9.h b/lib_lc3plus/fft/fft_2_9.h index 54f4f839df..55fe84f3b7 100644 --- a/lib_lc3plus/fft/fft_2_9.h +++ b/lib_lc3plus/fft/fft_2_9.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_32.h b/lib_lc3plus/fft/fft_32.h index 48b891108b..803923a015 100644 --- a/lib_lc3plus/fft/fft_32.h +++ b/lib_lc3plus/fft/fft_32.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_384_768.h b/lib_lc3plus/fft/fft_384_768.h index 47f42e90d6..bd89393c17 100644 --- a/lib_lc3plus/fft/fft_384_768.h +++ b/lib_lc3plus/fft/fft_384_768.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_60_128.h b/lib_lc3plus/fft/fft_60_128.h index 75f1aaef45..e5a88ccad8 100644 --- a/lib_lc3plus/fft/fft_60_128.h +++ b/lib_lc3plus/fft/fft_60_128.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_generic.h b/lib_lc3plus/fft/fft_generic.h index e517ffb250..903875ab5a 100644 --- a/lib_lc3plus/fft/fft_generic.h +++ b/lib_lc3plus/fft/fft_generic.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/iis_fft.c b/lib_lc3plus/fft/iis_fft.c index b1f8ab5ab8..30ae240200 100644 --- a/lib_lc3plus/fft/iis_fft.c +++ b/lib_lc3plus/fft/iis_fft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,8 +15,8 @@ #include #include #include - #include "iis_fft.h" + /**************************************************************************************************/ /* AFFT uses two fft implementations @@ -25,7 +25,6 @@ fast lengths, check the fft_n function. */ - #define FFT_COMPLEX 1 #define FFT_REAL 2 diff --git a/lib_lc3plus/fft/iis_fft.h b/lib_lc3plus/fft/iis_fft.h index b658930fa7..b70a3719d3 100644 --- a/lib_lc3plus/fft/iis_fft.h +++ b/lib_lc3plus/fft/iis_fft.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef IIS_FFT_H #define IIS_FFT_H +#include "options.h" #include "../structs.h" #include "../defines.h" #include "cfft.h" diff --git a/lib_lc3plus/fft/iisfft.c b/lib_lc3plus/fft/iisfft.c index 227d2b6037..cdf7f8d2a8 100644 --- a/lib_lc3plus/fft/iisfft.c +++ b/lib_lc3plus/fft/iisfft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -8,8 +8,8 @@ ******************************************************************************/ -#include "options.h" +#include "options.h" #include #include /* for mmove */ #include diff --git a/lib_lc3plus/fft/iisfft.h b/lib_lc3plus/fft/iisfft.h index 7b448e2bbe..b45e73cdec 100644 --- a/lib_lc3plus/fft/iisfft.h +++ b/lib_lc3plus/fft/iisfft.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef IISFFT_H #define IISFFT_H +#include "options.h" #include "../defines.h" #ifndef M_PIl diff --git a/lib_lc3plus/functions.h b/lib_lc3plus/functions.h index 7a529a25d7..b0997e85fa 100644 --- a/lib_lc3plus/functions.h +++ b/lib_lc3plus/functions.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef FUNCTIONS_H #define FUNCTIONS_H +#include "options.h" #include "clib.h" #include "defines.h" #include "float.h" @@ -106,8 +107,11 @@ void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3 void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx); -void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4, LC3_INT* mem_old_T0, LC3_INT* T0_out, - LC3_FLOAT* normcorr_out, LC3_INT len, LC3_INT frame_dms); +void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4, LC3_INT* mem_old_T0, +#ifdef CR9_F_PITCH_WIN_LEN_FIX + LC3_INT* pitch_flag, +#endif + LC3_INT* T0_out,LC3_FLOAT* normcorr_out, LC3_INT len, LC3_INT frame_dms); void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, LC3_INT fs, LC3_INT N, LC3_INT frame_dms, LC3_INT nBits, LC3_INT* order_out, LC3_INT* rc_idx, LC3_INT* tns_numfilters, LC3_INT* bits_out @@ -117,14 +121,18 @@ void levinsonDurbin(LC3_FLOAT* r, LC3_FLOAT* out_lev, LC3_FLOAT* rc_unq, LC3_FLO void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs); -void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor); +void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor, LC3_INT fs_idx); void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_LC3_INT); void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx); void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, - const LC3_INT bands_number, const LC3_FLOAT* ener); - + const LC3_INT bands_number, const LC3_FLOAT* ener +#ifdef CR8_E_TONE_DETECTOR + , const LC3_INT16 frame_dms, const LC3_INT16 hrmode ); +#else + ); +#endif void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d); void ProcessingIMDCT_fl(LC3_FLOAT* y, LC3_INT yLen, const LC3_FLOAT* win, LC3_INT winLen, LC3_INT last_zeros, LC3_FLOAT* mem, LC3_FLOAT* x, @@ -134,12 +142,19 @@ void ProcessingITDA_WIN_OLA_fl(LC3_FLOAT* x_tda, LC3_INT32 yLen, const LC3_FLOAT void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC3_INT pitch_ol, LC3_FLOAT pitch_ol_norm_corr, LC3_INT frame_dms, LC3_FLOAT* mem_old_x, LC3_INT memLen, LC3_FLOAT* mem_norm_corr_past, LC3_INT* mem_on, LC3_FLOAT* mem_pitch, - LC3_INT* param, LC3_FLOAT* mem_norm_corr_past_past, LC3_INT* bits); + LC3_INT* param, LC3_FLOAT* mem_norm_corr_past_past, LC3_INT* bits +#ifdef CR9_K_REDUCE_NORM_CORR_TH + ,LC3_INT16 hrmode +#endif +); void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, LC3_INT* mem_pitch_LC3_INT, LC3_INT* mem_pitch_fr, LC3_FLOAT* mem_gain, LC3_INT* mem_beta_idx, LC3_INT bfi, LC3_INT* param, LC3_INT* mem_param, LC3_INT conf_beta_idx, LC3_FLOAT conf_beta, LC3_INT concealMethod, LC3_FLOAT damping , LC3_INT *mem_ltpf_active +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + , LC3_FLOAT *rel_pitch_change, LC3_INT hrmode, LC3_INT frame_dms +#endif ); void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[], @@ -225,10 +240,19 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, LC3_INT32 ns_nbLostCmpt, LC3_FLOAT *stabFac, LC3_FLOAT *cum_fading_slow, LC3_FLOAT *cum_fading_fast, LC3_FLOAT *spec_prev, LC3_FLOAT *spec, LC3_INT32 spec_inv_idx, LC3_INT32 yLen, LC3_INT32 bfi, LC3_INT32 frame_dms, LC3_INT32 concealMethod, LC3_INT32 pitch_present_bfi1, LC3_INT32 pitch_present_bfi2, - LC3_FLOAT *cum_fflcAtten); + LC3_FLOAT *cum_fflcAtten +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ); + void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 nbLostCmpt, LC3_FLOAT *stabFac, LC3_INT32 processDampScramb, LC3_FLOAT *cum_fflcAtten, LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOAT *cum_fading_slow, - LC3_FLOAT *cum_fading_fast, LC3_INT32 *seed, LC3_INT32 spec_inv_idx); + LC3_FLOAT *cum_fading_fast, LC3_INT32 *seed, LC3_INT32 spec_inv_idx +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ); void plc_phEcu_F0_refine_first(LC3_INT32 *plocs, LC3_INT32 n_plocs, LC3_FLOAT *f0est, const LC3_INT32 Xabs_len, LC3_FLOAT *f0binPtr, LC3_FLOAT *f0gainPtr, const LC3_INT32 nSubm); @@ -253,7 +277,12 @@ void plc_phEcu_spec_ana(LC3_FLOAT* xfp, LC3_INT32 xfp_len, const LC3_FLOAT* LC3_FLOAT* f0hzLtpBinPtr, LC3_FLOAT* f0gainLtpPtr, LC3_INT32 bw_idx, Fft* PhEcu_Fft); void plc_phEcu_subst_spec(LC3_INT32* plocs, LC3_INT32 n_plocs, LC3_FLOAT* f0est, LC3_INT32 time_offs, Complex* X, LC3_INT32 X_len, LC3_FLOAT* mag_chg_gr, LC3_INT32 *seed, LC3_FLOAT* alpha, LC3_FLOAT* beta, LC3_FLOAT* Xavg, - LC3_INT32 t_adv_in, LC3_INT32 Lprot, LC3_INT32 delta_corr, LC3_FLOAT *corr_phase_dbg, + LC3_INT32 t_adv_in, LC3_INT32 Lprot, LC3_INT32 delta_corr, +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT16 fadeout, /* needed for DC muting */ + LC3_INT16* nonpure_tone_flag_ptr, /* i/o: flag */ +#endif + LC3_FLOAT *corr_phase_dbg, LC3_FLOAT *X_i_new_re_dbg, LC3_FLOAT *X_i_new_im_dbg); void plc_phEcu_rec_frame(Complex *X_in, LC3_INT32 xfp_len, LC3_INT32 Lecu, const LC3_FLOAT *whr, const LC3_FLOAT *winMDCT, LC3_INT32 Lprot, LC3_FLOAT *xfp, LC3_INT32 time_offs, LC3_FLOAT *x_out, @@ -268,12 +297,21 @@ void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FL void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *grp_pow_change, LC3_FLOAT *stPhECU_beta_mute, LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_FLOAT *ph_dith, LC3_INT32 *tr_dec, - LC3_FLOAT *att_val, LC3_INT32 *attDegreeFrames, LC3_FLOAT *thresh_dbg); + LC3_FLOAT *att_val, LC3_INT32 *attDegreeFrames, + LC3_FLOAT *thresh_dbg +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ); void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape, LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape, LC3_FLOAT *old_EwPtr, LC3_FLOAT *stPhECU_beta_mute, LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, - LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg); + LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ); void plc_phEcu_hq_ecu( LC3_FLOAT *f0binPtr, LC3_FLOAT *f0ltpGainPtr, LC3_FLOAT *xfp, LC3_INT16 prev_bfi, LC3_INT32 *short_flag_prev, @@ -287,6 +325,10 @@ void plc_phEcu_hq_ecu( LC3_FLOAT *st_beta_mute, LC3_FLOAT *st_mag_chg_1st, LC3_FLOAT *st_Xavg, LC3_INT32 LA_ZEROS, LC3_FLOAT *x_tda, LC3_FLOAT *xsubst_dbg, Complex *X_out_m_dbg, LC3_INT32 *seed_dbg, LC3_FLOAT *mag_chg_dbg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg, LC3_FLOAT *X_i_new_re_dbg, LC3_FLOAT *X_i_new_im_dbg, LC3_FLOAT *corr_phase_dbg ,Fft* PhEcu_Fft,Fft* PhEcu_Ifft +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type, + LC3_INT16 *nonpure_tone_flag_ptr +#endif ); void processTdcPreemphasis_fl(LC3_FLOAT *in, LC3_FLOAT *pre_emph_factor, LC3_INT32 n_bands); @@ -296,7 +338,11 @@ void processTdcInverseOdft_fl(LC3_FLOAT *in, LC3_INT32 n_bands, LC3_FLOAT *out, void processTdcApply_fl(const LC3_INT32 pitch_LC3_INT, const LC3_FLOAT *preemphFac, const LC3_FLOAT* A, const LC3_INT32 lpc_order, const LC3_FLOAT* pcmbufHist, const LC3_INT32 max_len_pcm_plc, const LC3_INT32 N, const LC3_INT32 frame_dms, const LC3_INT32 SampRate, const LC3_INT32 nbLostCmpt, const LC3_INT32 overlap, const LC3_FLOAT *stabFac, LC3_FLOAT harmonicBuf[MAX_PITCH], LC3_FLOAT synthHist[M], - LC3_INT32* fract, LC3_INT16* seed, LC3_FLOAT* gain_c, LC3_FLOAT* alpha, LC3_FLOAT* synth); + LC3_INT32* fract, LC3_INT16* seed, LC3_FLOAT* gain_c, LC3_FLOAT* alpha, LC3_FLOAT* synth +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + ,LC3_UINT8 plc_fadeout_type +#endif +); void* balloc(void* base, size_t* base_size, size_t size); diff --git a/lib_lc3plus/imdct.c b/lib_lc3plus/imdct.c index 5d38aa6cc7..b1b5d4b43b 100644 --- a/lib_lc3plus/imdct.c +++ b/lib_lc3plus/imdct.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -14,8 +14,8 @@ /* Function expects already flipped window */ void ProcessingIMDCT_fl(LC3_FLOAT* y, LC3_INT yLen, const LC3_FLOAT* win, LC3_INT winLen, LC3_INT last_zeros, LC3_FLOAT* mem, LC3_FLOAT* x, Dct4* dct) { - LC3_FLOAT x_tda[MAX_LEN] = {0}, x_ov[2 * MAX_LEN] = {0}; - LC3_INT i = 0, j = 0; + LC3_FLOAT x_tda[MAX_LEN], x_ov[2 * MAX_LEN]; + LC3_INT i, j; /* Flip imdct window up to down */ i = winLen - 1; @@ -61,7 +61,7 @@ void ProcessingIMDCT_fl(LC3_FLOAT* y, LC3_INT yLen, const LC3_FLOAT* win, LC3_IN void ProcessingITDA_WIN_OLA_fl(LC3_FLOAT* x_tda, LC3_INT32 yLen, const LC3_FLOAT* win, LC3_INT32 winLen, LC3_INT32 last_zeros, LC3_FLOAT* mem, LC3_FLOAT* x) { - LC3_FLOAT x_ov[2 * MAX_LEN] = {0}; + LC3_FLOAT x_ov[2 * MAX_LEN]; LC3_INT32 i, j; move_float(x_ov, &x_tda[yLen / 2], yLen / 2); diff --git a/lib_lc3plus/lc3.c b/lib_lc3plus/lc3.c index 17d2ccb712..f09c53a538 100644 --- a/lib_lc3plus/lc3.c +++ b/lib_lc3plus/lc3.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -71,6 +71,9 @@ static int lc3plus_frame_size_supported(float frame_ms) { case 25: /* fallthru */ case 50: /* fallthru */ +#ifdef CR8_G_ADD_75MS + case 75: /* fallthru */ +#endif case 100: return 1; default: break; } @@ -102,7 +105,6 @@ int32_t lc3_enc_supported_lfe(void) LC3PLUS_Error lc3plus_enc_init(LC3PLUS_Enc *encoder, int samplerate, int channels, int hrmode, int32_t lfe_channel_array[]) { int ch = 0; - RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); RETURN_IF((uintptr_t)encoder % 4 != 0, LC3PLUS_ALIGN_ERROR); RETURN_IF(!lc3plus_samplerate_supported(samplerate), LC3PLUS_SAMPLERATE_ERROR); @@ -198,7 +200,6 @@ LC3PLUS_Error lc3plus_enc_set_frame_dms(LC3PLUS_Enc *encoder, int frame_dms) LC3PLUS_Error lc3plus_enc_set_bandwidth(LC3PLUS_Enc *encoder, int bandwidth) { LC3_INT effective_fs; - RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); #ifdef ENABLE_HR_MODE_FL_FLAG RETURN_IF(encoder->hrmode == 1, LC3PLUS_HRMODE_BW_ERROR); @@ -359,7 +360,7 @@ LC3PLUS_Error lc3plus_free_encoder_structs(LC3PLUS_Enc* encoder) LC3PLUS_Error lc3plus_free_decoder_structs(LC3PLUS_Dec* decoder) { - int ch = 0; + int ch = 0; RETURN_IF(!decoder, LC3PLUS_NULL_ERROR); for (ch = 0; ch < decoder->channels; ch++) { @@ -388,7 +389,6 @@ LC3PLUS_Error lc3plus_enc_set_ep_mode(LC3PLUS_Enc *encoder, LC3PLUS_EpMode epmod { LC3PLUS_EpMode oldEpmode; LC3PLUS_Error error; - RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); RETURN_IF((unsigned)epmode > LC3PLUS_EP_HIGH, LC3PLUS_EPMODE_ERROR); oldEpmode = encoder->epmode; diff --git a/lib_lc3plus/lc3.h b/lib_lc3plus/lc3.h index 3e45438fed..95dff9eb84 100644 --- a/lib_lc3plus/lc3.h +++ b/lib_lc3plus/lc3.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -25,6 +25,7 @@ #define LC3PLUS_H #ifndef _MSC_VER +#include "options.h" #include #else typedef unsigned char uint8_t; @@ -36,7 +37,7 @@ typedef __int32 int32_t; #define LC3PLUS_VERSION_INT(major, minor, micro) (((major) << 16) | ((minor) << 8) | (micro)) /*! Version number to ensure header and binary are matching. */ -#define LC3PLUS_VERSION LC3PLUS_VERSION_INT(1, 6, 9) +#define LC3PLUS_VERSION LC3PLUS_VERSION_INT(1, 7, 1) /*! Maximum number of supported channels. The actual binary might support * less, use lc3plus_channels_supported() to check. */ diff --git a/lib_lc3plus/lc3plus_fft.c b/lib_lc3plus/lc3plus_fft.c index 14f443f860..f1fc8fe714 100644 --- a/lib_lc3plus/lc3plus_fft.c +++ b/lib_lc3plus/lc3plus_fft.c @@ -1,12 +1,12 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + #include "options.h" #include "functions.h" @@ -19,11 +19,11 @@ void fft_init(Fft* fft, int length) HANDLE_IIS_FFT handle = NULL; IIS_FFT_ERROR error = 0; assert(length % 2 == 0); - + fft->length = length; - + error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); - + assert(error == IIS_FFT_NO_ERROR); fft->handle = handle; } @@ -31,10 +31,10 @@ void fft_init(Fft* fft, int length) void fft_free(Fft* fft) { IIS_FFT_ERROR error = 0; - + if (fft) { error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); - + assert(error == IIS_FFT_NO_ERROR); memset(fft, 0, sizeof(*fft)); } @@ -82,7 +82,7 @@ void fft_apply(Fft* fft, const Complex* input, Complex* output) { IIS_FFT_ERROR error = 0; error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); - + assert(error == IIS_FFT_NO_ERROR); } @@ -90,10 +90,11 @@ void fft_apply(Fft* fft, const Complex* input, Complex* output) void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) { IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; - + UNUSED(error); - error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); + error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); assert(error == IIS_FFT_NO_ERROR); } + diff --git a/lib_lc3plus/license.h b/lib_lc3plus/license.h index d9d6c89675..266f91a165 100644 --- a/lib_lc3plus/license.h +++ b/lib_lc3plus/license.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -8,11 +8,12 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" static const char *const LICENSE = "*******************************************************************************\n" - "* ETSI TS 103 634 V1.4.1 *\n" + "* ETSI TS 103 634 V1.4.3 *\n" "* Low Complexity Communication Codec Plus (LC3plus) *\n" "* Floating Point Software V%i.%i.%iETSI, " __DATE__ " *\n" "* Copyright licence is solely granted through ETSI Intellectual Property *\n" diff --git a/lib_lc3plus/ltpf_coder.c b/lib_lc3plus/ltpf_coder.c index fac8c481c0..286d8fa166 100644 --- a/lib_lc3plus/ltpf_coder.c +++ b/lib_lc3plus/ltpf_coder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,7 +15,7 @@ static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len); LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len) { - LC3_INT max_i = 0, i = 0; + LC3_INT max_i = 0, i; LC3_FLOAT max = 0; if (len <= 0) { @@ -34,16 +34,29 @@ LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len) void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC3_INT pitch_ol, LC3_FLOAT pitch_ol_norm_corr, LC3_INT frame_dms, LC3_FLOAT* mem_old_x, LC3_INT memLen, LC3_FLOAT* mem_norm_corr_past, LC3_INT* mem_on, LC3_FLOAT* mem_pitch, - LC3_INT* param, LC3_FLOAT* mem_norm_corr_past_past, LC3_INT* bits) + LC3_INT* param, LC3_FLOAT* mem_norm_corr_past_past, LC3_INT* bits +#ifdef CR9_K_REDUCE_NORM_CORR_TH + , LC3_INT16 hrmode +#endif +) { - LC3_FLOAT buffer[LTPF_MEMIN_LEN + LEN_12K8 + 1 + (LEN_12K8 >> 2)] = {0}, sum = 0, buf_tmp[MAX_LEN] = {0}, cor_up[MAX_LEN] = {0}, *x; - LC3_INT i = 0, j = 0, k = 0, n = 0, step = 0, N = 0, ltpf_active = 0, pitch_search_delta = 0, + LC3_FLOAT buffer[LTPF_MEMIN_LEN + LEN_12K8 + 1 + (LEN_12K8 >> 2)], sum = 0, cor_up[(MAX_PITCH_12K8 - MIN_PITCH_12K8) / 2] = {0}, *x; + LC3_INT i, j, n, step, N, ltpf_active, pitch_search_delta, pitch_search_upsamp = 0, pitch_search_L_interpol1 = 0, t0_min = 0, t0_max = 0, t_min = 0, t_max = 0, temp2 = 0, t1 = 0, pitch_int = 0, pitch_fr = 0, midpoint = 0, delta_up = 0, delta_down = 0, pitch_index = 0, gain = 0, acflen = 0; - LC3_FLOAT norm_corr = 0, cor[MAX_LEN] = {0}, cor_int[MAX_LEN] = {0}, currFrame[MAX_LEN] = {0}, predFrame[MAX_LEN] = {0}, sum1 = 0, sum2 = 0, sum3 = 0; + LC3_FLOAT cor_tmp, cor_int_tmp, norm_corr = 0, cor[MAX_LEN_NR], cor_int[MAX_LEN_NR], sum1 = 0, sum2 = 0, sum3 = 0; LC3_FLOAT pitch = 0; +#ifdef CR9_K_REDUCE_NORM_CORR_TH + LC3_FLOAT normCorrTh = 0.0f; + if (hrmode) { + normCorrTh = 0.4; + } else { + normCorrTh = 0.6; + } +#endif + /* Signal Buffer */ N = xLen - 1; x = &buffer[memLen]; @@ -59,7 +72,11 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC pitch_search_upsamp = 4; pitch_search_L_interpol1 = 4; +#ifdef CR9_K_REDUCE_NORM_CORR_TH + if (pitch_ol_norm_corr > normCorrTh) { +#else if (pitch_ol_norm_corr > 0.6) { +#endif /* Search Bounds */ t0_min = pitch_ol - pitch_search_delta; t0_max = pitch_ol + pitch_search_delta; @@ -83,19 +100,24 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC sum1 += x[j] * x[j]; sum2 += x[j - t_min] * x[j - t_min]; } + + /* Do first iteration outside of loop */ + sum = mac_loop(x, &x[-t_min], acflen); + + sum3 = LC3_SQRT(sum1 * sum2) + 1.00e-05; + norm_corr = sum / sum3; + + norm_corr = MAX(0, norm_corr); + cor[0] = norm_corr; /* Compute Cross-Correlation */ - for (i = t_min; i <= t_max; i++) { - sum = 0; - for (j = 0; j < acflen; j++) { - sum += x[j] * x[j - i]; - } + for (i = t_min + 1; i <= t_max; i++) { + sum = mac_loop(x, &x[-i], acflen); - if (i > t_min) { - sum2 = sum2 + x[-i]*x[-i] + sum2 = sum2 + x[-i]*x[-i] - x[acflen - 1 - ( i - 1 )]*x[acflen - 1 - ( i - 1 )]; - } - sum3 = LC3_SQRT(sum1 * sum2) + LC3_POW(10, -5); + + sum3 = LC3_SQRT(sum1 * sum2) + 1.00e-05; norm_corr = sum / sum3; norm_corr = MAX(0, norm_corr); @@ -104,13 +126,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC } /* Find Integer Pitch-Lag */ - j = 0; - for (i = pitch_search_L_interpol1; i <= t_max - t_min - pitch_search_L_interpol1; i++) { - buf_tmp[j] = cor[i]; - j++; - } - - temp2 = searchMaxIndice(buf_tmp, j); + temp2 = searchMaxIndice(&cor[pitch_search_L_interpol1], t_max - t_min - pitch_search_L_interpol1 - pitch_search_L_interpol1 + 1); t1 = temp2 + t0_min; assert(t1 >= t0_min && t1 <= t0_max); @@ -128,13 +144,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC } for (i = 0; i < pitch_search_upsamp * (t0_max - t0_min + 1); i++) { - sum = 0; - - k = 0; - for (j = i; j < i + 32; j++) { - sum += cor_up[j] * inter4_1[k]; - k++; - } + sum = mac_loop(&cor_up[i], (const LC3_FLOAT *)inter4_1, 32); cor_int[i] = sum; } @@ -153,14 +163,15 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC } else { delta_down = pitch_search_upsamp - step; } - + j = 0; for (i = midpoint - delta_down - 1; i <= midpoint + delta_up; i = i + step) { - buf_tmp[j] = cor_int[i]; + cor[j] = cor_int[i]; j++; } - temp2 = searchMaxIndice(buf_tmp, ((midpoint + delta_up) - (midpoint - delta_down)) / step + 1); + + temp2 = searchMaxIndice(cor, ((midpoint + delta_up) - (midpoint - delta_down)) / step + 1); pitch_fr = temp2 * step - delta_down; if (pitch_fr >= 0) { @@ -188,34 +199,25 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC pitch = (LC3_FLOAT) pitch_int + (LC3_FLOAT) pitch_fr / 4.0; + /* Normalized Correlation */ + sum1 = sum2 = sum3 = 0; for (n = 0; n < acflen; n++) { - currFrame[n] = x[n + 1] * enc_inter_filter[0][0] + + cor_tmp = x[n + 1] * enc_inter_filter[0][0] + x[n] * enc_inter_filter[0][1] + x[n - 1] * enc_inter_filter[0][2]; - predFrame[n] = x[n - pitch_int + 1] * enc_inter_filter[pitch_fr][0] + + cor_int_tmp = x[n - pitch_int + 1] * enc_inter_filter[pitch_fr][0] + x[n - pitch_int] * enc_inter_filter[pitch_fr][1] + x[n - pitch_int - 1] * enc_inter_filter[pitch_fr][2] + x[n - pitch_int - 2] * enc_inter_filter[pitch_fr][3]; + + sum1 += cor_tmp * cor_int_tmp; + sum2 += cor_tmp * cor_tmp; + sum3 += cor_int_tmp * cor_int_tmp; } - /* Normalized Correlation */ - sum1 = sum2 = sum3 = 0; - - for (i = 0; i < acflen; i++) { - sum1 += currFrame[i] * predFrame[i]; - } - - for (i = 0; i < acflen; i++) { - sum2 += currFrame[i] * currFrame[i]; - } - - for (i = 0; i < acflen; i++) { - sum3 += predFrame[i] * predFrame[i]; - } - - sum2 = LC3_SQRT(sum2 * sum3) + LC3_POW(10, -5); + sum2 = LC3_SQRT(sum2 * sum3) + 1.00e-05; norm_corr = sum1 / sum2; assert(norm_corr >= -1.00001 && norm_corr <= 1.00001); diff --git a/lib_lc3plus/ltpf_decoder.c b/lib_lc3plus/ltpf_decoder.c index a40c85213a..e95a274a46 100644 --- a/lib_lc3plus/ltpf_decoder.c +++ b/lib_lc3plus/ltpf_decoder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -16,18 +16,31 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f LC3_INT* param, LC3_INT* mem_param, LC3_INT conf_beta_idx, LC3_FLOAT conf_beta, LC3_INT concealMethod, LC3_FLOAT damping , LC3_INT *mem_ltpf_active +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + , LC3_FLOAT *rel_pitch_change, LC3_INT hrmode, LC3_INT frame_dms +#endif ) { - LC3_INT i = 0, j = 0, n = 0, N = 0, L_past_x = 0, N4 = 0, N34 = 0, - pitch_int = 0, pitch_fr = 0, p1 = 0, p2 = 0, L_past_y = 0, inter_len = 0, tilt_len = 0, - tilt_len_r = 0, inter_len_r = 0, old_x_len = 0, old_y_len = 0; - - LC3_FLOAT conf_alpha = 0, gain = 0, a1[MAX_LEN] = {0}, a2[MAX_LEN] = {0}, b1[MAX_LEN] = {0}, b2[MAX_LEN] = {0}, - buf_x[4 * MAX_LEN] = {0}, buf_y[4 * MAX_LEN] = {0}, buf_z[4 * MAX_LEN] = {0}, pitch = 0, sum1 = 0, sum2 = 0; - + LC3_INT i, j, n, N, L_past_x, N4, N34, + pitch_int, pitch_fr, p1, p2, L_past_y, inter_len, tilt_len = 0, + tilt_len_r, inter_len_r, old_x_len, old_y_len; + + LC3_FLOAT conf_alpha, gain, a1[12], a2[12], b1[11], b2[11], + buf_x[4 * MAX_LEN], buf_y[4 * MAX_LEN], buf_z[4 * MAX_LEN], pitch, sum1, sum2; +#ifdef CR9_LTPF_REWRITE + LC3_FLOAT *p_x, *p_y, *p_y2, *p_x_init, *p_y_init, *p_a1, *p_b1, *p_a2, *p_b2, fade_fac, current_fade_fac_up, current_fade_fac_down; +#endif +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + LC3_FLOAT pitch_fl_c_old, pitch_delta; +#endif const LC3_FLOAT *inter_filter[4], *tilt_filter[4]; - +#ifdef WMOPS + push_wmops("process_ltpf_decoder_fl"); +#endif +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + pitch_fl_c_old = (LC3_FLOAT) *mem_pitch_int + (LC3_FLOAT)*mem_pitch_fr / 4.0; +#endif conf_alpha = 0.85; if (bfi != 1) { @@ -213,6 +226,13 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f } /* First quarter of the current frame: cross-fading */ +#ifdef CR9_LTPF_REWRITE + fade_fac = 1. / (LC3_FLOAT) N4; + current_fade_fac_up = 0.f; + current_fade_fac_down = 1.f; + (void) p_x; (void) p_y; (void) p_a1; (void) p_b1; +#endif + if (mem_param[1] == 0 && param[1] == 0) { memmove(&buf_y[L_past_y], &buf_x[L_past_x], sizeof(LC3_FLOAT) * N4); @@ -232,8 +252,14 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f j++; } +#ifdef CR9_LTPF_REWRITE + buf_y[L_past_y + n] = buf_x[L_past_x + n] - current_fade_fac_down * sum1 + + current_fade_fac_down * sum2; + current_fade_fac_down -= fade_fac; +#else buf_y[L_past_y + n] = buf_x[L_past_x + n] - (((LC3_FLOAT)N4 - (LC3_FLOAT)n) / (LC3_FLOAT)N4) * sum1 + (((LC3_FLOAT)N4 - (LC3_FLOAT)n) / (LC3_FLOAT)N4) * sum2; +#endif } } else if (mem_param[1] == 0 && param[1] == 1) { @@ -252,7 +278,12 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f j++; } +#ifdef CR9_LTPF_REWRITE + buf_y[L_past_y + n] = buf_x[L_past_x + n] - current_fade_fac_up * sum1 + current_fade_fac_up * sum2; + current_fade_fac_up += fade_fac; +#else buf_y[L_past_y + n] = buf_x[L_past_x + n] - ((LC3_FLOAT)n / (LC3_FLOAT)N4) * sum1 + ((LC3_FLOAT)n / (LC3_FLOAT)N4) * sum2; +#endif } } else if (*mem_pitch_int == pitch_int && *mem_pitch_fr == pitch_fr) { for (n = 0; n < N4; n++) { @@ -273,6 +304,69 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f buf_y[L_past_y + n] = buf_x[L_past_x + n] - sum1 + sum2; } } else { +#ifdef CR9_LTPF_REWRITE + p_x_init = &buf_x[L_past_x]; + p_y_init = &buf_y[L_past_y - p1 + inter_len - 1]; + p_y2 = &buf_y[L_past_y]; + for (n = 0; n < N4; n++) { + sum1 = 0; + sum2 = 0; + p_b1 = b1; + p_x = p_x_init; + for (i = tilt_len; i >= 0; i--) { + sum1 += *p_b1 * *p_x; + p_b1++; + p_x--; + } + + p_y = p_y_init; + p_a1 = a1; + for (i = 2*inter_len - 1; i >= 0; i--) { + sum2 += *p_a1 * *p_y; + p_a1++; + p_y--; + } + + *p_y2 = *p_x_init - current_fade_fac_down * sum1 + + current_fade_fac_down * sum2; + current_fade_fac_down -= fade_fac; + p_x_init++; + p_y_init++; + p_y2++; + } + + move_float(buf_z, buf_y, (old_y_len + xLen)); + p_x_init = &buf_z[L_past_y]; /* buf z in this case */ + p_y_init = &buf_y[L_past_y - p2 + inter_len - 1]; + p_y2 = &buf_y[L_past_y]; + + for (n = 0; n < N4; n++) { + sum1 = 0; + sum2 = 0; + j = 0; + p_x = p_x_init; + p_b2 = b2; + for (i = tilt_len; i >= 0; i--) { + sum1 += *p_b2 * *p_x; + p_b2++; + p_x--; + } + + p_y = p_y_init; + p_a2 = a2; + for (i = 2*inter_len - 1; i >= 0; i--) { + sum2 += *p_a2 * *p_y; + p_a2++; + p_y--; + } + + *p_y2 = *p_x_init - current_fade_fac_up * sum1 + current_fade_fac_up * sum2; + current_fade_fac_up += fade_fac; + p_x_init++; + p_y_init++; + p_y2++; + } +#else for (n = 0; n < N4; n++) { sum1 = 0; sum2 = 0; @@ -292,7 +386,7 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f (((LC3_FLOAT)N4 - (LC3_FLOAT)n) / (LC3_FLOAT)N4) * sum2; } - memmove(buf_z, buf_y, sizeof(LC3_FLOAT) * 4 * MAX_LEN); + memmove(buf_z, buf_y, sizeof(LC3_FLOAT) * (old_y_len + xLen)); for (n = 0; n < N4; n++) { sum1 = 0; @@ -311,8 +405,45 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f buf_y[L_past_y + n] = buf_z[L_past_y + n] - ((LC3_FLOAT)n / (LC3_FLOAT)N4) * sum1 + ((LC3_FLOAT)n / (LC3_FLOAT)N4) * sum2; } +#endif } +#ifdef CR9_LTPF_REWRITE + /* Second quarter of the current frame */ + if (param[1] == 0) { + move_float(&buf_y[L_past_y + N4], &buf_x[L_past_x + N4], + ((L_past_x + N4 + N34) - (L_past_x + N4))); + } else { + p_x_init = &buf_x[L_past_x + N4]; + p_y_init = &buf_y[L_past_y + N4 - p2 + inter_len - 1]; + p_y2 = &buf_y[L_past_y + N4]; + for (n = 0; n < N34; n++) { + sum1 = 0; + sum2 = 0; + p_b2 = b2; + p_x = p_x_init; + + for (i = 0; i <= tilt_len; i++) { + sum1 += *p_b2 * *p_x; + p_b2++; + p_x--; + } + + p_a2 = a2; + p_y = p_y_init; + + for (i = 2*inter_len - 1; i >= 0; i--) { + sum2 += *p_a2 * *p_y; + p_a2++; + p_y--; + } + p_y_init++; + *p_y2 = *p_x_init - sum1 + sum2; + p_x_init++; + p_y2++; + } + } +#else /* Second quarter of the current frame */ if (param[1] == 0) { memmove(&buf_y[L_past_y + N4], &buf_x[L_past_x + N4], @@ -336,7 +467,7 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f buf_y[L_past_y + N4 + n] = buf_x[L_past_x + N4 + n] - sum1 + sum2; } } - +#endif /* Output */ move_float(y, &buf_y[L_past_y], N); @@ -353,4 +484,14 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f *mem_pitch_fr = pitch_fr; *mem_gain = gain; *mem_beta_idx = conf_beta_idx; +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + if (bfi == 0 && hrmode == 1 && (frame_dms == 50 || frame_dms == 25)){ + pitch_delta = LC3_FABS(pitch_fl_c_old - (LC3_FLOAT)pitch_int - (LC3_FLOAT)(pitch_fr / 4.0)); + *rel_pitch_change = pitch_delta / MAX(pitch_fl_c_old, 1); + } +#endif + +#ifdef WMOPS + pop_wmops(); +#endif } diff --git a/lib_lc3plus/mdct.c b/lib_lc3plus/mdct.c index 11618b9465..ff4075977d 100644 --- a/lib_lc3plus/mdct.c +++ b/lib_lc3plus/mdct.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -31,6 +31,26 @@ static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT h return NULL; } } +#ifdef CR8_G_ADD_75MS + else if (frame_dms == 75) { + switch (length) { + case 60: + return MDCT_WINS_7_5ms[hrmode][0]; + case 120: + return MDCT_WINS_7_5ms[hrmode][1]; + case 180: + return MDCT_WINS_7_5ms[hrmode][2]; + case 240: + return MDCT_WINS_7_5ms[hrmode][3]; + case 360: + return MDCT_WINS_7_5ms[hrmode][4]; + case 720: + return MDCT_WINS_7_5ms[hrmode][5]; + default: + return NULL; + } + } +#endif else if (frame_dms == 50) { switch (length) { case 40: @@ -74,10 +94,15 @@ void mdct_init(Mdct* mdct, LC3_INT length, LC3_INT frame_dms, LC3_INT fs_idx, LC { if (frame_dms == 100) { mdct->leading_zeros = MDCT_la_zeroes[fs_idx]; - } + } +#ifdef CR8_G_ADD_75MS + else if (frame_dms == 75) { + mdct->leading_zeros = MDCT_la_zeroes_7_5ms[fs_idx]; + } +#endif else if (frame_dms == 50) { mdct->leading_zeros = MDCT_la_zeroes_5ms[fs_idx]; - } + } else if (frame_dms == 25) { mdct->leading_zeros = MDCT_la_zeroes_2_5ms[fs_idx]; } @@ -103,8 +128,8 @@ void mdct_free(Mdct* mdct) void mdct_apply(const LC3_FLOAT* input, LC3_FLOAT* output, Mdct* mdct) { - LC3_FLOAT tmp[MAX_LEN * 2] = {0}; - LC3_INT i = 0; + LC3_FLOAT tmp[MAX_LEN * 2]; + LC3_INT i; LC3_INT hlen; move_float(tmp, mdct->mem, mdct->mem_length); diff --git a/lib_lc3plus/mdct_shaping.c b/lib_lc3plus/mdct_shaping.c index 1876192504..d3ca7dd953 100644 --- a/lib_lc3plus/mdct_shaping.c +++ b/lib_lc3plus/mdct_shaping.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,11 +13,15 @@ void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT scf[], const LC3_INT bands_offset[], LC3_INT fdns_npts) { - LC3_INT i = 0, j = 0; + LC3_INT i, j; + LC3_FLOAT val; + j = 0; for (i = 0; i < fdns_npts; i++) { + val = scf[i]; + for (; j < bands_offset[i + 1]; j++) { - x[j] = x[j] * scf[i]; + x[j] = x[j] * val; } } } diff --git a/lib_lc3plus/near_nyquist_detector.c b/lib_lc3plus/near_nyquist_detector.c index ce94351302..e18eb52112 100644 --- a/lib_lc3plus/near_nyquist_detector.c +++ b/lib_lc3plus/near_nyquist_detector.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -7,32 +7,86 @@ * estoppel or otherwise. * ******************************************************************************/ -#include "functions.h" #include "options.h" +#include "functions.h" void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, - const LC3_INT bands_number, const LC3_FLOAT* ener) + const LC3_INT bands_number, const LC3_FLOAT* ener +#ifdef CR8_E_TONE_DETECTOR + , const LC3_INT16 frame_dms, const LC3_INT16 hrmode) +#else +) +#endif { *near_nyquist_flag = 0; +#ifdef CR8_E_TONE_DETECTOR + if (hrmode == 0){ +#endif + if (fs_idx < 4) + { + LC3_INT i = 0; + LC3_FLOAT ener_low = FLT_EPSILON, ener_high = 0; + + for (i=0; i NN_thresh * ener_low){ + *near_nyquist_flag = 1; + } + } +#ifdef CR8_E_TONE_DETECTOR + } + else // hrmode == 1 { - LC3_INT i = 0; - LC3_FLOAT ener_low = FLT_EPSILON, ener_high = 0; + // inverse spectral flatness = mean(energy) ./ 2^(mean(log2(energy))); + LC3_INT32 td_thresh, i = 0; + LC3_FLOAT mean_ener = 0, mean_ener_log2 = 0, inv_flatness = 0; - for (i=0; i NN_thresh * ener_low){ - *near_nyquist_flag = 1; + // calculate geometric mean + for (i = 0; i < bands_number; i++) + { + if (ener[i] != 0) { + mean_ener_log2 += LC3_LOGTWO(ener[i]); + } } + mean_ener_log2 = mean_ener_log2 / bands_number; + + inv_flatness = mean_ener / LC3_POW(2,mean_ener_log2); + + if (inv_flatness > td_thresh) { + *near_nyquist_flag = 1; + } } +#endif // CR8_E_TONE_DETECTOR } diff --git a/lib_lc3plus/noise_factor.c b/lib_lc3plus/noise_factor.c index c5aa582e45..9cf130348f 100644 --- a/lib_lc3plus/noise_factor.c +++ b/lib_lc3plus/noise_factor.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,94 +15,111 @@ void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3 LC3_INT target_bytes ) { - LC3_INT sumZeroLines = 0, kZeroLines = 0, startOffset = 0, nTransWidth = 0, end = 0, start = 0, i = 0, j = 0, k = 0, - allZeros = 0, m = 0; - LC3_FLOAT fac_ns_unq = 0, mean = 0, idx = 0, nsf1 = 0, nsf2 = 0; - LC3_INT zeroLines[MAX_LEN] = {0}, zL1[MAX_LEN] = {0}, zL2[MAX_LEN] = {0}; + LC3_INT sumZeroLines = 0, kZeroLines = 0, startOffset = 0, nTransWidth = 0, i = 0, j = 0, k = 0, m = 0, nzeros = 0; + LC3_FLOAT fac_ns_unq = 0, idx = 0, nsf1 = 0, nsf2 = 0; + LC3_INT zeroLines[MAX_LEN]; switch (frame_dms) { case 25: - nTransWidth = 4; + nTransWidth = 1; startOffset = 6; break; case 50: - nTransWidth = 4; + nTransWidth = 1; startOffset = 12; break; +#ifdef CR8_G_ADD_75MS + case 75: + nTransWidth = 2; + startOffset = 18; + break; +#endif case 100: - nTransWidth = 8; + nTransWidth = 3; startOffset = 24; break; } - for (k = startOffset; k < BW_cutoff_idx; k++) { - allZeros = 1; - - start = k - (nTransWidth - 2) / 2; - end = MIN(BW_cutoff_idx - 1, k + (nTransWidth - 2) / 2); - - for (i = start; i <= end; i++) { - if (xq[i] != 0) { - allZeros = 0; - } + for (k = startOffset - nTransWidth; k < startOffset + nTransWidth; k++) + { + if (xq[k] != 0) + { + nzeros = -2 * nTransWidth - 1; + } + if (xq[k] == 0) + { + nzeros ++; + } + } + for (k = startOffset; k < BW_cutoff_idx - nTransWidth; k++) + { + if (xq[k + nTransWidth] != 0) + { + nzeros = -2 * nTransWidth - 1; } + if (xq[k + nTransWidth] == 0) + { + nzeros ++; + } + if (nzeros >= 0) + { + zeroLines[j++] = k; + } + } - if (allZeros == 1) { - zeroLines[j] = k + 1; - kZeroLines++; - j++; + for (k = BW_cutoff_idx - nTransWidth; k < BW_cutoff_idx; k++) + { + nzeros ++; + if (nzeros >= 0) + { + zeroLines[j++] = k; } } - for (i = 0; i < kZeroLines; i++) { - sumZeroLines += zeroLines[i]; + if (j == 0) { + fac_ns_unq = 0; } + else + { + kZeroLines = j; - if (sumZeroLines > 0) { + fac_ns_unq = 0; for (j = 0; j < kZeroLines; j++) { - mean += LC3_FABS(x[zeroLines[j] - 1]); + fac_ns_unq += LC3_FABS(x[zeroLines[j]]); } - fac_ns_unq = mean / (gg * kZeroLines); - } else { - fac_ns_unq = 0; - } + fac_ns_unq /= (gg) * kZeroLines; + + + + if (kZeroLines > 1 && target_bytes <= 20 && frame_dms == 100) { + + j = 0, k = 0, nsf1 = 0, nsf2 = 0, sumZeroLines = 0; + + for (i = 0; i < kZeroLines; i++) { + sumZeroLines += zeroLines[i]; + } - if (kZeroLines > 0) - { - if (target_bytes <= 20 && frame_dms == 100) { - j = 0, k = 0; m = floor(sumZeroLines / kZeroLines); for (i = 0; i < kZeroLines; i++) { if (zeroLines[i] <= m) { - zL1[j] = zeroLines[i]; j++; + nsf1 += LC3_FABS(x[zeroLines[i]]); } - - if (zeroLines[i] > m) { - zL2[k] = zeroLines[i]; + else { + nsf2 += LC3_FABS(x[zeroLines[i]]); k++; } } - mean = 0; - for (i = 0; i < j; i++) { - mean += LC3_FABS(x[zL1[i] - 1]) / gg; - } - - nsf1 = mean / j; - - mean = 0; - for (i = 0; i < k; i++) { - mean += LC3_FABS(x[zL2[i] - 1]) / gg; - } - - nsf2 = mean / k; + nsf1 /= (gg) * j; + nsf2 /= (gg) * k; fac_ns_unq = MIN(nsf1, nsf2); } + } idx = round(8 - 16 * fac_ns_unq); diff --git a/lib_lc3plus/noise_filling.c b/lib_lc3plus/noise_filling.c index 7fac5e0f72..1ae4c8ab8c 100644 --- a/lib_lc3plus/noise_filling.c +++ b/lib_lc3plus/noise_filling.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,8 +13,8 @@ void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) { - LC3_INT zeroLines[MAX_LEN] = {0}; - LC3_INT nTransWidth = 0, startOffset = 0, i = 0, j = 0, k = 0, start = 0, end = 0, allZeros = 0, kZeroLines = 0; + LC3_INT zeroLines[MAX_LEN]; + LC3_INT nTransWidth, startOffset, j, k, nzeros = 0, kZeroLines; LC3_FLOAT fac_ns = 0; switch (frame_dms) @@ -27,6 +27,12 @@ void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, nTransWidth = 1; startOffset = 12; break; +#ifdef CR8_G_ADD_75MS + case 75: + nTransWidth = 2; + startOffset = 18; + break; +#endif case 100: nTransWidth = 3; startOffset = 24; @@ -37,25 +43,44 @@ void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, j = 0; - for (k = startOffset; k < bw_stopband; k++) { - allZeros = 1; - - start = k - nTransWidth; - end = MIN(bw_stopband - 1, k + nTransWidth); - - for (i = start; i <= end; i++) { - if (xq[i] != 0) { - allZeros = 0; - } + for (k = startOffset - nTransWidth; k < startOffset + nTransWidth; k++) + { + if (xq[k] != 0) + { + nzeros = -2 * nTransWidth - 1; + } + if (xq[k] == 0) + { + nzeros ++; + } + } + for (k = startOffset; k < bw_stopband - nTransWidth; k++) + { + if (xq[k + nTransWidth] != 0) + { + nzeros = -2 * nTransWidth - 1; + } + if (xq[k + nTransWidth] == 0) + { + nzeros ++; + } + if (nzeros >= 0) + { + zeroLines[j++] = k; } + } - if (allZeros == 1) { - zeroLines[j] = k; - kZeroLines++; - j++; + for (k = bw_stopband - nTransWidth; k < bw_stopband; k++) + { + nzeros ++; + if (nzeros >= 0) + { + zeroLines[j++] = k; } } + kZeroLines = j; + for (k = 0; k < kZeroLines; k++) { nfseed = (13849 + (nfseed + 32768) * 31821) & 65535; nfseed -= 32768; diff --git a/lib_lc3plus/olpa.c b/lib_lc3plus/olpa.c index 6bec50952e..b1b8f2171c 100644 --- a/lib_lc3plus/olpa.c +++ b/lib_lc3plus/olpa.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,29 +11,24 @@ #include "options.h" #include "functions.h" -static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input); -static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len); +static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_INT32 len_input); +static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT32 len); -void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input) +void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_INT32 len_input) { - LC3_INT i = 0, j = 0; - LC3_FLOAT sum = 0; /* a = 1, so denominator == 1, nothing to do here */ + LC3_INT32 i, j; - for (i = 0; i < len_input; i++) { - j = 0; - sum = 0; - for (j = 0; (j < len_buf) && (j <= i); j++) { - sum += buf[j] * in[i - j]; - } - out[i] = sum; + j = 0; + for (i = 4; i < len_input; i += 2) { + out[j++] = (buf[0] * in[i]) + (buf[1] * in[i - 1]) + (buf[2] * in[i - 2]) + (buf[3] * in[i - 3]) + (buf[4] * in[i - 4]); } } LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len) { - LC3_INT max_i = 0, i = 0; + LC3_INT max_i = 0, i; LC3_FLOAT max = in[0]; if (len <= 0) { @@ -50,52 +45,84 @@ LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len) return max_i; } -void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4, LC3_INT* mem_old_T0, LC3_INT* T0_out, - LC3_FLOAT* normcorr_out, LC3_INT len, LC3_INT frame_dms) +void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4, LC3_INT* mem_old_T0, +#ifdef CR9_F_PITCH_WIN_LEN_FIX + LC3_INT* pitch_flag, +#endif + LC3_INT* T0_out, LC3_FLOAT* normcorr_out, LC3_INT len, LC3_INT frame_dms) { LC3_FLOAT norm_corr = 0, sum = 0, sum0 = 0, sum1 = 0, sum2 = 0, norm_corr2 = 0, *s6k4; - LC3_FLOAT buf[LEN_6K4 + MAX_PITCH_6K4] = {0}, filt_out[LEN_12K8 + 3] = {0}, d_wsp[LEN_6K4] = {0}, R0[RANGE_PITCH_6K4] = {0}, R[RANGE_PITCH_6K4] = {0}; /* constant length */ - LC3_INT i = 0, j = 0, len2 = 0, T0 = 0, T02 = 0, min_pitch = 0, max_pitch = 0, L = 0, mem_in_len = 0, acflen = 0; - + LC3_FLOAT buf[LEN_6K4 + MAX_PITCH_6K4 + MAX_LEN], R0[RANGE_PITCH_6K4]; /* constant length */ + LC3_INT i = 0, len2 = 0, T0 = 0, T02 = 0, min_pitch = 0, max_pitch = 0, L = 0, mem_in_len = 0, acflen = 0, delta = 0; - mem_in_len = MAX_PITCH_6K4; len2 = len / 2; +#ifdef CR9_F_PITCH_WIN_LEN_FIX + switch(frame_dms) + { + case 50: + delta = len / 2; + acflen = len2 * 2; + break; + + case 25: + delta = 3*(len /2); + acflen = len2*4; + break; + + default: +#endif + delta = 0; acflen = len2; +#ifdef CR9_F_PITCH_WIN_LEN_FIX + } +#endif + + mem_in_len = MAX_PITCH_6K4 + delta; + +#ifndef CR9_F_PITCH_WIN_LEN_FIX if (frame_dms == 25) { mem_in_len += 16; acflen += 16; } +#endif /* Downsampling */ move_float(buf, mem_s12k8, 3); move_float(&buf[3], s_12k8, len); move_float(mem_s12k8, &buf[len], 3); - filter_olpa(buf, filt_out, olpa_down2, 5, len + 3); - for (i = 4, j = 0; i < len + 3; i = i + 2) { - d_wsp[j] = filt_out[i]; - j++; - } + filter_olpa(buf, R0, olpa_down2, len + 3); /* Compute autocorrelation */ +#ifdef CR9_F_PITCH_WIN_LEN_FIX + s6k4 = &buf[mem_in_len - delta]; + move_float(&buf[mem_in_len], R0, len2); + move_float(buf, mem_s6k4, mem_in_len); + move_float(mem_s6k4, &buf[len2], mem_in_len); +#else s6k4 = &buf[mem_in_len]; move_float(buf, mem_s6k4, mem_in_len); - move_float(s6k4, d_wsp, len2); + move_float(s6k4, R0, len2); move_float(mem_s6k4, &buf[len2], mem_in_len); if (frame_dms == 25) { s6k4 = s6k4 - 16; } +#endif for (i = MIN_PITCH_6K4; i <= MAX_PITCH_6K4; i++) { - sum = 0; - for (j = 0; j < acflen; j++) { - sum += s6k4[j] * s6k4[j - i]; - } + sum = mac_loop(s6k4, &s6k4[-i], acflen); R0[i - MIN_PITCH_6K4] = sum; } /* Weight autocorrelation and find maximum */ - move_float(R, R0, RANGE_PITCH_6K4); + + /* Second try in the neighborhood of the previous pitch */ + min_pitch = MAX(MIN_PITCH_6K4, *mem_old_T0 - 4); + max_pitch = MIN(MAX_PITCH_6K4, *mem_old_T0 + 4); + + L = searchMaxIndice(&R0[min_pitch - MIN_PITCH_6K4], max_pitch - min_pitch + 1 ); + T02 = L + min_pitch; + for (i = 0; i < RANGE_PITCH_6K4; i++) { R0[i] = R0[i] * olpa_acw[i]; } @@ -104,22 +131,17 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 /* Compute normalized correlation */ sum0 = sum1 = sum2 = 0; + for (i = 0; i < acflen; i++) { sum0 += s6k4[i] * s6k4[i - T0]; sum1 += s6k4[i - T0] * s6k4[i - T0]; sum2 += s6k4[i] * s6k4[i]; } sum1 = sum1 * sum2; - sum1 = LC3_SQRT(sum1) + LC3_POW(10.0, -5.0); + sum1 = LC3_SQRT(sum1) + 1.00e-05; norm_corr = sum0 / sum1; norm_corr = MAX(0, norm_corr); - /* Second try in the neighborhood of the previous pitch */ - min_pitch = MAX(MIN_PITCH_6K4, *mem_old_T0 - 4); - max_pitch = MIN(MAX_PITCH_6K4, *mem_old_T0 + 4); - L = searchMaxIndice(&R[min_pitch - MIN_PITCH_6K4], max_pitch - min_pitch + 1 ); - T02 = L + min_pitch; - if (T02 != T0) { sum0 = sum1 = sum2 = 0; for (i = 0; i < acflen; i++) { @@ -128,7 +150,7 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 sum2 += s6k4[i] * s6k4[i]; } sum1 = sum1 * sum2; - sum1 = LC3_SQRT(sum1) + LC3_POW(10.0, -5.0); + sum1 = LC3_SQRT(sum1) + 1.00e-05; norm_corr2 = sum0 / sum1; norm_corr2 = MAX(0, norm_corr2); @@ -138,7 +160,41 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 } } +#ifdef CR9_F_PITCH_WIN_LEN_FIX + switch(frame_dms) + { + case 50: + if (*pitch_flag == 1) + { + *mem_old_T0 = T0; + *pitch_flag = 0; + } + else + { + *pitch_flag += 1; + } + break; + + case 25: + if (*pitch_flag == 3) + { + *mem_old_T0 = T0; + *pitch_flag = 0; + } + else + { + *pitch_flag += 1; + } + break; + + default: +#endif *mem_old_T0 = T0; +#ifdef CR9_F_PITCH_WIN_LEN_FIX + } +#endif + *T0_out = T0 * 2.0; *normcorr_out = norm_corr; + } diff --git a/lib_lc3plus/pc_apply.c b/lib_lc3plus/pc_apply.c index 1d1bc40005..4ca871f2fc 100644 --- a/lib_lc3plus/pc_apply.c +++ b/lib_lc3plus/pc_apply.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/pc_classify.c b/lib_lc3plus/pc_classify.c index 71196edb89..9fa5f38d9c 100644 --- a/lib_lc3plus/pc_classify.c +++ b/lib_lc3plus/pc_classify.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/pc_main.c b/lib_lc3plus/pc_main.c index 268ee94d2a..ead43deefe 100644 --- a/lib_lc3plus/pc_main.c +++ b/lib_lc3plus/pc_main.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/pc_update.c b/lib_lc3plus/pc_update.c index 57539b5079..214ced77d0 100644 --- a/lib_lc3plus/pc_update.c +++ b/lib_lc3plus/pc_update.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/per_band_energy.c b/lib_lc3plus/per_band_energy.c index db1b5b2d0f..ec34c3d7da 100644 --- a/lib_lc3plus/per_band_energy.c +++ b/lib_lc3plus/per_band_energy.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,8 +13,8 @@ void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) { - LC3_INT i = 0, j = 0, start = 0, stop = 0, maxBwBin = 0; - LC3_FLOAT sum = 0; + LC3_INT i, j, start, stop, maxBwBin; + LC3_FLOAT sum; # ifdef ENABLE_HR_MODE_FL if (hrmode) @@ -40,6 +40,11 @@ void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_ maxBwBin = maxBwBin >> 1; break; # endif +#ifdef CR8_G_ADD_75MS + case 75: + maxBwBin = (maxBwBin >> 2) * 3; + break; +#endif } for (i = 0; i < bands_number; i++) { diff --git a/lib_lc3plus/plc_classify.c b/lib_lc3plus/plc_classify.c index 619a1f7419..e45f08747d 100644 --- a/lib_lc3plus/plc_classify.c +++ b/lib_lc3plus/plc_classify.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,87 @@ #include "options.h" #include "functions.h" +#ifdef CR8_A_PLC_FADEOUT_TUNING + +static LC3_INT32 change_bit_at_position(LC3_INT32 value, LC3_UINT8 bit_position, LC3_INT8 bit) +{ + LC3_INT32 helper_mask = ~(1 << bit_position); + LC3_INT32 tmp = value & helper_mask; + tmp = tmp | (bit << bit_position); + return tmp; +} + +static void update_bit_and_byte_positions(LC3_INT16 longterm_analysis_counter_max_bytebuffer, LC3_INT8 *byte_position, LC3_INT8 *bit_position) +{ + if (*bit_position == 30) + { + *bit_position = 0; + + if ((*byte_position - longterm_analysis_counter_max_bytebuffer) < -1) + { + *byte_position = *byte_position + 1; + } else { + *byte_position = 0; + } + } else { + *bit_position = *bit_position + 1; + } +} + +static void array_insert_and_shift(LC3_INT32 *array, LC3_UINT8 value, LC3_INT16 longterm_analysis_counter_max, LC3_INT16 *overall_counter, LC3_INT8 *byte_position, LC3_INT8 *bit_position) +{ + LC3_INT32 current_byte = 0; + + if (overall_counter != NULL) + { + *overall_counter = MIN(*overall_counter + 1, longterm_analysis_counter_max); + } + + current_byte = array[*byte_position]; + + current_byte = change_bit_at_position(current_byte, *bit_position, value); + + array[*byte_position] = current_byte; +} + +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER +static void array_calculate(LC3_INT32 *array_tdc, LC3_INT32 *array_ns, int length, LC3_INT16 *counter_tdc, LC3_INT16 *counter_ns, LC3_INT16 longterm_analysis_counter_max) +#else +static void array_calculate(LC3_INT32 *array_tdc, LC3_INT32 *array_ns, int length, LC3_INT16 *counter_tdc, LC3_INT16 *counter_ns, LC3_INT16 *counter_phecu, LC3_INT16 overall_counter, LC3_INT16 longterm_analysis_counter_max) +#endif +{ + int i, k; + LC3_INT32 current_byte_tdc = 0, current_byte_ns = 0; + LC3_INT16 counter_loc_tdc = 0, counter_loc_ns = 0, counter_tmp = 0; + + for (i = length - 1; i >= 0; i--) + { + current_byte_tdc = array_tdc[i]; + current_byte_ns = array_ns[i]; + + for (k = 0; k < 30; k++) + { + counter_loc_tdc += ((current_byte_tdc >> k) & 1); + counter_loc_ns += ((current_byte_ns >> k) & 1); + counter_tmp++; + + /* Break from both loops if full 2s buffer has been evaluated */ + if (counter_tmp >= longterm_analysis_counter_max) + { + i = -1; + k = 30; + break; + } + } + } + + *counter_tdc = counter_loc_tdc; + *counter_ns = counter_loc_ns; +#ifndef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + *counter_phecu = overall_counter - counter_loc_tdc - counter_loc_ns; +#endif +} +#endif static void plc_xcorr_lc(LC3_FLOAT *pcmbufHist, LC3_INT32 max_len_pcm_plc, LC3_INT32 pitch_int, LC3_INT32 framelength, LC3_INT32 frame_dms, LC3_INT32 fs, LC3_FLOAT *xcorr); static void spectral_centroid_lc(LC3_FLOAT *gains, LC3_INT32 tilt, const LC3_INT *bands_offset, LC3_INT32 bands_number, LC3_INT32 framelength, LC3_INT32 fs, LC3_FLOAT *sc); @@ -22,21 +103,46 @@ void processPlcClassify_fl(LC3_INT plcMeth, LC3_INT *concealMethod, LC3_INT32 *n ) { LC3_FLOAT sc, class; - +#ifdef CR8_A_PLC_FADEOUT_TUNING + int fs_idx_tmp; +#endif + if (plcAd) { *xcorr = 0; } +#ifdef CR8_A_PLC_FADEOUT_TUNING + fs_idx_tmp = FS2FS_IDX(fs); + /* Save statistics for 24 kHz, 48 kHz and 96 kHz */ + if ((bfi == 1) || ((bfi >= 0) && (bfi <= 2) && ((fs_idx_tmp == 2) || (fs_idx_tmp == 4) || (fs_idx_tmp == 5)))) /* Partial Concealment PC(bfi==2) requires allowing value 2 to pass thru as well */ +#else if (bfi == 1) +#endif { +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (bfi == 1) + { + *nbLostCmpt = *nbLostCmpt + 1; + } +#else *nbLostCmpt = *nbLostCmpt + 1; +#endif /* Use pitch correlation at ltpf integer lag if available */ +#ifdef CR8_A_PLC_FADEOUT_TUNING + if ((*nbLostCmpt == 1) || (bfi != 1) )/* PC(bfi==2) requires allowing 2 to pass thru as well */ +#else if (*nbLostCmpt == 1) +#endif { +#ifdef CR8_A_PLC_FADEOUT_TUNING + *concealMethod = 4; /* Noise Substitution */ + UNUSED(plcMeth); +#else *concealMethod = plcMeth; // this is a dangerous mapping! - +#endif + /* Advanced PLC */ if (pitch_int > 0) { @@ -44,24 +150,53 @@ void processPlcClassify_fl(LC3_INT plcMeth, LC3_INT *concealMethod, LC3_INT32 *n plc_xcorr_lc(plcAd->pcmbufHist, plcAd->max_len_pcm_plc, pitch_int, framelength, frame_dms, fs, xcorr); spectral_centroid_lc(plcAd->scf_q_old, tilt, band_offsets, bands_number, framelength, fs, &sc); - class = *xcorr * 7640.0/32768.0 - sc - 5112.0/32768.0; - + class = *xcorr * 7640.0 / 32768.0 - sc - 5112.0 / 32768.0; + if (class <= 0) { if (frame_dms == 100 && hrmode == 0) { *concealMethod = 2; /* PhaseEcu selected */ +#ifdef CR8_A_PLC_FADEOUT_TUNING + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#endif } else { +#ifndef CR9_G_PLC_NS_TDC_FIX *concealMethod = 4; /* Noise Substitution */ +#endif +#ifdef CR8_A_PLC_FADEOUT_TUNING + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#endif } } +#ifdef CR8_A_PLC_FADEOUT_TUNING + else { + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 1, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + } +#endif } else { *concealMethod = 4; /* Noise Substitution */ +#ifdef CR8_A_PLC_FADEOUT_TUNING + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 1, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#endif } + +#ifdef CR8_A_PLC_FADEOUT_TUNING +# ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + array_calculate(plcAd->plc_longterm_advc_tdc, plcAd->plc_longterm_advc_ns, plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_plcTdc, &plcAd->longterm_counter_plcNsAdv, plcAd->longterm_analysis_counter_max); +# else + array_calculate(plcAd->plc_longterm_advc_tdc, plcAd->plc_longterm_advc_ns, plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_plcTdc, &plcAd->longterm_counter_plcNsAdv, &plcAd->longterm_counter_plcPhaseEcu, plcAd->overall_counter, plcAd->longterm_analysis_counter_max); +# endif + update_bit_and_byte_positions(plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#endif } } } diff --git a/lib_lc3plus/plc_compute_stab_fac.c b/lib_lc3plus/plc_compute_stab_fac.c index 4a1111a2c7..a81af2218b 100644 --- a/lib_lc3plus/plc_compute_stab_fac.c +++ b/lib_lc3plus/plc_compute_stab_fac.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_damping_scrambling.c b/lib_lc3plus/plc_damping_scrambling.c index ecea32be5f..a863c1621a 100644 --- a/lib_lc3plus/plc_damping_scrambling.c +++ b/lib_lc3plus/plc_damping_scrambling.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -17,7 +17,11 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, LC3_INT32 ns_nbLostCmpt, LC3_FLOAT *stabFac, LC3_FLOAT *cum_fading_slow, LC3_FLOAT *cum_fading_fast, LC3_FLOAT *spec_prev, LC3_FLOAT *spec, LC3_INT32 spec_inv_idx, LC3_INT32 yLen, LC3_INT32 bfi, LC3_INT32 frame_dms, LC3_INT32 concealMethod, LC3_INT32 pitch_present_bfi1, LC3_INT32 pitch_present_bfi2, - LC3_FLOAT *cum_fflcAtten) + LC3_FLOAT *cum_fflcAtten +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ) { LC3_INT32 processDampScramb; @@ -31,15 +35,33 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, { processDampScramb = 1; } + +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (ns_nbLostCmpt == 1) + { + *cum_fading_slow = 1; + *cum_fading_fast = 1; + *cum_fflcAtten = 1; + } +#endif + if ( bfi == 1 ) { processPlcDampingScrambling_fl(spec, yLen, ns_nbLostCmpt, stabFac, processDampScramb, cum_fflcAtten, - pitch_present_bfi1, frame_dms, cum_fading_slow, cum_fading_fast, ns_seed, 0); + pitch_present_bfi1, frame_dms, cum_fading_slow, cum_fading_fast, ns_seed, 0 +#ifdef CR8_A_PLC_FADEOUT_TUNING + , plc_fadeout_type +#endif + ); } else /* bfi == 2 */ { processPlcDampingScrambling_fl(spec, yLen, ns_nbLostCmpt_pc, stabFac, processDampScramb, cum_fflcAtten, - pitch_present_bfi2, frame_dms, cum_fading_slow, cum_fading_fast, pc_seed, spec_inv_idx); + pitch_present_bfi2, frame_dms, cum_fading_slow, cum_fading_fast, pc_seed, spec_inv_idx +#ifdef CR8_A_PLC_FADEOUT_TUNING + , plc_fadeout_type +#endif + ); processPlcUpdateSpec_fl(spec_prev, spec, yLen); } } @@ -47,13 +69,18 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 nbLostCmpt, LC3_FLOAT *stabFac, LC3_INT32 processDampScramb, LC3_FLOAT *cum_fflcAtten, LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOAT *cum_fading_slow, - LC3_FLOAT *cum_fading_fast, LC3_INT32 *seed, LC3_INT32 spec_inv_idx) + LC3_FLOAT *cum_fading_fast, LC3_INT32 *seed, LC3_INT32 spec_inv_idx +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ) { LC3_INT32 plc_start_inFrames, plc_end_inFrames, plc_duration_inFrames, x, b, i, ad_ThreshFac_start; LC3_FLOAT slow, fast, linFuncStartStop, randThreshold, ad_ThreshFac_end, ad_threshFac, frame_energy, mean_energy, energThreshold, fac, m, n, fflcAtten, cum_fading_slow_local, cum_fading_fast_local; frame_energy = 0; +#ifndef CR8_A_PLC_FADEOUT_TUNING /* Main process */ if (nbLostCmpt == 1) { @@ -61,6 +88,7 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n *cum_fading_fast = 1; *cum_fflcAtten = 1; } +#endif slow = 0.8 + 0.2 * (*stabFac); fast = 0.3 + 0.2 * (*stabFac); @@ -75,64 +103,104 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n slow = LC3_SQRT(slow); fast = LC3_SQRT(fast); break; +#ifdef CR8_G_ADD_75MS + case 75: + slow = LC3_SQRT(LC3_SQRT(slow*slow*slow)); + fast = LC3_SQRT(LC3_SQRT(fast*fast*fast)); + break; +#endif } - *cum_fading_slow = *cum_fading_slow * slow; - *cum_fading_fast = *cum_fading_fast * fast; - - if (processDampScramb == 1) +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (plc_fadeout_type == 0) { - fflcAtten = 1; - cum_fading_slow_local = *cum_fading_slow; - cum_fading_fast_local = *cum_fading_fast; - - if (spec_inv_idx == 0) - { - if (nbLostCmpt * frame_dms > PLC_FADEOUT_IN_MS * 10) - { - fflcAtten = 0; - *cum_fflcAtten = 0; - } - else if (nbLostCmpt * frame_dms > 200) - { - switch(frame_dms) - { - case 25: fflcAtten = PLC34_ATTEN_FAC_025; break; - case 50: fflcAtten = PLC34_ATTEN_FAC_050; break; - case 100: fflcAtten = PLC34_ATTEN_FAC_100; break; - } - } - - - *cum_fflcAtten = *cum_fflcAtten * fflcAtten; - cum_fading_slow_local = *cum_fading_slow * *cum_fflcAtten; - cum_fading_fast_local = *cum_fading_fast * *cum_fflcAtten; - } +#endif + *cum_fading_slow = *cum_fading_slow * slow; + *cum_fading_fast = *cum_fading_fast * fast; +#ifdef CR8_A_PLC_FADEOUT_TUNING + } +#endif + + if (processDampScramb == 1) + { +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (plc_fadeout_type != 0) + { + if (nbLostCmpt < (4 * (100.0 / (LC3_FLOAT)frame_dms))) { + cum_fading_slow_local = 1.0; + } + else if (nbLostCmpt < (8 * (100.0 / (LC3_FLOAT)frame_dms))) { + cum_fading_slow_local = 0.9; + } + else { + cum_fading_slow_local = 0.85; + } - if (pitch_present == 0) - { - plc_start_inFrames = 1; - } else { - plc_start_inFrames = floor(PLC4_TRANSIT_START_IN_MS / (frame_dms / 10.0)); - } + *cum_fading_slow = *cum_fading_slow * cum_fading_slow_local; + cum_fading_slow_local = *cum_fading_slow; + } + else { +#endif + fflcAtten = 1; + cum_fading_slow_local = *cum_fading_slow; + cum_fading_fast_local = *cum_fading_fast; - plc_end_inFrames = floor(PLC4_TRANSIT_END_IN_MS / (frame_dms / 10.0)); - plc_duration_inFrames = plc_end_inFrames - plc_start_inFrames; + if (spec_inv_idx == 0) + { + if (nbLostCmpt * frame_dms > PLC_FADEOUT_IN_MS * 10) + { + fflcAtten = 0; + *cum_fflcAtten = 0; + } + else if (nbLostCmpt * frame_dms > 200) + { + switch (frame_dms) + { + case 25: fflcAtten = PLC34_ATTEN_FAC_025; break; + case 50: fflcAtten = PLC34_ATTEN_FAC_050; break; +#ifdef CR8_G_ADD_75MS + case 75: fflcAtten = PLC34_ATTEN_FAC_075; break; +#endif + case 100: fflcAtten = PLC34_ATTEN_FAC_100; break; + } + } - if (nbLostCmpt <= plc_start_inFrames) - { - linFuncStartStop = 1; - } else if (nbLostCmpt >= plc_end_inFrames) - { - linFuncStartStop = 0; - } else { - x = nbLostCmpt; - m = -1.0 / plc_duration_inFrames; - b = -plc_end_inFrames; - linFuncStartStop = m * (x + b); - } - - randThreshold = -32768 * linFuncStartStop; + + *cum_fflcAtten = *cum_fflcAtten * fflcAtten; + cum_fading_slow_local = *cum_fading_slow * *cum_fflcAtten; + cum_fading_fast_local = *cum_fading_fast * *cum_fflcAtten; + } + + if (pitch_present == 0) + { + plc_start_inFrames = 1; + } + else { + plc_start_inFrames = floor(PLC4_TRANSIT_START_IN_MS / (frame_dms / 10.0)); + } + + plc_end_inFrames = floor(PLC4_TRANSIT_END_IN_MS / (frame_dms / 10.0)); + plc_duration_inFrames = plc_end_inFrames - plc_start_inFrames; + + if (nbLostCmpt <= plc_start_inFrames) + { + linFuncStartStop = 1; + } + else if (nbLostCmpt >= plc_end_inFrames) + { + linFuncStartStop = 0; + } + else { + x = nbLostCmpt; + m = -1.0 / plc_duration_inFrames; + b = -plc_end_inFrames; + linFuncStartStop = m * (x + b); + } + + randThreshold = -32768 * linFuncStartStop; +#ifdef CR8_A_PLC_FADEOUT_TUNING + } +#endif for (i = spec_inv_idx; i < yLen; i++) { @@ -146,37 +214,52 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n if (*seed < 0) { +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (plc_fadeout_type != 0 || pitch_present == 0 || *seed < randThreshold ) +#else if (pitch_present == 0 || *seed < randThreshold) +#endif { spec[i] = -spec[i]; } } } - ad_ThreshFac_start = 10; - ad_ThreshFac_end = 1.2; - ad_threshFac = (ad_ThreshFac_start - ad_ThreshFac_end) * linFuncStartStop + ad_ThreshFac_end; - - if (spec_inv_idx < yLen) +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (plc_fadeout_type == 0) { - for (i = spec_inv_idx; i < yLen; i++) +#endif + ad_ThreshFac_start = 10; + ad_ThreshFac_end = 1.2; + ad_threshFac = (ad_ThreshFac_start - ad_ThreshFac_end) * linFuncStartStop + ad_ThreshFac_end; + + if (spec_inv_idx < yLen) + { + for (i = spec_inv_idx; i < yLen; i++) + { + frame_energy = frame_energy + (spec[i] * spec[i]); + } + + mean_energy = frame_energy * 1 / (yLen - spec_inv_idx); + } + else { - frame_energy = frame_energy + (spec[i] * spec[i]); + mean_energy = 0; } - mean_energy = frame_energy * 1 / (yLen - spec_inv_idx); + energThreshold = LC3_SQRT(ad_threshFac * mean_energy); + fac = (cum_fading_slow_local - cum_fading_fast_local) * energThreshold; +#ifdef CR8_A_PLC_FADEOUT_TUNING } - else - { - mean_energy = 0; - } - - energThreshold = LC3_SQRT(ad_threshFac * mean_energy); - fac = (cum_fading_slow_local - cum_fading_fast_local) * energThreshold; +#endif for (i = spec_inv_idx; i < yLen; i++) { +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (plc_fadeout_type != 0 || LC3_FABS(spec[i]) < energThreshold ) +#else if (LC3_FABS(spec[i]) < energThreshold) +#endif { m = cum_fading_slow_local; n = 0; diff --git a/lib_lc3plus/plc_main.c b/lib_lc3plus/plc_main.c index df3fd184d9..4fc19f6053 100644 --- a/lib_lc3plus/plc_main.c +++ b/lib_lc3plus/plc_main.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -24,6 +24,16 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* LC3_INT16 prev_bfi_plc2; LC3_FLOAT phEcu_env_stab_local[1]; LC3_FLOAT phEcu_pfind_sens[1]; + +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT16 consecutiveLostThreshold = 0; +#endif + +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + LC3_INT16 thresh_tdc_cnt; + LC3_INT16 thresh_ns_cnt; + LC3_INT16 thresh_tdc_ns_cnt; +#endif prev_bfi_plc2 = 1; if (PlcSetup->nbLostCmpt == 0) @@ -53,14 +63,114 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* if (bfi == 1) { +# ifdef CR8_A_PLC_FADEOUT_TUNING + switch(decoder->frame_dms) + { + case 25: + consecutiveLostThreshold = 16; +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + thresh_tdc_cnt = THRESH_025_DMS_TDC_CNT; + thresh_ns_cnt = THRESH_025_DMS_NS_CNT; + thresh_tdc_ns_cnt = THRESH_025_DMS_TDC_NS_CNT; +#endif + break; + case 50: consecutiveLostThreshold = 8; +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + thresh_tdc_cnt = THRESH_050_DMS_TDC_CNT; + thresh_ns_cnt = THRESH_050_DMS_NS_CNT; + thresh_tdc_ns_cnt = THRESH_050_DMS_TDC_NS_CNT; +#endif + break; + case 75: consecutiveLostThreshold = 6; +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + thresh_tdc_cnt = THRESH_075_DMS_TDC_CNT; + thresh_ns_cnt = THRESH_075_DMS_NS_CNT; + thresh_tdc_ns_cnt = THRESH_075_DMS_TDC_NS_CNT; +#endif + break; + case 100: consecutiveLostThreshold = 4; +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + thresh_tdc_cnt = THRESH_100_DMS_TDC_CNT; + thresh_ns_cnt = THRESH_100_DMS_NS_CNT; + thresh_tdc_ns_cnt = THRESH_100_DMS_TDC_NS_CNT; +#endif + break; + default: assert(0); + } + + if (decoder->fs_idx == 2 || decoder->fs_idx >= 4) + { +#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + if (PlcAdvSetup->longterm_counter_plcTdc < thresh_tdc_cnt){ + PlcAdvSetup->plc_fadeout_type = 1; + } + else if (PlcAdvSetup->longterm_counter_plcNsAdv < thresh_ns_cnt){ + PlcAdvSetup->plc_fadeout_type = 1; + } + else if (PlcAdvSetup->longterm_counter_plcTdc + PlcAdvSetup->longterm_counter_plcNsAdv < thresh_tdc_ns_cnt){ + PlcAdvSetup->plc_fadeout_type = 1; + } + else { + PlcAdvSetup->plc_fadeout_type = 0; + } +#else + if (((PlcAdvSetup->longterm_counter_plcPhaseEcu < PlcAdvSetup->longterm_counter_plcTdc*FAC1_FADEOUT) || + (PlcAdvSetup->longterm_counter_plcPhaseEcu < PlcAdvSetup->longterm_counter_plcNsAdv*FAC1_FADEOUT)) && + (PlcAdvSetup->longterm_counter_plcTdc / (PlcAdvSetup->longterm_counter_plcNsAdv + LC3_EPS) < FAC2_FADEOUT)) + { + PlcAdvSetup->plc_fadeout_type = 0; + } else { + if ((PlcAdvSetup->longterm_counter_plcPhaseEcu > FAC3_FADEOUT * PlcAdvSetup->longterm_counter_plcTdc) || + (PlcAdvSetup->longterm_counter_plcPhaseEcu > FAC3_FADEOUT * PlcAdvSetup->longterm_counter_plcNsAdv)) + { + PlcAdvSetup->plc_fadeout_type = 1; + } else { + PlcAdvSetup->plc_fadeout_type = 0; + } + } +#endif + + if ((PlcAdvSetup->overall_counter - (int)(PLC_LONGTERM_ANALYSIS_STARTUP_FILL * PlcAdvSetup->longterm_analysis_counter_max)) < 0) + { + PlcAdvSetup->plc_fadeout_type = 0; + } +#ifndef CR9_H_REMOVE_SWITCH_TO_PLC_NS + if (PlcSetup->nbLostCmpt >= consecutiveLostThreshold && PlcAdvSetup->plc_fadeout_type == 1) + { + if ( h_DecSetup->concealMethod == 3 ) + { + h_DecSetup->concealMethod = 4; + } + } +#endif +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + if (h_DecSetup->rel_pitch_change > REL_PITCH_THRESH && hrmode == 1 && (decoder->frame_dms == 50 || decoder->frame_dms == 25) ){ + PlcAdvSetup->plc_fadeout_type = 2; + } else +#endif + if ( h_DecSetup->concealMethod != 2 ) { + /* not PhECU */ + if (PlcSetup->nbLostCmpt < consecutiveLostThreshold ) + { + PlcAdvSetup->plc_fadeout_type = 0; + } + } + } else { + PlcAdvSetup->plc_fadeout_type = 0; + } +# endif + +#ifdef PLC_CR8_A_PRINTF + printf("plc_fadeout_type = %d\n", PlcAdvSetup->plc_fadeout_type); +#endif switch (h_DecSetup->concealMethod) { case 2: { LC3_FLOAT pitch_fl_c; - + assert(decoder->fs_idx == floor(decoder->fs / 10000)); - // phaseECU supports only 10ms framing + /* phaseECU supports only 10ms framing*/ assert(PlcSetup->nbLostCmpt != 0 || decoder->frame_dms == 100); if (decoder->frame_dms != 100) @@ -155,6 +265,10 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* , &(PlcAdvSetup->PlcPhEcuSetup.PhEcu_Fft), &(PlcAdvSetup->PlcPhEcuSetup.PhEcu_Ifft) +#ifdef CR8_A_PLC_FADEOUT_TUNING + ,PlcAdvSetup->plc_fadeout_type, + &(PlcAdvSetup->PlcPhEcuSetup.PhECU_nonpure_tone_flag) /* nonpure tone flag */ +#endif ); @@ -162,8 +276,7 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* h_DecSetup->imdct_mem, synth); move_float(syntM_fl_c, synth, decoder->frame_length); - - + } } break; @@ -180,7 +293,11 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* processTdcApply_fl(ltpf_pitch_int, &PlcAdvSetup->PlcTdcSetup.preemphFac, A, PlcAdvSetup->PlcTdcSetup.lpcorder, PlcAdvSetup->pcmbufHist, PlcAdvSetup->max_len_pcm_plc, decoder->frame_length, decoder->frame_dms, decoder->fs, PlcSetup->nbLostCmpt, decoder->frame_length - decoder->la_zeroes, &PlcAdvSetup->stabFac, PlcAdvSetup->PlcTdcSetup.harmonicBuf, PlcAdvSetup->PlcTdcSetup.synthHist, &PlcAdvSetup->PlcTdcSetup.fract, &PlcAdvSetup->PlcTdcSetup.seed, &PlcAdvSetup->PlcTdcSetup.gain_c, - &h_DecSetup->alpha, synth); + &h_DecSetup->alpha, synth +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + ,PlcAdvSetup->plc_fadeout_type +#endif +); processTdcTdac_fl(synth, decoder->imdct_win, decoder->frame_length, decoder->la_zeroes, h_DecSetup->imdct_mem); memmove(syntM_fl_c, synth, sizeof(LC3_FLOAT) * decoder->frame_length); diff --git a/lib_lc3plus/plc_noise_substitution.c b/lib_lc3plus/plc_noise_substitution.c index 4913ee53e5..92f8b3cf21 100644 --- a/lib_lc3plus/plc_noise_substitution.c +++ b/lib_lc3plus/plc_noise_substitution.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_f0_refine_first.c b/lib_lc3plus/plc_phecu_f0_refine_first.c index 11ebf276b1..2a580024f0 100644 --- a/lib_lc3plus/plc_phecu_f0_refine_first.c +++ b/lib_lc3plus/plc_phecu_f0_refine_first.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_fec_hq.c b/lib_lc3plus/plc_phecu_fec_hq.c index c25466c3e9..4aebbfa885 100644 --- a/lib_lc3plus/plc_phecu_fec_hq.c +++ b/lib_lc3plus/plc_phecu_fec_hq.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_hq_ecu.c b/lib_lc3plus/plc_phecu_hq_ecu.c index 5b1978bcab..112d965a49 100644 --- a/lib_lc3plus/plc_phecu_hq_ecu.c +++ b/lib_lc3plus/plc_phecu_hq_ecu.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,6 +13,7 @@ #include "functions.h" + void plc_phEcu_hq_ecu( LC3_FLOAT *f0binPtr, LC3_FLOAT *f0ltpGainPtr, LC3_FLOAT *xfp, LC3_INT16 prev_bfi, LC3_INT32 *short_flag_prev, LC3_INT32 fs, @@ -24,7 +25,12 @@ void plc_phEcu_hq_ecu( LC3_FLOAT *xsubst_dbg, Complex *X_out_m_dbg, LC3_INT32 *seed_dbg, LC3_FLOAT *mag_chg_dbg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg, LC3_FLOAT *X_i_new_re_dbg, LC3_FLOAT *X_i_new_im_dbg, LC3_FLOAT *corr_phase_dbg, - Fft *PhEcu_Fft, Fft *PhEcu_Ifft) + Fft *PhEcu_Fft, Fft *PhEcu_Ifft +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type, LC3_INT16 *nonpure_tone_flag_ptr /* nonpure tone flag */ +#endif + + ) { LC3_INT32 i; LC3_INT32 fs_idx, L, Lprot, n_grp, Lecu, LXsav, Lxfp_inuse; @@ -48,6 +54,8 @@ void plc_phEcu_hq_ecu( Lxfp_inuse = (LC3_INT32)(L*(3.75/10.0)); } + + UNUSED(env_stabPtr); UNUSED(xsubst_dbg); UNUSED(X_out_m_dbg); @@ -69,12 +77,20 @@ void plc_phEcu_hq_ecu( xfp_local_rnd[i] = 0.0; } } +#ifdef CR8_A_PLC_FADEOUT_TUNING + *nonpure_tone_flag_ptr = -1; /* set nonpure tone flag for new analysis */ +#endif *time_offs = 0; burst_len = (*time_offs / L + 1); plc_phEcu_trans_burst_ana_sub(fs_idx, burst_len, n_grp, oold_grp_shape, oold_EwPtr , old_grp_shape, old_EwPtr, st_beta_mute, - st_mag_chg_1st, st_Xavg, alpha, beta, mag_chg, NULL, NULL); + st_mag_chg_1st, st_Xavg, alpha, beta, mag_chg, NULL, NULL + +#ifdef CR8_A_PLC_FADEOUT_TUNING + ,plc_fadeout_type +#endif + ); plc_phEcu_spec_ana(xfp_local_rnd, Lprot, winWhr, pfind_sensPtr, plocs, n_plocs, f0est, X_sav_m, &LXsav, f0binPtr, f0ltpGainPtr, fs_idx, PhEcu_Fft); } @@ -85,7 +101,11 @@ void plc_phEcu_hq_ecu( burst_len = ((*time_offs / L) + 1); plc_phEcu_trans_burst_ana_sub(fs_idx, burst_len, n_grp, oold_grp_shape, oold_EwPtr, old_grp_shape, old_EwPtr, st_beta_mute, - st_mag_chg_1st, st_Xavg, alpha, beta, mag_chg, NULL, NULL); + st_mag_chg_1st, st_Xavg, alpha, beta, mag_chg, NULL, NULL +#ifdef CR8_A_PLC_FADEOUT_TUNING + ,plc_fadeout_type +#endif + ); } @@ -100,6 +120,12 @@ void plc_phEcu_hq_ecu( /* inplace X_out_m update */ plc_phEcu_subst_spec(plocs, *n_plocs, f0est, *time_offs, X_out_m, LXsav, mag_chg, &seed, alpha, beta, st_Xavg, t_adv, Lprot, delta_corr, +#ifdef CR8_A_PLC_FADEOUT_TUNING + plc_fadeout_type, + nonpure_tone_flag_ptr, /* nonpure_tone_flag , a state updated here */ +#endif + + NULL, NULL, NULL); diff --git a/lib_lc3plus/plc_phecu_lf_peak_analysis.c b/lib_lc3plus/plc_phecu_lf_peak_analysis.c index 0bcc98d7a4..225aa52560 100644 --- a/lib_lc3plus/plc_phecu_lf_peak_analysis.c +++ b/lib_lc3plus/plc_phecu_lf_peak_analysis.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_rec_frame.c b/lib_lc3plus/plc_phecu_rec_frame.c index 0e6570743a..e56cb3dd75 100644 --- a/lib_lc3plus/plc_phecu_rec_frame.c +++ b/lib_lc3plus/plc_phecu_rec_frame.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -51,7 +51,12 @@ void plc_phEcu_rec_frame(Complex *X_in, UNUSED(ifft_out_dbg); UNUSED(xsubst_dbg); UNUSED(xsubst_LL); - fs_idx = FRAME2FS_IDX(L); + +#ifdef CR8_A_PLC_FADEOUT_TUNING + fs_idx = FRAME2FS_IDX_10MS(L); +#else + fs_idx = FRAME2FS_IDX(L); +#endif hannOla = hannOla_wins[fs_idx]; X_in[0].i = X_in[Lprot / 2].r; /* move fs/2 real to imag part of X_in[0]*/ diff --git a/lib_lc3plus/plc_phecu_setf0hz.c b/lib_lc3plus/plc_phecu_setf0hz.c index b14327e2b2..7bdb0a8c5c 100644 --- a/lib_lc3plus/plc_phecu_setf0hz.c +++ b/lib_lc3plus/plc_phecu_setf0hz.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_spec_ana.c b/lib_lc3plus/plc_phecu_spec_ana.c index b496900305..313b338777 100644 --- a/lib_lc3plus/plc_phecu_spec_ana.c +++ b/lib_lc3plus/plc_phecu_spec_ana.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_subst_spec.c b/lib_lc3plus/plc_phecu_subst_spec.c index 43f806339b..d494af826f 100644 --- a/lib_lc3plus/plc_phecu_subst_spec.c +++ b/lib_lc3plus/plc_phecu_subst_spec.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,35 +13,47 @@ #include "functions.h" #include "constants.h" - static LC3_INT32 own_rand(LC3_INT32 seed); static Complex valley_magnitude_adj(Complex X_i_in, LC3_INT32 uni_seed, LC3_FLOAT cos_F); static LC3_INT32 rand_phase(LC3_INT32 seed_in, LC3_FLOAT* cos_F); +#ifdef CR8_A_PLC_FADEOUT_TUNING + +#define ONE_SIDED_SINE_WIDTH (4) /* expected pure sine main lobe maximum width (4+1+4) bins *62.5 hz/bin => approx 560 Hz total width */ + +static LC3_INT16 plc_phEcu_nonpure_tone_ana(const LC3_INT32* plocs, const LC3_INT32 n_plocs, const Complex* X, const LC3_FLOAT* Xavg, const LC3_INT32 Lprot); +#endif + void plc_phEcu_subst_spec(LC3_INT32* plocs, LC3_INT32 n_plocs, LC3_FLOAT* f0est, LC3_INT32 time_offs, Complex* X, LC3_INT32 X_len, LC3_FLOAT* mag_chg_gr, LC3_INT32 *seed, LC3_FLOAT* alpha, LC3_FLOAT* beta, LC3_FLOAT* Xavg, - LC3_INT32 t_adv_in, LC3_INT32 Lprot, LC3_INT32 delta_corr, LC3_FLOAT *corr_phase_dbg, + LC3_INT32 t_adv_in, LC3_INT32 Lprot, LC3_INT32 delta_corr, +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT16 fadeout, /* need for DC muting */ + LC3_INT16* nonpure_tone_flag_ptr, +#endif + LC3_FLOAT *corr_phase_dbg, LC3_FLOAT *X_i_new_re_dbg, LC3_FLOAT *X_i_new_im_dbg) { LC3_INT32 i, i2, lprotBy2Minus1, one_peak_flag_mask, noise_mag_scale; LC3_INT32 t_adv; - LC3_FLOAT corr_phase[MAX_PLC_NPLOCS] = {0}; - LC3_FLOAT cos_F, mag_chg_local, alpha_local, beta_local, tmp; + LC3_FLOAT corr_phase[MAX_PLC_NPLOCS] = {0}; + LC3_FLOAT cos_F, mag_chg_local, alpha_local, beta_local, tmp; Complex X_i, X_i_new; LC3_INT32 segmentLen, e; LC3_FLOAT Xph; LC3_FLOAT seed_local; - LC3_INT32 binCounter, subInd; - + LC3_INT32 binCounter = 1, subInd = 0; +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT16 fs_idx; +#endif + UNUSED(corr_phase_dbg); UNUSED(X_i_new_re_dbg); UNUSED(X_i_new_im_dbg); seed_local = (LC3_FLOAT) *seed; - - lprotBy2Minus1 = imin(320, Lprot/2 - 1); /* limit to 20 KHz */ - + lprotBy2Minus1 = imin(320, Lprot/2 - 1); /* limit to 20 KHz */ t_adv = t_adv_in + time_offs; @@ -49,15 +61,33 @@ void plc_phEcu_subst_spec(LC3_INT32* plocs, LC3_INT32 n_plocs, LC3_FLOAT* f0est, corr_phase[i] = (LC3_FLOAT)2.0 * (LC3_FLOAT)M_PI * (f0est[i]/Lprot)*(LC3_FLOAT)t_adv; } - // EVOLVE PHASE ----------------- - binCounter = 1; - subInd = 0; one_peak_flag_mask = -1; +#ifdef CR8_A_PLC_FADEOUT_TUNING + fs_idx = (LC3_INT16)LC3_FLOOR((LC3_FLOAT)Lprot / 160.0); /* aquire, fs_idx for 10 ms frame sizes */ + if (n_plocs < 3 && n_plocs > 0) + { + one_peak_flag_mask = 0; /* initial crude single tone detection, only using n_plocs as a result from peak_locator() dynamics as input */ + + if ( (*nonpure_tone_flag_ptr < 0 ) + && ( (fs_idx == 2) /*SemiSWB 24 kHz */ || (fs_idx >= 4) /* FB 48 kHz */ ) + ) + { + /* in the first lost frame analyze spectra to possibly reverse initial pure sine assumption */ + *nonpure_tone_flag_ptr = plc_phEcu_nonpure_tone_ana(plocs, n_plocs, X, Xavg, Lprot ); + } + + if ( *nonpure_tone_flag_ptr > 0 ) { + one_peak_flag_mask = -1; /* actually revert single pure tone detection */ /* 0-> mute all surrounding valley bins in evolution , 0xff -> generate noise in all valleys */ + } + + } +#else if (n_plocs < 3 && n_plocs > 0) { one_peak_flag_mask = 0; } +#endif noise_mag_scale = 0; if (n_plocs == 0 || time_offs != 0) { @@ -69,6 +99,32 @@ void plc_phEcu_subst_spec(LC3_INT32* plocs, LC3_INT32 n_plocs, LC3_FLOAT* f0est, X[X_len-1] = realtoc(0); } +#ifdef CR8_A_PLC_FADEOUT_TUNING +#if 0 + /* align DC fs/2 muting to BASOP */ +#endif + /* binary selection of fadeout scheme */ + assert(PLC2_FADEOUT_LONG_IN_MS >= PLC2_FADEOUT_IN_MS_MIN && PLC2_FADEOUT_IN_MS >= PLC2_FADEOUT_IN_MS_MIN); + assert(PLC2_FADEOUT_LONG_IN_MS <= PLC2_FADEOUT_IN_MS_MAX && PLC2_FADEOUT_IN_MS <= PLC2_FADEOUT_IN_MS_MAX); + i = (PLC2_FADEOUT_IN_MS - PLC2_FADEOUT_IN_MS_MIN) / PLC2_FADEOUT_RES; + + if (fadeout != 0) + { + i = (PLC2_FADEOUT_LONG_IN_MS - PLC2_FADEOUT_IN_MS_MIN) / PLC2_FADEOUT_RES; + } + + /* calculate local burst_len for securing DC and fs/2 muting */ + i2 = (time_offs / ((Lprot * 100) / 160)) + 1; /* burst_len */ + + if (i2 > (fade_scheme_tab[i][1] + 1)) + { + /* start DC scaling attenuation */ + X[0].r = alpha[0] * X[0].r; + + /* start fs/by2 attenuation */ + X[X_len - 1].r = alpha[(xavg_N_grp[fs_idx] - 1)] * X[X_len - 1].r; + } +#endif if (n_plocs != 0) { for (i = 0; i < n_plocs; i++) { @@ -221,11 +277,11 @@ void plc_phEcu_subst_spec(LC3_INT32* plocs, LC3_INT32 n_plocs, LC3_FLOAT* f0est, } static LC3_INT32 own_rand(LC3_INT32 seed) { - LC3_INT32 retSeed; - assert(seed <= 32767 && seed >= -32768); - retSeed = (13849 + (seed + 32768) * 31821) & 65535; - retSeed -= 32768; - assert(retSeed <= 32767 && retSeed >= -32768); + LC3_INT32 retSeed; + assert(seed <= 32767 && seed >= -32768); + retSeed = (13849 + (seed + 32768) * 31821) & 65535; + retSeed -= 32768; + assert(retSeed <= 32767 && retSeed >= -32768); return retSeed; } @@ -245,3 +301,164 @@ static LC3_INT32 rand_phase(LC3_INT32 seed_in, LC3_FLOAT* cos_F) { return (LC3_INT32) seed; } + +#ifdef CR8_A_PLC_FADEOUT_TUNING + +static LC3_INT16 plc_phEcu_nonpure_tone_ana(const LC3_INT32* plocs, const LC3_INT32 n_plocs, const Complex* X, const LC3_FLOAT* Xavg, const LC3_INT32 Lprot) +{ + + LC3_INT16 nonpure_tone_detect; + LC3_INT16 n_ind, tone_ind, low_ind, high_ind; + LC3_FLOAT peak_amp, peak_amp2, valley_amp, x_abs[(1 + 2 * ONE_SIDED_SINE_WIDTH + 2 * 1)]; + LC3_INT16 sineband_ind_low, sineband_ind_high; + LC3_INT16 i, fs_idx, N_grp; + LC3_FLOAT tmp, tmp_dB, tot_inc_HF, tot_inc_LF; + + + + /* use compressed hearing sensitivity curve to allow more deviation in highest and lowest bands */ + /* ROM table LC3_FLOAT scATHFx[MAX_LGW - 1] */ + + /* init */ + nonpure_tone_detect = 0; + tot_inc_HF = 0.0; + tot_inc_LF = 0.0; + + /* limit single sine optimization to when 2 peaks are close enough to represent a single sinusoid */ + if (n_plocs == 2 && (plocs[1] - plocs[0]) >= ONE_SIDED_SINE_WIDTH) /* NB, plocs is an ordered vector */ + { + nonpure_tone_detect |= 0x1; + } + + /* local bin wise dynamics analysis, if 2 peaks, we do the analysis based on the location of the largest peak */ + { + tone_ind = 0; + plc_phEcu_fft_spec2_sqrt_approx(&(X[plocs[0]]), 1, &peak_amp); /* get 1st peak amplitude = approx_sqrt(Re^2+Im^2) */ + + + if ((n_plocs - 2) == 0) + { + plc_phEcu_fft_spec2_sqrt_approx(&(X[plocs[1]]), 1, &peak_amp2); /* get 2nd peak amplitude */ + if (peak_amp2 > peak_amp) + { + tone_ind = 1; + peak_amp = peak_amp2; + } + } + + low_ind = MAX(1, plocs[tone_ind] - (ONE_SIDED_SINE_WIDTH + 1)); /* DC is not allowed as valley */ + high_ind = MIN((Lprot >> 1) - 2, plocs[tone_ind] + (ONE_SIDED_SINE_WIDTH + 1)); /* Fs/2 is not allowed as valley */ + + n_ind = high_ind - low_ind + 1; + + /* find lowest amplitudes around the assumed main lobe center location */ + plc_phEcu_fft_spec2_sqrt_approx(&(X[low_ind]), n_ind, x_abs); + valley_amp = peak_amp; + for (i = 0; i < n_ind; i++) { + valley_amp = MIN(x_abs[i], valley_amp); + } + + /* at least a localized amplitude ratio of 16 (24 dB) required to declare a pure sinusoid */ + if (peak_amp < 16 * valley_amp) /* 1/16 easily implemented in BASOP */ + { + + nonpure_tone_detect |= 0x2;/* not a pure tone due to too low local SNR */ + + } + } + + /* analyze LF/ HF bands energy dynamics vs the assumed single tone band ( one or two peaks found) */ + { + fs_idx = (LC3_INT16)floor(Lprot / 160); /* fs_idx */ + assert(fs_idx < 5); + + /* Xavg , is a vector of rather rough MDCT based band energy estimates in perceptually motivated bands. from approx the last 26 ms of synthesis */ + + /* eval amplitude relations for assumed tonal band vs lower and higher bands */ + N_grp = xavg_N_grp[fs_idx]; /* { 4 NB , 5 WB , 6 SSWB , 7 SWB, 8 FB }; */ + + /* establish band(s) with assumed sinusoid tone */ + /* if tone freq location is below first MDCT-band definition, use first band as location anyway */ + i = 0; /* band 0 , 1 , 2 , 3 , ...*/ + while (plocs[tone_ind] >= gwlpr[i + 1]) { /* gwplr= [ 1, 12(750Hz), 20(1250Hz) , 36 , .. */ + /* dct-inds "0"...11, 12...19, 20...35, 36 ... */ + i++; + } + sineband_ind_low = i; + sineband_ind_high = i; /* typically in the same band as low */ + + /* a single tone may end up on a band border + , handle case when assumed tone is more or less right in between two perceptual bands +/-4 62.5 Hz */ + if ((sineband_ind_high > 0) && + (plocs[tone_ind] - ONE_SIDED_SINE_WIDTH) >= gwlpr[sineband_ind_high + 1] + ) { + sineband_ind_low = sineband_ind_high - 1; + } + + if ( (sineband_ind_low < (N_grp - 1)) && + (plocs[tone_ind] + ONE_SIDED_SINE_WIDTH) >= gwlpr[sineband_ind_low + 1] + ) { + sineband_ind_high = sineband_ind_low + 1; + } + } + + + + /* intraframe(26 ms), weighted LB and HB envelope dynamics/variation analysis */ + /* envelope analysis , + require at least two HF or two LF bands in the envelope taper/roll-off analysis , otherwise skip this condition */ + + + if (nonpure_tone_detect == 0 && + (((sineband_ind_high + 2) < N_grp) || + ((sineband_ind_low - 2) >= 1) + ) + ) + { + /* delta taper-off analysis solution, less sensitive to input bandwidth limitation and levels */ + +#if 0 + /* note: in BASOP the Xavg ratios below are calculated in log2 domain on a maximally upshifted Xavg vector. + if Xavg is an all zero vector in BASOP, then the nonpure_tone_detect flag is or'ed with 0x100 , + to trigger normal valley noise generation */ +#endif + + /* verify that an assumed clean sine does not have any odd HF content indications by thresholding the accumulated delta rise in LF/HF side lobes */ + for (i = (sineband_ind_high + 1); i < (N_grp - 1); i++) { + tmp = (Xavg[i + 1] + LC3_EPS) / (Xavg[i] + LC3_EPS); + tmp_dB = 20.0*LC3_LOGTEN(tmp); + if ((Xavg[i] + LC3_EPS) > (Xavg[i + 1] + LC3_EPS)) { + tmp_dB = 0; + } + tot_inc_HF += scATHFx[i] * tmp_dB; /* i is ATH factor between band i, i+1 based on Hearing sensitivity */ + } + + /* verify that an assumed clean sine does not have any odd LF content by thresholding the accumulated LF reverse up tilt */ + for (i = MAX(0, (sineband_ind_low - 1)); i > 0; i--) { + tmp = (Xavg[i - 1] + LC3_EPS) / (Xavg[i] + LC3_EPS); + tmp_dB = 20.0*LC3_LOGTEN(tmp); /* switch to log2() to simplify BASOP */ + + if ((Xavg[i - 1] + LC3_EPS) < (Xavg[i] + LC3_EPS)) { + tmp_dB = 0; + } + tot_inc_LF += scATHFx[i - 1] * tmp_dB; /* "psycho" scale using i-1 is ATH factor between band i-1, i , based on Hearing sensitivity */ + } + + if (tot_inc_HF > 4.5){ /* 4.5 dB in log2 is 0.7474 */ + nonpure_tone_detect |= 0x10; /* still not a pure tone, too great HF side increase */ + } + + if (tot_inc_LF > 4.5) { /* 4.5 dB limit in 4.5 = 20log10(x) corresponds to limit value 0.7474 in log2(x) */ + nonpure_tone_detect |= 0x20; /* still not a pure tone, too great accumulated LF side increase */ + } + + /* verify that an assumed clean sine does not have any odd LF+HF content by thresholding the accumulated LF+HF unexpected tilt */ + if ((tot_inc_LF + tot_inc_HF) > 6.0) { /* 6 dB limit in 20log10(x) corresponds to limit value 1.0 in log2(x) */ + nonpure_tone_detect |= 0x40; /* still not a pure tone, to great LF+HF side variation/increase */ + } + } /* bands available*/ + + return nonpure_tone_detect; +} +#endif /* CR8_A_PLC_FADEOUT_TUNING */ + diff --git a/lib_lc3plus/plc_phecu_tba_per_band_gain.c b/lib_lc3plus/plc_phecu_tba_per_band_gain.c index 9f585f28dd..507f45a647 100644 --- a/lib_lc3plus/plc_phecu_tba_per_band_gain.c +++ b/lib_lc3plus/plc_phecu_tba_per_band_gain.c @@ -1,19 +1,19 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + #include "options.h" #include "defines.h" #include "functions.h" -void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FLOAT *gr_pow_right, LC3_FLOAT *trans, LC3_FLOAT *grp_pow_change) +void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FLOAT *gr_pow_right, LC3_FLOAT *trans, LC3_FLOAT *grp_pow_change) { LC3_INT32 i; @@ -39,6 +39,5 @@ void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FL } - return; + return; } - diff --git a/lib_lc3plus/plc_phecu_tba_spect_Xavg.c b/lib_lc3plus/plc_phecu_tba_spect_Xavg.c index 600b9714e4..b4727cfd4c 100644 --- a/lib_lc3plus/plc_phecu_tba_spect_Xavg.c +++ b/lib_lc3plus/plc_phecu_tba_spect_Xavg.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c b/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c index e5f0d3caae..3b58d92b42 100644 --- a/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c +++ b/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -40,11 +40,29 @@ const LC3_INT32 POW_ATT_TABLE0[OFF_FRAMES_LIMIT + 1] = { 32767, 31293, 29885, 28 #ifdef PLC2_FADEOUT_IN_MS #if PLC2_FADEOUT_IN_MS == 0 -/* default setting only requieres two tables */ +#ifndef CR8_A_PLC_FADEOUT_TUNING +/* default setting only requires two tables */ const Word16* const POW_ATT_TABLES[1 + 2] = { NULL, POW_ATT_TABLE1/*1 0.3dB steps */ , POW_ATT_TABLE0/*2 0.4 dB steps*/, }; +#endif #else + +#ifdef CR8_A_PLC_FADEOUT_TUNING +const LC3_INT32 POW_ATT_TABLE_p3x9_14_7[OFF_FRAMES_LIMIT + 1] = { + 32767, + 31656, 30581, 29543, 28540, 27571, 26635, 25731, 24857, 24013, /* 9 times .3dB steps , 14 6 dB steps, 7 muted steps */ + 12007, 6003, 3002, 1501, 750, 375, 188, 94, 47, 23, 12, 6, 3, 1, + 0, 0, 0, 0, 0, 0, 0 }; + +const LC3_INT32 POW_ATT_TABLE_p4x9_14_7[OFF_FRAMES_LIMIT + 1] = +{ 32767, + 31293, 29885, 28540, 27255, 26029, 24857, 23738, 22670, 21650, /* 9 times .4dB steps , 14 6 dB steps, 7 muted steps */ + 10825, 5413, 2706, 1353, 677, 338, 169, 85, 42, 21, 11, 5, 3, 1, + 0, 0,0,0,0,0,0 }; +#endif + + const LC3_INT32 POW_ATT_TABLE_p3x8_6[] = { 32767, 31656, 30581, 29543, 28540, 27571, 26635, 25731, 12865, 6433, 3216, 1608, 804, 402, 201, 101, 50, 25, 13, 6, @@ -81,6 +99,23 @@ const LC3_INT32 POW_ATT_TABLE_p4x1_6[OFF_FRAMES_LIMIT + 1] = { 32, 16, 8, 4, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +#ifdef CR8_A_PLC_FADEOUT_TUNING +#if 0 +/* POW_ATT_TABLES now ordered logically based on initial slow muting phase time */ +/* POW_ATT_TABLES[ind] is used after the initial gain==1.0 no energy muting phase */ +#endif +const LC3_INT32 *const POW_ATT_TABLES[1 + 12] = +{ NULL, +/*0.3dB col , 0.4dB col */ +/* 1*/POW_ATT_TABLE_p3x1_6, POW_ATT_TABLE_p4x1_6, /* 0 0.3dB, 16 6dB, 14mute */ /* 0.4dB version */ /* old short mute tabs */ +/* 3*/POW_ATT_TABLE_p3x2_6, POW_ATT_TABLE_p4x2_6, /* 1 0.3dB, 15 6dB ,14mute */ /* 0.4dB version */ +/* 5*/POW_ATT_TABLE_p3x4_6, POW_ATT_TABLE_p4x4_6, /* 3 0.3dB, 15 6dB , 12 mute */ /* 0.4dB version */ +/* 7*/POW_ATT_TABLE_p3x8_6, POW_ATT_TABLE_p4x8_6, /* 7 0.3dB, 15 6dB , 8 mute */ /* 0.4dB version */ +/* 9*/POW_ATT_TABLE_p3x9_14_7, POW_ATT_TABLE_p4x9_14_7, /* 9 0.3dB, 14 6dB , 7 mute */ /* 0.4dB version */ /* opt 120 ms */ +/*11*/POW_ATT_TABLE1, POW_ATT_TABLE0, /* 15 0.3dB, 14 6dB , 1 mute */ /* 0.4dB version */ /* original curves */ +}; + +#else const LC3_INT32* const POW_ATT_TABLES[1 + 10] = { NULL, @@ -90,13 +125,18 @@ const LC3_INT32* const POW_ATT_TABLES[1 + 10] = POW_ATT_TABLE_p3x2_6, POW_ATT_TABLE_p4x2_6, /* .3dB x2, 30 6dB steps */ /* .4dB x2, 30 6dB steps */ POW_ATT_TABLE_p3x1_6, POW_ATT_TABLE_p4x1_6 /* .3dB x1, 30 6dB steps */ /* .4dB x1, 30 6dB steps */ }; +#endif #endif #endif void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *grp_pow_change, LC3_FLOAT *stPhECU_beta_mute, LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_FLOAT *ph_dith, LC3_INT32 *tr_dec, - LC3_FLOAT *att_val, LC3_INT32 *attDegreeFrames_dbg, LC3_FLOAT *thresh_dbg) + LC3_FLOAT *att_val, LC3_INT32 *attDegreeFrames_dbg, LC3_FLOAT *thresh_dbg +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif + ) { LC3_INT32 i; @@ -108,14 +148,19 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL LC3_INT32 burst_att_thresh; LC3_INT32 att_per_frame_idx; LC3_INT32 att_always, attDegreeFrames; - +#ifndef CR8_A_PLC_FADEOUT_TUNING LC3_INT32 FADEOUT_IN_MS, PLC_P800_SPEECH_FADEOUT_IN_FRAMES, PLC2_FADEOUT_IN_FRAMES, BURST_ATT_THRESH_PRE; +#endif const LC3_INT32 *TABLEQ15; +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT32 beta_mute_thr; /* time threshold in 10 ms frames to start beta - noise attenuation */ +#endif +#ifndef CR8_A_PLC_FADEOUT_TUNING LC3_INT32 BURST_ATT_THRESH; /* start attenuate with losses in a row, also starts FADE2AVG actions */ - LC3_INT32 ATT_PER_FRAME; /* initial msuic attenuation table ptr, actually implemented in table lookup! */ + LC3_INT32 ATT_PER_FRAME; /* initial msuic attenuation table ptr, actually implemented in table lookup! */ LC3_INT32 BETA_MUTE_THR; /* time threshold in 10 ms frames to start beta - noise attenuation */ - +#endif UNUSED(attDegreeFrames_dbg); /* constants setup */ @@ -123,32 +168,31 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL XavgFadeinFactor = -1.0; - if (PLC2_FADEOUT_IN_MS != 0) +#ifndef CR8_A_PLC_FADEOUT_TUNING + if (PLC2_FADEOUT_IN_MS < 0) { - if (PLC2_FADEOUT_IN_MS < 0) - { - FADEOUT_IN_MS = PLC_FADEOUT_IN_MS; /* % use TDC - SETTING as input */ - } - else - { - FADEOUT_IN_MS = PLC2_FADEOUT_IN_MS; /* % use a PLC2 individual settinsg */ - } - - PLC_P800_SPEECH_FADEOUT_IN_FRAMES = (LC3_INT32) LC3_FLOOR((LC3_FLOAT)FADEOUT_IN_MS / (LC3_FLOAT)10.0); /* % nominal svaleu for speech */ + FADEOUT_IN_MS = PLC_FADEOUT_IN_MS; /* % use TDC - SETTING as basic input */ + } + else + { + FADEOUT_IN_MS = PLC2_FADEOUT_IN_MS; /* % use a PLC2 individual settings */ + } +#endif - PLC2_FADEOUT_IN_FRAMES = MIN(OFF_FRAMES_LIMIT, MAX(6, 3 * PLC_P800_SPEECH_FADEOUT_IN_FRAMES)); /* for PLC2 we typically maintain energy 3x longer */ +#ifndef CR8_A_PLC_FADEOUT_TUNING + PLC_P800_SPEECH_FADEOUT_IN_FRAMES = (LC3_INT32)LC3_FLOOR((LC3_FLOAT)FADEOUT_IN_MS / (LC3_FLOAT)10.0); /* % nominal value for speech */ - BURST_ATT_THRESH_PRE = MIN(5, MAX(1, (1 * PLC2_FADEOUT_IN_FRAMES) / 6)); /* nominal 20-40 ms to start actual muting, will be thresh +1 fot assumed music */ + PLC2_FADEOUT_IN_FRAMES = MIN(OFF_FRAMES_LIMIT, MAX(6, 3 * PLC_P800_SPEECH_FADEOUT_IN_FRAMES)); /* for PLC2 we typically maintain energy 3x longer */ - ATT_PER_FRAME = MIN(10, MAX(2, 2 * (6 - BURST_ATT_THRESH_PRE))); /* % we let the BURST_ATT_thresh control the initial table selection */ - BURST_ATT_THRESH = MIN(BURST_ATT_THRESH_PRE, 4); - BETA_MUTE_THR = MIN(4 + (OFF_FRAMES_LIMIT / 2) + 1, MAX(4, BURST_ATT_THRESH + 1 + (LC3_INT32)LC3_POW((LC3_FLOAT)2.0,BURST_ATT_THRESH_PRE - (LC3_FLOAT)1))); /* nominal time to start mandatory decrease of Xavg */ - } + BURST_ATT_THRESH_PRE = MIN(5, MAX(1, (1 * PLC2_FADEOUT_IN_FRAMES) / 6)); /* nominal 20-40 ms to start actual muting, will be thresh +1 */ + ATT_PER_FRAME = MIN(10, MAX(2, 2 * (6 - BURST_ATT_THRESH_PRE))); /* % we let the BURST_ATT_thresh control the initial table selection */ + BURST_ATT_THRESH = MIN(BURST_ATT_THRESH_PRE, 4); + BETA_MUTE_THR = MIN(4 + (OFF_FRAMES_LIMIT / 2) + 1, MAX(4, BURST_ATT_THRESH + 1 + (LC3_INT32)LC3_POW((LC3_FLOAT)2.0, BURST_ATT_THRESH_PRE - (LC3_FLOAT)1))); /* nominal time to start mandatory decrease of Xavg */ - - /* Initialize in the same way as done in trans_burst_ana_fx(), even though this is not really needed */ +/* Initialize in the same way as done in trans_burst_ana_fx(), even though this is not really needed */ burst_att_thresh = BURST_ATT_THRESH; att_per_frame_idx = ATT_PER_FRAME; +#endif /* 10ms constants */ @@ -158,10 +202,26 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL max_increase_grp_pow_lin = (LC3_FLOAT)1.0*LC3_POW((LC3_FLOAT)10.0, max_increase_grp_pow / (LC3_FLOAT)10.0)*(LC3_FLOAT)(32767.0 / 32768.0); +#ifndef CR8_A_PLC_FADEOUT_TUNING /* envelope setting */ burst_att_thresh = BURST_ATT_THRESH + 1; att_per_frame_idx = ATT_PER_FRAME - 1; +#endif +#ifdef CR8_A_PLC_FADEOUT_TUNING + if (plc_fadeout_type != 0) + { + i = (PLC2_FADEOUT_LONG_IN_MS - PLC2_FADEOUT_IN_MS_MIN) / PLC2_FADEOUT_RES; /*a long fading table entry in fade_scheme_tab */ + } else { + i = (PLC2_FADEOUT_IN_MS - PLC2_FADEOUT_IN_MS_MIN) / PLC2_FADEOUT_RES; /* a shorter fading entry in fade_scheme_tab */ + } + assert(i >= 0 && i <= ((PLC2_FADEOUT_IN_MS_MAX - PLC2_FADEOUT_IN_MS_MIN) / PLC2_FADEOUT_RES) && "fade_scheme_tab index error"); + + att_per_frame_idx = fade_scheme_tab[i][0]; + burst_att_thresh = fade_scheme_tab[i][1]; /* number of 1.0 frames before muting/mixing phase */ + /* band gain muting may can take place earlier due to a band transient */ + beta_mute_thr = fade_scheme_tab[i][2]; /* muting of Xavg contribution start when slow fadeout is over */ +#endif attDegreeFrames = 0; if (burst_len > burst_att_thresh) @@ -203,7 +263,6 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL /* transient processing */ /* transients may be both rise and decay transients !! */ - if(LC3_FABS(grp_pow_change[i]) >= thresh_tr_dB) { @@ -233,13 +292,20 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL assert(burst_len >= 2); /* states used here */ tr_dec[i] = 0; +#ifndef CR8_A_PLC_FADEOUT_TUNING if (PLC_FADEOUT_IN_MS > 0) +#endif { +#ifdef CR8_A_PLC_FADEOUT_TUNING + assert(att_per_frame_idx >= 1 && att_per_frame_idx <= (10+2)); +#else assert(att_per_frame_idx >= 1 && att_per_frame_idx <= 10); +#endif TABLEQ15 = POW_ATT_TABLES[att_per_frame_idx]; att_val[i] = (LC3_FLOAT)1.0 * ( (LC3_FLOAT) TABLEQ15[MIN(OFF_FRAMES_LIMIT, attDegreeFrames )] / (LC3_FLOAT)32768.0); /* Table idx 0...N-1 therefore no + 1 */ att_val[i] = att_val[i]; } +#ifndef CR8_A_PLC_FADEOUT_TUNING else { @@ -252,7 +318,7 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL att_val[i] = (LC3_FLOAT)1.0 * ( (LC3_FLOAT)POW_ATT_TABLE1[MIN(OFF_FRAMES_LIMIT, attDegreeFrames)] / (LC3_FLOAT)32768.0); } } - +#endif if ( (att_val[i] != 0) && (att_val[i] * (LC3_FLOAT)32768.0 < (LC3_FLOAT)0.5) ) { @@ -270,8 +336,12 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL } - +#ifdef CR8_A_PLC_FADEOUT_TUNING + /* note beta_mute decreased once per frame, not once per band */ + if (i == 0 && burst_len > beta_mute_thr) +#else if(burst_len > BETA_MUTE_THR) +#endif { *stPhECU_beta_mute = *stPhECU_beta_mute * (LC3_FLOAT)BETA_MUTE_FAC; } diff --git a/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c b/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c index c860cd6ce3..d4d8f15e20 100644 --- a/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c +++ b/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c @@ -1,22 +1,28 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + #include "options.h" #include "defines.h" #include "functions.h" -void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape, - LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape, + + +void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape, + LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape, LC3_FLOAT *old_EwPtr, LC3_FLOAT *stPhECU_beta_mute, - LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg) + LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg +#ifdef CR8_A_PLC_FADEOUT_TUNING + , LC3_UINT8 plc_fadeout_type +#endif +) { LC3_FLOAT gr_pow_left[MAX_LGW]; LC3_FLOAT gr_pow_right[MAX_LGW]; @@ -28,7 +34,7 @@ void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_IN LC3_INT32 attDegreeFrames; LC3_FLOAT thresh_dbg; - + UNUSED(tr_dec_dbg); UNUSED(gpc_dbg); @@ -40,8 +46,13 @@ void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_IN } + plc_phEcu_tba_trans_dect_gains(burst_len, n_grp, grp_pow_change, stPhECU_beta_mute, stPhECU_mag_chg_1st, alpha, beta, mag_chg, ph_dith, tr_dec, att_val, &attDegreeFrames, &thresh_dbg +#ifdef CR8_A_PLC_FADEOUT_TUNING + , plc_fadeout_type +#endif + ); + - plc_phEcu_tba_trans_dect_gains(burst_len, n_grp, grp_pow_change, stPhECU_beta_mute, stPhECU_mag_chg_1st, alpha, beta, mag_chg, ph_dith, tr_dec, att_val, &attDegreeFrames, &thresh_dbg); return; } diff --git a/lib_lc3plus/plc_tdc.c b/lib_lc3plus/plc_tdc.c index 1a1a408f4d..89d7455433 100644 --- a/lib_lc3plus/plc_tdc.c +++ b/lib_lc3plus/plc_tdc.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -8,11 +8,11 @@ ******************************************************************************/ -#include "options.h" /***************************************************************************\ * contents/description: Main function for Time domain concealment \***************************************************************************/ +#include "options.h" #include #include "functions.h" @@ -61,6 +61,9 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, LC3_FLOAT* gain_c, LC3_FLOAT* alpha, LC3_FLOAT* synth +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + ,LC3_UINT8 plc_fadeout_type +#endif ) { LC3_FLOAT step, step_n; @@ -77,6 +80,9 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, LC3_FLOAT alphaPrev; LC3_FLOAT throttle; LC3_INT32 frame_dms_idx, nbLostFramesInRow_mod; +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + LC3_INT32 plc_fadeout_len = 0; +#endif memset(synth_mem, 0, M * sizeof(LC3_FLOAT)); memset(scratchSpace, 0, (MAX_LEN_PCM_PLC + MDCT_MEM_LEN_MAX + MAX_LEN_PCM_PLC + 1 + M) * sizeof(LC3_FLOAT)); @@ -91,7 +97,20 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, beforeNextInc = beforeNextIncArray[frame_dms_idx][nbLostFramesInRow_mod]; nextInc = nextIncArray [frame_dms_idx][nbLostFramesInRow_mod]; +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + if (plc_fadeout_type == 1){ + plc_fadeout_len = PLC_FADEOUT_TYPE_1_IN_MS; + } + else{ + plc_fadeout_len = PLC_FADEOUT_IN_MS; + } +#endif + +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + if (nbLostCmpt_loc > plc_fadeout_len/10) +#else if (nbLostCmpt_loc > PLC_FADEOUT_IN_MS/10) +#endif { gain_p = 0; *gain_c = 0; @@ -198,7 +217,14 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, { alphaPrev = *alpha; } - + +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + if (plc_fadeout_type == 2){ + *alpha = LC3_POW(0.5,(nbLostFramesInRow + LC3_ROUND(100.0/frame_dms) - 1) * frame_dms/100.0); + } + else{ +#endif + if (nextInc != 0) { switch (nbLostCmpt_loc) @@ -231,7 +257,14 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, switch (frame_dms) { case 25: *alpha *= PLC34_ATTEN_FAC_025; break; +#ifdef CR9_J_SLOW_TDC_FADEOUT + case 50: *alpha *= PLC34_ATTEN_FAC_025; break; +#else case 50: *alpha *= PLC34_ATTEN_FAC_050; break; +#endif +#ifdef CR8_G_ADD_75MS + case 75: *alpha *= PLC34_ATTEN_FAC_075; break; +#endif case 100: *alpha *= PLC34_ATTEN_FAC_100; break; } } @@ -240,7 +273,9 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, { gain_p = *alpha; } - +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + } +#endif /*---------------------------------------------------------------* * Construct the harmonic part * * Last pitch cycle of the previous frame is repeatedly copied. * @@ -377,7 +412,11 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, *----------------------------------------------------------*/ if (beforeNextInc != 0) { +#ifdef CR9_I_INC_TDC_FADEOUT_LEN + if (nbLostCmpt_loc == plc_fadeout_len/10) +#else if (nbLostCmpt_loc == PLC_FADEOUT_IN_MS/10) +#endif { gain_h = 1; step = 1.0f/(LC3_FLOAT)N; diff --git a/lib_lc3plus/plc_tdc_tdac.c b/lib_lc3plus/plc_tdc_tdac.c index 329361b14c..3c8e99b0e6 100644 --- a/lib_lc3plus/plc_tdc_tdac.c +++ b/lib_lc3plus/plc_tdc_tdac.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_update.c b/lib_lc3plus/plc_update.c index a151420eb7..4ec4e86341 100644 --- a/lib_lc3plus/plc_update.c +++ b/lib_lc3plus/plc_update.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -7,8 +7,8 @@ * estoppel or otherwise. * ******************************************************************************/ -#include "functions.h" #include "options.h" +#include "functions.h" void processPlcUpdate_fl(PlcAdvSetup *PlcAdvSetup, LC3_INT32 frame_length, LC3_FLOAT *syntM, LC3_FLOAT *scf_q, diff --git a/lib_lc3plus/quantize_spec.c b/lib_lc3plus/quantize_spec.c index 7886b4586d..01339f99bd 100644 --- a/lib_lc3plus/quantize_spec.c +++ b/lib_lc3plus/quantize_spec.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,80 +11,143 @@ #include "options.h" #include "functions.h" -static LC3_INT sign(LC3_FLOAT x); - -LC3_INT sign(LC3_FLOAT x) +LC3_INT32 find_last_nz_pair(LC3_INT32 x[], LC3_INT32 length); +LC3_INT32 find_last_nz_pair(LC3_INT32 x[], LC3_INT32 length) { - if (x > 0) - return 1; + LC3_INT32 last_nz, lobs[4]; LC3_INT32 stage, i; + + lobs[0] = 4; + + lobs[1] = (length >> 1); /* length/2 */ + + lobs[2] = (lobs[1]+ (length >> 2)); + + lobs[3] = (lobs[2]+ (length >> 3)); + - if (x < 0) - return -1; + last_nz = 0; + + i = length; + + for (stage = 3; stage >= 0; --stage) + { + /* unmapped kernel */ + for (; i >= lobs[stage]; i -= 2) + { + if (x[i - 2] != 0) + { + last_nz = MAX(last_nz, i); + } + if (x[i - 1] != 0) + { + last_nz = MAX(last_nz, i); + } + } + if (last_nz > 0) + { + break; + } + } - return 0; + return MAX(last_nz, 2); } + void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT nt, LC3_INT totalBits, LC3_INT* nbits, LC3_INT* nbits2, LC3_INT fs, LC3_INT* lastnzout, LC3_INT* codingdata, LC3_INT* lsbMode, LC3_INT mode, LC3_INT target, LC3_INT hrmode) { - LC3_INT rateFlag = 0, i = 0, lastnz2 = 0, m = 0, maxlev = 0, k = 0; - LC3_INT nbits_lsb = 0; - LC3_INT c = 0; - LC3_INT a = 0, b = 0, lev1 = 0, sym = 0, t = 0, pki = 0; - LC3_INT a1_msb = 0, b1_msb = 0; - LC3_INT lastnz = 1; + LC3_INT rateFlag, i, lastnz2, m, maxlev, k; + LC3_INT nbits_lsb; + LC3_INT c; + LC3_INT a, b, lev1, sym, t, pki; + LC3_INT a1_msb, b1_msb; + LC3_INT lastnz = 1, nt_half; LC3_FLOAT offset = 0.375; + LC3_INT32 bits, bits2; +#ifdef CR9_QUANT_SPEC_REWRITE + LC3_FLOAT inv_gain; +#endif + + assert(target >= 0); + + nbits_lsb = 0; + + nt_half = nt >> 1; + rateFlag = 0; c = 0; + if (hrmode) { offset = 0.5; } - /* Quantization */ + +#ifdef CR9_QUANT_SPEC_REWRITE + inv_gain = 1.0 / gain; +#endif + for (i = 0; i < nt; i++) { - xq[i] = trunc(x[i] / gain + offset * sign(x[i])); + if (x[i] > 0) + { +#ifdef CR9_QUANT_SPEC_REWRITE + xq[i] = (LC3_INT32) ( x[i] * inv_gain + offset); +#else + xq[i] = (LC3_INT32) ( x[i] / gain + offset); +#endif + } + else + { +#ifdef CR9_QUANT_SPEC_REWRITE + xq[i] = -((LC3_INT32) (-x[i] * inv_gain + offset)); +#else + xq[i] = -((LC3_INT32) (-x[i] / gain + offset)); +#endif + } if (hrmode == 0) { assert(xq[i] <= 32767 && xq[i] >= -32768); } } /* Rate flag */ - - if ((fs < 48000 && totalBits > 320 + (fs / 8000 - 2) * 160) || (fs == 48000 && totalBits > 800)) { + if (fs != 96000 && (totalBits > (160 + FS2FS_IDX(fs) * 160))) + { rateFlag = 512; } /* Init */ - if (mode == 0 && ((fs < 48000 && totalBits >= 640 + (fs / 8000 - 2) * 160) || (fs == 48000 && totalBits >= 1120))) { + if (fs != 96000 && (mode == 0 && (totalBits >= (480 + FS2FS_IDX(fs) * 160)))) + { mode = 1; } /* Last non-zero 2-tuple */ - for (i = nt - 2; i >= 2; i = i - 2) { if (xq[i + 1] != 0 || xq[i] != 0) { - lastnz = i + 1; + lastnz = i+2; break; } } - - if (mode < 0) { - lastnz2 = lastnz + 1; - } else { + if (mode < 0) + { + lastnz2 = lastnz; + } + else + { lastnz2 = 2; } - *nbits = 0; - *nbits2 = 0; + bits = bits2 = 0; /* Calculate number of estimated bits */ - for (k = 0; k < lastnz; k = k + 2) { + for (k = 0; k < lastnz; k = k + 2) + { t = c + rateFlag; - if (k > nt / 2) { + if (k > nt_half) + { t += 256; } @@ -94,29 +157,36 @@ void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT b = abs(xq[k + 1]); m = MAX(a, b); - if (m == 0) { + if (m == 0) + { maxlev = -1; - } else { + } + else + { maxlev = 29 - (clz_func(MAX(m, 3)) - 1); } codingdata[1] = maxlev; if (mode <= 0) { - *nbits = *nbits + MIN(a, 1) * 2048; - *nbits = *nbits + MIN(b, 1) * 2048; + bits = bits + (MIN(a, 1) << 11); + bits = bits + (MIN(b, 1) << 11); } lev1 = 0; - while (MAX(a, b) >= 4) { - pki = ari_spec_lookup_fl[t + lev1 * 1024]; - *nbits = *nbits + ari_spec_bits_fl[pki][16]; + while (MAX(a, b) >= 4) + { + pki = ari_spec_lookup_fl[t + lev1 * 1024]; + bits = bits + ari_spec_bits_fl[pki][16]; - if (lev1 == 0 && mode > 0) { + if (lev1 == 0 && mode > 0) + { nbits_lsb += 2; - } else { - *nbits = *nbits + 2 * 2048; + } + else + { + bits = bits + 2 * 2048; } a = a >> 1; @@ -127,68 +197,84 @@ void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT pki = ari_spec_lookup_fl[t + lev1 * 1024]; sym = a + 4 * b; codingdata[2] = sym; - codingdata += 3; - *nbits = *nbits + ari_spec_bits_fl[pki][sym]; + codingdata += 3; + bits = bits + ari_spec_bits_fl[pki][sym]; - if (mode > 0) { + if (mode > 0) + { a1_msb = abs(xq[k]); b1_msb = abs(xq[k + 1]); - if (lev1 > 0) { + if (lev1 > 0) + { a1_msb = a1_msb >> 1; b1_msb = b1_msb >> 1; - if (a1_msb == 0 && xq[k] != 0) { + if (a1_msb == 0 && xq[k] != 0) + { nbits_lsb++; } - if (b1_msb == 0 && xq[k + 1] != 0) { + if (b1_msb == 0 && xq[k + 1] != 0) + { nbits_lsb++; } } - *nbits = *nbits + MIN(a1_msb, 1) * 2048; - *nbits = *nbits + MIN(b1_msb, 1) * 2048; + bits = bits + (MIN(a1_msb, 1) << 11); + bits = bits + (MIN(b1_msb, 1) << 11); } - if (mode >= 0 && (abs(xq[k]) != 0 || abs(xq[k + 1]) != 0) && *nbits <= target * 2048) { + if (mode >= 0 && (abs(xq[k]) != 0 || abs(xq[k + 1]) != 0) && bits <= target * 2048) + { lastnz2 = k + 2; - *nbits2 = *nbits; + bits2 = bits; } lev1 = lev1 - 1; - if (lev1 <= 0) { + + if (lev1 <= 0) + { t = 1 + (a + b) * (lev1 + 2); - } else { + } + else + { t = 13 + lev1; } c = (c & 15) * 16 + t; } - /* Number of bits */ - *nbits = ceil((LC3_FLOAT)*nbits / 2048.0); + *nbits = (bits + 2047) >> 11; // Exactly same as ceil((LC3_FLOAT)*nbits / 2048.0); - if (mode >= 0) { - *nbits2 = ceil((LC3_FLOAT)*nbits2 / 2048.0); - } else { + if (mode >= 0) + { + *nbits2 = (bits2 + 2047) >> 11; //ceil((LC3_FLOAT)*nbits2 / 2048.0); + } + else + { *nbits2 = *nbits; } - if (mode > 0) { - *nbits += nbits_lsb; + if (mode > 0) + { + *nbits += nbits_lsb; *nbits2 += nbits_lsb; } /* Truncation of high-frequency coefficients */ - for (i = lastnz2; i <= lastnz; i++) { - xq[i] = 0; + if (lastnz > lastnz2) + { + memset(&xq[lastnz2], 0, (lastnz - lastnz2) * sizeof(*xq)); } /* Truncation of LSBs */ - if (mode > 0 && *nbits > target) { + if (mode > 0 && *nbits > target) + { *lsbMode = 1; - } else { + } + else + { *lsbMode = 0; } diff --git a/lib_lc3plus/reorder_bitstream.c b/lib_lc3plus/reorder_bitstream.c index 77b50d7a13..61880dbd09 100644 --- a/lib_lc3plus/reorder_bitstream.c +++ b/lib_lc3plus/reorder_bitstream.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/resamp12k8.c b/lib_lc3plus/resamp12k8.c index 0cab5daae9..fd8caad7c0 100644 --- a/lib_lc3plus/resamp12k8.c +++ b/lib_lc3plus/resamp12k8.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -16,15 +16,13 @@ void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3 { - LC3_INT len_12k8 = 0, N12k8 = 0, i = 0, k = 0; - LC3_FLOAT mac = 0, buf_out[120 + MAX_LEN] = {0}, bufdown[128] = {0}, buf[120 + MAX_LEN] = {0}; + LC3_INT len_12k8, N12k8, i, k; + LC3_FLOAT mac, bufdown[128], buf[120 + MAX_LEN]; LC3_INT32 index_int, index_frac, resamp_upfac, resamp_delay, resamp_off_int, resamp_off_frac; LC3_FLOAT u_11, u_21, u_1, u_2; - const LC3_FLOAT *filter; const LC3_FLOAT *filt_input, *filt_coeff; - switch (frame_dms) { case 25: @@ -33,6 +31,11 @@ void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3 case 50: len_12k8 = LEN_12K8 / 2; break; +#ifdef CR8_G_ADD_75MS + case 75: + len_12k8 = (LEN_12K8 / 4) * 3; + break; +#endif case 100: len_12k8 = LEN_12K8; break; @@ -46,8 +49,6 @@ void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3 memmove(&buf[mem_in_len], x, x_len * sizeof(LC3_FLOAT)); memmove(mem_in, &buf[x_len], mem_in_len * sizeof(LC3_FLOAT)); - - filter = lp_filter[fs_idx]; /* Upsampling & Low-pass Filtering & Downsampling */ @@ -97,11 +98,11 @@ void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3 mem_50[1] = (LC3_FLOAT)u_21; /* Output Buffer */ - memmove(buf_out, mem_out, mem_out_len * sizeof(LC3_FLOAT)); + memmove(buf, mem_out, mem_out_len * sizeof(LC3_FLOAT)); - memmove(&buf_out[mem_out_len], bufdown, len_12k8 * sizeof(LC3_FLOAT)); + memmove(&buf[mem_out_len], bufdown, len_12k8 * sizeof(LC3_FLOAT)); - memmove(y, buf_out, (*y_len + 1) * sizeof(LC3_FLOAT)); + memmove(y, buf, (*y_len + 1) * sizeof(LC3_FLOAT)); - memmove(mem_out, &buf_out[N12k8], mem_out_len * sizeof(LC3_FLOAT)); + memmove(mem_out, &buf[N12k8], mem_out_len * sizeof(LC3_FLOAT)); } diff --git a/lib_lc3plus/residual_coding.c b/lib_lc3plus/residual_coding.c index 42094d275f..bcd6637310 100644 --- a/lib_lc3plus/residual_coding.c +++ b/lib_lc3plus/residual_coding.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -19,7 +19,7 @@ void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_I LC3_INT iter=0; LC3_FLOAT offset; LC3_INT iter_max = 1; - LC3_INT nz_idx[MAX_LEN] = {0}; + LC3_INT nz_idx[MAX_LEN]; LC3_INT N_nz = 0, idx = 0; diff --git a/lib_lc3plus/residual_decoding.c b/lib_lc3plus/residual_decoding.c index 97fd94afc3..5085d999af 100644 --- a/lib_lc3plus/residual_decoding.c +++ b/lib_lc3plus/residual_decoding.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -18,7 +18,7 @@ void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec LC3_INT k = 0, n = 0; LC3_FLOAT offset1 = 0, offset2 = 0; LC3_FLOAT offset = 0; - LC3_INT nz_idx[MAX_LEN] = {0}; + LC3_INT nz_idx[MAX_LEN]; LC3_INT N_nz = 0, idx = 0; LC3_INT iter = 0, iter_max = 1; @@ -65,7 +65,7 @@ void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec break; } } - offset /= 2; + offset *= 0.5; iter ++; } } diff --git a/lib_lc3plus/setup_com_lc3.c b/lib_lc3plus/setup_com_lc3.c index 17054d1ffc..cecbfd7762 100644 --- a/lib_lc3plus/setup_com_lc3.c +++ b/lib_lc3plus/setup_com_lc3.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -7,8 +7,8 @@ * estoppel or otherwise. * ******************************************************************************/ -#include "functions.h" #include "options.h" +#include "functions.h" LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len) { diff --git a/lib_lc3plus/setup_dec_lc3.c b/lib_lc3plus/setup_dec_lc3.c index c14309720e..517a48b492 100644 --- a/lib_lc3plus/setup_dec_lc3.c +++ b/lib_lc3plus/setup_dec_lc3.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -19,8 +19,8 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) { - int ch = 0; - size_t size = sizeof(LC3PLUS_Dec); + int ch = 0; + size_t size = sizeof(LC3PLUS_Dec); size_t frame_len = DYN_MAX_LEN_EXT(samplerate); void *PlcAdvSetup = NULL; @@ -34,6 +34,11 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) HANDLE_IIS_FFT handle_fft_phaseecu; HANDLE_IIS_FFT handle_ifft_phaseecu; LC3_FLOAT *q_old_res; + +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT32 * plc_longterm_advc_tdc = NULL, *plc_longterm_advc_ns = NULL; + LC3_INT16 longterm_analysis_counter_max = 0, longterm_analysis_counter_max_bytebuffer = 0; +#endif for (ch = 0; ch < channels; ch++) { DecSetup* setup = balloc(decoder, &size, sizeof(DecSetup)); @@ -57,6 +62,15 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) sine_table1_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); sine_table2_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); + +#ifdef CR8_A_PLC_FADEOUT_TUNING + longterm_analysis_counter_max = plc_fadeout_param_maxlen[0]; + longterm_analysis_counter_max_bytebuffer = plc_fadeout_param_maxbytes[0]; + + + plc_longterm_advc_tdc = balloc(decoder, &size, sizeof(LC3_INT32) * longterm_analysis_counter_max_bytebuffer); + plc_longterm_advc_ns = balloc(decoder, &size, sizeof(LC3_INT32) * longterm_analysis_counter_max_bytebuffer); +#endif q_old_res = balloc(decoder, &size, sizeof(LC3_FLOAT) * frame_len); @@ -80,6 +94,14 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) setup->PlcAdvSetup->PlcPhEcuSetup.handle_fft_phaseecu->sine_table = sine_table1_phecu; setup->PlcAdvSetup->PlcPhEcuSetup.handle_ifft_phaseecu->sine_table = sine_table2_phecu; + +#ifdef CR8_A_PLC_FADEOUT_TUNING + setup->PlcAdvSetup->longterm_analysis_counter_max = longterm_analysis_counter_max; + setup->PlcAdvSetup->longterm_analysis_counter_max_bytebuffer = longterm_analysis_counter_max_bytebuffer; + + setup->PlcAdvSetup->plc_longterm_advc_tdc = plc_longterm_advc_tdc; + setup->PlcAdvSetup->plc_longterm_advc_ns = plc_longterm_advc_ns; +#endif setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Lprot = (CODEC_FS(samplerate) * 16) / 1000; real_fft_init(&(setup->PlcAdvSetup->PlcPhEcuSetup.PhEcu_Fft), setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Lprot, &(setup->PlcAdvSetup->PlcPhEcuSetup.handle_fft_phaseecu)); @@ -104,10 +126,12 @@ LC3PLUS_Error FillDecSetup(LC3PLUS_Dec* decoder, int samplerate, int channels, L decoder->plcMeth = plc_mode; decoder->hrmode = hrmode != 0; - + +#ifndef CR8_A_PLC_FADEOUT_TUNING if (decoder->fs_idx > 4) { decoder->fs_idx = 5; } +#endif decoder->channels = channels; decoder->frame_ms = 10; decoder->frame_dms = 100; @@ -175,6 +199,21 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) decoder->yLen /= 2; decoder->bands_number = bands_number_5ms[decoder->fs_idx]; } +#ifdef CR8_G_ADD_75MS + if (decoder->frame_ms == 7.5) + { + decoder->frame_length = (decoder->frame_length >> 2) * 3; + decoder->yLen = (decoder->yLen / 4) * 3; + if (decoder->hrmode) + { + decoder->bands_number = bands_number_7_5ms_HR[decoder->fs_idx]; + } + else + { + decoder->bands_number = bands_number_7_5ms[decoder->fs_idx]; + } + } +# endif if (decoder->hrmode) { @@ -221,6 +260,20 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } decoder->cutoffBins = BW_cutoff_bin_all_5ms; } +#ifdef CR8_G_ADD_75MS + else if (decoder->frame_ms == 7.5) + { + if (decoder->hrmode) + { + decoder->bands_offset = ACC_COEFF_PER_BAND_7_5ms_HR[decoder->fs_idx]; + } + else + { + decoder->bands_offset = ACC_COEFF_PER_BAND_7_5ms[decoder->fs_idx]; + } + decoder->cutoffBins = BW_cutoff_bin_all_7_5ms; + } +# endif decoder->n_bandsPLC = MIN(decoder->frame_length, 80); @@ -246,6 +299,19 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) decoder->n_bandsPLC = 60; } } +# ifdef CR8_G_ADD_75MS + else if (decoder->frame_ms == 7.5) + { + decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC_7_5ms[decoder->fs_idx]; + + if (decoder->fs != 32000 && decoder->fs != 96000) + if (decoder->fs != 32000) + { + decoder->n_bandsPLC = 60; + } + } +# endif + assert(decoder->bands_offsetPLC); if (decoder->frame_ms == 10) { @@ -263,6 +329,13 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) decoder->imdct_laZeros = MDCT_la_zeroes_5ms[decoder->fs_idx]; decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_5ms[decoder->fs_idx]; } +#ifdef CR8_G_ADD_75MS + else if (decoder->frame_ms == 7.5) { + decoder->imdct_win = MDCT_WINS_7_5ms[decoder->hrmode][decoder->fs_idx]; + decoder->imdct_laZeros = MDCT_la_zeroes_7_5ms[decoder->fs_idx]; + decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_7_5ms[decoder->fs_idx]; + } +# endif decoder->la_zeroes = decoder->imdct_laZeros; @@ -307,6 +380,11 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) setup->PlcAdvSetup->cum_fading_fast = 1; setup->PlcAdvSetup->cum_fading_slow = 1; setup->PlcAdvSetup->cum_fflcAtten = 1; + +#ifdef CR8_A_PLC_FADEOUT_TUNING + setup->PlcAdvSetup->longterm_analysis_counter_max = plc_fadeout_param_maxlen[(decoder->frame_dms / 25) - 1]; + setup->PlcAdvSetup->longterm_analysis_counter_max_bytebuffer = plc_fadeout_param_maxbytes[(decoder->frame_dms / 25) - 1]; +#endif if (decoder->fs_idx <= 4 && decoder->frame_dms == 100) { @@ -340,6 +418,9 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_short_flag_prev = 0; /* fullband transient */ setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_num_plocs = 0; +#ifdef CR8_A_PLC_FADEOUT_TUNING + setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_nonpure_tone_flag = -1; /* nonpure tone flag, -1==new calc., 0==pure, 1==nonpure */ +#endif } } } @@ -362,6 +443,12 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) maxBytes = 375; minBytes = MIN_NBYTES; break; +#ifdef CR8_G_ADD_75MS + case 75: + maxBytes = 625; + minBytes = MIN_NBYTES; + break; +#endif case 100: maxBytes = 625; minBytes = MIN_NBYTES; @@ -406,6 +493,12 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) setup->enable_lpc_weighting = (setup->total_bits < 240); totalBits = setup->total_bits * 2 - 160; } +# ifdef CR8_G_ADD_75MS + if (decoder->frame_ms == 7.5) { + setup->enable_lpc_weighting = (setup->total_bits < 360); + totalBits = round(setup->total_bits * 10 / 7.5); + } +# endif if (decoder->frame_length > 40 * ((LC3_FLOAT) (decoder->frame_dms) / 10.0)) { setup->N_red_tns = 40 * ((LC3_FLOAT) (decoder->frame_dms) / 10.0); diff --git a/lib_lc3plus/setup_dec_lc3.h b/lib_lc3plus/setup_dec_lc3.h index 6ed0f438ea..3ae6b13977 100644 --- a/lib_lc3plus/setup_dec_lc3.h +++ b/lib_lc3plus/setup_dec_lc3.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef SETUP_DEC_LC3_FL_H #define SETUP_DEC_LC3_FL_H +#include "options.h" #include "constants.h" /* Channel state and bitrate-derived values go in this struct */ @@ -49,6 +50,9 @@ typedef struct { LC3_FLOAT x_fl[MAX_LEN]; LC3_FLOAT imdct_mem[MAX_LEN]; LC3_FLOAT alpha; +#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH + LC3_FLOAT rel_pitch_change; +#endif Dct4 dct4structImdct; diff --git a/lib_lc3plus/setup_enc_lc3.c b/lib_lc3plus/setup_enc_lc3.c index 986b43d608..a7c94a44e2 100644 --- a/lib_lc3plus/setup_enc_lc3.c +++ b/lib_lc3plus/setup_enc_lc3.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -42,9 +42,12 @@ LC3PLUS_Error FillEncSetup(LC3PLUS_Enc* encoder, int samplerate, int channels encoder->fs_in = samplerate; encoder->fs_idx = FS2FS_IDX(encoder->fs); encoder->frame_dms = 100; + +#ifndef CR8_A_PLC_FADEOUT_TUNING if (encoder->fs_idx > 4) { encoder->fs_idx = 5; } +#endif encoder->hrmode = hrmode != 0; @@ -103,6 +106,7 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->yLen = MIN(MAX_BW, encoder->frame_length); encoder->sns_damping = 0.85; } + encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; encoder->bands_number = 64; encoder->nSubdivisions = 3; @@ -140,19 +144,46 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->attdec_damping = 0.5; encoder->attdec_hangover_thresh = 2; } - else if (encoder->frame_ms == 2.5) { - encoder->la_zeroes = MDCT_la_zeroes_2_5ms[encoder->fs_idx]; +#ifdef CR8_G_ADD_75MS + else if (encoder->frame_ms == 7.5) { if (encoder->hrmode) { - encoder->bands_offset = ACC_COEFF_PER_BAND_2_5ms_HR[encoder->fs_idx]; + encoder->bands_offset = ACC_COEFF_PER_BAND_7_5ms_HR[encoder->fs_idx]; } else { - encoder->bands_offset = ACC_COEFF_PER_BAND_2_5ms[encoder->fs_idx]; + encoder->bands_offset = ACC_COEFF_PER_BAND_7_5ms[encoder->fs_idx]; } - encoder->cutoffBins = BW_cutoff_bin_all_2_5ms; + encoder->la_zeroes = MDCT_la_zeroes_7_5ms[encoder->fs_idx]; + encoder->cutoffBins = BW_cutoff_bin_all_7_5ms; + encoder->attdec_nblocks = 3; + encoder->attdec_damping = 0.3; + encoder->attdec_hangover_thresh = 1; + + encoder->frame_length = (encoder->frame_length >> 2) * 3; + encoder->yLen = (encoder->yLen >> 2) * 3; + + encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; + if (encoder->hrmode) + { + encoder->bands_number = bands_number_7_5ms_HR[encoder->fs_idx]; + } + else + { + encoder->bands_number = bands_number_7_5ms[encoder->fs_idx]; + } + encoder->nSubdivisions = 3; + encoder->near_nyquist_index = encoder->bands_number - 4; + encoder->r12k8_mem_out_len = ceil(2.0 * ((LC3_FLOAT) encoder->frame_length / 2.0 - (LC3_FLOAT) encoder->la_zeroes) * 12800.0 / (LC3_FLOAT) encoder->fs - 8.0); } +#endif else if (encoder->frame_ms == 5) { + encoder->frame_length = encoder->frame_length >> 1; + encoder->yLen /= 2; + encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; + encoder->bands_number = bands_number_5ms[encoder->fs_idx]; + encoder->nSubdivisions = 2; + encoder->near_nyquist_index = encoder->bands_number - 3; encoder->la_zeroes = MDCT_la_zeroes_5ms[encoder->fs_idx]; if (encoder->hrmode) { @@ -164,8 +195,17 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) } encoder->cutoffBins = BW_cutoff_bin_all_5ms; } - - if (encoder->frame_ms == 2.5) { + else if (encoder->frame_ms == 2.5) { + encoder->la_zeroes = MDCT_la_zeroes_2_5ms[encoder->fs_idx]; + if (encoder->hrmode) + { + encoder->bands_offset = ACC_COEFF_PER_BAND_2_5ms_HR[encoder->fs_idx]; + } + else + { + encoder->bands_offset = ACC_COEFF_PER_BAND_2_5ms[encoder->fs_idx]; + } + encoder->cutoffBins = BW_cutoff_bin_all_2_5ms; encoder->frame_length = encoder->frame_length >> 2; encoder->yLen /= 4; encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; @@ -182,22 +222,14 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->near_nyquist_index = encoder->bands_number - 2; encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (LEN_12K8 >> 2); } - - - if (encoder->frame_ms == 5) { - encoder->frame_length = encoder->frame_length >> 1; - encoder->yLen /= 2; - encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; - encoder->bands_number = bands_number_5ms[encoder->fs_idx]; - encoder->nSubdivisions = 2; - encoder->near_nyquist_index = encoder->bands_number - 3; - } for (ch = 0; ch < encoder->channels; ch++) { setup = encoder->channel_setup[ch]; setup->olpa_mem_pitch = 17; - +#ifdef CR9_F_PITCH_WIN_LEN_FIX + setup->pitch_flag = 0; +#endif if (setup->mdctStruct.mem != NULL) { mdct_free(&setup->mdctStruct); mdct_init(&setup->mdctStruct, encoder->frame_length, encoder->frame_dms, encoder->fs_idx, encoder->hrmode); @@ -219,9 +251,9 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) int ch = 0, bitsTmp = 0, minBR = 0, maxBR = 0, totalBytes = 0; LC3_INT channel_bytes = 0, max_bytes = 0; +#ifdef ENABLE_HR_MODE_FL if (encoder->hrmode) { -#ifdef ENABLE_HR_MODE_FL switch (encoder->frame_dms) { case 25: @@ -236,6 +268,14 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) else if (encoder->fs == 96000) {minBR = MIN_BR_50MS_96KHZ_HR;} else { return LC3PLUS_HRMODE_ERROR;} break; +#ifdef CR8_G_ADD_75MS + case 75: + maxBR = 500000; + if (encoder->fs == 48000) {minBR = MIN_BR_075DMS_48KHZ_HR;} + else if (encoder->fs == 96000) {minBR = MIN_BR_075DMS_96KHZ_HR;} + else {return LC3PLUS_HRMODE_ERROR;} + break; +#endif case 100: maxBR = 500000; if (encoder->fs == 48000) {minBR = MIN_BR_100MS_48KHZ_HR;} @@ -245,9 +285,9 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) default: return LC3PLUS_HRMODE_ERROR; } -#endif } else +#endif /* ENABLE_HR_MODE_FL */ { minBR = (MIN_NBYTES << 3); maxBR = MAX_BR; @@ -268,6 +308,20 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) default: break; } break; +#ifdef CR8_G_ADD_75MS + case 75: + minBR = MIN_BR_075DMS; + maxBR = MAX_BR_075DMS; + /* have additional limitations for 7.5ms */ + switch (encoder->fs_in) + { + case 8000: maxBR = MAX_BR_075DMS_NB ; break; + case 16000: maxBR = MAX_BR_075DMS_WB ; break; + case 24000: maxBR = MAX_BR_075DMS_SSWB; break; + default: break; + } + break; +#endif case 100: /* have additional limitations for 10ms */ minBR = MIN_BR_100DMS; @@ -388,6 +442,11 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) setup->targetBitsAri = setup->total_bits; setup->enable_lpc_weighting = setup->total_bits < 480; +#ifdef CR8_G_ADD_75MS + if (encoder->frame_ms == 7.5) { + setup->enable_lpc_weighting = setup->total_bits < 360; + } +#endif if (encoder->frame_ms == 5) { setup->enable_lpc_weighting = setup->total_bits < 240; } @@ -433,6 +492,11 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) if (encoder->frame_ms == 5) { bitsTmp = bitsTmp * 2 - 160; } +#ifdef CR8_G_ADD_75MS + if (encoder->frame_ms == 7.5) { + bitsTmp = round(bitsTmp * 10 / 7.5); + } +#endif if (bitsTmp < 400 + (encoder->fs_idx - 1) * 80) { setup->ltpf_enable = 1; @@ -461,6 +525,14 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) encoder->sns_damping = 6881.0/32768.0; } } +#ifdef CR8_G_ADD_75MS + if (encoder->frame_ms == 7.5) + { + if (setup->total_bits > 3*4400/4) { + encoder->sns_damping = 5898.0/32768.0; + } + } +#endif if (encoder->frame_ms == 5) { if (setup->total_bits > 4600/2) { @@ -487,6 +559,12 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) { setup->regBits +=2; } +#ifdef CR8_G_ADD_75MS + if (encoder->frame_ms == 7.5) + { + setup->regBits +=1; + } +#endif if (encoder->frame_ms == 2.5) { setup->regBits -= 6; @@ -502,6 +580,12 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) { setup->regBits += 0; } +#ifdef CR8_G_ADD_75MS + if (encoder->frame_ms == 7.5) + { + setup->regBits +=2; + } +#endif if (encoder->frame_ms == 10) { setup->regBits += 5; @@ -538,9 +622,11 @@ void update_enc_bandwidth(LC3PLUS_Enc* encoder, int bandwidth) { encoder->bandwidth = bandwidth; index = FS2FS_IDX(bandwidth); +#ifndef CR8_A_PLC_FADEOUT_TUNING if (index > 4) { index = 5; } +#endif encoder->bw_ctrl_cutoff_bin = encoder->cutoffBins[index]; } } diff --git a/lib_lc3plus/setup_enc_lc3.h b/lib_lc3plus/setup_enc_lc3.h index 31f0cbeb50..43c29e12bc 100644 --- a/lib_lc3plus/setup_enc_lc3.h +++ b/lib_lc3plus/setup_enc_lc3.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef SETUP_ENC_LC3_FL_H #define SETUP_ENC_LC3_FL_H +#include "options.h" #include "constants.h" /* Channel state and bitrate-derived values go in this struct */ @@ -22,7 +23,11 @@ typedef struct { LC3_FLOAT attdec_acc_energy; LC3_FLOAT r12k8_mem_50[2]; LC3_FLOAT r12k8_mem_in[120]; +#ifdef CR8_G_ADD_75MS + LC3_FLOAT r12k8_mem_out[44]; +#else LC3_FLOAT r12k8_mem_out[24]; +#endif LC3_FLOAT olpa_mem_s12k8[3]; LC3_FLOAT olpa_mem_s6k4[LEN_6K4 + MAX_PITCH_6K4 + 16]; LC3_FLOAT ltpf_mem_in[LTPF_MEMIN_LEN + LEN_12K8 + 1]; @@ -44,6 +49,9 @@ typedef struct { LC3_INT tns_bits; LC3_INT targetBitsQuant; LC3_INT olpa_mem_pitch; +#ifdef CR9_F_PITCH_WIN_LEN_FIX + LC3_INT pitch_flag; +#endif LC3_INT ltpf_mem_ltpf_on; LC3_INT mem_targetBits; LC3_INT mem_specBits; diff --git a/lib_lc3plus/sns_compute_scf.c b/lib_lc3plus/sns_compute_scf.c index 5cb041925b..586fd9ef66 100644 --- a/lib_lc3plus/sns_compute_scf.c +++ b/lib_lc3plus/sns_compute_scf.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,12 +11,16 @@ #include "options.h" #include "functions.h" -void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor) +void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor, LC3_INT fs_idx) { - LC3_INT bands_number = 0, d = 0, i = 0, j = 0, n = 0, n2 = 0, n4 = 0, mapping[64] = {0}; - LC3_FLOAT tmp[64] = {0}, x_tmp1[MAX_LEN] = {0}, x_tmp2[MAX_LEN] = {0}, sum = 0, mean = 0, xl4[16] = {0}, nf = 0, xl[64] = {0}, gains_smooth[M] = {0}, ratio = 0; - LC3_FLOAT W[6] = {1.0 / 12.0, 2.0 / 12.0, 3.0 / 12.0, 3.0 / 12.0, 2.0 / 12.0, 1.0 / 12.0}; - + LC3_INT bands_number, d, i, j, n, n2, n4, mapping[64]; + LC3_FLOAT x_tmp1[MAX_LEN], sum, mean, nf, gains_smooth[M], ratio; + LC3_FLOAT sum_gains_smooth; + const LC3_FLOAT* sns_preemph; + + sum_gains_smooth = 0; sum = 0; + sns_preemph = sns_preemph_all[fs_idx]; + bands_number = xLen; assert(bands_number <= 64); @@ -28,13 +32,14 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT { j = 0; for (i = 0; i < 2 * d; i = i + 2) { - tmp[i] = x[j]; - tmp[i + 1] = x[j]; + x_tmp1[i] = x[j]; + x_tmp1[i + 1] = x[j]; j++; } - move_float(&tmp[2 * d], &x[d], 64 - 2 * d); - } else if (ceil(64.0 / (LC3_FLOAT) xLen) == 4) + move_float(&x_tmp1[2 * d], &x[d], 64 - 2 * d); + } + else if (bands_number < 32) { ratio = LC3_FABS((LC3_FLOAT) (1.0 - 32.0 / (LC3_FLOAT) xLen)); n4 = round(ratio * xLen); @@ -60,13 +65,13 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT for (i = 0; i < 64; i++) { - tmp[i] = x[mapping[i] - 1]; + x_tmp1[i] = x[mapping[i] - 1]; } } else { assert(0 && "Unsupported number of bands!"); } - move_float(x, tmp, 64); + move_float(x, x_tmp1, 64); bands_number = 64; xLen = bands_number; @@ -76,20 +81,17 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT /* Smoothing */ x_tmp1[0] = x[0]; + move_float(&x_tmp1[1], &x[0], 63); - move_float(&x_tmp1[1], &x[0], xLen - 1); - - move_float(&x_tmp2[0], &x[1], xLen - 1); - - x_tmp2[xLen - 1] = x[xLen - 1]; - - for (i = 0; i < xLen; i++) { - x[i] = 0.5 * x[i] + 0.25 * (x_tmp1[i] + x_tmp2[i]); + for (i = 0; i < 63; i++) { + x[i] = 0.5 * x[i] + 0.25 * (x_tmp1[i] + x[i + 1]); } + + x[63] = 0.5 * x[63] + 0.25 * (x_tmp1[63] + x[63]); /* Pre-emphasis */ - for (i = 0; i < xLen; i++) { - x[i] = x[i] * LC3_POW(10.0, (LC3_FLOAT)i * (LC3_FLOAT)tilt / ((LC3_FLOAT)bands_number - 1.0) / 10.0); + for (i = 0; i < 64; i++) { + x[i] = x[i] * sns_preemph[i]; } /* Noise floor at -40dB */ @@ -97,10 +99,10 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT sum += x[i]; } - mean = sum / (LC3_FLOAT)xLen; + mean = sum * 0.015625; /* 1/64 */ - nf = mean * LC3_POW(10.0, -40.0 / 10.0); - nf = MAX(nf, LC3_POW(2.0, -32.0)); + nf = mean * 1.00e-04; + nf = MAX(nf, 2.328306436538696e-10); for (i = 0; i < 64; i++) { if (x[i] < nf) { @@ -110,45 +112,40 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT /* Log-domain */ for (i = 0; i < 64; i++) { - xl[i] = LC3_LOGTWO(x[i]) / 2.0; + x[i] = LC3_LOGTWO(x[i]) * 0.5; } /* Downsampling */ - for (n = 0; n < bands_number / 4; n++) { + for (n = 0; n < 16; n++) { if (n == 0) { - tmp[0] = xl[0]; + x_tmp1[0] = x[0]; - move_float(&tmp[1], &xl[0], 5); + move_float(&x_tmp1[1], &x[0], 5); - } else if (n == (bands_number / 4 - 1)) { - move_float(tmp, &xl[59], 5); + } else if (n == 15) { + move_float(x_tmp1, &x[59], 5); - tmp[5] = xl[63]; + x_tmp1[5] = x[63]; } else { - move_float(tmp, &xl[n * 4 - 1], ((n * 4 + 5 - 1) - (n * 4 - 1) + 1)); + move_float(x_tmp1, &x[n * 4 - 1], ((n * 4 + 5 - 1) - (n * 4 - 1) + 1)); } sum = 0; for (i = 0; i < 6; i++) { - sum += tmp[i] * W[i]; + sum += x_tmp1[i] * sns_W[i]; } - xl4[n] = sum; + gains_smooth[n] = sum; + sum_gains_smooth += sum; } /* Remove mean and scaling */ + mean = sum_gains_smooth / 16.0; - sum = 0; - for (i = 0; i < bands_number / 4; i++) { - sum += xl4[i]; - } - - mean = sum / ((LC3_FLOAT)bands_number / 4.0); - - for (i = 0; i < bands_number / 4; i++) { - gains[i] = sns_damping * (xl4[i] - mean); + for (i = 0; i < 16; i++) { + gains[i] = sns_damping * (gains_smooth[i] - mean); } /* Smoothing */ diff --git a/lib_lc3plus/sns_interpolate_scf.c b/lib_lc3plus/sns_interpolate_scf.c index 4419397890..fea81e6be5 100644 --- a/lib_lc3plus/sns_interpolate_scf.c +++ b/lib_lc3plus/sns_interpolate_scf.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,23 +13,23 @@ void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int) { - LC3_INT i = 0, n = 0, d = 0, n4 = 0; - LC3_FLOAT tmp[MAX_BANDS_NUMBER_PLC] = {0}, ratio = 0; + LC3_INT i, n, d, n4; + LC3_FLOAT tmp[MAX_BANDS_NUMBER_PLC], ratio; /* Interpolation */ gains_int[0] = gains[0]; gains_int[1] = gains[0]; - for (n = 0; n <= 14; n++) { - gains_int[n * 4 + 2] = gains[n] + (gains[n + 1] - gains[n]) / 8.0; - gains_int[n * 4 + 3] = gains[n] + 3.0 * (gains[n + 1] - gains[n]) / 8.0; - gains_int[n * 4 + 4] = gains[n] + 5.0 * (gains[n + 1] - gains[n]) / 8.0; - gains_int[n * 4 + 5] = gains[n] + 7.0 * (gains[n + 1] - gains[n]) / 8.0; + for (n = 0; n <= 14; n++) { + gains_int[n * 4 + 2] = gains[n] + (gains[n + 1] - gains[n]) * 0.125; + gains_int[n * 4 + 3] = gains[n] + (gains[n + 1] - gains[n]) * 0.375; + gains_int[n * 4 + 4] = gains[n] + (gains[n + 1] - gains[n]) * 0.625; + gains_int[n * 4 + 5] = gains[n] + (gains[n + 1] - gains[n]) * 0.875; } - gains_int[62] = gains[15] + (gains[15] - gains[14]) / 8.0; - gains_int[63] = gains[15] + 3.0 * (gains[15] - gains[14]) / 8.0; + gains_int[62] = gains[15] + (gains[15] - gains[14]) * 0.125; + gains_int[63] = gains[15] + (gains[15] - gains[14]) * 0.375; /* For 5ms */ @@ -53,7 +53,8 @@ void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT } move_float(gains_int, tmp, d); - } else if (ceil(64.0 / (LC3_FLOAT) bands_number) == 4) + } + else if (bands_number < 32) { ratio = LC3_FABS((LC3_FLOAT) ((LC3_FLOAT)1.0 - (LC3_FLOAT)32.0 / (LC3_FLOAT) bands_number)); n4 = LC3_ROUND(ratio * (LC3_FLOAT)bands_number); diff --git a/lib_lc3plus/sns_quantize_scf.c b/lib_lc3plus/sns_quantize_scf.c index 704127cce7..3cb81aee9c 100644 --- a/lib_lc3plus/sns_quantize_scf.c +++ b/lib_lc3plus/sns_quantize_scf.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -421,7 +421,7 @@ LC3_INT find_last_indice_le(LC3_INT compare, const LC3_INT* array, LC3_INT len) void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses) { - LC3_INT leading_sign = 0, idx = 0, k_delta = 0, pos = 0; + LC3_INT leading_sign, idx, k_delta = 0, pos; leading_sign = 1 - 2 * LS_ind; @@ -454,9 +454,9 @@ void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pu void process_snsQuantizesScf_Dec(LC3_INT* scf_idx, LC3_FLOAT* scf_q) { - LC3_INT i = 0, submode = 0; + LC3_INT i, submode; LC3_INT pulses2[6] = {0}, pulses[M] = {0}; - LC3_FLOAT st2_vector[M] = {0}, st2_vector_idct[M] = {0}, sum = 0; + LC3_FLOAT st2_vector[M], st2_vector_idct[M], sum = 0; /* Decode first stage */ @@ -505,13 +505,18 @@ void process_snsQuantizesScf_Dec(LC3_INT* scf_idx, LC3_FLOAT* scf_q) idct_II(st2_vector, st2_vector_idct, M); /* Gain */ + /* Add stage 1 and stage 2 */ +#ifdef CR9_SIMPLIFY_LOOP + for (i = 0; i < M; i++) { + scf_q[i] += st2_vector_idct[i] * sns_dec_gains[submode][scf_idx[3]]; + } +#else for (i = 0; i < M; i++) { st2_vector_idct[i] = st2_vector_idct[i] * sns_dec_gains[submode][scf_idx[3]]; } - /* Add stage 1 and stage 2 */ - for (i = 0; i < M; i++) { scf_q[i] = scf_q[i] + st2_vector_idct[i]; } +#endif } diff --git a/lib_lc3plus/structs.h b/lib_lc3plus/structs.h index fea377da41..e311824b7f 100644 --- a/lib_lc3plus/structs.h +++ b/lib_lc3plus/structs.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef STRUCTS_H #define STRUCTS_H +#include "options.h" #include "defines.h" #include "fft/iisfft.h" @@ -66,6 +67,7 @@ typedef struct { LC3_INT32 pc_be_bp_left; LC3_INT32 pc_be_bp_right; LC3_INT32 pc_return; + LC3_INT16 pc_inv_bin; } Decoder_State_fl; typedef struct { @@ -154,6 +156,9 @@ typedef struct { LC3_INT32 PhECU_num_plocs; HANDLE_IIS_FFT handle_fft_phaseecu; HANDLE_IIS_FFT handle_ifft_phaseecu; +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT16 PhECU_nonpure_tone_flag; /* BASOP Word16 PhECU_nonpure_tone_flag*/ +#endif } PlcPhEcuSetup; @@ -179,8 +184,24 @@ typedef struct { LC3_FLOAT cum_fflcAtten; LC3_FLOAT scf_q_old[M]; LC3_FLOAT scf_q_old_old[M]; - PlcPhEcuSetup PlcPhEcuSetup; + PlcPhEcuSetup PlcPhEcuSetup; + +#ifdef CR8_A_PLC_FADEOUT_TUNING + LC3_INT16 longterm_counter_plcTdc; +# ifndef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER + LC3_INT16 longterm_counter_plcPhaseEcu; +# endif + LC3_INT16 longterm_counter_plcNsAdv; + LC3_INT16 longterm_analysis_counter_max; /* Maximum longterm frames number */ + LC3_INT16 longterm_analysis_counter_max_bytebuffer; /* Same as above but reduced for circular bit-buffer */ + LC3_INT32 *plc_longterm_advc_tdc; + LC3_INT32 *plc_longterm_advc_ns; + LC3_UINT8 plc_fadeout_type; + LC3_UINT8 plc_fadeout_type_first; + LC3_INT16 overall_counter; + LC3_INT8 longterm_counter_byte_position; + LC3_INT8 longterm_counter_bit_position; +#endif } PlcAdvSetup; - #endif diff --git a/lib_lc3plus/tns_coder.c b/lib_lc3plus/tns_coder.c index ff3883d2b5..e9301af9df 100644 --- a/lib_lc3plus/tns_coder.c +++ b/lib_lc3plus/tns_coder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -14,35 +14,22 @@ static void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen); static void levdown(LC3_FLOAT* anxt, LC3_FLOAT* out_a, LC3_INT* len); static void poly2rc(LC3_FLOAT* a, LC3_FLOAT* out, LC3_INT len); -static LC3_INT findRC_idx(const LC3_FLOAT* in1, const LC3_FLOAT* in2, LC3_FLOAT checkValue); void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen) { - LC3_INT i = 0, m = 0; - LC3_FLOAT sum = 0, tmp_buf[MAX_LEN] = {0}; + LC3_INT32 m; - for (m = -lag; m <= lag; m++) { - /* Append zeros and input vector */ - zero_float(tmp_buf, abs(m)); - - move_float(&tmp_buf[abs(m)], in, inLen - abs(m)); - - /* Calculate sum */ - sum = 0; - - for (i = 0; i < inLen; i++) { - sum += in[i] * tmp_buf[i]; - } - - out[m + lag] = sum; + for (m = 0; m <= lag; m++) { + /* Calculate correlation */ + out[m] = mac_loop(in, &in[m], (inLen - m)); } } void levinsonDurbin(LC3_FLOAT* r, LC3_FLOAT* out_lev, LC3_FLOAT* rc_unq, LC3_FLOAT* error, LC3_INT len) { - LC3_INT t = 0, i = 0, j = 0; - LC3_FLOAT g = 0, v = 0, sum = 0, buf_tmp[MAX_LEN] = {0}; + LC3_INT t, i, j; + LC3_FLOAT g, v, sum, buf_tmp[10]; g = r[1] / r[0]; out_lev[0] = g; @@ -51,7 +38,6 @@ void levinsonDurbin(LC3_FLOAT* r, LC3_FLOAT* out_lev, LC3_FLOAT* rc_unq, LC3_FLO rc_unq[0] = -g; for (t = 1; t < len; t++) { - zero_float(buf_tmp, len + 1); sum = 0; for (i = 1; i <= t; i++) { @@ -91,33 +77,33 @@ void levinsonDurbin(LC3_FLOAT* r, LC3_FLOAT* out_lev, LC3_FLOAT* rc_unq, LC3_FLO void levdown(LC3_FLOAT* anxt, LC3_FLOAT* out_a, LC3_INT* len) { - LC3_INT i = 0, j = 0; - LC3_FLOAT tmp_buf[8] = {0}, tmp_buf1[8] = {0}, tmp_buf2[8] = {0}, knxt = 0; + LC3_INT32 i, j; + LC3_FLOAT tmp_buf[8], knxt; + LC3_FLOAT norm; + memset(tmp_buf, 0, 8 * sizeof(LC3_FLOAT)); /* Initial length = 9 */ /* Drop the leading 1 */ - move_float(&tmp_buf[0], &anxt[1], (*len - 1)); - *len = *len - 1; /* Lenght = 8 */ /* Last coefficient */ - knxt = tmp_buf[*len - 1]; /* At [7] */ + knxt = anxt[*len]; /* At [7] */ *len = *len - 1; /* Lenght = 7 */ - move_float(tmp_buf1, tmp_buf, *len); - j = 0; for (i = *len - 1; i >= 0; i--) { - tmp_buf2[j] = knxt * tmp_buf[i]; + tmp_buf[j] = knxt * anxt[i + 1]; j++; } + + norm = 1.0 / (1.0 - (LC3_FABS(knxt)) * (LC3_FABS(knxt))); out_a[0] = 1; for (i = 0; i < *len; i++) { - out_a[i + 1] = (tmp_buf1[i] - tmp_buf2[i]) / (1.0 - (LC3_FABS(knxt)) * (LC3_FABS(knxt))); + out_a[i + 1] = (anxt[i + 1] - tmp_buf[i]) * norm; } *len = *len + 1; /* Length = 8 */ @@ -125,8 +111,8 @@ void levdown(LC3_FLOAT* anxt, LC3_FLOAT* out_a, LC3_INT* len) void poly2rc(LC3_FLOAT* a, LC3_FLOAT* out, LC3_INT len) { - LC3_INT k = 0, i = 0, len_old = 0; - LC3_FLOAT buf[9] = {0}; + LC3_INT k, i, len_old; + LC3_FLOAT buf[9]; len_old = len; @@ -155,30 +141,21 @@ void poly2rc(LC3_FLOAT* a, LC3_FLOAT* out, LC3_INT len) } } -LC3_INT findRC_idx(const LC3_FLOAT* in1, const LC3_FLOAT* in2, LC3_FLOAT checkValue) -{ - LC3_INT i = 0, ret = 0; - - for (i = 0; i < 17; i++) { - if (checkValue <= in1[i] && checkValue > in2[i]) { - ret = i; - } - } - - return ret; -} void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, LC3_INT fs, LC3_INT N, LC3_INT frame_dms, LC3_INT nBits, LC3_INT* order_out, LC3_INT* rc_idx, LC3_INT* tns_numfilters, LC3_INT* bits_out , LC3_INT16 near_nyquist_flag ) { - LC3_INT i = 0, stopfreq[2] = {0}, startfreq[2] = {0}, f = 0, numfilters = 0, maxOrder = 0, bits = 0, sub = 0, - subdiv_startfreq = 0, subdiv_stopfreq = 0, j = 0, rc_idx_tmp[8] = {0}, order_tmp[8] = {0}, tmp = 0, tns = 0; - LC3_FLOAT minPGfac = 0, minPredictionGain = 0, maxPG = 0, xcorr_out[MAX_LEN] = {0}, buf_tmp[MAX_LEN] = {0}, sum = 0, - subdiv_len = 0, nSubdivisions = 0, r[9] = {0}, out_lev[9] = {0}, rc_unq[9] = {0}, error_lev = 0, predGain = 0, - alpha = 0, rc[8] = {0}, st[9] = {0}, s = 0, tmpSave = 0, tmp_fl = 0; + LC3_INT i, stopfreq[2], startfreq[2], f, numfilters, maxOrder, bits, sub, + subdiv_startfreq, subdiv_stopfreq, j, rc_idx_tmp[MAXLAG], order_tmp, tmp, tns; + LC3_FLOAT minPGfac, minPredictionGain, maxPG, xcorr_out[MAXLAG + 1], sum, + subdiv_len, nSubdivisions, r[MAXLAG + 1], rc_unq[MAXLAG + 1], error_lev, predGain, + alpha, rc[MAXLAG], st[MAXLAG + 1] = {0}, s, tmpSave, tmp_fl; const LC3_INT* order; + LC3_FLOAT inv_sum, x_val; + LC3_FLOAT alpha_loc; + LC3_INT32 iIndex; /* Init */ @@ -188,8 +165,10 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L numfilters = 1; } - if (N > 40 * ((LC3_FLOAT) (frame_dms) / 10.0)) { - N = 40 * ((LC3_FLOAT) (frame_dms) / 10.0); + /* 40 * frame_dms / 10 = 4 * frame_dms */ + if (N > 4 * frame_dms) + { + N = 4 * frame_dms; fs = 40000; } @@ -213,21 +192,21 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L maxOrder = 4; nSubdivisions = 2.0; break; +#ifdef CR8_G_ADD_75MS + case 75: + maxOrder = 8; + nSubdivisions = 3; + break; +#endif case 100: maxOrder = 8; nSubdivisions = 3.0; break; } - minPGfac = 0.85; - maxPG = 2; minPredictionGain = 1.5; - if ((frame_dms >= 50 && nBits >= 48 * ((LC3_FLOAT) frame_dms / 10.0)) || frame_dms == 25) { - maxPG = minPredictionGain; - } - - if ((frame_dms >= 50 && nBits >= 48 * ((LC3_FLOAT) frame_dms / 10.0)) || frame_dms == 25) { + if (nBits >= 4.8 * frame_dms) { order = order1_tns; } else { order = order2_tns; @@ -249,32 +228,53 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L for (f = 0; f < numfilters; f++) { subdiv_len = ((LC3_FLOAT)stopfreq[f] + 1.0 - (LC3_FLOAT)startfreq[f]) / nSubdivisions; - zero_float(r, 9); + zero_float(r, MAXLAG+1); for (sub = 1; sub <= nSubdivisions; sub++) { subdiv_startfreq = floor(subdiv_len * (sub - 1)) + startfreq[f] - 1; subdiv_stopfreq = floor(subdiv_len * sub) + startfreq[f] - 1; + +#ifdef CR8_G_ADD_75MS + if (fs == 32000 && frame_dms == 75) + { + if (subdiv_startfreq == 83) + { + subdiv_startfreq = 82; + } + + if (subdiv_stopfreq == 83) + { + subdiv_stopfreq = 82; + } + + if (subdiv_startfreq == 160) + { + subdiv_startfreq = 159; + } + + if (subdiv_stopfreq == 160) + { + subdiv_stopfreq = 159; + } + } +#endif sum = 0; for (i = subdiv_startfreq; i < subdiv_stopfreq; i++) { sum += x[i] * x[i]; } - if (sum < LC3_EPS) - { - zero_float(r, 9); + if (sum < LC3_EPS) { + zero_float(r, MAXLAG+1); r[0] = 1; break; } - move_float(buf_tmp, &x[subdiv_startfreq], subdiv_stopfreq - subdiv_startfreq); - - xcorr(buf_tmp, xcorr_out, maxOrder, subdiv_stopfreq - subdiv_startfreq); + xcorr(&x[subdiv_startfreq], xcorr_out, maxOrder, subdiv_stopfreq - subdiv_startfreq); - j = 0; - for (i = maxOrder; i >= 0; i--) { - r[j] = r[j] + xcorr_out[i] / sum; - j++; + inv_sum = 1.0 / sum; + for (i = 0; i <= maxOrder; i++) { + r[i] = r[i] + xcorr_out[i] * inv_sum; } } @@ -282,7 +282,7 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L r[i] = r[i] * lagw_tns[i]; } - levinsonDurbin(r, out_lev, rc_unq, &error_lev, maxOrder); + levinsonDurbin(r, xcorr_out, rc_unq, &error_lev, maxOrder); predGain = r[0] / error_lev; @@ -295,34 +295,50 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L bits++; if (tns == 1) { + minPGfac = 0.85; + maxPG = 2; + if (nBits >= 4.8 * frame_dms) { + maxPG = minPredictionGain; + } + /* LPC weighting */ if (predGain < maxPG) { alpha = (maxPG - predGain) * (minPGfac - 1.0) / (maxPG - minPredictionGain) + 1.0; + alpha_loc = 1; for (i = 0; i <= maxOrder; i++) { - out_lev[i] = out_lev[i] * LC3_POW(alpha, i); + xcorr_out[i] = xcorr_out[i] * alpha_loc; + alpha_loc *= alpha; } - poly2rc(out_lev, rc_unq, maxOrder + 1); + poly2rc(xcorr_out, rc_unq, maxOrder + 1); } /* PARCOR Quantization */ - for (i = 0; i < maxOrder; i++) { - rc_idx_tmp[i] = findRC_idx(&quants_thr_tns[1], &quants_thr_tns[0], rc_unq[i]); + for (i = 0; i < maxOrder; i++) + { + iIndex = 1; + x_val = rc_unq[i]; + + while ((iIndex < 17) && (x_val > quants_thr_tns[iIndex - 1])) + { + iIndex = (iIndex + 1); + } + rc_idx_tmp[i] = (iIndex - 2); } /* Filter Order */ - j = 0; + order_tmp = 0; for (i = 0; i < maxOrder; i++) { rc[i] = quants_pts_tns[rc_idx_tmp[i]]; if (rc[i] != 0) { - order_tmp[j] = i + 1; - j++; + order_tmp = i + 1; } } - order_out[f] = order_tmp[j - 1]; + order_out[f] = order_tmp; + // Disable TNS if order is 0: if (order_out[f] == 0) { tns = 0; @@ -344,6 +360,9 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L rc_idx[i] = rc_idx_tmp[j]; j++; } + } else { +tns_disabled: + order_out[f] = 0; } /* Filtering */ @@ -367,7 +386,6 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L } } } -tns_disabled: *tns_numfilters = numfilters; *bits_out = bits; diff --git a/lib_lc3plus/tns_decoder.c b/lib_lc3plus/tns_decoder.c index d3aeefc3a3..f4dff52f39 100644 --- a/lib_lc3plus/tns_decoder.c +++ b/lib_lc3plus/tns_decoder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,8 +13,9 @@ void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs) { - LC3_INT startfreq[2] = {0}, stopfreq[2] = {0}, f = 0, i = 0, j = 0, m = 0, l = 0, rc_idx_f[9] = {0}; - LC3_FLOAT rc[9] = {0}, s = 0, st[9] = {0}; + LC3_INT startfreq[2], stopfreq[2], f, i, j, m, l; + LC3_FLOAT rc[9], s, st[9] = {0}; + LC3_INT order_tmp; if (numfilters == 2) { startfreq[0] = floor(600 * N * 2 / fs) + 1; @@ -27,19 +28,20 @@ void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT } for (f = 0; f < numfilters; f++) { - if (order[f] > 0) { + order_tmp = order[f]; + + if (order_tmp > 0) { j = 0; - for (i = f * 8; i < f * 8 + 8; i++) { - rc_idx_f[j] = rc_idx[i]; - rc[j] = quants_pts_tns[rc_idx_f[j]]; + for (i = f * 8; i < f * 8 + order_tmp; i++) { + rc[j] = quants_pts_tns[rc_idx[i]]; j++; } for (m = startfreq[f]; m <= stopfreq[f]; m++) { - s = x[m - 1] - rc[order[f] - 1] * st[order[f] - 1]; + s = x[m - 1] - rc[order_tmp - 1] * st[order_tmp - 1]; - for (l = order[f] - 2; l >= 0; l--) { + for (l = order_tmp - 2; l >= 0; l--) { s = s - rc[l] * st[l]; st[l + 1] = rc[l] * s + st[l]; } diff --git a/lib_lc3plus/util.h b/lib_lc3plus/util.h index 7ef6dedef7..adf422cff6 100644 --- a/lib_lc3plus/util.h +++ b/lib_lc3plus/util.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.4.1 * +* ETSI TS 103 634 V1.4.3 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,7 @@ #ifndef UTIL_H #define UTIL_H +#include "options.h" #include "clib.h" #include "math.h" @@ -51,18 +52,50 @@ static inline LC3_FLOAT sqrf(LC3_FLOAT x) { return x * x; } /* convenience wrappers around memmove */ static inline void move_float(LC3_FLOAT *dst, const LC3_FLOAT *src, LC3_INT len) { +#ifdef WMOPS + LC3_INT i; + for (i = 0; i < len; i++) + { + dst[i] = src[i]; + } +#else memmove(dst, src, len * sizeof(LC3_FLOAT)); +#endif } static inline void move_int(LC3_INT *dst, const LC3_INT *src, LC3_INT len) { +#ifdef WMOPS + LC3_INT i; + for (i = 0; i < len; i++) + { + dst[i] = src[i]; + } +#else memmove(dst, src, len * sizeof(LC3_INT)); +#endif } /* convenience wrappers around memset */ static inline void zero_float(LC3_FLOAT *x, LC3_INT len) { +#ifdef WMOPS + LC3_INT i; + for (i = 0; i < len; i++) + { + x[i] = 0; + } +#else memset(x, 0, len * sizeof(LC3_FLOAT)); +#endif } static inline void zero_int(LC3_INT *x, LC3_INT len) { +#ifdef WMOPS + LC3_INT i; + for (i = 0; i < len; i++) + { + x[i] = 0; + } +#else memset(x, 0, len * sizeof(LC3_INT)); +#endif } /* multiply float vectors element by element, in-place */ -- GitLab From ea740e9fdc3fd9391a49ce879fc103c4b0b85db1 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 15 Feb 2024 16:33:31 +0100 Subject: [PATCH 332/498] [CI] disable lc3plus-ensure-no-code-changes job --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c0c52bbe9..94173beb32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1028,7 +1028,7 @@ check-first-frame-is-sid: expose_as: "logs-sidstart" expire_in: "5 days" -lc3plus-ensure-no-code-changes: +.lc3plus-ensure-no-code-changes: extends: - .test-job-linux - .rules-merge-request -- GitLab From 8a905890163d5d390db83b0c269661fa02bc2c1e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 15 Feb 2024 16:48:58 +0100 Subject: [PATCH 333/498] wrap changes into ifdef NONBE_FIX_998_DIRAC_ROTATION --- lib_com/options.h | 2 ++ lib_dec/ivas_output_config.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..a8336495ef 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,6 +182,8 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ +#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 221492abfb..346a6095da 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -188,7 +188,11 @@ void ivas_renderer_select( } else if ( nchan_internal == 4 || nchan_internal == 3 ) { +#ifdef NONBE_FIX_998_DIRAC_ROTATION st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; +#else + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; +#endif } else if ( nchan_internal == 6 || nchan_internal == 5 ) { -- GitLab From a22c17a48dac1248003ff8f7c48fca9231763fb2 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 15 Feb 2024 16:51:06 +0100 Subject: [PATCH 334/498] skip passing XFAIL cases until bug in paramBin is fixed --- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 7ce51ae175..9e12df6cf4 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -196,6 +196,9 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt ], ) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): + # TODO: remove once fixed + if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: + pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( TESTV_DIR.joinpath(FORMAT_TO_METADATA_FILES["MASA"].format(in_dir, in_tc, fs)) @@ -234,6 +237,9 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file ): + # TODO: remove once fixed + if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: + pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( TESTV_DIR.joinpath(FORMAT_TO_METADATA_FILES["MASA"].format(in_dir, in_tc, fs)) -- GitLab From 5fda509541969c0335fac80c0aac2d4ff9ed4a2a Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 17:02:07 +0100 Subject: [PATCH 335/498] issue 699: complement FileReader_getFilePath() logic for TSM and JBM; under FIX_699_FILE_READER_JBM_TSM --- apps/decoder.c | 65 +++++++++++++++++--------------- apps/encoder.c | 4 ++ lib_com/options.h | 2 +- lib_util/tsm_scale_file_reader.c | 6 +++ lib_util/tsm_scale_file_reader.h | 6 +++ 5 files changed, 51 insertions(+), 32 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 01e6b4f3d1..e8acfb67a2 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2334,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; @@ -2426,7 +2430,6 @@ static ivas_error decodeG192( #endif } } - } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); if ( error == IVAS_ERR_END_OF_FILE ) @@ -2577,8 +2580,8 @@ static ivas_error decodeG192( } /*------------------------------------------------------------------------------------------* - * Flush what is still left in the VoIP Buffers.... - *------------------------------------------------------------------------------------------*/ + * Flush what is still left in the VoIP Buffers.... + *------------------------------------------------------------------------------------------*/ while ( nSamplesAvailableNext > 0 ) { @@ -2733,8 +2736,8 @@ static ivas_error decodeG192( } /*------------------------------------------------------------------------------------------* - * Printouts after decoding has finished - *------------------------------------------------------------------------------------------*/ + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ if ( !arg.quietModeEnabled ) { @@ -2766,8 +2769,8 @@ static ivas_error decodeG192( } /*------------------------------------------------------------------------------------------* - * Add zeros at the end to have equal length of synthesized signals - *------------------------------------------------------------------------------------------*/ + * Add zeros at the end to have equal length of synthesized signals + *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2784,8 +2787,8 @@ static ivas_error decodeG192( #endif /*------------------------------------------------------------------------------------------* - * Close files and deallocate resources - *------------------------------------------------------------------------------------------*/ + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ @@ -2816,10 +2819,10 @@ cleanup: #ifdef DEBUGGING /*---------------------------------------------------------------------* - * printBitstreamInfoVoip() - * - * Print bitstream info of a VoIP G.192 or RTPDUMP bitstream. - *---------------------------------------------------------------------*/ + * printBitstreamInfoVoip() + * + * Print bitstream info of a VoIP G.192 or RTPDUMP bitstream. + *---------------------------------------------------------------------*/ static ivas_error printBitstreamInfoVoip( DecArguments arg, @@ -2897,8 +2900,8 @@ static ivas_error printBitstreamInfoVoip( IVAS_DEC_PrintConfigWithVoipBitstream( hIvasDec, arg.quietModeEnabled, au, auSizeBits ); /*------------------------------------------------------------------------------------------* - * Close fhandles and deallocate resources - *------------------------------------------------------------------------------------------*/ + * Close fhandles and deallocate resources + *------------------------------------------------------------------------------------------*/ previewFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ @@ -2924,10 +2927,10 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer /*---------------------------------------------------------------------* - * decodeVoIP() - * - * Read G.192 or RTPDUMP bitstream and decode in VOIP - *---------------------------------------------------------------------*/ + * decodeVoIP() + * + * Read G.192 or RTPDUMP bitstream and decode in VOIP + *---------------------------------------------------------------------*/ static ivas_error decodeVoIP( DecArguments arg, @@ -3093,8 +3096,8 @@ static ivas_error decodeVoIP( #endif /*------------------------------------------------------------------------------------------* - * Main receiving/decoding loop - *------------------------------------------------------------------------------------------*/ + * Main receiving/decoding loop + *------------------------------------------------------------------------------------------*/ while ( 1 ) { @@ -3431,8 +3434,8 @@ static ivas_error decodeVoIP( } /*------------------------------------------------------------------------------------------* - * Add zeros at the end to have equal length of synthesized signals - *------------------------------------------------------------------------------------------*/ + * Add zeros at the end to have equal length of synthesized signals + *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) @@ -3442,8 +3445,8 @@ static ivas_error decodeVoIP( } /*------------------------------------------------------------------------------------------* - * Printouts after decoding has finished - *------------------------------------------------------------------------------------------*/ + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ if ( !arg.quietModeEnabled ) { @@ -3475,8 +3478,8 @@ static ivas_error decodeVoIP( } /*------------------------------------------------------------------------------------------* - * Close files and deallocate resources - *------------------------------------------------------------------------------------------*/ + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ @@ -3506,10 +3509,10 @@ cleanup: #ifdef DEBUGGING /*---------------------------------------------------------------------* - * parseForcedRendModeDec() - * - * - *---------------------------------------------------------------------*/ + * parseForcedRendModeDec() + * + * + *---------------------------------------------------------------------*/ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ) diff --git a/apps/encoder.c b/apps/encoder.c index 882187601b..835c4d18f9 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -686,7 +686,11 @@ 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; } diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..008f909ad1 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ - +#define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ diff --git a/lib_util/tsm_scale_file_reader.c b/lib_util/tsm_scale_file_reader.c index 775462253b..147f077f66 100644 --- a/lib_util/tsm_scale_file_reader.c +++ b/lib_util/tsm_scale_file_reader.c @@ -36,6 +36,9 @@ #include #include +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + struct TsmScaleFileReader { FILE *file; @@ -146,3 +149,6 @@ const char *TsmScaleFileReader_getFilePath( return self->file_path; } + +#endif +#endif diff --git a/lib_util/tsm_scale_file_reader.h b/lib_util/tsm_scale_file_reader.h index 4fe560e39b..7666a3b594 100644 --- a/lib_util/tsm_scale_file_reader.h +++ b/lib_util/tsm_scale_file_reader.h @@ -37,6 +37,9 @@ /* clang-format off */ +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + typedef struct TsmScaleFileReader TsmScaleFileReader; @@ -59,6 +62,9 @@ const char *TsmScaleFileReader_getFilePath( TsmScaleFileReader* self /* i/o: TsmScaleFileReader handle */ ); +#endif +#endif + /* clang-format on */ #endif /* IVAS_TSM_SCALE_FILE_READER_H */ -- GitLab From 55dc3a30bc1f14ce8b09e534e7dc8871dc4cd122 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 17:10:11 +0100 Subject: [PATCH 336/498] fix non-diegetic switch condition --- scripts/config/self_test_ltv.prm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index b9d765b97f..ff3b45d783 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -536,7 +536,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stv+4ISM48s.wav_brate_sw_48-48_DTX_EXT.tst // 4 ISM with extended metadata and non diegetic pan object switching bitrate 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out -../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM_with_no_diegetic_switch.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit +../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst -- GitLab From e00604ed8f918861d77fd8059265a4653748e520 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Feb 2024 17:57:28 +0100 Subject: [PATCH 337/498] clang-format --- apps/decoder.c | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index e8acfb67a2..5b0193cb7c 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2580,8 +2580,8 @@ static ivas_error decodeG192( } /*------------------------------------------------------------------------------------------* - * Flush what is still left in the VoIP Buffers.... - *------------------------------------------------------------------------------------------*/ + * Flush what is still left in the VoIP Buffers.... + *------------------------------------------------------------------------------------------*/ while ( nSamplesAvailableNext > 0 ) { @@ -2736,8 +2736,8 @@ static ivas_error decodeG192( } /*------------------------------------------------------------------------------------------* - * Printouts after decoding has finished - *------------------------------------------------------------------------------------------*/ + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ if ( !arg.quietModeEnabled ) { @@ -2769,8 +2769,8 @@ static ivas_error decodeG192( } /*------------------------------------------------------------------------------------------* - * Add zeros at the end to have equal length of synthesized signals - *------------------------------------------------------------------------------------------*/ + * Add zeros at the end to have equal length of synthesized signals + *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2787,8 +2787,8 @@ static ivas_error decodeG192( #endif /*------------------------------------------------------------------------------------------* - * Close files and deallocate resources - *------------------------------------------------------------------------------------------*/ + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ @@ -2819,10 +2819,10 @@ cleanup: #ifdef DEBUGGING /*---------------------------------------------------------------------* - * printBitstreamInfoVoip() - * - * Print bitstream info of a VoIP G.192 or RTPDUMP bitstream. - *---------------------------------------------------------------------*/ + * printBitstreamInfoVoip() + * + * Print bitstream info of a VoIP G.192 or RTPDUMP bitstream. + *---------------------------------------------------------------------*/ static ivas_error printBitstreamInfoVoip( DecArguments arg, @@ -2900,8 +2900,8 @@ static ivas_error printBitstreamInfoVoip( IVAS_DEC_PrintConfigWithVoipBitstream( hIvasDec, arg.quietModeEnabled, au, auSizeBits ); /*------------------------------------------------------------------------------------------* - * Close fhandles and deallocate resources - *------------------------------------------------------------------------------------------*/ + * Close fhandles and deallocate resources + *------------------------------------------------------------------------------------------*/ previewFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ @@ -2927,10 +2927,10 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer /*---------------------------------------------------------------------* - * decodeVoIP() - * - * Read G.192 or RTPDUMP bitstream and decode in VOIP - *---------------------------------------------------------------------*/ + * decodeVoIP() + * + * Read G.192 or RTPDUMP bitstream and decode in VOIP + *---------------------------------------------------------------------*/ static ivas_error decodeVoIP( DecArguments arg, @@ -3096,8 +3096,8 @@ static ivas_error decodeVoIP( #endif /*------------------------------------------------------------------------------------------* - * Main receiving/decoding loop - *------------------------------------------------------------------------------------------*/ + * Main receiving/decoding loop + *------------------------------------------------------------------------------------------*/ while ( 1 ) { @@ -3434,8 +3434,8 @@ static ivas_error decodeVoIP( } /*------------------------------------------------------------------------------------------* - * Add zeros at the end to have equal length of synthesized signals - *------------------------------------------------------------------------------------------*/ + * Add zeros at the end to have equal length of synthesized signals + *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) @@ -3445,8 +3445,8 @@ static ivas_error decodeVoIP( } /*------------------------------------------------------------------------------------------* - * Printouts after decoding has finished - *------------------------------------------------------------------------------------------*/ + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ if ( !arg.quietModeEnabled ) { @@ -3478,8 +3478,8 @@ static ivas_error decodeVoIP( } /*------------------------------------------------------------------------------------------* - * Close files and deallocate resources - *------------------------------------------------------------------------------------------*/ + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ @@ -3509,10 +3509,10 @@ cleanup: #ifdef DEBUGGING /*---------------------------------------------------------------------* - * parseForcedRendModeDec() - * - * - *---------------------------------------------------------------------*/ + * parseForcedRendModeDec() + * + * + *---------------------------------------------------------------------*/ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ) -- GitLab From d47f7b046fbfc8f61b2cf7cdd6058bfe4cc5aaf3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 16 Feb 2024 08:15:09 +0100 Subject: [PATCH 338/498] correct function description --- lib_dec/ivas_spar_decoder.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 58dcdb6dc7..776f606c4d 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1250,12 +1250,19 @@ void ivas_spar_dec_set_render_map( return; } - +#ifdef FIX_997_REMOVE_SPAR_DEC_UPMIXER /*-------------------------------------------------------------------* * ivas_spar_dec_set_render_params() * + * IVAS SPAR set rendering parameters + *-------------------------------------------------------------------*/ +#else +/*-------------------------------------------------------------------* + * ivas_spar_dec_upmixer() + * * IVAS SPAR upmixer *-------------------------------------------------------------------*/ +#endif void ivas_spar_dec_set_render_params( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -- GitLab From 6b82ff1d40a7564615d61968079999856da0c2b2 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 16 Feb 2024 09:53:28 +0100 Subject: [PATCH 339/498] remove obsolete code and tables for ParamMC --- lib_com/ivas_cnst.h | 4 ++++ lib_com/ivas_mc_param_com.c | 18 ++++++++++++------ lib_com/ivas_prot.h | 4 ++++ lib_com/ivas_rom_com.c | 11 ++++++++++- lib_com/ivas_stat_com.h | 4 ++++ lib_com/options.h | 3 ++- lib_dec/ivas_mc_param_dec.c | 14 +++++++++++--- lib_enc/ivas_mc_param_enc.c | 25 +++++++++++++++++++++---- 8 files changed, 68 insertions(+), 15 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e9173e6e93..48b1715412 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1390,7 +1390,11 @@ typedef enum #define PARAM_MC_MAX_DECORR_CLDFB_BANDS 20 /* Maximum number of CLDFB bands with decorrelation */ #define PARAM_MC_MAX_TRANSPORT_CHANS 4 /* Number of down mix channels */ #define PARAM_MC_MAX_ILD_REF_CHANNELS 2 /* Maximum number of reference channels for a coded ILD */ +#ifdef FIX_901_PARAMMC_DEAD_CODE +#define PARAM_MC_NUM_CONFIGS 14 /* Number of available Parametric MC configurations */ +#else #define PARAM_MC_NUM_CONFIGS 15 /* Number of available Parametric MC configurations */ +#endif #define PARAM_MC_MAX_BAND_LFE 1 /* Number of parameter bands for LFE coding */ #define PARAM_MC_SZ_ICC_MAP 11 /* Maximum number of transmitted ICCs per parameter band */ #define PARAM_MC_SZ_ILD_MAP 12 /* Maximum number of transmitted channel energies per band*/ diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index 44efdebe2e..429d28e131 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -128,22 +128,26 @@ void ivas_param_mc_metadata_open( { assert( 0 && "nbands must be 20 or 14!" ); } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /* create map of all possible ICCs */ ivas_param_mc_create_full_icc_mapping( nchan_setup, lfe_index, hMetadataPMC->icc_map_full, &hMetadataPMC->icc_map_size_full ); +#endif hMetadataPMC->icc_mapping_conf = ivas_param_mc_conf[config_index].icc_mapping_conf; hMetadataPMC->ild_mapping_conf = ivas_param_mc_conf[config_index].ild_mapping_conf; hMetadataPMC->ild_factors = ivas_param_mc_conf[config_index].ild_factors; +#ifndef FIX_901_PARAMMC_DEAD_CODE /* set default ICC maps */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) { ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[i] ); } - +#endif /* init remaining flags and indices */ hMetadataPMC->param_frame_idx = 0; +#ifndef FIX_901_PARAMMC_DEAD_CODE hMetadataPMC->flag_use_adaptive_icc_map = 0; +#endif hMetadataPMC->bAttackPresent = 0; hMetadataPMC->attackIndex = 0; hMetadataPMC->lfe_on = 1; @@ -198,7 +202,7 @@ void ivas_param_mc_set_coded_bands( return; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /*------------------------------------------------------------------------- * ivas_param_mc_metadata_close() * @@ -223,7 +227,7 @@ void ivas_param_mc_metadata_close( return; } - +#endif /*------------------------------------------------------------------------- * ivas_param_mc_getNumTransportChannels() @@ -247,7 +251,7 @@ int16_t ivas_param_mc_getNumTransportChannels( return nchan_transport; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /*------------------------------------------------------------------------- * ivas_param_mc_create_full_icc_mapping() * @@ -303,7 +307,6 @@ void ivas_param_mc_create_full_icc_mapping( return; } - /*------------------------------------------------------------------------- * ivas_param_mc_default_icc_map() * @@ -326,6 +329,7 @@ void ivas_param_mc_default_icc_map( return; } +#endif /*------------------------------------------------------------------------- @@ -408,9 +412,11 @@ static int16_t ivas_param_mc_get_num_param_bands( case IVAS_128k: num_parameter_bands = 14; break; +#ifndef FIX_901_PARAMMC_DEAD_CODE case IVAS_160k: num_parameter_bands = 20; break; +#endif } break; default: diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 594d00ee30..e736949e86 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3835,9 +3835,11 @@ void ivas_param_mc_set_coded_bands( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); +#ifndef FIX_901_PARAMMC_DEAD_CODE void ivas_param_mc_metadata_close( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); +#endif void ivas_param_mc_create_full_icc_mapping( const int16_t n_channels, /* i : number of channels with LFE for the internal setup */ @@ -3910,10 +3912,12 @@ void ivas_param_mc_dec( float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ); +#ifndef FIX_901_PARAMMC_DEAD_CODE void ivas_param_mc_default_icc_map( const PARAM_MC_ICC_MAPPING * hIccMapping, /* i : handle to ICC mapping configuration */ int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from the configuration */ ); +#endif /*! r: number of cldfb synthesis instances */ int16_t param_mc_get_num_cldfb_syntheses( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 50892fcf53..704b4355b1 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1973,6 +1973,7 @@ const float ivas_param_mc_ild_fac_CICP19_3tc[12] = 0.5f }; +#ifndef FIX_901_PARAMMC_DEAD_CODE const float ivas_param_mc_ild_fac_CICP19_4tc[12] = { 0.35f, @@ -1988,6 +1989,7 @@ const float ivas_param_mc_ild_fac_CICP19_4tc[12] = 0.5f, 0.2f, }; +#endif const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = { @@ -2052,6 +2054,7 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc = {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} }; +#ifndef FIX_901_PARAMMC_DEAD_CODE const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = { 11, @@ -2060,6 +2063,7 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = {1,1,2,1,1,1,1,1,1,1,1,2}, {{0},{1},{0,1},{0},{1},{0},{1},{2},{3},{2},{3},{0,1}} }; +#endif const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = { @@ -2161,6 +2165,7 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc = } }; +#ifndef FIX_901_PARAMMC_DEAD_CODE const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = { 8, @@ -2176,6 +2181,7 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = { 2, 3 } /* C/LFE */ } }; +#endif const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = { @@ -2332,7 +2338,9 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_icc_mapping_CICP19_3tc, &ivas_param_mc_dmx_fac_CICP19_3tc[0], &ivas_param_mc_ild_fac_CICP19_3tc[0] - }, + } +#ifndef FIX_901_PARAMMC_DEAD_CODE + , /* CICP19 160000 */ { MC_LS_SETUP_7_1_4, @@ -2344,6 +2352,7 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_dmx_fac_CICP19_4tc[0], &ivas_param_mc_ild_fac_CICP19_4tc[0] } + #endif }; const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 566abcb443..438cd4b102 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -595,11 +595,15 @@ typedef struct ivas_parametric_mc_metadata_struct { const PARAM_MC_ILD_MAPPING *ild_mapping_conf; const PARAM_MC_ICC_MAPPING *icc_mapping_conf; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t icc_mapping[PARAM_MC_PARAMETER_FRAMES][PARAM_MC_SZ_ICC_MAP][2]; int16_t *icc_map_full[2]; +#endif int16_t icc_map_size_full; int16_t param_frame_idx; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t flag_use_adaptive_icc_map; +#endif const float *ild_factors; int16_t coding_band_mapping[PARAM_MC_MAX_PARAMETER_BANDS]; int16_t nbands_in_param_frame[PARAM_MC_PARAMETER_FRAMES]; diff --git a/lib_com/options.h b/lib_com/options.h index a4eab8337d..b8e746503e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,8 +151,9 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_643_PCA_OPTION /* VA: issue 643: rename PCA bypass command-line option */ +#define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ -/* #################### End BE switches ################################## */ + /* #################### End BE switches ################################## */ #define FIX_899_VARIABLE_SPEED_DECODING /* FhG: Fix variable speed decoding */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 3352a79781..f12eaba92c 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -629,6 +629,7 @@ ivas_error ivas_param_mc_dec_reconfig( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; +#ifndef FIX_901_PARAMMC_DEAD_CODE /* deallocate the full icc map, gets newly allocated in the metadata open function */ for ( k = 0; k < 2; k++ ) @@ -642,6 +643,7 @@ ivas_error ivas_param_mc_dec_reconfig( hParamMC->hMetadataPMC->icc_map_full[k] = NULL; } } +#endif mvs2s( hParamMC->band_grouping, band_grouping_old, hParamMC->hMetadataPMC->num_parameter_bands + 1 ); @@ -1104,8 +1106,9 @@ void ivas_param_mc_dec_close( /* parameter decoding */ if ( hParamMC->hMetadataPMC != NULL ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_close( hParamMC->hMetadataPMC ); - +#endif free( hParamMC->hMetadataPMC ); hParamMC->hMetadataPMC = NULL; } @@ -1310,6 +1313,7 @@ void ivas_param_mc_dec_read_BS( num_lfe_bands = 0; } +#ifndef FIX_901_PARAMMC_DEAD_CODE if ( hMetadataPMC->flag_use_adaptive_icc_map == 1 ) { int16_t icc_mapping_index[PARAM_MC_SZ_ICC_MAP]; @@ -1368,6 +1372,7 @@ void ivas_param_mc_dec_read_BS( ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx] ); } } +#endif ivas_param_mc_bs_decode_parameter_values( bit_buffer, &bit_pos, bits_to_copy, &st->BER_detect, hMetadataPMC, &hMetadataPMC->icc_coding, icc_map_size_wo_lfe, icc_map_size, num_lfe_bands, band_step, num_param_bands, hParamMC->icc_q ); @@ -1905,7 +1910,6 @@ void ivas_param_mc_dec_render( return; } - /*------------------------------------------------------------------------- * ivas_param_mc_dec() * @@ -1946,7 +1950,6 @@ void ivas_param_mc_dec( return; } - /*------------------------------------------------------------------------- * param_mc_dec_init() * @@ -2771,8 +2774,13 @@ static void ivas_param_mc_dequantize_cov( /* replace some estimated ICCs with transmitted values */ for ( k = 0; k < hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe; k++ ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1]] = icc_q[k]; Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0]] = icc_q[k]; +#else + Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1]] = icc_q[k]; + Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0]] = icc_q[k]; +#endif } if ( param_band_index >= PARAM_MC_MAX_BAND_LFE || !hParamMC->hMetadataPMC->lfe_on ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index fba2975665..ec050bf9b0 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -62,7 +62,9 @@ static void ivas_param_mc_parameter_quantizer( const float *x, const int16_t L, static void ivas_param_mc_transient_detection( PARAM_MC_ENC_HANDLE hParamMC, TRAN_DET_HANDLE hTranDet, int16_t *bAttackPresent, int16_t *attackIdx ); +#ifndef FIX_901_PARAMMC_DEAD_CODE static void ivas_param_mc_enc_find_icc_map( PARAM_MC_ENC_HANDLE hParamMC, float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], const int16_t nchan_input, const int16_t nchan_transport ); +#endif static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); @@ -154,6 +156,7 @@ ivas_error ivas_param_mc_enc_open( /* open/init parameter coding */ ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); +#ifndef FIX_901_PARAMMC_DEAD_CODE /* init icc index states */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) { @@ -170,6 +173,7 @@ ivas_error ivas_param_mc_enc_open( } } } +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) @@ -280,6 +284,7 @@ ivas_error ivas_param_mc_enc_reconfig( /* get dmx factors */ hParamMC->dmx_factors = ivas_param_mc_conf[config_index].dmx_fac; +#ifndef FIX_901_PARAMMC_DEAD_CODE /* deallocate the full icc map, gets newly allocated in the metadata open function */ for ( i = 0; i < 2; i++ ) { @@ -292,10 +297,12 @@ ivas_error ivas_param_mc_enc_reconfig( hParamMC->hMetadataPMC.icc_map_full[i] = NULL; } } +#endif /* open/init parameter coding */ ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); +#ifndef FIX_901_PARAMMC_DEAD_CODE /* init icc index states */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) { @@ -312,6 +319,7 @@ ivas_error ivas_param_mc_enc_reconfig( } } } +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) @@ -374,9 +382,9 @@ void ivas_param_mc_enc_close( { return; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); - +#endif ivas_FB_mixer_close( &( *hParamMC )->hFbMixer, sampling_rate, 0 ); free( ( *hParamMC ) ); @@ -510,6 +518,7 @@ void ivas_param_mc_enc( ivas_param_mc_quantize_ilds( hParamMC, Cy_sum[k], Cx_sum[k], k, nchan_inp, st_ivas->nchan_transport, ILD_idx, ILD_q[k] ); } +#ifndef FIX_901_PARAMMC_DEAD_CODE /* get icc map */ if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) { @@ -519,6 +528,7 @@ void ivas_param_mc_enc( { ivas_param_mc_default_icc_map( hParamMC->hMetadataPMC.icc_mapping_conf, hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx] ); } +#endif /* ICC parameter quantization */ for ( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) @@ -986,7 +996,7 @@ static void ivas_param_mc_param_est_enc( return; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /*------------------------------------------------------------------------- * ivas_param_mc_enc_find_icc_map() * @@ -1209,7 +1219,7 @@ static void ivas_param_mc_enc_find_icc_map( return; } - +#endif /*------------------------------------------------------------------------- * ivas_param_mc_quantize_ilds() @@ -1447,8 +1457,13 @@ static void ivas_param_mc_quantize_iccs( /* Reduce set of parameters and quantize them */ for ( k = 0; k < num_iccs_to_code; ++k ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][0]; tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][1]; +#else + tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][0]; + tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][1]; +#endif ICC_vect[k] = Cy[tmp_map[0]][tmp_map[1]]; } @@ -1626,6 +1641,7 @@ static void ivas_param_mc_write_bs( nbands = hParamMC->hMetadataPMC.nbands_coded / band_step + ( ( hParamMC->hMetadataPMC.nbands_coded % band_step ) ? 1 : 0 ); } +#ifndef FIX_901_PARAMMC_DEAD_CODE /* Encoding of the ICC mapping done as simple bitmap */ if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) { @@ -1643,6 +1659,7 @@ static void ivas_param_mc_write_bs( *bit_pos += hParamMC->hMetadataPMC.icc_map_size_full - 1; } +#endif ivas_param_mc_encode_parameter( ICC_idx, &hParamMC->hMetadataPMC, &hParamMC->hMetadataPMC.icc_coding, nbands, band_step, icc_map_size_wo_lfe, icc_map_size, bit_buffer, bit_pos ); -- GitLab From 61e9983fe110a13f1c1325db82b19b9990c1d71b Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 16 Feb 2024 10:14:55 +0100 Subject: [PATCH 340/498] fix #901, remove dead ParamMC code and tables, change a few more defines, fix compiler warnings --- lib_com/ivas_cnst.h | 4 ++++ lib_com/ivas_mc_param_com.c | 8 ++++++-- lib_com/ivas_prot.h | 5 +++-- lib_dec/ivas_mc_param_dec.c | 14 ++++++++++++-- lib_enc/ivas_mc_param_enc.c | 19 ++++++++++++++++--- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 447c7b6e55..e409c2a891 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1392,7 +1392,11 @@ typedef enum #define PARAM_MC_ICC_ERROR_BIAS_FAC (1.15f) /* factor for favouring past ICC maps in the adaptive ICC map decision */ #define PARAM_MC_TRANSIENT_BAND_STEP 2 /* Number of parameter bands combined in case of a transient frame*/ #define PARAM_MC_MAX_DECORR_CLDFB_BANDS 20 /* Maximum number of CLDFB bands with decorrelation */ +#ifdef FIX_901_PARAMMC_DEAD_CODE +#define PARAM_MC_MAX_TRANSPORT_CHANS 3 /* Number of down mix channels */ +#else #define PARAM_MC_MAX_TRANSPORT_CHANS 4 /* Number of down mix channels */ +#endif #define PARAM_MC_MAX_ILD_REF_CHANNELS 2 /* Maximum number of reference channels for a coded ILD */ #ifdef FIX_901_PARAMMC_DEAD_CODE #define PARAM_MC_NUM_CONFIGS 14 /* Number of available Parametric MC configurations */ diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index 4584b01194..f38f071920 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -86,13 +86,17 @@ uint16_t ivas_param_mc_get_configuration_index( *------------------------------------------------------------------------*/ void ivas_param_mc_metadata_open( - const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ - const int16_t lfe_index, /* i : channel index of LFE */ + const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ +#ifndef FIX_901_PARAMMC_DEAD_CODE + const int16_t lfe_index, /* i : channel index of LFE */ +#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t i; +#endif uint16_t config_index; int16_t nchan_setup; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index bd8a91b5d0..dfa2b05456 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3805,7 +3805,9 @@ void ivas_mc_paramupmix_dec_render( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ + #ifndef FIX_901_PARAMMC_DEAD_CODE const int16_t lfe_index, /* i : channel index of LFE */ + #endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ); @@ -3818,7 +3820,6 @@ void ivas_param_mc_set_coded_bands( void ivas_param_mc_metadata_close( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); -#endif void ivas_param_mc_create_full_icc_mapping( const int16_t n_channels, /* i : number of channels with LFE for the internal setup */ @@ -3826,7 +3827,7 @@ void ivas_param_mc_create_full_icc_mapping( int16_t *icc_map[2], /* o : map of all possible ICCs */ int16_t *icc_map_size_full /* o : number of all possible ICCs */ ); - +#endif /*! r: number of IVAS transport channels */ int16_t ivas_param_mc_getNumTransportChannels( const int32_t ivas_total_bitrate, /* i : IVAS total bitrate */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index a5035ade02..937cc87339 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -228,7 +228,11 @@ ivas_error ivas_param_mc_dec_open( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); +#else + ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); +#endif /* init arrays for quantized parameters */ if ( ( hParamMC->icc_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ) ) == NULL ) @@ -642,8 +646,11 @@ ivas_error ivas_param_mc_dec_reconfig( #endif mvs2s( hParamMC->band_grouping, band_grouping_old, hParamMC->hMetadataPMC->num_parameter_bands + 1 ); - +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); +#else + ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 ) @@ -1218,7 +1225,10 @@ void ivas_param_mc_dec_read_BS( int16_t num_lfe_bands; int16_t num_param_bands; int16_t metadata_bit_pos; - int16_t i, j, k, l; + int16_t i, j, k; +#ifndef FIX_901_PARAMMC_DEAD_CODE + int16_t l; +#endif int16_t icc_map_size; int16_t icc_map_size_wo_lfe; int16_t ild_map_size; diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 6d9e31be10..eac2d3d194 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -88,7 +88,10 @@ ivas_error ivas_param_mc_enc_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ) { - int16_t i, k, l; + int16_t i; +#ifndef FIX_901_PARAMMC_DEAD_CODE + int16_t k, l; +#endif IVAS_FB_CFG *fb_cfg; PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; @@ -154,8 +157,11 @@ ivas_error ivas_param_mc_enc_open( } /* open/init parameter coding */ +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); - +#else + ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); +#endif #ifndef FIX_901_PARAMMC_DEAD_CODE /* init icc index states */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) @@ -239,7 +245,10 @@ ivas_error ivas_param_mc_enc_reconfig( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ) { - int16_t i, k, l; + int16_t i; +#ifndef FIX_901_PARAMMC_DEAD_CODE + int16_t k, l; +#endif PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; MC_LS_SETUP mc_input_setup; @@ -300,7 +309,11 @@ ivas_error ivas_param_mc_enc_reconfig( #endif /* open/init parameter coding */ +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); +#else + ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); +#endif #ifndef FIX_901_PARAMMC_DEAD_CODE /* init icc index states */ -- GitLab From cd4e1cae44889d33b96fa4a5c36076d358de5709 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 16 Feb 2024 10:25:40 +0100 Subject: [PATCH 341/498] fix for #901, remove dead ParamMC code, fix a compiler warning --- lib_com/ivas_mc_param_com.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index f38f071920..b1c0bdedd4 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -98,9 +98,11 @@ void ivas_param_mc_metadata_open( int16_t i; #endif uint16_t config_index; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t nchan_setup; nchan_setup = ivas_mc_ls_setup_get_num_channels( mc_ls_setup ); +#endif /* get coding band mappings */ set_s( hMetadataPMC->coding_band_mapping, 0, PARAM_MC_MAX_PARAMETER_BANDS ); -- GitLab From fa4094af079bfe7c23ba31dec4ab3206002821ab Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 16 Feb 2024 10:29:19 +0100 Subject: [PATCH 342/498] fix for #901, remove dead ParamMC code, fix Linux compiler warnings --- lib_dec/ivas_mc_param_dec.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 937cc87339..512e83a134 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -114,7 +114,9 @@ ivas_error ivas_param_mc_dec_open( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; +#ifndef FIX_901_PARAMMC_DEAD_CODE IVAS_OUTPUT_SETUP hTransportSetup; +#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -146,8 +148,9 @@ ivas_error ivas_param_mc_dec_open( output_Fs = st_ivas->hDecoderConfig->output_Fs; output_config = st_ivas->hDecoderConfig->output_config; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - +#ifndef FIX_901_PARAMMC_DEAD_CODE hTransportSetup = st_ivas->hTransSetup; +#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; hParamMC->hoa_encoder = NULL; @@ -555,7 +558,9 @@ ivas_error ivas_param_mc_dec_reconfig( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; +#ifndef FIX_901_PARAMMC_DEAD_CODE IVAS_OUTPUT_SETUP hTransportSetup; +#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -584,8 +589,9 @@ ivas_error ivas_param_mc_dec_reconfig( output_Fs = st_ivas->hDecoderConfig->output_Fs; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - +#ifndef FIX_901_PARAMMC_DEAD_CODE hTransportSetup = st_ivas->hTransSetup; +#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; @@ -2724,11 +2730,15 @@ static void ivas_param_mc_dequantize_cov( int16_t l; float *Cyp; float ap; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t param_frame_idx; +#endif const PARAM_MC_ILD_MAPPING *h_ild_mapping; float Cy_state_int[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; +#ifndef FIX_901_PARAMMC_DEAD_CODE param_frame_idx = hParamMC->hMetadataPMC->param_frame_idx; +#endif set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); h_ild_mapping = hParamMC->hMetadataPMC->ild_mapping_conf; -- GitLab From df38406c3610acd080b1c243cb3bbc92edc59526 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 16 Feb 2024 10:45:23 +0100 Subject: [PATCH 343/498] fix for #901, remove dead ParamMC code, fix formatting --- lib_com/ivas_prot.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index dfa2b05456..c77bc25bf4 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3805,9 +3805,9 @@ void ivas_mc_paramupmix_dec_render( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ - #ifndef FIX_901_PARAMMC_DEAD_CODE +#ifndef FIX_901_PARAMMC_DEAD_CODE const int16_t lfe_index, /* i : channel index of LFE */ - #endif +#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ); -- GitLab From d435f5f452126fb222bf75e4c36a3cc74b6ceee8 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 12:09:34 +0100 Subject: [PATCH 344/498] allow head rotation with HOA3 output signals for debugging --- apps/decoder.c | 2 ++ lib_com/options.h | 4 +++- lib_dec/ivas_init_dec.c | 5 ++++- lib_dec/ivas_output_config.c | 12 ++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 01e6b4f3d1..ca40ee51b1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,6 +306,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ +#if 0 if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM @@ -315,6 +316,7 @@ int main( fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; } +#endif if ( ( error = RotationFileReader_open( arg.headrotTrajFileName, &headRotReader ) ) != IVAS_ERR_OK ) { diff --git a/lib_com/options.h b/lib_com/options.h index a8336495ef..6552e1ea1d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,9 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ -#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ +#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ + +#define ALLOW_HOA3_ROTATION /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e1b6a6a415..03a345e4ea 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3130,12 +3130,14 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); } #endif - if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM +#endif +#ifdef ALLOW_HOA3_ROTATION + || output_config == IVAS_AUDIO_CONFIG_HOA3 #endif ) ) { @@ -3143,6 +3145,7 @@ static ivas_error doSanityChecks_IVAS( } } + if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 346a6095da..45d736a602 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -79,6 +79,18 @@ void ivas_renderer_select( st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; } +#ifdef ALLOW_HOA3_ROTATION + if (output_config == IVAS_AUDIO_CONFIG_HOA3) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + +#ifdef NONBE_FIX_998_DIRAC_ROTATION + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; +#endif + + } +#endif + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM -- GitLab From 23ea487d619ede9461db73de69ab4372ea10d012 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 16 Feb 2024 12:16:49 +0100 Subject: [PATCH 345/498] fix for #999, fix MCT renderer flushing on JBM rate switch --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..8af747f9f4 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,7 @@ #endif #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ +#define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index cb68cd2ddd..f19ab688d8 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1692,7 +1692,11 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); } +#ifdef NONBE_FIX_999_JBM_MCT_FLUSH + else if ( renderer_type_old == RENDERER_BINAURAL_OBJECTS_TD ) +#else else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) +#endif { if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { @@ -1701,6 +1705,12 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); } +#ifdef NONBE_FIX_999_JBM_MCT_FLUSH + else + { + return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong renderer in MCT VoIP renderer flushing!" ); + } +#endif } else { -- GitLab From d5255de12f598b1bcae6e9d7f00cf11536d738ef Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 12:17:32 +0100 Subject: [PATCH 346/498] fix formatting --- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_output_config.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 03a345e4ea..4355f45079 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3137,7 +3137,7 @@ static ivas_error doSanityChecks_IVAS( || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif #ifdef ALLOW_HOA3_ROTATION - || output_config == IVAS_AUDIO_CONFIG_HOA3 + || output_config == IVAS_AUDIO_CONFIG_HOA3 #endif ) ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 45d736a602..0305858161 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -80,15 +80,14 @@ void ivas_renderer_select( } #ifdef ALLOW_HOA3_ROTATION - if (output_config == IVAS_AUDIO_CONFIG_HOA3) - { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #ifdef NONBE_FIX_998_DIRAC_ROTATION st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; #endif - - } + } #endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -- GitLab From c74fb65e054bd21aa118befa2500bc8553fbacbf Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Feb 2024 13:44:56 +0200 Subject: [PATCH 347/498] Fix issue 991 by correctly using provided HRTF structure for ParamBin in rendering. --- lib_com/options.h | 1 + lib_dec/ivas_dirac_dec.c | 4 + lib_dec/ivas_init_dec.c | 4 + lib_dec/ivas_ism_dec.c | 8 ++ lib_rend/ivas_dirac_dec_binaural_functions.c | 103 ++++++++++++++++++- lib_rend/ivas_prot_rend.h | 4 + lib_rend/ivas_stat_rend.h | 19 ++++ lib_rend/lib_rend.c | 24 ++++- 8 files changed, 160 insertions(+), 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..3f9d7f83aa 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,7 @@ #endif #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ +#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f7f152b738..8e3f383fea 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -872,7 +872,11 @@ ivas_error ivas_dirac_dec_config( if ( st_ivas->hDiracDecBin == NULL ) #endif { +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e1b6a6a415..18c9a98603 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2006,7 +2006,11 @@ ivas_error ivas_init_decoder( } } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 5583f58651..dc05cdbdb1 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -263,7 +263,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -294,7 +298,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e0a4dc9549..ecfece02e0 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -119,9 +119,17 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( COM static void formulate2x2MixingMatrix( float Ein1, float Ein2, float CinRe, float CinIm, float Eout1, float Eout2, float CoutRe, float CoutIm, float Q[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], const float regularizationFactor ); +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF +static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); +#else static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue ); +#endif +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF +static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); +#else static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked ); +#endif static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); @@ -140,8 +148,12 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR *------------------------------------------------------------------------*/ ivas_error ivas_dirac_dec_init_binaural_data( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ +#else HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ +#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -173,6 +185,9 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->hReverb = NULL; hDiracDecBin->h_freq_domain_decorr_ap_params = NULL; hDiracDecBin->h_freq_domain_decorr_ap_state = NULL; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + hDiracDecBin->phHrtfParambin = NULL; +#endif } output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -224,7 +239,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#else + mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || @@ -239,7 +258,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL ) #endif { - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -303,6 +326,10 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + hDiracDecBin->phHrtfParambin = phHrtfParambin; +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT st_ivas->hDiracDecBin[pos_idx] = hDiracDecBin; } @@ -1289,7 +1316,11 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = max( spreadCoh, altSpreadCoh ); } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->hHrtfParambin ); +#else getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); +#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1332,7 +1363,11 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->hHrtfParambin ); +#else getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); +#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1342,7 +1377,11 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->hHrtfParambin ); +#else getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); +#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -1731,7 +1770,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = max( spreadCoh, altSpreadCoh ); } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); +#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1774,7 +1817,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); +#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1784,7 +1831,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); +#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -2172,7 +2223,11 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin->processMtxImPrev[chA][chB + 2][bin] = hDiracDecBin->processMtxIm[chA][chB + 2][bin]; } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked ); +#endif hDiracDecBin->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; hDiracDecBin->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; @@ -2947,7 +3002,12 @@ static void getDirectPartGains( const uint8_t renderStereoOutputInsteadOfBinaural, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, - const int16_t isHeadtracked ) + const int16_t isHeadtracked +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + , + HRTFS_PARAMBIN_HANDLE hHrtfParambin +#endif +) { float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; @@ -2992,7 +3052,11 @@ static void getDirectPartGains( { if ( aziDeg == gainCache->azi && eleDeg == gainCache->ele ) { +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE, hHrtfParambin ); +#else hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE ); +#endif } else { @@ -3002,7 +3066,11 @@ static void getDirectPartGains( { rotateAziEle( (float) aziDeg, (float) eleDeg, &aziDeg, &eleDeg, Rmat, 0 ); } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE, hHrtfParambin ); +#else hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE ); +#endif } } @@ -3019,9 +3087,20 @@ static void hrtfShGetHrtf( float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, - const int16_t useCachedValue ) + const int16_t useCachedValue +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + , + HRTFS_PARAMBIN_HANDLE hHrtfParambin +#endif +) { int16_t k; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + float( *hrtfShCoeffsReInt )[16][60]; + float( *hrtfShCoeffsImInt )[16][60]; + hrtfShCoeffsReInt = hHrtfParambin->hrtfShCoeffsRe; + hrtfShCoeffsImInt = hHrtfParambin->hrtfShCoeffsIm; +#endif *lRealp = 0.0f; *lImagp = 0.0f; @@ -3035,10 +3114,17 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; + *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; + *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; + *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; +#else *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; +#endif } } else @@ -3052,10 +3138,17 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; + *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; + *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; + *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; +#else *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; +#endif gainCache->shVec[k] = shVec[k]; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 975a2356aa..e2f7b5d091 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -245,7 +245,11 @@ void ivas_masa_ext_rend_parambin_render( ); ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ +#else HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ +#endif ); void ivas_dirac_dec_close_binaural_data( diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index bb91a6e7ab..d5701c81f6 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -500,6 +500,19 @@ typedef struct ivas_diffuse_distribution_data_structure } DIFFUSE_DISTRIBUTION_DATA, *DIFFUSE_DISTRIBUTION_HANDLE; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF +/* Parametric binaural renderer HRTF structure */ +typedef struct ivas_hrtfs_parambin_struct +{ + float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; + float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; + + float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; + float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; + float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; + +} HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; +#endif /* Parametric binaural data structure */ typedef struct ivas_dirac_dec_binaural_data_structure @@ -536,6 +549,10 @@ typedef struct ivas_dirac_dec_binaural_data_structure ivas_td_decorr_state_t *hTdDecorr; float reqularizationFactor; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + HRTFS_PARAMBIN_HANDLE *phHrtfParambin; +#endif + DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; HANDLE_DIRAC_DECORR_PARAMS h_freq_domain_decorr_ap_params; @@ -1314,6 +1331,7 @@ typedef struct ivas_hrtfs_fastconv_struct } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; +#ifndef NONBE_FIX_991_PARAMBIN_BINARY_HRTF typedef struct ivas_hrtfs_parambin_struct { float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; @@ -1324,6 +1342,7 @@ typedef struct ivas_hrtfs_parambin_struct float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; +#endif typedef struct ivas_hrtfs_statistics_struct { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8194de9fba..fec022e19f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -9262,7 +9262,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + HRTFS_PARAMBIN_HANDLE *phHrtfParambin; +#else HRTFS_PARAMBIN_HANDLE hHrtfParambin; +#endif int16_t nBins; int32_t output_Fs; RENDERER_TYPE renderer_type; @@ -9276,7 +9280,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + phHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; +#else hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); +#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -9346,7 +9354,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#else + mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ @@ -9354,7 +9366,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( hDiracDecBin->hReverb == NULL ) #endif { - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#else + if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -9395,6 +9411,10 @@ static ivas_error ivas_masa_ext_rend_parambin_init( /* External renderer uses constant regularization factor */ hDiracDecBin->reqularizationFactor = 0.4f; +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + hDiracDecBin->phHrtfParambin = phHrtfParambin; +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT inputMasa->hMasaExtRend->hDiracDecBin[pos_idx] = hDiracDecBin; } -- GitLab From 652da7527703f13dced59b7883c3f7f2802e1d7a Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 12:30:50 +0100 Subject: [PATCH 348/498] fix condition for shf_rot_max_order setting under ALLOW_HOA3_ROTATION --- lib_dec/ivas_output_config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 0305858161..92a17bf7f2 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -80,7 +80,8 @@ void ivas_renderer_select( } #ifdef ALLOW_HOA3_ROTATION - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 ) + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; -- GitLab From dc1087e079865b176217f4a77f1de9acb2edf69c Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 16 Feb 2024 12:51:54 +0100 Subject: [PATCH 349/498] formatting of empty lines --- lib_com/ivas_mc_param_com.c | 1 + lib_com/ivas_prot.h | 2 +- lib_com/ivas_rom_com.c | 8 ++++---- lib_dec/ivas_mc_param_dec.c | 5 +++-- lib_enc/ivas_mc_param_enc.c | 11 ++++++----- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index b1c0bdedd4..5a11a90d86 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -134,6 +134,7 @@ void ivas_param_mc_metadata_open( { assert( 0 && "nbands must be 20 or 14!" ); } + #ifndef FIX_901_PARAMMC_DEAD_CODE /* create map of all possible ICCs */ ivas_param_mc_create_full_icc_mapping( nchan_setup, lfe_index, hMetadataPMC->icc_map_full, &hMetadataPMC->icc_map_size_full ); diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c77bc25bf4..2fea7f535b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3897,8 +3897,8 @@ void ivas_param_mc_default_icc_map( const PARAM_MC_ICC_MAPPING * hIccMapping, /* i : handle to ICC mapping configuration */ int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from the configuration */ ); -#endif +#endif /*! r: number of cldfb synthesis instances */ int16_t param_mc_get_num_cldfb_syntheses( Decoder_Struct *st_ivas /* i : IVAS decoder structure */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index cae38ec552..8ab2c86821 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1989,8 +1989,8 @@ const float ivas_param_mc_ild_fac_CICP19_4tc[12] = 0.5f, 0.2f, }; -#endif +#endif const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = { 5, @@ -2063,8 +2063,8 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = {1,1,2,1,1,1,1,1,1,1,1,2}, {{0},{1},{0,1},{0},{1},{0},{1},{2},{3},{2},{3},{0,1}} }; -#endif +#endif const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = { 4, @@ -2181,8 +2181,8 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = { 2, 3 } /* C/LFE */ } }; -#endif +#endif const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = { /* CICP6 48000 */ @@ -2352,7 +2352,7 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_dmx_fac_CICP19_4tc[0], &ivas_param_mc_ild_fac_CICP19_4tc[0] } - #endif +#endif }; const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 512e83a134..45ed71c978 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -649,9 +649,10 @@ ivas_error ivas_param_mc_dec_reconfig( hParamMC->hMetadataPMC->icc_map_full[k] = NULL; } } -#endif +#endif mvs2s( hParamMC->band_grouping, band_grouping_old, hParamMC->hMetadataPMC->num_parameter_bands + 1 ); + #ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); #else @@ -1382,8 +1383,8 @@ void ivas_param_mc_dec_read_BS( ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx] ); } } -#endif +#endif ivas_param_mc_bs_decode_parameter_values( bit_buffer, &bit_pos, bits_to_copy, &st->BER_detect, hMetadataPMC, &hMetadataPMC->icc_coding, icc_map_size_wo_lfe, icc_map_size, num_lfe_bands, band_step, num_param_bands, hParamMC->icc_q ); if ( !st->BER_detect ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index eac2d3d194..b32bb1ce5d 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -64,8 +64,8 @@ static void ivas_param_mc_transient_detection( PARAM_MC_ENC_HANDLE hParamMC, TRA #ifndef FIX_901_PARAMMC_DEAD_CODE static void ivas_param_mc_enc_find_icc_map( PARAM_MC_ENC_HANDLE hParamMC, float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], const int16_t nchan_input, const int16_t nchan_transport ); -#endif +#endif static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t freq_idx, const int16_t nchan_input, const int16_t nchan_transport, int16_t *ILD_idx_out, float ILD_q[PARAM_MC_SZ_ILD_MAP] ); @@ -306,8 +306,8 @@ ivas_error ivas_param_mc_enc_reconfig( hParamMC->hMetadataPMC.icc_map_full[i] = NULL; } } -#endif +#endif /* open/init parameter coding */ #ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); @@ -332,8 +332,8 @@ ivas_error ivas_param_mc_enc_reconfig( } } } -#endif +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) { @@ -395,6 +395,7 @@ void ivas_param_mc_enc_close( { return; } + #ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); #endif @@ -541,8 +542,8 @@ void ivas_param_mc_enc( { ivas_param_mc_default_icc_map( hParamMC->hMetadataPMC.icc_mapping_conf, hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx] ); } -#endif +#endif /* ICC parameter quantization */ for ( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) { @@ -1672,8 +1673,8 @@ static void ivas_param_mc_write_bs( *bit_pos += hParamMC->hMetadataPMC.icc_map_size_full - 1; } -#endif +#endif ivas_param_mc_encode_parameter( ICC_idx, &hParamMC->hMetadataPMC, &hParamMC->hMetadataPMC.icc_coding, nbands, band_step, icc_map_size_wo_lfe, icc_map_size, bit_buffer, bit_pos ); -- GitLab From 9157e765c44d8af5eb67b5c9f088e6ea18e6921c Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 13:10:22 +0100 Subject: [PATCH 350/498] fix msan error with ALLOW_HOA3_ROTATION --- lib_dec/ivas_output_config.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 92a17bf7f2..b0895bf031 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -80,15 +80,18 @@ void ivas_renderer_select( } #ifdef ALLOW_HOA3_ROTATION - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) + if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; #endif - } + } + } #endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -- GitLab From 2eb58fd7bb640342297e72d84386efae225c924e Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Feb 2024 14:35:31 +0200 Subject: [PATCH 351/498] Fix split renderer path --- lib_rend/ivas_dirac_dec_binaural_functions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index ecfece02e0..f8de00c034 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1317,7 +1317,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( } #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->hHrtfParambin ); + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); #else getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); #endif @@ -1364,7 +1364,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the left source of the three coherent sources */ #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->hHrtfParambin ); + getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); #else getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); #endif @@ -1378,7 +1378,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->hHrtfParambin ); + getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); #else getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); #endif -- GitLab From e516bcd290d3b87569b16d6c1393bbf59044a162 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 13:42:11 +0100 Subject: [PATCH 352/498] fix formatting --- lib_dec/ivas_output_config.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index b0895bf031..8af2c4c531 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -82,16 +82,16 @@ void ivas_renderer_select( #ifdef ALLOW_HOA3_ROTATION if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) - { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; #endif - } - } + } + } #endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -- GitLab From b1f5fd5fb122174fe71cc4661bb5bccf826c4978 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 13:58:02 +0100 Subject: [PATCH 353/498] disable ALLOW_HOA3_ROTATION --- lib_com/options.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6552e1ea1d..67cda97653 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,9 +123,10 @@ /*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/* #define DEBUG_OSBA */ +/*#define DEBUG_OSBA */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ +/*#define ALLOW_HOA3_ROTATION*/ /* Allow outputting rotated HOA3 signals */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ @@ -184,8 +185,6 @@ #define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ -#define ALLOW_HOA3_ROTATION - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From 0808e7afda50dcc03125b7a3a38ad06a59cfea36 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 16 Feb 2024 14:08:02 +0100 Subject: [PATCH 354/498] fix typo: 60 kbps -> 64 kbps --- scripts/config/self_test.prm | 2 +- scripts/config/self_test_ltv.prm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 9c0a6d262a..7c17cd4f53 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1465,7 +1465,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit -// EVS non-diegetic panning at 60 kbps, 48kHz in, 48kHz out, STEREO out +// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod 64000 48 testv/stv48c.wav bit ../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 856ed910d4..d1b233d26e 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1465,7 +1465,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit -// EVS non-diegetic panning at 60 kbps, 48kHz in, 48kHz out, STEREO out +// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit ../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst -- GitLab From 50afee7f73060717ee159f79316a7c0bbde4471a Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 16 Feb 2024 15:09:08 +0100 Subject: [PATCH 355/498] fix command-line for IVAS decoder --- scripts/config/self_test.prm | 2 +- scripts/config/self_test_ltv.prm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 7c17cd4f53..83aa9ac504 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1471,7 +1471,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit // 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod -ism 1 testv/stvISM1.csv 32000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -non_diegetic_pan 80 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst +../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index d1b233d26e..9999e09d25 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1471,7 +1471,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit // 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod -ism 1 testv/ltv1ISM.csv 32000 48 testv/ltv48_1ISM.wav bit -../IVAS_dec -non_diegetic_pan 80 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst +../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst -- GitLab From 8e1b1a5c52c578087021e9f604837c2a43f92a18 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 16 Feb 2024 15:17:37 +0100 Subject: [PATCH 356/498] formal improvements --- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_output_config.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 4355f45079..58329a6ce4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3130,6 +3130,7 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); } #endif + if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB @@ -3145,7 +3146,6 @@ static ivas_error doSanityChecks_IVAS( } } - if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 8af2c4c531..7b77db1076 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -85,15 +85,15 @@ void ivas_renderer_select( nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; - #ifdef NONBE_FIX_998_DIRAC_ROTATION st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; +#else + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #endif } } -#endif +#endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM @@ -197,18 +197,21 @@ void ivas_renderer_select( { nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + +#ifdef NONBE_FIX_998_DIRAC_ROTATION + if ( nchan_internal == 4 || nchan_internal == 3 || nchan_internal == 2 ) +#else if ( nchan_internal == 2 ) +#endif { st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } +#ifndef NONBE_FIX_998_DIRAC_ROTATION else if ( nchan_internal == 4 || nchan_internal == 3 ) { -#ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; -#else st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; -#endif } +#endif else if ( nchan_internal == 6 || nchan_internal == 5 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 2; -- GitLab From 2b3f042e6d7b6b90f659110fd536782b047c76d2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 16 Feb 2024 17:18:49 +0100 Subject: [PATCH 357/498] patch for issue 1001 --- lib_com/ari_hm.c | 8 ++++++++ lib_com/options.h | 2 +- lib_com/prot.h | 8 ++++++++ lib_dec/ari_hm_dec.c | 8 ++++++++ lib_enc/ari_hm_enc.c | 16 ++++++++++++++++ 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 3e83529bbb..2e603fbaa1 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -205,7 +205,11 @@ int16_t CountIndexBits( *-------------------------------------------------------------------*/ int16_t tcx_hm_render( +#ifdef FIX_1001_ARI_HM_OVERFLOW + const int32_t lag, /* i : pitch lag */ +#else const int16_t lag, /* i : pitch lag */ +#endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ) @@ -265,7 +269,11 @@ int16_t tcx_hm_render( void tcx_hm_modify_envelope( const Word16 gain, /* i : HM gain (Q11) */ +#ifdef FIX_1001_ARI_HM_OVERFLOW + const int32_t lag, +#else const int16_t lag, +#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ Word32 env[], /* i/o: envelope (Q16) */ diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..71d4b3ba5b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ - +#define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ diff --git a/lib_com/prot.h b/lib_com/prot.h index e60023602e..fb721e9369 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -7832,14 +7832,22 @@ int16_t DecodeIndex( #define GET_ADJ2( T, L, F ) ( ( ( L ) << ( F ) ) - ( T ) ) int16_t tcx_hm_render( +#ifdef FIX_1001_ARI_HM_OVERFLOW + const int32_t lag, /* i : pitch lag */ +#else const int16_t lag, /* i : pitch lag */ +#endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ); void tcx_hm_modify_envelope( const Word16 gain, /* i : HM gain (Q11) */ +#ifdef FIX_1001_ARI_HM_OVERFLOW + const int32_t lag, +#else const int16_t lag, +#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ Word32 env[], /* i/o: envelope (Q16) */ diff --git a/lib_dec/ari_hm_dec.c b/lib_dec/ari_hm_dec.c index 30889e741f..2a0e8bde04 100644 --- a/lib_dec/ari_hm_dec.c +++ b/lib_dec/ari_hm_dec.c @@ -120,7 +120,11 @@ void tcx_hm_decode( int16_t *hm_bits /* o : bit consumption */ ) { +#ifdef FIX_1001_ARI_HM_OVERFLOW + int32_t lag; +#else int16_t lag; +#endif int32_t tmpL; int16_t NumTargetBits, fract_res; Word16 p[2 * kTcxHmParabolaHalfWidth + 1], gain; @@ -144,7 +148,11 @@ void tcx_hm_decode( /* Convert the index to lag */ UnmapIndex( prm_hm[1], L_frame >= 256, LtpPitchLag, ( NumTargetBits <= kSmallerLagsTargetBitsThreshold ) || ( L_frame < 256 ), &fract_res, &tmpL ); +#ifdef FIX_1001_ARI_HM_OVERFLOW + lag = tmpL; +#else lag = (int16_t) tmpL; +#endif /* Render the harmonic model */ if ( tcx_hm_render( lag, fract_res, p ) ) diff --git a/lib_enc/ari_hm_enc.c b/lib_enc/ari_hm_enc.c index dd37682551..0a18a007ab 100644 --- a/lib_enc/ari_hm_enc.c +++ b/lib_enc/ari_hm_enc.c @@ -418,7 +418,11 @@ static void PeakFilter( static float tcx_hm_get_re( const float x[], /* i : absolute spectrum */ const Word16 gain, /* i : HM gain (Q11) */ +#ifdef FIX_1001_ARI_HM_OVERFLOW + const int32_t lag, +#else const int16_t lag, +#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ const Word32 env[], /* i : envelope (Q16) */ @@ -467,7 +471,11 @@ static float tcx_hm_get_re( static void tcx_hm_quantize_gain( const float x[], /* i : absolute spectrum */ const Word32 env[], /* i : envelope (Q16) */ +#ifdef FIX_1001_ARI_HM_OVERFLOW + const int32_t lag, +#else const int16_t lag, +#endif const int16_t fract_res, Word16 p[], /* i : harmonic model (Q13) */ const int16_t L_frame, /* i : number of spectral lines */ @@ -557,7 +565,11 @@ void tcx_hm_analyse( int16_t *hm_bits /* o : bit consumption */ ) { +#ifdef FIX_1001_ARI_HM_OVERFLOW + int32_t lag; +#else int16_t lag; +#endif int32_t tmpL; int16_t fract_res; float fspec[N_MAX_ARI], RelativeScore; @@ -583,7 +595,11 @@ void tcx_hm_analyse( /* Convert the index to lag */ UnmapIndex( prm_hm[1], L_frame >= 256, LtpPitchLag, ( targetBits - *hm_bits <= kSmallerLagsTargetBitsThreshold ) || ( L_frame < 256 ), &fract_res, &tmpL ); +#ifdef FIX_1001_ARI_HM_OVERFLOW + lag = tmpL; +#else lag = (int16_t) tmpL; +#endif /* Render harmonic model */ tcx_hm_render( lag, fract_res, p ); -- GitLab From 59b67412b92aad57e9cfc7df9cd27ed37fd45ce7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 16 Feb 2024 17:21:39 +0100 Subject: [PATCH 358/498] formatting --- lib_com/ari_hm.c | 4 ++-- lib_com/prot.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 2e603fbaa1..0e9a18085c 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -206,9 +206,9 @@ int16_t CountIndexBits( int16_t tcx_hm_render( #ifdef FIX_1001_ARI_HM_OVERFLOW - const int32_t lag, /* i : pitch lag */ + const int32_t lag, /* i : pitch lag */ #else - const int16_t lag, /* i : pitch lag */ + const int16_t lag, /* i : pitch lag */ #endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ diff --git a/lib_com/prot.h b/lib_com/prot.h index fb721e9369..d55ffdfbc6 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -7833,9 +7833,9 @@ int16_t DecodeIndex( int16_t tcx_hm_render( #ifdef FIX_1001_ARI_HM_OVERFLOW - const int32_t lag, /* i : pitch lag */ + const int32_t lag, /* i : pitch lag */ #else - const int16_t lag, /* i : pitch lag */ + const int16_t lag, /* i : pitch lag */ #endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ -- GitLab From c0f4bfc51eca1adab46f6de3996ac66ceabb8595 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 19 Feb 2024 08:34:13 +0100 Subject: [PATCH 359/498] fix typo in command line --- scripts/config/self_test_ltv.prm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 9999e09d25..9b9bccf657 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1470,7 +1470,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst // 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod -ism 1 testv/ltv1ISM.csv 32000 48 testv/ltv48_1ISM.wav bit +../IVAS_cod -ism 1 testv/ltvISM1.csv 32000 48 testv/ltv48_1ISM.wav bit ../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst -- GitLab From f16018777b80d4d278696dec3c7629e4cca58d1b Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 19 Feb 2024 09:19:28 +0100 Subject: [PATCH 360/498] #fix for #1003, fix ParamISM USAN problem for binaural output by fixing the TC Buffer reconfiguration on a rate switch for ParamISM and binaural output --- lib_com/options.h | 3 +-- lib_dec/ivas_ism_dec.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..36e4476128 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,8 +154,7 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ - - +#define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 5583f58651..50c994dfd7 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -343,11 +343,13 @@ static ivas_error ivas_ism_bitrate_switching_dec( tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; +#ifndef FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { tc_nchan_allocate_new = 2 * BINAURAL_CHANNELS; tc_nchan_full_new = tc_nchan_allocate_new; } +#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { -- GitLab From f5a2cddb934c3681fdf5f1007a42cf97a4709bff Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Mon, 19 Feb 2024 10:59:17 +0200 Subject: [PATCH 361/498] Add -q into git clean flags to suppress log output. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c0c52bbe9..8665784309 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,7 @@ variables: - 'default' - 'test-be-release' - 'test-long-self-test' + GIT_CLEAN_FLAGS: -ffdxq default: -- GitLab From 4fa087ab4a0a30fd035fdd85bdc09162ff8b6f65 Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 19 Feb 2024 10:13:26 +0100 Subject: [PATCH 362/498] avoid dib by zero in SWB TBE --- lib_com/options.h | 1 + lib_com/swb_tbe_com.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..43efa024c8 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,7 @@ #endif #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ +#define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index 95b8a53080..8e21ef1748 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -938,6 +938,14 @@ void GenShapedSHBExcitation( } den = 4.0f * c0 * c2 - c4 * c4; + +#ifdef NONBE_FIX_1000_G1_G2_SWB_TBE + if ( den == 0.0f ) + { + den = 1e-7f; + } +#endif + g1 = ( c3 * c4 - 2 * c1 * c2 ) / den; g2 = ( c1 * c4 - 2 * c0 * c3 ) / den; @@ -964,7 +972,17 @@ void GenShapedSHBExcitation( else { /* normalize gain */ +#ifdef NONBE_FIX_1000_G1_G2_SWB_TBE + temp = 0.0f; + if ( g1 + g2 == 0.0f ) + { + temp = 1e-7f; + } + + g = g2 / ( g1 + g2 + temp ); +#else g = g2 / ( g1 + g2 ); +#endif /* quantization of the mixing factor */ cbsize = 1 << NUM_BITS_SHB_VF; -- GitLab From 074b6183b5ce6c34b6195f472f72843e74b87df5 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 Feb 2024 10:19:20 +0100 Subject: [PATCH 363/498] [fix] update from latest DECT package to resolve crash --- lib_lc3plus/lc3.h | 2 +- lib_lc3plus/quantize_spec.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_lc3plus/lc3.h b/lib_lc3plus/lc3.h index 95dff9eb84..0981cea84b 100644 --- a/lib_lc3plus/lc3.h +++ b/lib_lc3plus/lc3.h @@ -37,7 +37,7 @@ typedef __int32 int32_t; #define LC3PLUS_VERSION_INT(major, minor, micro) (((major) << 16) | ((minor) << 8) | (micro)) /*! Version number to ensure header and binary are matching. */ -#define LC3PLUS_VERSION LC3PLUS_VERSION_INT(1, 7, 1) +#define LC3PLUS_VERSION LC3PLUS_VERSION_INT(1, 7, 2) /*! Maximum number of supported channels. The actual binary might support * less, use lc3plus_channels_supported() to check. */ diff --git a/lib_lc3plus/quantize_spec.c b/lib_lc3plus/quantize_spec.c index 01339f99bd..78d3486539 100644 --- a/lib_lc3plus/quantize_spec.c +++ b/lib_lc3plus/quantize_spec.c @@ -125,14 +125,14 @@ void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT /* Last non-zero 2-tuple */ for (i = nt - 2; i >= 2; i = i - 2) { if (xq[i + 1] != 0 || xq[i] != 0) { - lastnz = i+2; + lastnz = i + 1; break; } } if (mode < 0) { - lastnz2 = lastnz; + lastnz2 = lastnz + 1; } else { @@ -263,9 +263,9 @@ void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT } /* Truncation of high-frequency coefficients */ - if (lastnz > lastnz2) + for (i = lastnz2; i <= lastnz; i++) { - memset(&xq[lastnz2], 0, (lastnz - lastnz2) * sizeof(*xq)); + xq[i] = 0; } /* Truncation of LSBs */ -- GitLab From f54030b81bd22b3cd3efc8a855eec535ffc61fa7 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 19 Feb 2024 12:01:45 +0100 Subject: [PATCH 364/498] allow all render frame sizes for the decoder under test in the self test and the pytests --- .gitlab-ci.yml | 2 +- scripts/self_test.py | 13 +++++++------ tests/conftest.py | 22 +++++++++------------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 987b13772b..655cb1ab1d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -532,7 +532,7 @@ pytest-compare-20ms-and-5ms-rendering: - exit_code=0 # dummy, is needed for using the comparison anchor later - non_be_flag=0 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --dut_fr5 || exit_code=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --dut_fr 5 || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check artifacts: diff --git a/scripts/self_test.py b/scripts/self_test.py index 7e7a7ae760..5ed103089e 100755 --- a/scripts/self_test.py +++ b/scripts/self_test.py @@ -194,10 +194,11 @@ class SelfTest(IvasScriptsCommon.IvasScript): default=False, ) self.parser.add_argument( - "--dut_fr5", - help="Run the decoder under test with 5ms rendering", - action="store_true", - default=False, + "--dut_fr", + help="Run the decoder under test with specified render framn size", + default=20, + choices=[5, 10, 20], + type=int ) if shutil.which("valgrind"): self.valgrind = [ @@ -1508,8 +1509,8 @@ class SelfTest(IvasScriptsCommon.IvasScript): enable_logging=True, logger_name="{}.testrunner".format(self.logger.name), ) - if self.args["dut_fr5"] is True: - test_runner.decoder_cmdline_options.extend(["-fr","5"]) + + test_runner.decoder_cmdline_options.extend(["-fr", f"{self.args['dut_fr']}"]) test_runner.set_flat_mode_list(run_dict) test_runner.run() self.logger.console(" ") diff --git a/tests/conftest.py b/tests/conftest.py index 8410f1f47b..aee9387e17 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -159,9 +159,11 @@ def pytest_addoption(parser): ) parser.addoption( - "--dut_fr5", - action="store_true", - help="5ms rendering for the DUT output.", + "--dut_fr", + help="Render frame size for the DUT output.", + choices=[5, 10, 20], + type=int, + default=20, ) @pytest.fixture(scope="session", autouse=True) @@ -398,14 +400,14 @@ def dut_decoder_path(request) -> str: class DecoderFrontend: - def __init__(self, path, dec_type, timeout=None, fr5=None) -> None: + def __init__(self, path, dec_type, timeout=None, fr=20) -> None: self._path = path self._type = dec_type self.returncode = None self.stdout = None self.stderr = None self.timeout = timeout - self.fr5 = fr5 + self.fr = fr def run( self, @@ -423,8 +425,7 @@ class DecoderFrontend: if quiet_mode: command.extend(["-q"]) - if self.fr5 is not None: - command.extend(["-fr", "5"]) + command.extend(["-fr", str(self.fr)]) if plc_file is not None: @@ -512,13 +513,8 @@ def dut_decoder_frontend(dut_decoder_path, request) -> DecoderFrontend: """ Return a :class:`conftest.DecoderFrontend` instance as DUT for the test session. """ - - fr5 = None - if request.config.option.dut_fr5 is True: - fr5 = True - decoder = DecoderFrontend( - dut_decoder_path, "DUT", timeout=request.config.getoption("--testcase_timeout"), fr5=fr5 + dut_decoder_path, "DUT", timeout=request.config.getoption("--testcase_timeout"), fr=request.config.option.dut_fr ) yield decoder -- GitLab From 85dd6253728356125fa52b43c8926ebabd2b046a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 19 Feb 2024 13:06:25 +0100 Subject: [PATCH 365/498] update CI config to both test 5ms and 10ms versus 20ms --- .gitlab-ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 655cb1ab1d..2bcf401a85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -532,20 +532,26 @@ pytest-compare-20ms-and-5ms-rendering: - exit_code=0 # dummy, is needed for using the comparison anchor later - non_be_flag=0 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --dut_fr 5 || exit_code=$? - - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 || exit_code1=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 || exit_code2=$? + - zero_errors=$(cat report-junit-5ms.xml report-junit-10ms.xml | grep -c 'errors="0"') || true + - exit_code = 0 + - if [ $exit_code -eq 1] || [ $exit_code2 -eq 1]; then exit_code=1; fi - *merge-request-comparison-check artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always - expose_as: "pytest 5ms vs 20ms results" + expose_as: "pytest 5ms/10ms vs 20ms results" paths: - - report-junit.xml - - report.html + - report-junit-5ms.xml + - report-5ms.html + - report-junit-10ms.xml + - report-10ms.html reports: junit: - - report-junit.xml + - report-junit-5ms.xml + - report-junit-10ms.xml # test renderer executable renderer-smoke-test: -- GitLab From 319f9b0af5d50fe6601c0a58298b19aa71f1c67b Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 19 Feb 2024 13:11:20 +0100 Subject: [PATCH 366/498] fix CI config file problem --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d61570e78c..8ffdd5aac7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -558,7 +558,7 @@ pytest-compare-20ms-and-5ms-rendering: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" expire_in: 1 week when: always - expose_as: "pytest 5ms/10ms vs 20ms results" + expose_as: "pytest 5ms and 10ms vs 20ms results" paths: - report-junit-5ms.xml - report-5ms.html -- GitLab From be41fb0e885fab5951bda1cfa0dd7122266b6f83 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 19 Feb 2024 13:25:03 +0100 Subject: [PATCH 367/498] fix ifdef in head-rotation sanity check --- apps/decoder.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ca40ee51b1..83e360e687 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,8 +306,11 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ -#if 0 - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR +#ifdef ALLOW_HOA3_ROTATION + && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 +#endif + && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif @@ -316,7 +319,6 @@ int main( fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; } -#endif if ( ( error = RotationFileReader_open( arg.headrotTrajFileName, &headRotReader ) ) != IVAS_ERR_OK ) { -- GitLab From 83f4f3d9bbd08e80a2d5e6443626030fad2b9a4b Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 19 Feb 2024 13:26:42 +0100 Subject: [PATCH 368/498] fix formatting --- apps/decoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 83e360e687..2be9c78d87 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,11 +306,11 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR #ifdef ALLOW_HOA3_ROTATION - && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 -#endif - && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 +#endif + && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif -- GitLab From 346b7489d2f0ba8dfcbacac7d168870c2c1eedaf Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 19 Feb 2024 16:10:51 +0100 Subject: [PATCH 369/498] fix for #1005, fix TC Buffer update on a MC rate switch --- lib_com/options.h | 1 + lib_dec/ivas_mct_dec.c | 35 +++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..6e0255312f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,7 @@ #endif #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ +#define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 02f8483111..bfa2a6ad07 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -774,22 +774,29 @@ static ivas_error ivas_mc_dec_reconfig( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); /* transfer subframe info from DirAC or ParamMC to central tc buffer */ - if ( last_mc_mode == MC_MODE_PARAMMC ) +#ifdef NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE + if ( st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hParamMC->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hParamMC->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hParamMC->slots_rendered; - mvs2s( st_ivas->hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } - else if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->hSpatParamRendCom != NULL ) - { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); +#endif + if ( last_mc_mode == MC_MODE_PARAMMC ) + { + st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hParamMC->subframes_rendered; + st_ivas->hTcBuffer->num_slots = st_ivas->hParamMC->num_slots; + st_ivas->hTcBuffer->slots_rendered = st_ivas->hParamMC->slots_rendered; + mvs2s( st_ivas->hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } + else if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->hSpatParamRendCom != NULL ) + { + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; + st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } +#ifdef NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE } +#endif /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv render what still fits in the new granularity */ -- GitLab From 6f8b6f980f5f6d5e6c287b72b9a785da921cda24 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 20 Feb 2024 09:47:05 +0100 Subject: [PATCH 370/498] use tags in testcase name --- tests/hrtf_binary_loading/constants.py | 5 + .../test_codec_ROM_vs_file.py | 92 +++++++++---------- .../test_renderer_ROM_vs_file.py | 62 ++++++------- tests/hrtf_binary_loading/utils.py | 10 +- 4 files changed, 89 insertions(+), 80 deletions(-) diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 2fa8104cdf..6c19acbecf 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -54,6 +54,11 @@ HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin" HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin" HRTF_FILES = [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM] +HRTF_TAG_SAME_AS_ROM = "hrtf_same_as_rom" +HRTF_TAG_DIFF_FROM_ROM = "hrtf_diff_from_rom" +HRTF_TAGS = [HRTF_TAG_SAME_AS_ROM, HRTF_TAG_DIFF_FROM_ROM] +HRTF_FILE_FOR_TAG = dict(zip(HRTF_TAGS, HRTF_FILES)) + SAMPLE_RATE = ["16", "32", "48"] INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] # "MONO", "STEREO", diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 9e12df6cf4..2f5cbe6d1f 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -34,32 +34,32 @@ import itertools from tests.hrtf_binary_loading.utils import * -from .constants import HRTF_FILES, HRTF_BINARY_FILE_DIFF_FROM_ROM +from .constants import HRTF_TAGS """ Binary file """ @pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) -def test_binary_file(test_info, hrtf_file, out_fs): - check_binary_file(hrtf_file, out_fs) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) +def test_binary_file(test_info, hrtf_tag, out_fs): + check_binary_file(hrtf_tag, out_fs) """ Multichannel """ @pytest.mark.parametrize( - ("out_fmt", "out_fs", "in_fmt", "hrtf_file"), + ("out_fmt", "out_fs", "in_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( - OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_FILES + OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_TAGS ) ], ) -def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_file): +def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag): bitrate = 512000 in_fs = 48 option_list = ["-mc", in_fmt] @@ -73,12 +73,12 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f in_fs, out_fmt, out_fs, - hrtf_file, + hrtf_tag, ) @pytest.mark.parametrize( - ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_file"), + ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM @@ -88,12 +88,12 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, - HRTF_FILES, + HRTF_TAGS, ) ], ) def test_multichannel_binaural_headrotation( - test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_file + test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag ): bitrate = 512000 in_fs = 48 @@ -108,7 +108,7 @@ def test_multichannel_binaural_headrotation( in_fs, out_fmt, out_fs, - hrtf_file, + hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -117,17 +117,17 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize( - ("in_fmt", "fs", "out_fmt", "hrtf_file"), + ("in_fmt", "fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( - INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_FILES + INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_TAGS ) ], ) -def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): +def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_tag): bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -140,12 +140,12 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): fs, out_fmt, fs, - hrtf_file, + hrtf_tag, ) @pytest.mark.parametrize( - ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_file"), + ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM @@ -155,11 +155,11 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], [HR_TRAJECTORIES_TO_TEST[0]], - HRTF_FILES, + HRTF_TAGS, ) ], ) -def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_file): +def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_tag): bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -172,7 +172,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt fs, out_fmt, fs, - hrtf_file, + hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -181,7 +181,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt @pytest.mark.parametrize( - ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_file"), + ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM @@ -191,13 +191,13 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt SAMPLE_RATE[-1:], INPUT_FORMATS_MASA["dir"], INPUT_FORMATS_MASA["tc"], - HRTF_FILES, + HRTF_TAGS, ) ], ) -def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): +def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed - if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: + if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( @@ -214,12 +214,12 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): fs, out_fmt, fs, - hrtf_file, + hrtf_tag, ) @pytest.mark.parametrize( - ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_file"), + ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM @@ -230,15 +230,15 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE[-1:], [HR_TRAJECTORIES_TO_TEST[1]], - HRTF_FILES, + HRTF_TAGS, ) ], ) def test_masa_binaural_headrotation( - test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file + test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_tag ): # TODO: remove once fixed - if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: + if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( @@ -255,7 +255,7 @@ def test_masa_binaural_headrotation( fs, out_fmt, fs, - hrtf_file, + hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -264,17 +264,17 @@ def test_masa_binaural_headrotation( @pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), + ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( - INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_FILES + INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_TAGS ) ], ) -def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): +def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -295,12 +295,12 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): in_fs, out_fmt, out_fs, - hrtf_file, + hrtf_tag, ) @pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), + ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM @@ -310,12 +310,12 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], [HR_TRAJECTORIES_TO_TEST[0]], - HRTF_FILES, + HRTF_TAGS, ) ], ) def test_ism_binaural_headrotation( - test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file + test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] @@ -337,7 +337,7 @@ def test_ism_binaural_headrotation( in_fs, out_fmt, out_fs, - hrtf_file, + hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) @@ -346,17 +346,17 @@ def test_ism_binaural_headrotation( @pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), + ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( - INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_FILES + INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_TAGS ) ], ) -def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): +def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -377,12 +377,12 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf in_fs, out_fmt, out_fs, - hrtf_file, + hrtf_tag, ) @pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), + ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM @@ -392,12 +392,12 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], [HR_TRAJECTORIES_TO_TEST[0]], - HRTF_FILES, + HRTF_TAGS, ) ], ) def test_ism_binaural_roomreverb_headrotation( - test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file + test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] @@ -419,6 +419,6 @@ def test_ism_binaural_roomreverb_headrotation( in_fs, out_fmt, out_fs, - hrtf_file, + hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index 7781885fae..921562b5bc 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -43,7 +43,7 @@ from tests.renderer.constants import ( INPUT_FORMATS_MC, ) -from .constants import HRTF_FILES +from .constants import HRTF_TAGS """ Ambisonics """ @@ -51,12 +51,12 @@ from .constants import HRTF_FILES @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ambisonics_binaural_static_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size, hrtf_file + test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( - test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size + test_info, in_fmt, out_fmt, hrtf_tag, frame_size=frame_size ) @@ -64,15 +64,15 @@ def test_ambisonics_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ambisonics_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) @@ -84,15 +84,15 @@ def test_ambisonics_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_static_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size, hrtf_file + test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") compare_renderer_vs_renderer_with_binary_hrir( - test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size + test_info, in_fmt, out_fmt, hrtf_tag, frame_size=frame_size ) @@ -100,9 +100,9 @@ def test_multichannel_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -111,7 +111,7 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) @@ -123,9 +123,9 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_static_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size, hrtf_file + test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] @@ -136,7 +136,7 @@ def test_ism_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, in_meta_files=in_meta_files, frame_size=frame_size, ) @@ -146,9 +146,9 @@ def test_ism_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] @@ -159,7 +159,7 @@ def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, frame_size=frame_size, @@ -172,9 +172,9 @@ def test_ism_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_static_with_binary_hrir( - test_info, in_fmt, out_fmt, frame_size, hrtf_file + test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") @@ -183,7 +183,7 @@ def test_masa_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) @@ -192,9 +192,9 @@ def test_masa_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_headrotation_with_binary_hrir( - test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file + test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") @@ -203,7 +203,7 @@ def test_masa_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) @@ -215,15 +215,15 @@ def test_masa_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_custom_ls_input_binaural_with_binary_hrir( - test_info, in_layout, out_fmt, frame_size, hrtf_file + test_info, in_layout, out_fmt, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, - hrtf_file, + hrtf_tag, frame_size=frame_size, ) @@ -232,15 +232,15 @@ def test_custom_ls_input_binaural_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("hrtf_file", HRTF_FILES) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_custom_ls_input_binaural_headrotation_with_binary_hrir( - test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_file + test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, - hrtf_file, + hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index da7d3ba91c..2271f03432 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -140,7 +140,8 @@ def get_option_list_str(option_list): return option_list_str -def check_binary_file(hrtf_file, out_fs): +def check_binary_file(hrtf_tag, out_fs): + hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] with open(str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb") as file: binary_data = file.read() @@ -284,13 +285,15 @@ def compare_rom_vs_binary( in_fs, out_fmt, out_fs, - hrtf_file: str, + hrtf_tag: str, keep_file: Optional[bool] = False, trj_file: Optional[str] = None, ): option_str = "_".join(get_option_list_str(option_list_enc)) file_ext = f"_{option_str or ''}_{bitrate or ''}_{in_fs or ''}-{out_fs or ''}_{out_fmt or ''}-{uuid.uuid1()} " + hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] + xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM input_path = TESTV_DIR.joinpath(in_file).with_suffix(".wav") @@ -333,7 +336,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, - hrtf_file, + hrtf_tag, metadata_input: Optional[str] = None, in_meta_files: Optional[list] = None, trj_file: Optional[str] = None, @@ -346,6 +349,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( frame_size: Optional[str] = "20ms", keep_file=False, ): + hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM hrtf_file_dir = SCRIPTS_DIR.joinpath( -- GitLab From ba3ee3b9d49b83c34b77b8f3ab181627c5939975 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 20 Feb 2024 10:32:18 +0100 Subject: [PATCH 371/498] add more testcases to cover all paths --- tests/hrtf_binary_loading/constants.py | 10 +++++++++- .../test_codec_ROM_vs_file.py | 19 +++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/tests/hrtf_binary_loading/constants.py b/tests/hrtf_binary_loading/constants.py index 6c19acbecf..1524e9bf57 100644 --- a/tests/hrtf_binary_loading/constants.py +++ b/tests/hrtf_binary_loading/constants.py @@ -67,6 +67,14 @@ INPUT_FORMATS_ISM = ["1", "2", "3", "4"] INPUT_FORMATS_MASA = {"tc": ["1", "2"], "dir": ["1", "2"]} INPUT_FORMATS_MASA_RENDERER = ["MASA1", "MASA2"] +MC_BITRATE_FOR_FORMAT = { + "5_1": 96000, + "5_1_2": 32000, + "5_1_4": 512000, + "7_1": 512000, + "7_1_4": 160000, +} + FORMAT_TO_FILE_MC_WOEXT = { "5_1": "stv51MC{}c_cut", @@ -87,7 +95,7 @@ BITRATE_ISM = { "1": 96000, "2": 160000, "3": 384000, - "4": 512000, + "4": 32000, } FORMAT_TO_METADATA_FILES = {"MASA": "stv{}MASA{}TC{}c.met", "ISM": "stvISM{}.csv"} diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 2f5cbe6d1f..4428aeb81d 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -34,7 +34,7 @@ import itertools from tests.hrtf_binary_loading.utils import * -from .constants import HRTF_TAGS +from .constants import HRTF_TAGS, MC_BITRATE_FOR_FORMAT """ Binary file """ @@ -60,7 +60,7 @@ def test_binary_file(test_info, hrtf_tag, out_fs): ], ) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag): - bitrate = 512000 + bitrate = MC_BITRATE_FOR_FORMAT[in_fmt] in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -95,7 +95,7 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_t def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag ): - bitrate = 512000 + bitrate = MC_BITRATE_FOR_FORMAT[in_fmt] in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -117,18 +117,17 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize( - ("in_fmt", "fs", "out_fmt", "hrtf_tag"), + ("bitrate", "in_fmt", "fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( - INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_TAGS + [256000, 64000], INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_TAGS ) ], ) -def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_tag): - bitrate = 256000 +def test_sba_binaural_static(bitrate, test_info, in_fmt, fs, out_fmt, hrtf_tag): option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -145,12 +144,13 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_tag): @pytest.mark.parametrize( - ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_tag"), + ("bitrate", "in_fmt", "fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( + [256000, 64000], INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], @@ -159,8 +159,7 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_tag): ) ], ) -def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_tag): - bitrate = 256000 +def test_sba_binaural_headrotation(bitrate, test_info, in_fmt, fs, out_fmt, trj_file, hrtf_tag): option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) -- GitLab From 353214a9a58852fcdf3747da11e6c0e322321741 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 20 Feb 2024 09:32:59 +0100 Subject: [PATCH 372/498] add generateCustomBinaryFile --- ...erate_ivas_binauralizer_tables_from_sofa.m | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m b/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m index ec454511d7..e6547762f4 100644 --- a/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m +++ b/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m @@ -47,15 +47,21 @@ addpath(genpath('../td_object_renderer/modeling_tool/')); %% Set arguments writeRomFileOutput = true; %% generation of rom files if true writeBinaryOutput = true; %% generation of binary files if true. Always true for TD renderer -writeEachRendererBinaryOutput = true; %% generation of binary split files each containing binary data for individual renderer +writeEachRendererBinaryOutput = false; %% generation of binary split files each containing binary data for individual renderer %% Set ivas root path ivas_path = ['..' filesep '..' filesep]; +generateCustomBinaryFile = false; + %% Set input files -%hrir_file_name = 'D1_48K_24bit_256tap_FIR_SOFA.sofa'; -%hrir_file_name = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000.sofa'; -hrir_file_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa'; +if generateCustomBinaryFile + hrir_file_name = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000.sofa'; + output_bin_name = 'ivas_binaural_51_brir-lc'; +else + hrir_file_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa'; + output_bin_name = 'ivas_binaural'; +end brir_file_name = 'IIS_BRIR_officialMPEG_Combined.sofa'; hrir_path = fullfile ('.','HRIRs_sofa'); brir_path = fullfile ('.','BRIRs_sofa'); @@ -63,7 +69,6 @@ brir_path = fullfile ('.','BRIRs_sofa'); rom_path = [ivas_path 'lib_rend']; binary_path = fullfile ('.','binaural_renderers_hrtf_data'); binary_name = [erase(hrir_file_name,'.sofa') '+' erase(brir_file_name, '.sofa') ]; -output_bin_name = 'ivas_binaural'; if ~(exist(binary_path, 'dir')) mkdir(binary_path); end @@ -100,6 +105,12 @@ if writeBinaryOutput == true ]; end +if generateCustomBinaryFile + command = [command ... + ' -brir_optim_config_path' ... + ' brir_low_complexity_optim.cfg ' ... + ] +end command = [command ... ' -compute_reverb_rom ' ... erase(hrir_file,'.sofa') '.mat ' ... -- GitLab From 2c1f5e5ae880441cc4065f29513dbb280c9f2799 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 20 Feb 2024 11:19:12 +0100 Subject: [PATCH 373/498] add generateCustomBinaryFile and normalized input hrir --- ...erate_ivas_binauralizer_tables_from_sofa.m | 20 +++++++++++++---- .../SOFA_save.m | 22 +++++++++++++++++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m b/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m index e6547762f4..491062b1aa 100644 --- a/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m +++ b/scripts/binauralRenderer_interface/generate_ivas_binauralizer_tables_from_sofa.m @@ -47,8 +47,8 @@ addpath(genpath('../td_object_renderer/modeling_tool/')); %% Set arguments writeRomFileOutput = true; %% generation of rom files if true writeBinaryOutput = true; %% generation of binary files if true. Always true for TD renderer -writeEachRendererBinaryOutput = false; %% generation of binary split files each containing binary data for individual renderer - +writeEachRendererBinaryOutput = true; %% generation of binary split files each containing binary data for individual renderer +normalizeSofaInputData = false; %% if true SOFA IR are nomalized %% Set ivas root path ivas_path = ['..' filesep '..' filesep]; @@ -56,10 +56,12 @@ generateCustomBinaryFile = false; %% Set input files if generateCustomBinaryFile - hrir_file_name = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000.sofa'; + hrir_file_name_init = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000.sofa'; + hrir_file_name = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000_norm.sofa'; output_bin_name = 'ivas_binaural_51_brir-lc'; else - hrir_file_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa'; + hrir_file_name_init = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa'; + hrir_file_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000_norm.sofa'; output_bin_name = 'ivas_binaural'; end brir_file_name = 'IIS_BRIR_officialMPEG_Combined.sofa'; @@ -73,9 +75,19 @@ if ~(exist(binary_path, 'dir')) mkdir(binary_path); end +hrir_file_init = fullfile( hrir_path, hrir_file_name_init); hrir_file = fullfile( hrir_path, hrir_file_name); brir_file = fullfile( brir_path, brir_file_name); +%% normalize input HRTF + +if (normalizeSofaInputData) + SOFA_normalize(hrir_file_init,hrir_file); +else + hrir_file_name = hrir_file_name_init; + hrir_file = hrir_file_init; +end + %% generate td binauralizer rom or binary values dataSpec.dataBase = 'IVAS'; diff --git a/scripts/binauralRenderer_interface/matlab_hrir_generation_scripts/SOFA_save.m b/scripts/binauralRenderer_interface/matlab_hrir_generation_scripts/SOFA_save.m index f1f8743250..85e5e81f0e 100644 --- a/scripts/binauralRenderer_interface/matlab_hrir_generation_scripts/SOFA_save.m +++ b/scripts/binauralRenderer_interface/matlab_hrir_generation_scripts/SOFA_save.m @@ -35,6 +35,16 @@ function [outputArg1] = SOFA_save(IR,fs,latency_s, inputSofaTemplatePath,outputS % Detailed explanation goes here outputArg1 = false; inputAsLatencys = false; +outputFormatIsHOA = 0; +if (size(IR,3) == 4) + outputFormatIsHOA = 1; +end +if (size(IR,3) == 9) + outputFormatIsHOA = 1; +end +if (size(IR,3) == 16) + outputFormatIsHOA = 1; +end if isfile(inputSofaTemplatePath) if isfile(outputSofaPath) @@ -92,7 +102,11 @@ if isfile(inputSofaTemplatePath) varId = netcdf.inqVarID(ncid_in,sofa_data.Variables(indVar).Name); [name,xtype,dimids,natts] = netcdf.inqVar(ncid_in,varId); netcdf.defVar(ncid, name , xtype, dimids); - data = zeros(sofa_data.Variables(indVar).Size); + if (outputFormatIsHOA == 0) + data = netcdf.getVar(ncid_in,varId); + else + data = zeros(sofa_data.Variables(indVar).Size); + end netcdf.putVar(ncid, varId, data); if (strcmp(name, 'Data.IR')) netcdf.putVar(ncid, varId, IR); @@ -120,6 +134,10 @@ if isfile(inputSofaTemplatePath) ncwriteatt(outputSofaPath,'/', 'ListenerShortName',ncreadatt(inputSofaTemplatePath,'/','ListenerShortName')); ncwriteatt(outputSofaPath,'/', 'DatabaseName',ncreadatt(inputSofaTemplatePath,'/','DatabaseName')); ncwriteatt(outputSofaPath,'/','Title' ,ncreadatt(inputSofaTemplatePath,'/','Title')); - ncwriteatt(outputSofaPath,'/', 'SOFAConventions', 'AmbisonicsBRIR'); + if (outputFormatIsHOA == 0) + ncwriteatt(outputSofaPath,'/', 'SOFAConventions', 'AmbisonicsBRIR'); + else + ncwriteatt(outputSofaPath,'/', 'SOFAConventions', ncreadatt(inputSofaTemplatePath,'/','SOFAConventions')); + end end \ No newline at end of file -- GitLab From 654fa7dfbcd091251b85599a711894ac9cce961f Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 20 Feb 2024 12:14:54 +0100 Subject: [PATCH 374/498] exclude temporary test paths from recent HRTF update --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 2024f865f1..bceaf41a73 100644 --- a/.gitignore +++ b/.gitignore @@ -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 -- GitLab From 20c523122a882a5cf2416339635b7aaa740c7fa8 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Tue, 20 Feb 2024 16:47:44 +0100 Subject: [PATCH 375/498] Fix for #777 - render config reader with combined configurations --- lib_com/options.h | 1 + lib_util/render_config_reader.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 0803c5bcfd..0e53de46f7 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,6 +170,7 @@ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ +#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC #define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 43e0246898..c27bec2b6d 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2301,7 +2301,11 @@ ivas_error RenderConfigReader_read( /* RT60 */ else if ( strcmp( item, "RT60" ) == 0 ) { +#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE + if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) +#else if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) +#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; @@ -2311,7 +2315,11 @@ ivas_error RenderConfigReader_read( /* DSR */ else if ( strcmp( item, "DSR" ) == 0 ) { +#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE + if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) +#else if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) +#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; -- GitLab From 5f9e1d613cd3dc70eb96e227e9900dc51dfd00f4 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 20 Feb 2024 17:33:36 +0100 Subject: [PATCH 376/498] wrap print statement under #ifdef DEBUGGING --- lib_util/render_config_reader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 43e0246898..2c20e8a0cd 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2452,7 +2452,9 @@ ivas_error RenderConfigReader_read( while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); +#ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); +#endif if ( strcmp( item, "CODECDELAY" ) == 0 ) { if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.codec_delay_ms ) ) -- GitLab From 7976c073b0ae75717d19780df0de913f04ade2aa Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 21 Feb 2024 07:31:58 +0100 Subject: [PATCH 377/498] fix for #864, fix JBM for 5ms, address comments, simplify flushing for JBM --- apps/decoder.c | 157 ++++--------------------------------------------- 1 file changed, 12 insertions(+), 145 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 3af33307ff..f712cdb80b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3360,10 +3360,10 @@ static ivas_error decodeVoIP( #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE if ( vec_pos_update == 0 ) { -#endif systemTime_ms += vec_pos_len * systemTimeInc_ms; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE } +#else + systemTime_ms += systemTimeInc_ms; #endif #ifdef WMOPS @@ -3376,20 +3376,19 @@ static ivas_error decodeVoIP( #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t nSamplesFlushed = 0; - do - { - - /* decode and get samples */ + /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) #endif - { - fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + if ( nSamplesFlushed ) + { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) { @@ -3442,139 +3441,7 @@ static ivas_error decodeVoIP( } } } - - vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; - frame++; - if ( !arg.quietModeEnabled ) - { - fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); -#ifdef DEBUGGING - if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) ) - { - fprintf( stdout, "\n Decoding error: BER detected in frame %d !!!!!\n", frame - 1 ); - } -#endif - } - - /* reference vector */ - if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) - { - IVAS_VECTOR3 listenerPosition, referencePosition; - if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading listener and reference positions from %s\n", IVAS_DEC_GetErrorMessage( error ), Vector3PairFileReader_getFilePath( referenceVectorReader ) ); - goto cleanup; - } - - if ( ( error = IVAS_DEC_FeedRefVectorData( hIvasDec, listenerPosition, referencePosition ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedRefVectorData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - - /* Reference rotation */ - if ( arg.enableReferenceRotation && vec_pos_update == 0 ) - { - IVAS_QUATERNION quaternion; - if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); - goto cleanup; - } - - if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - int16_t num_subframes; - if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetNumOrientationSubframes failed: \n" ); - goto cleanup; - } - - /* Head-tracking input simulation */ - /* Head-tracking input simulation */ - if ( arg.enableHeadRotation ) - { - IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( headRotReader == NULL ) - { - for ( i = 0; i < num_subframes; i++ ) - { - Quaternions[i].w = -3.0f; - Quaternions[i].x = 0.0f; - Quaternions[i].y = 0.0f; - Quaternions[i].z = 0.0f; - Pos[i].x = 0.0f; - Pos[i].y = 0.0f; - Pos[i].z = 0.0f; - } - } - else - { -#endif - for ( i = 0; i < num_subframes; i++ ) - { - if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), - RotationFileReader_getFilePath( headRotReader ) ); - goto cleanup; - } - } -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - - for ( i = 0; i < num_subframes; i++ ) - { - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - DEFAULT_AXIS -#endif - ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - } - - if ( arg.enableExternalOrientation ) - { - IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int8_t enableHeadRotation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - - for ( i = 0; i < num_subframes; i++ ) - { - - if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), - RotationFileReader_getFilePath( externalOrientationFileReader ) ); - goto cleanup; - } - } - for ( i = 0; i < num_subframes; i++ ) - { - if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternions[i], enableHeadRotation[i], enableExternalOrientation[i], enableRotationInterpolation[i], numFramesToTargetOrientation[i], i ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } - } - } while ( nSamplesFlushed > 0 ); + } #endif /*------------------------------------------------------------------------------------------* -- GitLab From 527d79bf04e136a5bbfedb3c4b29218b5163dbb7 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 21 Feb 2024 08:07:19 +0100 Subject: [PATCH 378/498] #fix for 864, incorporate fix for #984 --- apps/decoder.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index 0bc42dd920..10a8ce2370 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3496,13 +3496,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 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; -- GitLab From 8b650cdd5a43bbbe3b59ebbc1b7eab8394590553 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 21 Feb 2024 09:20:39 +0100 Subject: [PATCH 379/498] Added lock functionality for creation of fer bitstreams. Synchronized test names in self_test.prm and self_test_ltv.prm --- scripts/config/self_test.prm | 104 ++++++++++++------------- scripts/config/self_test_ltv.prm | 125 ++++++++++++++++--------------- tests/conftest.py | 15 ++-- 3 files changed, 125 insertions(+), 119 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index a24dac7a4d..0d930c6692 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -569,19 +569,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32c.wav_SBA_24400_32-32_Binaural_Subframe_FER5.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_Binaural_Headrot.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, exo +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, exo ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_Binaural_Headrot_EXOF.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, OT +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, OT ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL 32 bit testv/stv3OA32c.pcm_SBA_24400_32-32_Binaural_Headrot_OtrAvg.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, exo, OT +// SBA at 24.4 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, exo, OT ../IVAS_cod -sba 3 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL 32 bit testv/stv3OA32c.pcm_SBA_24400_32-32_Binaural_Headrot_EXOF_OtrAvg.tst @@ -590,11 +590,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_FER5.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation +// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR ../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_Headrot.tst -// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, exo +// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR, exo ../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_Headrot_EXOF.tst @@ -611,7 +611,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 32000 32 testv/stvFOA32c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_32000_32-32_BINAURAL_ROOM.tst -// SBA at 32 kbps, 48kHz in, 48kHz out, MONO out, DTX,bandwidth switching +// SBA at 32 kbps, 48kHz in, 48kHz out, MONO out, DTX, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_FB.txt -dtx -sba 1 32000 48 testv/stvFOA48c.wav bit ../IVAS_dec MONO 48 bit testv/stvFOA48c.wav_SBA_32000_48-48_DTX_MONO.tst @@ -632,35 +632,35 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_BinauralRoom_Subframe.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_BinauralRoom_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_BinauralRoom_Headrot_EXOF.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking in level mode +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, reference vector tracking in level mode, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode, exo ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst @@ -669,11 +669,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32c.wav_SBA_48000_32-32_DTX_Binaural_FER5.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation +// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR ../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_DTX_Binaural_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, Headrotation, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR, exo ../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_48000_32-32_DTX_Binaural_Headrot_EXOF.tst @@ -715,11 +715,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32c.wav_SBA_80000_32-32_Binaural_FER5.tst -// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation +// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, HR ../IVAS_cod -sba 3 80000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_80000_32-32_Binaural_Headrot.tst -// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, Headrotation, exo +// SBA at 80 kbps, 32kHz in, 32kHz out, BINAURAL out, HR, exo ../IVAS_cod -sba 3 80000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c.wav_SBA_80000_32-32_Binaural_Headrot_EXOF.tst @@ -731,19 +731,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 96000 48 testv/stvFOA48c.wav bit ../IVAS_dec FOA 48 bit testv/stvFOA48c.wav_SBA_96000_48-48_FOA.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_128000_32-32_Binaural_room_Headrot.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, exo +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.wav_SBA_128000_32-32_Binaural_room_Headrot_EXOF.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, OT, exo +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst @@ -781,7 +781,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 256000 32 testv/stvFOA32c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_256000_32-32_BINAURAL_ROOM.tst -// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, Headrotation, exo +// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -sba 1 256000 32 testv/stvFOA32c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_256000_32-32_BinauralRoom_Headrot_EXOF.tst @@ -798,7 +798,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_binaural.tst -// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo +// SBA 3OA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst @@ -850,35 +850,35 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvFOA48c.wav bit ../IVAS_dec FOA 48 bit testv/stvFOA48c.wav_sw_48-48_FOA.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Headrotation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, HR ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoomReverb_Headrot.tst -// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, Headrotation +// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, HR ../IVAS_cod -sba -2 48000 32 testv/stv2OA32c.wav bit ../IVAS_dec -t testv/headrot.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stv2OA32c.pcm_planarSBA_48000_32-32_BinauralRoomReverb_Config_renderer_Headrot.tst -// SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation +// SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR ../IVAS_cod -sba 1 48000 32 testv/stvFOA32c.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin -t testv/headrot.csv BINAURAL_ROOM_REVERB 48 bit testv/stvFOA32c.pcm_SBA_48000_32-48_BinauralRoomReverb_Headrot_BinauralFile.tst -// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation +// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR ../IVAS_cod -sba -3 48000 32 testv/stv3OA32c.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_planarSBA_48000_32-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst -// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out Headrotation +// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out HR ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_12800032-32_BinauralRoomReverb_Headrot.tst -// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, Headrotation +// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, HR ../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot.tst -// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation +// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR ../IVAS_cod -sba 2 128000 32 testv/stv2OA32c.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/stv2OA32c.pcm_SBA_12800032-16_BinauralRoomReverb_Headrot_BinauralFile.tst -// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation +// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR ../IVAS_cod -sba -1 128000 48 testv/stvFOA48c.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stvFOA48c.pcm_planarSBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst @@ -901,11 +901,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/stv1MASA1TC48c.met 24400 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv1MASA1TC48c.wav_24400_48-48_BinauralRoom_Subframe.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -masa 1 testv/stv1MASA1TC48c.met 24400 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA1TC48c.wav_24400_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, exo +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -masa 1 testv/stv1MASA1TC48c.met 24400 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA1TC48c.wav_24400_48-48_BinauralRoom_Headrot_EXOF.tst @@ -931,11 +931,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 1 testv/stv2MASA1TC48c.met 128000 48 testv/stv2MASA1TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv2MASA1TC48c.wav_128000_48-48_BINAURAL_Subframe.tst -// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -masa 1 testv/stv2MASA1TC48c.met 128000 48 testv/stv2MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv2MASA1TC48c.wav_128000_48-48_BINAURAL_Headrot.tst -// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo +// MASA 2dir 1TC at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -masa 1 testv/stv2MASA1TC48c.met 128000 48 testv/stv2MASA1TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv2MASA1TC48c.wav_128000_48-48_BINAURAL_Headrot_EXOF.tst @@ -956,19 +956,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv1MASA2TC48c.wav_32000_48-48_BinauralRoom.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA2TC48c.wav_32000_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, exo +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv1MASA2TC48c.wav_32000_48-48_BinauralRoom_Headrot_EXOF.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, OT +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, OT, exo +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -masa 2 testv/stv1MASA2TC48c.met 32000 48 testv/stv1MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst @@ -1003,11 +1003,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec EXT 48 bit_error testv/stv2MASA2TC48c.wav_64000_48-48_external_FER5.tst -// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 64000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv2MASA2TC48c.wav_64000_48-48_BINAURAL_Headrot.tst -// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo +// MASA 2dir 2TC at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 64000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv2MASA2TC48c.wav_64000_48-48_BINAURAL_Headrot_EXOF.tst @@ -1024,7 +1024,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom.tst -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, bandwidth switching +// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst @@ -1103,11 +1103,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_Subframe.tst -// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo +// Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -mc 5_1 24400 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_24400_48-48_Binaural_Headrot_EXOF.tst @@ -1120,19 +1120,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_Headrot_EXOF.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_room_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, Headrotation, exo +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_Binaural_room_Headrot_EXOF.tst @@ -1145,11 +1145,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 128000 48 testv/stv51MC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv51MC48c.wav_MC51_128000_48-48_Binaural.tst -// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation +// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR ../IVAS_cod -mc 5_1 128000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_128000_48-48_Binaural_Headrot.tst -// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, Headrotation, exo +// Multi-channel 5_1 at 128 kbps, 48kHz in, 48kHz out, BINAURAL out, HR, exo ../IVAS_cod -mc 5_1 128000 48 testv/stv51MC48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_128000_48-48_Binaural_Headrot_EXOF.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 09564f01a6..aacd0afc63 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -303,7 +303,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism 1 testv/ltvISM1.csv 32000 32 testv/ltv32_1ISM.wav bit ../IVAS_dec MONO 32 bit testv/ltv32_1ISM.wav_1ISM_32000_32-32_DTX_MONO.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, HR, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, HR, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 48000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit_error testv/ltv48_1ISM.wav_64000_48-48_binaural_room_HR.tst @@ -313,7 +313,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL 48 bit_error testv/ltv48_1ISM.wav_64000_48-48_binaural_HR.tst -// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, HR, exo, random FER at 5% +// 1 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, HR, exo, random FER at 5% ../IVAS_cod -ism 1 testv/ltvISM1.csv 48000 48 testv/ltv48_1ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit_error testv/ltv48_1ISM.wav_64000_48-48_binaural_room_HR_EXOF.tst @@ -358,7 +358,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec EXT 48 bit_error testv/ltv48_2ISM.wav_48000_48-48_EXT_FER5.tst -// 2 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +// 2 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out ../IVAS_cod -ism 2 testv/ltvISM3.csv testv/ltvISM4.csv 64000 48 testv/ltv48_2ISM.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_2ISM.wav_64000_48-48_binaural_room.tst @@ -451,17 +451,17 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 32000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_4ISM.wav_32000_48-48_binaural_file_TDHR_EXOF.tst -// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out, random FER at 5% +// 4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out, random FER at 5% ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 32000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL_ROOM_IR 48 bit_error testv/ltv48_4ISM.wav_32000_48-48_binaural_room_FER5.tst -// 4 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL ROOM out, random FER at 5% +// 4 ISM with metadata at 48 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL ROOM IR out, random FER at 5% ../IVAS_cod -dtx -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 48000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL_ROOM_IR 48 bit_error testv/ltv48_4ISM.wav_48000_48-48_DTX_TD_binaural_room_FER5.tst -// 4 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM out +// 4 ISM with metadata at 64 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out ../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 64000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_4ISM.wav_64000_48-48_binaural_room.tst @@ -624,43 +624,43 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec STEREO 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_stereo.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom_Subframe.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom_Headrot.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_48000_32-32_BinauralRoom_Headrot_EXOF.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking in level mode +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, reference vector tracking in level mode, exo +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst @@ -731,19 +731,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 96000 48 testv/ltv48_FOA.wav bit ../IVAS_dec FOA 48 bit testv/ltv48_FOA.wav_SBA_96000_48-48_FOA.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_128000_32-32_Binaural_room_Headrot.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, exo +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.wav_SBA_128000_32-32_Binaural_room_Headrot_EXOF.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst -// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, OT, exo +// SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst @@ -781,7 +781,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 256000 32 testv/ltv32_FOA.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv32_FOA.wav_SBA_256000_32-32_BINAURAL_ROOM.tst -// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM out, HR, exo +// SBA at 256 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -sba 1 256000 32 testv/ltv32_FOA.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 32 bit testv/ltv32_FOA.wav_SBA_256000_32-32_BinauralRoom_Headrot_EXOF.tst @@ -850,35 +850,35 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_FOA.wav bit ../IVAS_dec FOA 48 bit testv/ltv48_FOA.wav_sw_48-48_FOA.tst -// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Headrotation +// SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, HR ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoomReverb_Headrot.tst -// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, Headrotation +// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, HR ../IVAS_cod -sba -2 48000 32 testv/ltv32_HOA2.wav bit ../IVAS_dec -t testv/headrot.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA2.pcm_planarSBA_48000_32-32_BinauralRoomReverb_Config_renderer_Headrot.tst -// SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation +// SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR ../IVAS_cod -sba 1 48000 32 testv/ltv32_FOA.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin -t testv/headrot.csv BINAURAL_ROOM_REVERB 48 bit testv/ltv32_FOA.pcm_SBA_48000_32-48_BinauralRoomReverb_Headrot_BinauralFile.tst -// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation +// Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR ../IVAS_cod -sba -3 48000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_planarSBA_48000_32-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst -// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out Headrotation +// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out HR ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Headrot.tst -// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, Headrotation +// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, HR ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot.tst -// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), Headrotation +// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR ../IVAS_cod -sba 2 128000 32 testv/ltv32_HOA2.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/ltv32_HOA2.pcm_SBA_12800032-16_BinauralRoomReverb_Headrot_BinauralFile.tst -// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, Headrotation +// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR ../IVAS_cod -sba -1 128000 48 testv/ltv48_FOA.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv48_FOA.pcm_planarSBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst @@ -893,19 +893,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec HOA3 48 bit_error testv/ltv48_MASA1TC.wav_16400_48-48_HOA3_FER5.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom_Subframe.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo +// MASA 1dir 1TC at 24.4 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 24400 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA1TC.wav_24400_48-48_BinauralRoom_Headrot_EXOF.tst @@ -952,23 +952,23 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 24400 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec STEREO 48 bit testv/ltv48_MASA2TC.wav_24400_48-48_STEREO.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_32000_48-48_BinauralRoom.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_32000_48-48_BinauralRoom_Headrot.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_32000_48-48_BinauralRoom_Headrot_EXOF.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT, exo +// MASA 1dir 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst @@ -1020,13 +1020,14 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 5_1_4 48 bit_error testv/ltv48_MASA2TC.wav_192000_48-48_5_1_4_FER5.tst +// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out +../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom_Subframe.tst + // MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom.tst -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out -../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom_Subframe.tst // MASA 2dir 2TC at 512 kbps, 48kHz in, 48kHz out, 5_1 out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 512000 48 testv/ltv48_MASA2TC.wav bit @@ -1128,11 +1129,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_Headrot_EXOF.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_room_Headrot.tst -// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo +// Multi-channel 5_1 at 64 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -mc 5_1 64000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_64000_48-48_Binaural_room_Headrot_EXOF.tst @@ -1158,7 +1159,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec STEREO 48 bit_error testv/ltv48_MC51.wav_MC51_256000_48-48_stereo_FER5.tst -// Multi-channel 5_1 at 192 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out +// Multi-channel 5_1 at 192 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out ../IVAS_cod -mc 5_1 192000 48 testv/ltv48_MC51.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_192000_48-48_BinauralRoom.tst @@ -1166,19 +1167,19 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_MC51.wav_MC51_256000_48-48_mono.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_256000_48-48_BinauralRoom_Headrot.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, exo +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, exo ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot_case00_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_MC51_256000_48-48_BinauralRoom_Headrot_EXOF.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst -// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM out, HR, OT, exo +// Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst @@ -1423,37 +1424,37 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_MASA2TC.wav_sw_48-48_EXT_JBM5.tst -// OMASA 2Dir2TC 1ISM at bitrate switching techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 +// OMASA 2Dir2TC 1ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 ../IVAS_cod -ism_masa 1 2 testv/ltv48_OMASA_1ISM_2TC_ISM1.csv testv/ltv48_OMASA_1ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_1ism.bin 48 testv/ltv48_OMASA_1ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL_ROOM_IR 48 netsimoutput testv/ltv48_OMASA_1ISM_2TC.wav_BINAURAL_ROOM_IR_sw_48-48_JBM5.tst -// OMASA 2Dir2TC 2ISM at bitrate switching techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 48kHz out, 7.1 out, JBM Prof 5 +// OMASA 2Dir2TC 2ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 48kHz out, 7.1 out, JBM Prof 5 ../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv NULL testv/ltv48_OMASA_2ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_48k_omasatechs_2ism.bin 48 testv/ltv48_OMASA_2ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP 7_1 48 netsimoutput testv/ltv48_OMASA_2ISM_2TC.wav_7_1_sw_48-48_JBM5.tst -// OMASA 2Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out, JBM Prof 5 +// OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out, JBM Prof 5 ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP MONO 48 netsimoutput testv/ltv48_OMASA_3ISM_2TC.wav_MONO_sw_48-48_JBM5.tst -// OMASA 2Dir1TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, JBM Prof 5 +// OMASA 2Dir1TC 3ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, JBM Prof 5 ../IVAS_cod -ism_masa 3 1 testv/ltv48_OMASA_3ISM_1TC_ISM1.csv testv/ltv48_OMASA_3ISM_1TC_ISM2.csv testv/ltv48_OMASA_3ISM_1TC_ISM3.csv testv/ltv48_OMASA_3ISM_1TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_48k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_1TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP STEREO 32 netsimoutput testv/ltv48_OMASA_3ISM_1TC.wav_STEREO_sw_48-32_JBM5.tst -// OMASA 1Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.2 out, JBM Prof 5 +// OMASA 1Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.2 out, JBM Prof 5 ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_3ism.bin 32 testv/ltv32_OMASA_3ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP 5_1_2 48 netsimoutput testv/ltv32_OMASA_3ISM_2TC.wav_5_1_2_sw_32-48_JBM5.tst -// OMASA 1Dir1TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, JBM Prof 5 +// OMASA 1Dir1TC 4ISM at br sw techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, JBM Prof 5 ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_32k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_1TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 48 netsimoutput testv/ltv48_OMASA_4ISM_1TC.wav_BINAURAL_sw_48-48_JBM5.tst -// OMASA 1Dir2TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, FOA out, JBM Prof 5 +// OMASA 1Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, FOA out, JBM Prof 5 ../IVAS_cod -ism_masa 4 2 NULL testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP FOA 48 netsimoutput testv/ltv48_OMASA_4ISM_2TC.wav_FOA_sw_48-48_JBM5.tst @@ -1571,29 +1572,29 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_EXT_384000_48-48.tst -// OMASA 2Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out +// OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_2TC.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OMASA_3ISM_2TC.wav_MONO_sw_48-48.tst -// OMASA 2Dir1TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% +// OMASA 2Dir1TC 3ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10% ../IVAS_cod -ism_masa 3 1 testv/ltv48_OMASA_3ISM_1TC_ISM1.csv testv/ltv48_OMASA_3ISM_1TC_ISM2.csv testv/ltv48_OMASA_3ISM_1TC_ISM3.csv testv/ltv48_OMASA_3ISM_1TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_48k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_1TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error ../IVAS_dec STEREO 32 bit_error testv/ltv48_OMASA_3ISM_1TC.wav_STEREO_sw_48-32.tst -// OMASA 1Dir2TC 3ISM at bitrate switching techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.4 out +// OMASA 1Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 32kHz in, 48kHz out, 5.1.4 out ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_3ism.bin 32 testv/ltv32_OMASA_3ISM_2TC.wav bit ../IVAS_dec 5_1_4 48 bit testv/ltv32_OMASA_3ISM_2TC.wav_5_1_4_sw_32-48.tst -// OMASA 1Dir1TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5% +// OMASA 1Dir1TC 4ISM at br sw techs 13.2 to 512 kbps start 32 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5% ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_32k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_1TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/ltv48_OMASA_4ISM_1TC.wav_BINAURAL_sw_48-48_FER5.tst -// OMASA 1Dir2TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, HOA3 out +// OMASA 1Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, HOA3 out ../IVAS_cod -ism_masa 4 2 NULL testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec HOA3 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_HOA3_sw_48-48.tst -// OMASA 2Dir2TC 4ISM at bitrate switching techs 13.2 to 512 kbps start 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out +// OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_384k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst @@ -1683,7 +1684,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 32 testv/ltv32_OSBA_4ISM_FOA.wav bit ../IVAS_dec STEREO 48 bit testv/ltv32_OSBA_4ISM_FOA.wav_STEREO_512000_32-48.tst -// OSBA 3OA 4ISM bitrate switching 13.2 to 512, 32kHz in, 48 out, EXT out +// OSBA 3OA 4ISM bitrate switching 13.2 to 512, 32kHz in, 48kHz out, EXT out ../IVAS_cod -ism_sba 4 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 32 testv/ltv32_OSBA_4ISM_HOA3.wav bit ../IVAS_dec EXT 48 bit testv/ltv32_OSBA_4ISM_HOA3.wav_EXT_sw_13k2_512k_32-32.tst diff --git a/tests/conftest.py b/tests/conftest.py index c3ac758fa4..503915a0c7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -42,6 +42,9 @@ import textwrap from pathlib import Path from subprocess import STDOUT, CalledProcessError, TimeoutExpired, run from typing import Optional, Union +import threading + +lock = threading.Lock() # Lock for fer bitstreams logger = logging.getLogger(__name__) USE_LOGGER_FOR_DBG = False # current tests do not make use of the logger feature @@ -171,8 +174,6 @@ def pytest_addoption(parser): help="MLD limit for comparison (default: 0)", default="0", ) - -<<<<<<< HEAD parser.addoption( "--create_ref", action="store_true", @@ -183,8 +184,6 @@ def pytest_addoption(parser): action="store_true", default=False, ) -======= ->>>>>>> main @pytest.fixture(scope="session", autouse=True) def update_ref(request): @@ -488,12 +487,18 @@ class DecoderFrontend: str(input_bitstream_path) + eid_output_suffix, ] + # If the same bitstream is combined with the same error patterns multiple times, + # the following section may create a race condition. Hence, it is guarded by a + # lock and the file is only created if it does not exist already. + lock.aquire() try: - result = run(eid_command, check=True) + if not os.path.exists(str(input_bitstream_path) + eid_output_suffix): + result = run(eid_command, check=True) except Exception as e: print(result.stderr) print(result.stdout) pytest.fail(f"eid-xor operation failed!") + lock.release() input_bitstream_path += eid_output_suffix -- GitLab From ace603875fd9075dd62f30bcfadcaace8ddd8b38 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 21 Feb 2024 09:38:05 +0100 Subject: [PATCH 380/498] Fix syntax error in tests/conftest.py --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 503915a0c7..3fa55b15d2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -490,7 +490,7 @@ class DecoderFrontend: # If the same bitstream is combined with the same error patterns multiple times, # the following section may create a race condition. Hence, it is guarded by a # lock and the file is only created if it does not exist already. - lock.aquire() + lock.acquire() try: if not os.path.exists(str(input_bitstream_path) + eid_output_suffix): result = run(eid_command, check=True) -- GitLab From 77fa776dadee446f4c17350e728881df8f5d1405 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 21 Feb 2024 09:39:25 +0100 Subject: [PATCH 381/498] fix for #1008, fix external target interpolation initialization --- lib_com/options.h | 6 +++--- lib_rend/ivas_rotation.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 11f4153922..94db09d156 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -48,7 +48,7 @@ /* ################### Start DEBUGGING switches ########################### */ #ifndef RELEASE -/* #define DEBUGGING */ /* Activate debugging part of the code */ +/*#define DEBUGGING*/ /* Activate debugging part of the code */ #endif /*#define WMOPS*/ /* Activate complexity and memory counters */ /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ @@ -57,7 +57,6 @@ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ #ifdef DEBUGGING - /*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ #ifdef DEBUG_MODE_INFO /*#define DEBUG_MODE_ACELP*/ /* output most important ACELP core parameters to the subdirectory "res/" */ @@ -72,6 +71,7 @@ /*#define DEBUG_MODE_INFO_PLC */ /* define to output PLC related parameters */ /*#define DEBUG_MODE_INFO_ALLRAD*/ /* define to output generated HOA decoding mtx */ /*#define DEBUG_MODE_LFE */ /* define to output LFE relevant parameters */ +/*#define DEBUG_MODE_ORIENTATION */ /* define to output combined orientation relevant parameters */ #endif #ifdef DEBUG_MODE_MDCT @@ -160,7 +160,7 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ - +#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 86cfec1d22..b9f05c9f2d 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -898,14 +898,18 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->num_subframes = num_subframes; ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; +#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION if ( num_subframes == 1 ) { ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 2000; } else { +#endif ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; +#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION } +#endif ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; @@ -1331,6 +1335,16 @@ ivas_error combine_external_and_head_orientations( } } +#ifdef DEBUG_MODE_ORIENTATION + for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) + { + dbgwrite( &hCombinedOrientationData->enableCombinedOrientation[i], sizeof( int16_t ), 1, 1, "res/dec_orientation_enabled.dat" ); + dbgwrite( &( hCombinedOrientationData->Quaternions[i].w ), sizeof( float ), 1, 1, "res/dec_orientation_quaternion_w.dat" ); + dbgwrite( &( hCombinedOrientationData->Quaternions[i].x ), sizeof( float ), 1, 1, "res/dec_orientation_quaternion_x.dat" ); + dbgwrite( &( hCombinedOrientationData->Quaternions[i].y ), sizeof( float ), 1, 1, "res/dec_orientation_quaternion_y.dat" ); + dbgwrite( &( hCombinedOrientationData->Quaternions[i].z ), sizeof( float ), 1, 1, "res/dec_orientation_quaternion_z.dat" ); + } +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->sr_pose_pred_axis = sr_pose_pred_axis; #endif -- GitLab From 00f8c8c6acebde050e23f7f8b036c5ecf8862e61 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 21 Feb 2024 10:58:43 +0100 Subject: [PATCH 382/498] Remove lock -- file names are unique and lock should not be needed --- tests/conftest.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 3fa55b15d2..0525bbf628 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -42,9 +42,6 @@ import textwrap from pathlib import Path from subprocess import STDOUT, CalledProcessError, TimeoutExpired, run from typing import Optional, Union -import threading - -lock = threading.Lock() # Lock for fer bitstreams logger = logging.getLogger(__name__) USE_LOGGER_FOR_DBG = False # current tests do not make use of the logger feature @@ -487,10 +484,6 @@ class DecoderFrontend: str(input_bitstream_path) + eid_output_suffix, ] - # If the same bitstream is combined with the same error patterns multiple times, - # the following section may create a race condition. Hence, it is guarded by a - # lock and the file is only created if it does not exist already. - lock.acquire() try: if not os.path.exists(str(input_bitstream_path) + eid_output_suffix): result = run(eid_command, check=True) @@ -498,7 +491,6 @@ class DecoderFrontend: print(result.stderr) print(result.stdout) pytest.fail(f"eid-xor operation failed!") - lock.release() input_bitstream_path += eid_output_suffix -- GitLab From 6a6070c33f5d2e5c6ddab1217f7ed52dbbf083d2 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 21 Feb 2024 12:44:05 +0200 Subject: [PATCH 383/498] Code review fixes --- lib_rend/ivas_dirac_dec_binaural_functions.c | 10 ++++++---- lib_rend/ivas_prot_rend.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f8de00c034..3c6c75bd96 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -3002,10 +3002,11 @@ static void getDirectPartGains( const uint8_t renderStereoOutputInsteadOfBinaural, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, - const int16_t isHeadtracked #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - , + const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin +#else + const int16_t isHeadtracked #endif ) { @@ -3087,10 +3088,11 @@ static void hrtfShGetHrtf( float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, - const int16_t useCachedValue #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - , + const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin +#else + const int16_t useCachedValue #endif ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index e2f7b5d091..80b53d508d 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -246,7 +246,7 @@ void ivas_masa_ext_rend_parambin_render( ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ + HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ #else HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ #endif -- GitLab From 25f8c5b4192c0b8a9398687151de2d0348a207e6 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 21 Feb 2024 13:29:18 +0100 Subject: [PATCH 384/498] Test cases added for combined room acoustics configuration --- scripts/config/self_test.prm | 4 ++++ scripts/config/self_test_ltv.prm | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 83aa9ac504..040434581c 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -539,6 +539,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism +4 testv/stvISM1.csv NULL testv/stvISM_with_no_diegetic_switch.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48n.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv+4ISM48n+non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst +// 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav + // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/stv3OA32c.wav bit diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 9b9bccf657..6c656abdf7 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -539,6 +539,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst +// 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bi +../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav + // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/ltv32_HOA3.wav bit -- GitLab From 9008f4401739c9842206ce6b7e4589851d96eadd Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 13:50:27 +0100 Subject: [PATCH 385/498] [cleanup] accept BE_FIX_567_DOUBLE_STEREO_DMX, NONBE_FIX_567_DOUBLE_STEREO_DMX --- lib_com/options.h | 2 -- lib_com/prot.h | 2 -- lib_com/tools.c | 2 -- lib_enc/ivas_stereo_dmx_evs.c | 52 ----------------------------------- 4 files changed, 58 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 024147cdf4..39e9adb235 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,8 +171,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ -#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ #define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC #define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ diff --git a/lib_com/prot.h b/lib_com/prot.h index d55ffdfbc6..10477f3587 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -132,12 +132,10 @@ float inv_sqrt( const float x /* i : input value */ ); -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX /*! r: inverse square root of input value (float) */ float inv_sqrtf( const float x /* i : input value */ ); -#endif /*! r: output random value */ int16_t own_random( diff --git a/lib_com/tools.c b/lib_com/tools.c index 4d70663ebf..10633883fd 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -768,7 +768,6 @@ float inv_sqrt( return (float) ( 1.0 / sqrt( x ) ); } -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX /*---------------------------------------------------------------------* * inv_sqrtf() * @@ -782,7 +781,6 @@ float inv_sqrtf( { return ( 1.0f / sqrtf( x ) ); } -#endif /*-------------------------------------------------------------------* * conv() diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index 11cc506c9c..e67029d071 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -58,11 +58,7 @@ #define STEREO_DMX_EVS_POC_FORGETTING 0.78f #define STEREO_DMX_EVS_TARGET_POC_FORGETTING 0.79f #define STEREO_DMX_EVS_POC_W_FORGETTING 0.875f -#ifdef BE_FIX_567_DOUBLE_STEREO_DMX #define STEREO_DMX_EVS_SHIFT_LIMIT STEREO_DFT_ZP_NS_ENC -#else -#define STEREO_DMX_EVS_SHIFT_LIMIT 5.625f /* ms */ -#endif #define STEREO_DMX_EVS_DMX_EGY_FORGETTING 0.25f #define STEREO_DMX_EVS_CORR_FORGETTING 0.78f @@ -529,11 +525,7 @@ static void calc_poc( tPi += IPDi; /* ICCr */ -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX Pn = inv_sqrtf( ( IPDr * IPDr + IPDi * IPDi ) + EPSILON ); -#else - Pn = (float) inv_sqrt( ( IPDr * IPDr + IPDi * IPDi ) + EPSILON ); -#endif IPDr *= Pn; IPDi *= Pn; @@ -546,11 +538,7 @@ static void calc_poc( eneL += ( specLr[i] * specLr[i] + specLi[i] * specLi[i] ); eneR += ( specRr[i] * specRr[i] + specRi[i] * specRi[i] ); } -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX Pn = inv_sqrtf( ( tPr * tPr + tPi * tPi ) + EPSILON ); -#else - Pn = (float) inv_sqrt( ( tPr * tPr + tPi * tPi ) + EPSILON ); -#endif tPr *= Pn; tPi *= Pn; @@ -559,11 +547,7 @@ static void calc_poc( Pr[n] = ipd_ff[n] * Pr[n] + ( 1.0f - ipd_ff[n] ) * tPr; Pi[n] = ipd_ff[n] * Pi[n] + ( 1.0f - ipd_ff[n] ) * tPi; -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX Pn = inv_sqrtf( ( Pr[n] * Pr[n] + Pi[n] * Pi[n] ) + EPSILON ); -#else - Pn = (float) inv_sqrt( ( Pr[n] * Pr[n] + Pi[n] * Pi[n] ) + EPSILON ); -#endif Pr[n] *= Pn; Pi[n] *= Pn; @@ -572,11 +556,7 @@ static void calc_poc( { Pr[n] = ipd_ff[n] * Pr[n] + ( 1.0f - ipd_ff[n] ) * tPr; Pi[n] = ipd_ff[n] * Pi[n] + ( 1.0f - ipd_ff[n] ) * tPi; -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX Pn = inv_sqrtf( ( Pr[n] * Pr[n] + Pi[n] * Pi[n] ) + EPSILON ); -#else - Pn = (float) inv_sqrt( ( Pr[n] * Pr[n] + Pi[n] * Pi[n] ) + EPSILON ); -#endif Pr[n] *= Pn; Pi[n] *= Pn; } @@ -603,11 +583,7 @@ static void calc_poc( } #endif -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX ICCr = sqrtf( ( Nr * Nr + Ni * Ni ) / ( eneL * eneR + EPSILON ) ); -#else - ICCr = (float) sqrt( ( Nr * Nr + Ni * Ni ) / ( eneL * eneR + EPSILON ) ); -#endif hPHA->iccr_s = STEREO_DMX_EVS_ICCR_FORGETTING * hPHA->iccr_s + ( 1.0f - STEREO_DMX_EVS_ICCR_FORGETTING ) * ICCr; #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA @@ -792,7 +768,6 @@ static void calc_poc( isd_rate = (float) isd_cnt_l / freq_8k; for ( i = 1; i < nsbd; i++ ) { -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX rfft_pha_buf[i * 2] = sqrtf( ( 1.0f + Pr[i] ) / 2.0f ); rfft_pha_buf[i * 2 + 1] = sqrtf( ( 1.0f - Pr[i] ) / 2.0f ) * sign( Pi[i] ); if ( isd_rate > STEREO_DMX_EVS_ISD_DIST_THRES_IPD ) @@ -800,15 +775,6 @@ static void calc_poc( rfft_pha_buf[i * 2 + 1] = sqrtf( ( 1.0f - rfft_pha_buf[i * 2] ) / 2.0f ) * sign( rfft_pha_buf[i * 2 + 1] ); rfft_pha_buf[i * 2] = sqrtf( ( 1.0f + rfft_pha_buf[i * 2] ) / 2.0f ); } -#else - rfft_pha_buf[i * 2] = (float) sqrt( ( 1.0f + Pr[i] ) / 2.0f ); - rfft_pha_buf[i * 2 + 1] = (float) sqrt( ( 1.0f - Pr[i] ) / 2.0f ) * sign( Pi[i] ); - if ( isd_rate > STEREO_DMX_EVS_ISD_DIST_THRES_IPD ) - { - rfft_pha_buf[i * 2 + 1] = (float) sqrt( ( 1.0f - rfft_pha_buf[i * 2] ) / 2.0f ) * sign( rfft_pha_buf[i * 2 + 1] ); - rfft_pha_buf[i * 2] = (float) sqrt( ( 1.0f + rfft_pha_buf[i * 2] ) / 2.0f ); - } -#endif if ( ( tEr[i] > STEREO_DMX_EVS_LR_EGY * tEl[i] ) || ( tEl[i] > STEREO_DMX_EVS_LR_EGY * tEr[i] ) ) { ild_cnt++; @@ -902,7 +868,6 @@ static void calc_poc( isd_rate = (float) isd_cnt_l / freq_8k; for ( i = 1; i < nsbd; i++ ) { -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX rfft_pha_buf[i * 2] = sqrtf( ( 1.0f + Pr[i] ) / 2.0f ); rfft_pha_buf[i * 2 + 1] = sqrtf( ( 1.0f - Pr[i] ) / 2.0f ) * sign( Pi[i] ); if ( isd_rate > STEREO_DMX_EVS_ISD_DIST_THRES_IPD ) @@ -910,15 +875,6 @@ static void calc_poc( rfft_pha_buf[i * 2 + 1] = sqrtf( ( 1.0f - rfft_pha_buf[i * 2] ) / 2.0f ) * sign( rfft_pha_buf[i * 2 + 1] ); rfft_pha_buf[i * 2] = sqrtf( ( 1.0f + rfft_pha_buf[i * 2] ) / 2.0f ); } -#else - rfft_pha_buf[i * 2] = (float) sqrt( ( 1.0f + Pr[i] ) / 2.0f ); - rfft_pha_buf[i * 2 + 1] = (float) sqrt( ( 1.0f - Pr[i] ) / 2.0f ) * sign( Pi[i] ); - if ( isd_rate > STEREO_DMX_EVS_ISD_DIST_THRES_IPD ) - { - rfft_pha_buf[i * 2 + 1] = (float) sqrt( ( 1.0f - rfft_pha_buf[i * 2] ) / 2.0f ) * sign( rfft_pha_buf[i * 2 + 1] ); - rfft_pha_buf[i * 2] = (float) sqrt( ( 1.0f + rfft_pha_buf[i * 2] ) / 2.0f ); - } -#endif if ( ( tEr[i] > STEREO_DMX_EVS_LR_EGY * tEl[i] ) || ( tEl[i] > STEREO_DMX_EVS_LR_EGY * tEr[i] ) ) { ild_cnt++; @@ -976,11 +932,7 @@ static void calc_poc( { energy += hPHA->p_curr_taps[n][i] * hPHA->p_curr_taps[n][i]; } -#ifdef NONBE_FIX_567_DOUBLE_STEREO_DMX energy = inv_sqrtf( energy + EPSILON ); -#else - energy = (float) inv_sqrt( energy + EPSILON ); -#endif for ( i = 0; i < hPHA->pha_len; i++ ) { hPHA->p_curr_taps[n][i] *= energy; @@ -2291,11 +2243,7 @@ ivas_error stereo_dmx_evs_init_encoder( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for STEREO_DMX_EVS_POC_DATA\n" ) ); } -#ifdef BE_FIX_567_DOUBLE_STEREO_DMX hStereoDmxEVS->hPOC->shift_limit = NS2SA( input_Fs, STEREO_DMX_EVS_SHIFT_LIMIT ); -#else - hStereoDmxEVS->hPOC->shift_limit = (int16_t) ( STEREO_DMX_EVS_SHIFT_LIMIT * input_Fs / 1000 ); -#endif for ( n = 0; n < CPE_CHANNELS; n++ ) { -- GitLab From 5aae34aebc478c890939130bbaf074c514a148d0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 13:51:31 +0100 Subject: [PATCH 386/498] [cleanup] accept NONBE_FIX_947_STEREO_DMX_EVS_POC --- lib_com/options.h | 3 --- lib_enc/ivas_rom_enc.c | 23 -------------------- lib_enc/ivas_rom_enc.h | 6 ------ lib_enc/ivas_stereo_dmx_evs.c | 40 ----------------------------------- 4 files changed, 72 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 39e9adb235..2b7b6dd222 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,10 +171,7 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC #define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ -#endif #define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index 8273e0e444..57eede1ee5 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -534,7 +534,6 @@ const float ari_bit_estimate_s17_LC[RANGE_N_CONTEXT][RANGE_N_SYMBOLS] = * Stereo downmix to EVS ROM tables *----------------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 2] = { 0.00009518625f, 0.00038070876f, 0.00085645882f, 0.00152225529f, 0.00237784467f, 0.00342290120f, 0.00465702698f, 0.00607975212f, 0.00769053493f, 0.00948876211f, @@ -593,28 +592,6 @@ const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 2] = { 0.46899585921f, 0.47225590178f, 0.47551712789f, 0.47877939840f, 0.48204257416f, 0.48530651596f, 0.48857108456f, 0.49183614071f, 0.49510154512f, 0.49836715849f, }; -#else -const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 4] = { - 0.00154133327f, 0.0138150426f, 0.0380602330f, 0.0736799166f, 0.119797014f, 0.175276011f, 0.238750681f, 0.308658302f, 0.383277327f, 0.460770488f, - 0.539229512f, 0.616722703f, 0.691341758f, 0.761249363f, 0.824724138f, 0.880203009f, 0.926320136f, 0.961939812f, 0.986184955f, 0.998458624f, -}; - -const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 4] = { - 0.000385481922f, 0.00346577191f, 0.00960735977f, 0.0187723786f, 0.0309043285f, 0.0459284224f, 0.0637519881f, 0.0842651874f, 0.107341543f, 0.132838756f, - 0.160599619f, 0.190453023f, 0.222214893f, 0.255689442f, 0.290670186f, 0.326941460f, 0.364279807f, 0.402454913f, 0.441231340f, 0.480370134f, - 0.519629955f, 0.558768749f, 0.597545147f, 0.635720134f, 0.673058629f, 0.709329903f, 0.744310737f, 0.777785182f, 0.809546947f, 0.839400351f, - 0.867161214f, 0.892658472f, 0.915734828f, 0.936248004f, 0.954071581f, 0.969095647f, 0.981227636f, 0.990392625f, 0.996534228f, 0.999614537f -}; - -const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 4] = { - 0.000171337553f, 0.00154133327f, 0.00427756971f, 0.00837254710f, 0.0138150426f, 0.0205901340f, 0.0286792554f, 0.0380602330f, 0.0487073623f, 0.0605914444f, - 0.0736799166f, 0.0879369006f, 0.103323318f, 0.119797014f, 0.137312800f, 0.155822709f, 0.175276011f, 0.195619285f, 0.216796920f, 0.238750681f, - 0.261420637f, 0.284744442f, 0.308658302f, 0.333096594f, 0.357992321f, 0.383277327f, 0.408882231f, 0.434736967f, 0.460770488f, 0.486911595f, - 0.513088524f, 0.539229512f, 0.565263212f, 0.591117799f, 0.616722703f, 0.642007649f, 0.666903436f, 0.691341758f, 0.715255499f, 0.738579512f, - 0.761249363f, 0.783203125f, 0.804380774f, 0.824724138f, 0.844177306f, 0.862687230f, 0.880203009f, 0.896676719f, 0.912063122f, 0.926320136f, - 0.939408541f, 0.951292694f, 0.961939812f, 0.971320748f, 0.979409873f, 0.986184955f, 0.991627395f, 0.995722473f, 0.998458624f, 0.999828696f -}; -#endif const float Stereo_dmx_wnd_coef_32k[L_FRAME32k] = { 0.00245436677f, 0.00736304140f, 0.0122715384f, 0.0171797406f, 0.0220875274f, 0.0269947834f, 0.0319013894f, 0.0368072242f, 0.0417121723f, 0.0466161147f, diff --git a/lib_enc/ivas_rom_enc.h b/lib_enc/ivas_rom_enc.h index 3dae881bc8..f5ab81f8c0 100644 --- a/lib_enc/ivas_rom_enc.h +++ b/lib_enc/ivas_rom_enc.h @@ -120,15 +120,9 @@ extern const uint16_t ECSQ_tab_vals[ECSQ_PARAM_COUNT - 1][1 + ECSQ_TAB_VALS_SIZE * Stereo downmix to EVS ROM tables *----------------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC extern const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 2]; extern const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 2]; extern const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 2]; -#else -extern const float Stereo_dmx_s_wnd_coef_16k[L_FRAME16k >> 4]; -extern const float Stereo_dmx_s_wnd_coef_32k[L_FRAME32k >> 4]; -extern const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 4]; -#endif extern const float Stereo_dmx_wnd_coef_32k[L_FRAME32k]; extern const float Stereo_dmx_wnd_coef_48k[L_FRAME48k]; diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index e67029d071..985040e236 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -1225,7 +1225,6 @@ static void weighted_ave( const float wnd[] /* i : window coef */ ) { -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC #ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT @@ -1271,25 +1270,6 @@ static void weighted_ave( #endif -#else - - int16_t i, len; - float gain_tmp = 0.f, gain_sub; - - len = input_frame >> 4; - gain_sub = gain - old_gain; - - for ( i = 0; i < len; i++ ) - { - gain_tmp = old_gain + gain_sub * wnd[i]; - dst[i] = src1[i] * gain_tmp + src2[i] * ( 1.0f - gain_tmp ); - } - for ( ; i < input_frame; i++ ) - { - dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); - } - -#endif return; } @@ -1407,7 +1387,6 @@ static void adapt_gain( const float wnd[] /* i : window coef */ ) { -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC #ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT @@ -1450,25 +1429,6 @@ static void adapt_gain( dst[i] = src[i] * gain; } -#else - - int16_t i, len; - float gain_tmp, gain_sub; - - len = input_frame >> 4; - gain_sub = gain - old_gain; - - for ( i = 0; i < len; i++ ) - { - gain_tmp = old_gain + gain_sub * wnd[i]; - dst[i] = src[i] * gain_tmp; - } - for ( ; i < input_frame; i++ ) - { - dst[i] = src[i] * gain; - } - -#endif return; } -- GitLab From 6fbdff39d3533f93be53cc15617d36cb5d7b3b57 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 13:52:16 +0100 Subject: [PATCH 387/498] [cleanup] accept NONBE_FIX_947_STEREO_DMX_ROMOPT --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dmx_evs.c | 36 ----------------------------------- 2 files changed, 37 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2b7b6dd222..d3b29c2f01 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ #define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index 985040e236..d93076d6ce 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -1226,7 +1226,6 @@ static void weighted_ave( ) { -#ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT int16_t i, len, len2; float gain_tmp = 0.f, gain_sub; @@ -1250,25 +1249,6 @@ static void weighted_ave( dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); } -#else - - int16_t i, len; - float gain_tmp = 0.f, gain_sub; - - len = input_frame >> 1; - gain_sub = gain - old_gain; - - for ( i = 0; i < len; i++ ) - { - gain_tmp = old_gain + gain_sub * wnd[i]; - dst[i] = src1[i] * gain_tmp + src2[i] * ( 1.0f - gain_tmp ); - } - for ( ; i < input_frame; i++ ) - { - dst[i] = src1[i] * gain + src2[i] * ( 1.0f - gain_tmp ); - } - -#endif return; @@ -1388,7 +1368,6 @@ static void adapt_gain( ) { -#ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT int16_t i, len, len2; float gain_tmp, gain_sub; @@ -1408,21 +1387,6 @@ static void adapt_gain( dst[i] = src[i] * gain_tmp; } -#else - - int16_t i, len; - float gain_tmp, gain_sub; - - len = input_frame >> 1; - gain_sub = gain - old_gain; - - for ( i = 0; i < len; i++ ) - { - gain_tmp = old_gain + gain_sub * wnd[i]; - dst[i] = src[i] * gain_tmp; - } - -#endif for ( ; i < input_frame; i++ ) { -- GitLab From 83b938a39d451150b07e4497a19ccedbe8d48642 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 13:54:03 +0100 Subject: [PATCH 388/498] [cleanup] accept NONBE_FIX_947_STEREO_DMX_EVS_PHA --- lib_com/options.h | 3 - lib_enc/ivas_stat_enc.h | 10 - lib_enc/ivas_stereo_dmx_evs.c | 447 ---------------------------------- 3 files changed, 460 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d3b29c2f01..c619a7e3a2 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,10 +171,7 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ -#endif #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 434692f722..3962ac055f 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1074,9 +1074,6 @@ typedef struct stereo_dmx_evs_phase_only_correlation_structure typedef struct stereo_dmx_evs_correlation_filter_structure { -#ifndef NONBE_FIX_947_STEREO_DMX_EVS_PHA - int16_t init_frmCntr; -#endif float isd_rate_s; float iccr_s; float ipd_ff[STEREO_DMX_EVS_NB_SUBBAND_MAX]; @@ -1097,7 +1094,6 @@ typedef struct stereo_dmx_evs_correlation_filter_structure STEREO_DMX_EVS_PHA curr_pha; STEREO_DMX_EVS_PHA prev_pha; int16_t pha_hys_cnt; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA STEREO_DMX_EVS_PHA proc_pha; bool force_poc; @@ -1109,21 +1105,16 @@ typedef struct stereo_dmx_evs_correlation_filter_structure int16_t pha_ipd_chanswitch; int16_t pha_ipd_chanswitch_allowed; float pha_ipd_sf_Threshold; -#endif int16_t prc_thres; STEREO_DMX_EVS_PRC curr_prc; STEREO_DMX_EVS_PRC prev_prc; int16_t prc_hys_cnt; float fad_g_prc[L_FRAME48k]; -#ifndef NONBE_FIX_947_STEREO_DMX_EVS_PHA - int16_t fad_len_prc; -#endif float trns_aux_energy[CPE_CHANNELS]; float crst_fctr; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA int16_t n_fad_g; int16_t n_fad_cnt; float dmx_pha_ener; @@ -1133,7 +1124,6 @@ typedef struct stereo_dmx_evs_correlation_filter_structure float dmx_pha_gain_sgc; float dmx_poc_gain_sgc; float low_egy_thres_sgc; -#endif } STEREO_DMX_EVS_PHA_DATA, *STEREO_DMX_EVS_PHA_HANDLE; diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index d93076d6ce..e653022c83 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -88,14 +88,10 @@ #define STEREO_DMX_EVS_SWTCH_PRC_THRES_48 29 #define STEREO_DMX_EVS_SWTCH_PRC_HYS_THRES 1 -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define STEREO_DMX_EVS_IFF_AMIN 0.857696f #define STEREO_DMX_EVS_IFF_AMAX 0.944061f #define STEREO_DMX_EVS_IFF_FREQ 3000.0f #define STEREO_DMX_EVS_PHA_WND_C 1.8f -#else -#define STEREO_DMX_EVS_FADE_LEN_PRC 20.0f -#endif #define STEREO_DMX_EVS_NB_SBFRM 5 #define STEREO_DMX_EVS_TRNS_DTC_INST 75.0f @@ -105,7 +101,6 @@ #define STEREO_DMX_EVS_TRNS_EGY_FORGETTING 0.75f -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define STEREO_DMX_EVS_FAD_R 3 #define STEREO_DMX_EVS_SGC_EGY_FORGETTING 0.9f #define STEREO_DMX_EVS_SGC_GR_S 1.00461543f @@ -119,7 +114,6 @@ #define STEREO_DMX_EVS_IPD_ILD_THRES 3.16f // 5dB #define STEREO_DMX_EVS_IPD_SF_THRES 0.05f -#endif /*-----------------------------------------------------------------------* * Local function prototypes @@ -133,9 +127,7 @@ static void adapt_gain( const float src[], float dst[], const float gain, const static void create_M_signal( const float srcL[], const float srcR[], float dmx[], const float w_curr, const int16_t input_frame, const float wnd[], float *w_prev, float *dmx_energy, float *src_energy ); static float find_poc_peak( STEREO_DMX_EVS_POC_HANDLE hPOC, float itd[], const int16_t input_frame, const float ratio ); static void calc_energy( const float src1[], const float src2[], float energy[], const int16_t input_frame, const float ratio ); -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA static float spectral_flatness( const float sig[], const int16_t sig_length ); -#endif /*-------------------------------------------------------------------* * estimate_itd_wnd_fft() @@ -227,11 +219,7 @@ static void calc_poc( int16_t cos_step, cos_max; float eps_cos, eps_sin, EPS; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA int16_t isd_cnt_h, isd_cnt_l, ild_cnt, n, freq_8k, freq_ipd_max, nsbd, input_frame_pha, pha_ipd_ild_chan2rephase; -#else - int16_t isd_cnt_h, isd_cnt_l, ild_cnt, n, freq_8k, freq_ipd_max, nsbd, input_frame_pha; -#endif float Nr, Ni, Dr, Di, tPr, tPi, Pn, energy, isd_rate; float eneL, eneR, IPDr, IPDi, tIPDr, tIPDi, ICCr; float *Pr, *Pi, *ipd_ff, *p_curr_taps; @@ -410,13 +398,6 @@ static void calc_poc( } specPOr[n0] = sign( specLr[n0] * specRr[n0] ) * wnd[i * step + bias] * gamma; -#ifndef NONBE_FIX_947_STEREO_DMX_EVS_PHA - hPHA->init_frmCntr--; - if ( hPHA->init_frmCntr < 0 ) - { - hPHA->init_frmCntr = 0; - } -#endif freq_8k = L_FRAME16k / 2; freq_ipd_max = (int16_t) ( freq_8k * 5000.0f / ( 8000.0f * STEREO_DMX_EVS_SUBBAND_SIZE ) ); @@ -543,7 +524,6 @@ static void calc_poc( tPr *= Pn; tPi *= Pn; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA Pr[n] = ipd_ff[n] * Pr[n] + ( 1.0f - ipd_ff[n] ) * tPr; Pi[n] = ipd_ff[n] * Pi[n] + ( 1.0f - ipd_ff[n] ) * tPi; @@ -551,26 +531,10 @@ static void calc_poc( Pr[n] *= Pn; Pi[n] *= Pn; -#else - if ( hPHA->init_frmCntr == 0 ) - { - Pr[n] = ipd_ff[n] * Pr[n] + ( 1.0f - ipd_ff[n] ) * tPr; - Pi[n] = ipd_ff[n] * Pi[n] + ( 1.0f - ipd_ff[n] ) * tPi; - Pn = inv_sqrtf( ( Pr[n] * Pr[n] + Pi[n] * Pi[n] ) + EPSILON ); - Pr[n] *= Pn; - Pi[n] *= Pn; - } - else - { - Pr[n] = tPr; - Pi[n] = tPi; - } -#endif Pr[n] = ( Pr[n] > 1.0f ) ? 1.0f : Pr[n]; Pr[n] = ( Pr[n] < -1.0f ) ? -1.0f : Pr[n]; } -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Computes Spectral flatness on one channel */ tmp1 = spectral_flatness( &tEl[1], nsbd - 1 ); if ( tmp1 < hPHA->pha_ipd_sf_Threshold ) @@ -581,12 +545,10 @@ static void calc_poc( { hPHA->pha_ipd_chanswitch_allowed = 1; } -#endif ICCr = sqrtf( ( Nr * Nr + Ni * Ni ) / ( eneL * eneR + EPSILON ) ); hPHA->iccr_s = STEREO_DMX_EVS_ICCR_FORGETTING * hPHA->iccr_s + ( 1.0f - STEREO_DMX_EVS_ICCR_FORGETTING ) * ICCr; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA if ( hPHA->curr_pha == STEREO_DMX_EVS_PHA_IPD ) { hPHA->force_poc = FALSE; @@ -808,115 +770,6 @@ static void calc_poc( p_curr_taps[i] = rfft_pha_buf[input_frame_pha - i]; } } -#else - if ( hPHA->curr_pha == STEREO_DMX_EVS_PHA_IPD ) - { - hPHA->p_curr_taps[0] = NULL; - hPHA->p_curr_taps[1] = hPHA->curr_taps[1]; - - rfft_pha_buf[0] = 1.; - rfft_pha_buf[1] = 1.; - - ild_cnt = 0; - for ( i = 1; i < nsbd; i++ ) - { - rfft_pha_buf[i * 2] = Pr[i]; - rfft_pha_buf[i * 2 + 1] = Pi[i]; - if ( ( tEr[i] > STEREO_DMX_EVS_LR_EGY * tEl[i] ) || ( tEl[i] > STEREO_DMX_EVS_LR_EGY * tEr[i] ) ) - { - ild_cnt++; - tEr[i] = 1; - } - else - { - tEr[i] = -1; - } - } - if ( ild_cnt > nsbd * STEREO_DMX_EVS_ILD_PRC ) - { - for ( i = 1; i < nsbd; i++ ) - { - if ( tEr[i] > 0 ) - { - rfft_pha_buf[i * 2] = 1.; - rfft_pha_buf[i * 2 + 1] = 0.; - } - } - } - - rfft( rfft_pha_buf, hPHA->rfft_ipd_coef, input_frame_pha, +1 ); - mvr2r( rfft_pha_buf, hPHA->p_curr_taps[1], hPHA->pha_len ); - } - else - { - if ( ( hPHA->iccr_s < STEREO_DMX_EVS_ICCR_HYST_L ) || ( ( hPHA->iccr_s < STEREO_DMX_EVS_ICCR_HYST_H ) && ( hPHA->p_curr_taps[0] != NULL ) ) ) - { - /* IPDn */ - - set_f( &( Pr[freq_ipd_max] ), 1.0f, ( nsbd - freq_ipd_max ) ); - set_f( &( Pi[freq_ipd_max] ), 0.0f, ( nsbd - freq_ipd_max ) ); - - for ( n = 0; n < CPE_CHANNELS; n++ ) - { - hPHA->p_curr_taps[n] = hPHA->curr_taps[n]; - } - - rfft_pha_buf[0] = 1.; - rfft_pha_buf[1] = 1.; - - ild_cnt = 0; - isd_rate = (float) isd_cnt_l / freq_8k; - for ( i = 1; i < nsbd; i++ ) - { - rfft_pha_buf[i * 2] = sqrtf( ( 1.0f + Pr[i] ) / 2.0f ); - rfft_pha_buf[i * 2 + 1] = sqrtf( ( 1.0f - Pr[i] ) / 2.0f ) * sign( Pi[i] ); - if ( isd_rate > STEREO_DMX_EVS_ISD_DIST_THRES_IPD ) - { - rfft_pha_buf[i * 2 + 1] = sqrtf( ( 1.0f - rfft_pha_buf[i * 2] ) / 2.0f ) * sign( rfft_pha_buf[i * 2 + 1] ); - rfft_pha_buf[i * 2] = sqrtf( ( 1.0f + rfft_pha_buf[i * 2] ) / 2.0f ); - } - if ( ( tEr[i] > STEREO_DMX_EVS_LR_EGY * tEl[i] ) || ( tEl[i] > STEREO_DMX_EVS_LR_EGY * tEr[i] ) ) - { - ild_cnt++; - tEr[i] = 1; - } - else - { - tEr[i] = -1; - } - } - if ( ild_cnt > nsbd * STEREO_DMX_EVS_ILD_PRC ) - { - for ( i = 1; i < nsbd; i++ ) - { - if ( tEr[i] > 0 ) - { - rfft_pha_buf[i * 2] = 1.; - rfft_pha_buf[i * 2 + 1] = 0.; - } - } - } - - rfft( rfft_pha_buf, hPHA->rfft_ipd_coef, input_frame_pha, +1 ); - mvr2r( rfft_pha_buf, hPHA->p_curr_taps[1], hPHA->pha_len ); - - /* PHA L2R */ - p_curr_taps = hPHA->p_curr_taps[0]; - p_curr_taps[0] = rfft_pha_buf[0]; - for ( i = 1; i < hPHA->pha_len; i++ ) - { - p_curr_taps[i] = rfft_pha_buf[input_frame_pha - i]; - } - } - else - { - for ( n = 0; n < CPE_CHANNELS; n++ ) - { - hPHA->p_curr_taps[n] = NULL; - } - } - } -#endif for ( n = 0; n < CPE_CHANNELS; n++ ) { @@ -1254,7 +1107,6 @@ static void weighted_ave( return; } -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA /*-------------------------------------------------------------------* * spectral_flatness() * @@ -1285,7 +1137,6 @@ static float spectral_flatness( return geoMean / ariMean; } -#endif /*-------------------------------------------------------------------* * calc_energy() @@ -1333,7 +1184,6 @@ static void calc_energy( } -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA /*-------------------------------------------------------------------* * calc_energy_sgc() * @@ -1349,7 +1199,6 @@ static void calc_energy_sgc( *energy = ratio * *energy + ( 1.0f - ratio ) * sum2_f( src, input_frame ); return; } -#endif /*-------------------------------------------------------------------* @@ -1454,7 +1303,6 @@ static void create_M_signal( } -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA /*-------------------------------------------------------------------* * apply_gain_sgc() @@ -1493,7 +1341,6 @@ static void apply_gain_sgc( *gain *= lr; } -#endif /*-------------------------------------------------------------------* @@ -1510,7 +1357,6 @@ void stereo_dmx_evs_enc( const bool is_binaural /* i : indication that input is binaural audio */ ) { -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA float dmx_weight, corr; #ifdef NONBE_FIX_947_STEREO_DMX_FADOPT @@ -1857,247 +1703,6 @@ void stereo_dmx_evs_enc( mvr2s( p_dmx_data, data, n_samples ); -#else - - int16_t n; - float dmx_weight, corr; - float data_f[CPE_CHANNELS][L_FRAME48k]; - - int16_t k, m, pha_len, fad_len; - float mem_prev[STEREO_DMX_EVS_FAD_LEN_MAX], data_mem[STEREO_DMX_EVS_DATA_LEN_MAX]; - float *p_data_mem, *p_prev_taps, *p_curr_taps, *fad_g, *p_data; - float dmx_poc_data[L_FRAME48k], dmx_pha_data[L_FRAME48k], *p_dmx_data, ftmp; - STEREO_DMX_EVS_PRC curr_prc; - int16_t input_subframe, is_transient; - float *p_sub_frame, subframe_energy[STEREO_DMX_EVS_NB_SBFRM]; - - int16_t input_frame; - - if ( is_binaural ) - { - /* use of is_binaural flag is to be considered */ - } - - input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); - - for ( n = 0; n < input_frame; n++ ) - { - data_f[0][n] = (float) data[2 * n]; - data_f[1][n] = (float) data[2 * n + 1]; - } - if ( n_samples < input_frame ) - { - set_f( data_f[0] + n_samples, 0.0f, input_frame - n_samples ); - set_f( data_f[1] + n_samples, 0.0f, input_frame - n_samples ); - } - - - input_subframe = n_samples / STEREO_DMX_EVS_NB_SBFRM; - is_transient = 0; - for ( k = 0; k < CPE_CHANNELS; k++ ) - { - ftmp = 0; - for ( m = 0; m < STEREO_DMX_EVS_NB_SBFRM; m++ ) - { - p_sub_frame = &( data_f[k][m * input_subframe] ); - subframe_energy[m] = 0; - for ( n = 0; n < input_subframe; n++ ) - { - subframe_energy[m] += p_sub_frame[n] * p_sub_frame[n]; - } - - if ( subframe_energy[m] / ( hStereoDmxEVS->hPHA->trns_aux_energy[k] + EPSILON ) > hStereoDmxEVS->hPHA->crst_fctr ) - { - is_transient = 1; - } - - if ( hStereoDmxEVS->hPHA->init_frmCntr == 0 ) - { - hStereoDmxEVS->hPHA->trns_aux_energy[k] = STEREO_DMX_EVS_TRNS_EGY_FORGETTING * hStereoDmxEVS->hPHA->trns_aux_energy[k] + ( 1.0f - STEREO_DMX_EVS_TRNS_EGY_FORGETTING ) * subframe_energy[m]; - } - else - { - hStereoDmxEVS->hPHA->trns_aux_energy[k] = 0.5f * hStereoDmxEVS->hPHA->trns_aux_energy[k] + 0.5f * subframe_energy[m]; - } - - ftmp += subframe_energy[m]; - } - - for ( m = 1; m < STEREO_DMX_EVS_NB_SBFRM; m++ ) - { - if ( subframe_energy[m] / ( subframe_energy[m - 1] + EPSILON ) > STEREO_DMX_EVS_TRNS_DTC_INST ) - { - is_transient = 1; - } - } - } - - estimate_itd( &corr, hStereoDmxEVS->hPOC, hStereoDmxEVS->hPHA, data_f[0], data_f[1], &hStereoDmxEVS->itd, input_frame ); - - /* poc */ - - if ( hStereoDmxEVS->itd ) - { - dmx_weight = ( ( hStereoDmxEVS->itd > 0 ) ? ( -1 ) : 1 ) * 0.5f * corr + 0.5f; - } - else - { - dmx_weight = 0.5f; - } - - create_M_signal( data_f[0], data_f[1], dmx_poc_data, dmx_weight, input_frame, hStereoDmxEVS->s_wnd, - hStereoDmxEVS->dmx_weight, hStereoDmxEVS->pre_dmx_energy, hStereoDmxEVS->aux_dmx_energy ); - - /* pha */ - - pha_len = hStereoDmxEVS->hPHA->pha_len; - fad_len = hStereoDmxEVS->hPHA->fad_len; - fad_g = hStereoDmxEVS->hPHA->fad_g; - - set_zero( dmx_pha_data, n_samples ); - set_zero( mem_prev, fad_len ); - - for ( k = 0; k < CPE_CHANNELS; k++ ) - { - p_data = data_f[k]; - mvr2r( hStereoDmxEVS->hPHA->data_mem[k], data_mem, pha_len ); - mvr2r( &( p_data[n_samples - pha_len] ), hStereoDmxEVS->hPHA->data_mem[k], pha_len ); - p_data_mem = &( data_mem[pha_len] ); - mvr2r( p_data, p_data_mem, n_samples ); - - p_prev_taps = hStereoDmxEVS->hPHA->p_prev_taps[k]; - if ( p_prev_taps ) - { - for ( n = 0; n < fad_len; n++ ) - { - for ( ftmp = 0, m = 0; m < pha_len; m++ ) - { - ftmp += p_data_mem[n - m] * p_prev_taps[m]; - } - mem_prev[n] += ftmp * INV_SQRT_2; - } - } - else - { - for ( n = 0; n < fad_len; n++ ) - { - mem_prev[n] += p_data[n] * INV_SQRT_2; - } - } - - p_curr_taps = hStereoDmxEVS->hPHA->p_curr_taps[k]; - if ( p_curr_taps ) - { - for ( n = 0; n < n_samples; n++ ) - { - for ( ftmp = 0, m = 0; m < pha_len; m++ ) - { - ftmp += p_data_mem[n - m] * p_curr_taps[m]; - } - dmx_pha_data[n] += ftmp * INV_SQRT_2; - } - } - else - { - for ( n = 0; n < n_samples; n++ ) - { - dmx_pha_data[n] += p_data[n] * INV_SQRT_2; - } - } - } - - for ( n = 0, m = ( fad_len - 1 ); n < fad_len; n++, m-- ) - { - dmx_pha_data[n] *= fad_g[n]; - dmx_pha_data[n] += ( mem_prev[n] ) * fad_g[m]; - } - - /* prc switch */ - - curr_prc = hStereoDmxEVS->hPHA->curr_prc; - if ( abs( (int16_t) hStereoDmxEVS->itd ) > hStereoDmxEVS->hPHA->prc_thres ) - { - if ( hStereoDmxEVS->hPHA->curr_prc != STEREO_DMX_EVS_PRC_POC ) - { - if ( hStereoDmxEVS->hPHA->prev_prc == STEREO_DMX_EVS_PRC_POC ) - { - hStereoDmxEVS->hPHA->prc_hys_cnt += 1; - } - else - { - hStereoDmxEVS->hPHA->prc_hys_cnt = 0; - } - - if ( hStereoDmxEVS->hPHA->prc_hys_cnt >= STEREO_DMX_EVS_SWTCH_PRC_HYS_THRES ) - { - hStereoDmxEVS->hPHA->curr_prc = STEREO_DMX_EVS_PRC_POC; - } - } - hStereoDmxEVS->hPHA->prev_prc = STEREO_DMX_EVS_PRC_POC; - } - else - { - if ( hStereoDmxEVS->hPHA->curr_prc != STEREO_DMX_EVS_PRC_PHA ) - { - if ( hStereoDmxEVS->hPHA->prev_prc == STEREO_DMX_EVS_PRC_PHA ) - { - hStereoDmxEVS->hPHA->prc_hys_cnt += 1; - } - else - { - hStereoDmxEVS->hPHA->prc_hys_cnt = 0; - } - - if ( hStereoDmxEVS->hPHA->prc_hys_cnt >= STEREO_DMX_EVS_SWTCH_PRC_HYS_THRES ) - { - hStereoDmxEVS->hPHA->curr_prc = STEREO_DMX_EVS_PRC_PHA; - } - } - hStereoDmxEVS->hPHA->prev_prc = STEREO_DMX_EVS_PRC_PHA; - } - - if ( ( is_transient == 1 ) || ( hStereoDmxEVS->aux_dmx_energy[0] > STEREO_DMX_EVS_ILDS_EGY * hStereoDmxEVS->aux_dmx_energy[1] ) || ( hStereoDmxEVS->aux_dmx_energy[1] > STEREO_DMX_EVS_ILDS_EGY * hStereoDmxEVS->aux_dmx_energy[0] ) || ( ( hStereoDmxEVS->hPHA->p_curr_taps[0] == NULL ) && ( hStereoDmxEVS->hPHA->p_curr_taps[1] == NULL ) ) ) - { - hStereoDmxEVS->hPHA->curr_prc = STEREO_DMX_EVS_PRC_POC; - hStereoDmxEVS->hPHA->prc_hys_cnt = 0; - } - - if ( hStereoDmxEVS->hPHA->curr_prc == STEREO_DMX_EVS_PRC_POC ) - { - p_dmx_data = dmx_poc_data; - - if ( curr_prc != hStereoDmxEVS->hPHA->curr_prc ) - { - fad_len = hStereoDmxEVS->hPHA->fad_len_prc; - fad_g = hStereoDmxEVS->hPHA->fad_g_prc; - - for ( n = 0, m = ( fad_len - 1 ); n < fad_len; n++, m-- ) - { - p_dmx_data[n] *= fad_g[n]; - p_dmx_data[n] += fad_g[m] * dmx_pha_data[n]; - } - } - } - else - { - p_dmx_data = dmx_pha_data; - - if ( curr_prc != hStereoDmxEVS->hPHA->curr_prc ) - { - fad_len = hStereoDmxEVS->hPHA->fad_len_prc; - fad_g = hStereoDmxEVS->hPHA->fad_g_prc; - - for ( n = 0, m = ( fad_len - 1 ); n < fad_len; n++, m-- ) - { - p_dmx_data[n] *= fad_g[n]; - p_dmx_data[n] += fad_g[m] * dmx_poc_data[n]; - } - } - } - - mvr2s( p_dmx_data, data, n_samples ); - -#endif return; } @@ -2118,11 +1723,7 @@ ivas_error stereo_dmx_evs_init_encoder( int16_t n, input_frame; int16_t m, len, pha_len, fad_len, fad_len2, trans_len, itrh, rfft_ipd_coef_step, n0, input_frame_pha; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA float *win, *fad_g, fad_r, tmp_r, a_step, *ipd_ff; -#else - float *win, *fad_g, fad_r, tmp_r, a_min, a_max, a_step, *ipd_ff; -#endif const float *p_ipd_w; input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); @@ -2236,9 +1837,7 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->fad_len = STEREO_DMX_EVS_FAD_LEN_16; hStereoDmxEVS->hPHA->prc_thres = STEREO_DMX_EVS_SWTCH_PRC_THRES_16; hStereoDmxEVS->hPHA->crst_fctr = STEREO_DMX_EVS_CRST_FCTR_16; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA hStereoDmxEVS->hPHA->low_egy_thres_sgc = STEREO_DMX_EVS_SGC_LEGY_THRES_16; -#endif } else if ( input_Fs == 32000 ) { @@ -2246,9 +1845,7 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->fad_len = STEREO_DMX_EVS_FAD_LEN_32; hStereoDmxEVS->hPHA->prc_thres = STEREO_DMX_EVS_SWTCH_PRC_THRES_32; hStereoDmxEVS->hPHA->crst_fctr = STEREO_DMX_EVS_CRST_FCTR_32; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA hStereoDmxEVS->hPHA->low_egy_thres_sgc = STEREO_DMX_EVS_SGC_LEGY_THRES_32; -#endif } else if ( input_Fs == 48000 ) { @@ -2256,9 +1853,7 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->fad_len = STEREO_DMX_EVS_FAD_LEN_48; hStereoDmxEVS->hPHA->prc_thres = STEREO_DMX_EVS_SWTCH_PRC_THRES_48; hStereoDmxEVS->hPHA->crst_fctr = STEREO_DMX_EVS_CRST_FCTR_48; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA hStereoDmxEVS->hPHA->low_egy_thres_sgc = STEREO_DMX_EVS_SGC_LEGY_THRES_48; -#endif } else { @@ -2266,9 +1861,6 @@ ivas_error stereo_dmx_evs_init_encoder( } hStereoDmxEVS->hPHA->pha_len = len / 2; -#ifndef NONBE_FIX_947_STEREO_DMX_EVS_PHA - hStereoDmxEVS->hPHA->init_frmCntr = (int16_t) ( FRAMES_PER_SEC * 0.2f ); -#endif hStereoDmxEVS->hPHA->isd_rate_s = 0.0f; hStereoDmxEVS->hPHA->iccr_s = 0.0f; @@ -2276,21 +1868,13 @@ ivas_error stereo_dmx_evs_init_encoder( fad_len = hStereoDmxEVS->hPHA->fad_len; trans_len = (int16_t) ( (float) pha_len / 20.0f ); -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA set_f( hStereoDmxEVS->hPHA->win, STEREO_DMX_EVS_PHA_WND_C, pha_len - trans_len ); -#else - set_f( hStereoDmxEVS->hPHA->win, 1.8f, pha_len - trans_len ); -#endif hStereoDmxEVS->hPHA->win[0] = 1.0f; tmp_r = 1.0f / ( ( trans_len * 2 ) + 1 ); win = &( hStereoDmxEVS->hPHA->win[pha_len - trans_len] ); for ( n = 0; n < trans_len; n++ ) { -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA win[n] = ( 0.5f * ( 1.0f + cosf( ( PI2 * ( n + 1 ) ) * tmp_r ) ) ) * STEREO_DMX_EVS_PHA_WND_C; -#else - win[n] = ( 0.5f * ( 1.0f + cosf( ( PI2 * ( n + 1 ) ) * tmp_r ) ) ) * 1.8f; -#endif } fad_g = hStereoDmxEVS->hPHA->fad_g; @@ -2306,7 +1890,6 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->prev_pha = STEREO_DMX_EVS_PHA_IPD; hStereoDmxEVS->hPHA->pha_hys_cnt = 0; -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA hStereoDmxEVS->hPHA->pha_ipd_chan_cnt = 0; hStereoDmxEVS->hPHA->pha_ipd_chan_thresh = 10; @@ -2337,29 +1920,6 @@ ivas_error stereo_dmx_evs_init_encoder( { ipd_ff[n] = STEREO_DMX_EVS_IFF_AMIN; } -#else - - /* Compute the forgetting factor */ - a_min = 0.8576958985908941f; - a_max = 0.9440608762859234f; - itrh = (int16_t) ( ( 3000 * input_frame ) / ( input_Fs * STEREO_DMX_EVS_SUBBAND_SIZE ) ); /* 3kHz */ - n0 = L_FRAME16k / ( 2 * STEREO_DMX_EVS_SUBBAND_SIZE ); - a_step = ( a_min - a_max ) / ( n0 + 1 - itrh ); - ipd_ff = hStereoDmxEVS->hPHA->ipd_ff; - for ( n = 0; n < itrh; n++ ) - { - ipd_ff[n] = a_max; - } - for ( ; n < ( n0 + 1 ); n++ ) /* 8kHz */ - { - ipd_ff[n] = a_max + ( n - itrh ) * a_step; - } - for ( ; n < STEREO_DMX_EVS_NB_SUBBAND_MAX; n++ ) - { - ipd_ff[n] = a_min; - } - -#endif set_f( hStereoDmxEVS->hPHA->Pr, 1.0, STEREO_DMX_EVS_NB_SUBBAND_MAX ); set_zero( hStereoDmxEVS->hPHA->Pi, STEREO_DMX_EVS_NB_SUBBAND_MAX ); @@ -2399,12 +1959,7 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->prev_prc = STEREO_DMX_EVS_PRC_POC; hStereoDmxEVS->hPHA->prc_hys_cnt = 0; -#ifndef NONBE_FIX_947_STEREO_DMX_EVS_PHA - hStereoDmxEVS->hPHA->fad_len_prc = (int16_t) ( STEREO_DMX_EVS_FADE_LEN_PRC * (float) input_Fs / 1000.0f ); - fad_len = hStereoDmxEVS->hPHA->fad_len_prc; -#else fad_len = input_frame; -#endif fad_g = hStereoDmxEVS->hPHA->fad_g_prc; fad_r = 1.0f / (float) ( fad_len + 1 ); @@ -2420,7 +1975,6 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->trns_aux_energy[n] = 0.0f; } -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA hStereoDmxEVS->hPHA->n_fad_g = input_frame; hStereoDmxEVS->hPHA->n_fad_cnt = 0; @@ -2433,7 +1987,6 @@ ivas_error stereo_dmx_evs_init_encoder( hStereoDmxEVS->hPHA->dmx_pha_ener = 0.0f; hStereoDmxEVS->hPHA->dmx_poc_ener = 0.0f; -#endif *hStereoDmxEVS_out = hStereoDmxEVS; -- GitLab From 130ba3bc58ba2f8b21313f097224ee3a78a952cb Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 13:54:54 +0100 Subject: [PATCH 389/498] [cleanup] accept NONBE_FIX_947_STEREO_DMX_FADOPT --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dmx_evs.c | 23 ----------------------- 2 files changed, 24 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c619a7e3a2..b5c9fdc074 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index e653022c83..849c90d442 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -1359,11 +1359,7 @@ void stereo_dmx_evs_enc( { float dmx_weight, corr; -#ifdef NONBE_FIX_947_STEREO_DMX_FADOPT int16_t k, m, n, pha_len, fad_len, input_subframe, input_frame, n_fad_r, n_fad_g, m_fad_g, n_fad_cnt, sbfad_len; -#else - int16_t k, m, n, pha_len, fad_len, input_subframe, input_frame, n_fad_r, n_fad_g, m_fad_g, n_fad_cnt; -#endif float data_f[CPE_CHANNELS][L_FRAME48k]; float mem_prev[STEREO_DMX_EVS_FAD_LEN_MAX], data_mem[STEREO_DMX_EVS_DATA_LEN_MAX]; float dmx_poc_data[L_FRAME48k], dmx_pha_data[L_FRAME48k], subframe_energy[STEREO_DMX_EVS_NB_SBFRM]; @@ -1609,11 +1605,7 @@ void stereo_dmx_evs_enc( else { hPHA->n_fad_g = input_frame - hPHA->n_fad_g - 1; -#ifdef NONBE_FIX_947_STEREO_DMX_FADOPT hPHA->n_fad_cnt = 0; -#else - hPHA->n_fad_cnt = is_transient ? 0 : n_fad_r - hPHA->n_fad_cnt; -#endif } } else if ( is_transient ) @@ -1630,7 +1622,6 @@ void stereo_dmx_evs_enc( n_fad_cnt = hPHA->n_fad_cnt; m_fad_g = input_frame - n_fad_g - 1; -#ifdef NONBE_FIX_947_STEREO_DMX_FADOPT if ( n_fad_r == 1 ) { n_fad_cnt = 0; @@ -1682,20 +1673,6 @@ void stereo_dmx_evs_enc( } } } -#else - for ( n = 0; n < fad_len; n++ ) - { - p_dmx_data[n] *= fad_g[n_fad_g]; - p_dmx_data[n] += fad_g[m_fad_g] * p_dmx_data_fo[n]; - - if ( ++n_fad_cnt == n_fad_r ) - { - n_fad_cnt = 0; - n_fad_g++; - m_fad_g--; - } - } -#endif hPHA->n_fad_g = n_fad_g; hPHA->n_fad_cnt = n_fad_cnt; -- GitLab From 938f6cd1e8d6caf0810be7a582fe63595304307c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 13:56:24 +0100 Subject: [PATCH 390/498] [cleanup] accept NONBE_FIX_982_OMASA_DELAY_COMP_5MS --- lib_com/ivas_cnst.h | 2 - lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 10 ----- lib_dec/ivas_jbm_dec.c | 2 - lib_dec/ivas_omasa_dec.c | 45 -------------------- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 -- 6 files changed, 64 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e409c2a891..db4e1a7c5b 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1225,9 +1225,7 @@ enum #define MASA_BIT_REDUCT_PARAM 10 #define MASA_MAXIMUM_TWO_DIR_BANDS 24 #define NBITS_HR_COH 4 -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS #define OMASA_TDREND_MATCHING_GAIN 0.7943f -#endif #define MASA_JBM_RINGBUFFER_FRAMES 3 diff --git a/lib_com/options.h b/lib_com/options.h index b5c9fdc074..a61c381a5e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_LCLD_5MS /* Dlb: LCLD 5ms framing operation */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index b2a7231771..3dbc6a6190 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -523,16 +523,6 @@ void ivas_omasa_separate_object_render_jbm( for ( obj = 0; obj < num_objects; obj++ ) { -#ifndef NONBE_FIX_982_OMASA_DELAY_COMP_5MS - /* Delay the signal to match CLDFB delay. Delay the whole buffer with the first rendering call of the stretched buffer. */ - if ( slots_rendered == 0 ) - { - int16_t tcBufferSize; - - tcBufferSize = hSpatParamRendCom->num_slots * hSpatParamRendCom->slot_size; - delay_signal( input_f[obj], tcBufferSize, st_ivas->hMasaIsmData->delayBuffer[obj], st_ivas->hMasaIsmData->delayBuffer_size ); - } -#endif offsetSamples = 0; for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 36ce6117b3..89aa3f8d4c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -934,7 +934,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( ivas_ism_dec_digest_tc( st_ivas ); } -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_DIRAC ) { int16_t num_objects; @@ -957,7 +956,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( delay_signal( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); } } -#endif #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 75c5d97e22..ab032e2440 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -45,16 +45,6 @@ #endif #include "wmc_auto.h" -#ifndef NONBE_FIX_982_OMASA_DELAY_COMP_5MS -/*------------------------------------------------------------------------- - * Local constants - *------------------------------------------------------------------------*/ - -#define OMASA_TDREND_MATCHING_GAIN 0.7943f -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT -#define EXT_RENDER_IIR_FAC 0.95f -#endif -#else #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*------------------------------------------------------------------------- * Local constants @@ -62,7 +52,6 @@ #define EXT_RENDER_IIR_FAC 0.95f #endif -#endif /*-------------------------------------------------------------------* * ivas_omasa_data_open() @@ -747,34 +736,22 @@ void ivas_omasa_dirac_rend_jbm( int16_t n; float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS if ( !st_ivas->hDecoderConfig->Opt_tsm ) { *nSamplesRendered = min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); -#endif if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); -#else - mvr2r( output_f[CPE_CHANNELS], data_separated_objects[0], nSamplesAsked ); -#endif } else { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS mvr2r( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); -#else - mvr2r( output_f[n + CPE_CHANNELS], data_separated_objects[n], nSamplesAsked ); -#endif } } -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS } -#endif subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; @@ -804,36 +781,14 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( { int16_t n; float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#ifndef NONBE_FIX_982_OMASA_DELAY_COMP_5MS - float gain = OMASA_TDREND_MATCHING_GAIN; -#endif ivas_error error; float *p_sepobj[MAX_NUM_OBJECTS]; -#ifndef NONBE_FIX_982_OMASA_DELAY_COMP_5MS - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) { p_sepobj[n] = &data_separated_objects[n][0]; } -#ifndef NONBE_FIX_982_OMASA_DELAY_COMP_5MS - /* Delay the object signals to match the CLDFB delay. Delay the whole buffer with the first rendering call of the stretched buffer. */ - if ( st_ivas->hSpatParamRendCom->slots_rendered == 0 ) - { - int16_t tcBufferSize; - - tcBufferSize = st_ivas->hSpatParamRendCom->num_slots * st_ivas->hSpatParamRendCom->slot_size; - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - tc_local[n] = st_ivas->hTcBuffer->tc[n + 2]; - v_multc( tc_local[n], gain, tc_local[n], tcBufferSize ); - delay_signal( tc_local[n], tcBufferSize, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); - } - } -#endif ivas_dirac_dec_binaural_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, nchan_transport, output_f ); /* reset combined orientation access index before calling the td renderer */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e0a4dc9549..7df3979328 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -2138,11 +2138,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( if ( ivas_format == MASA_ISM_FORMAT ) { -#ifdef NONBE_FIX_982_OMASA_DELAY_COMP_5MS gainFactor = OMASA_TDREND_MATCHING_GAIN * sqrtf( hDiracDecBin->earlyPartEneCorrection[bin] ); -#else - gainFactor = 0.7943f * sqrtf( hDiracDecBin->earlyPartEneCorrection[bin] ); -#endif } else { -- GitLab From aa0fbf05e7265c6aca0311e01991915e97e8bf91 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 21 Feb 2024 13:59:20 +0100 Subject: [PATCH 391/498] Combined room acoustics configuration added --- scripts/testv/rend_config_combined.cfg | 101 +++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 scripts/testv/rend_config_combined.cfg diff --git a/scripts/testv/rend_config_combined.cfg b/scripts/testv/rend_config_combined.cfg new file mode 100644 index 0000000000..37c76d0dd1 --- /dev/null +++ b/scripts/testv/rend_config_combined.cfg @@ -0,0 +1,101 @@ +[directivitySetting] +directivityCount = 4; + +[directivityPattern:0] +directivity = [0.0, 360.0, 0.2512] +[directivityPattern:1] +directivity = [0.0, 360.0, 0.5] +[directivityPattern:2] +directivity = [15.0, 345.0, 0.701] +[directivityPattern:3] +directivity = [90.0, 270.0, 0.1] + +[roomAcoustics] +frequencyGridCount = 2; +acousticEnvironmentCount = 3; + +[frequencyGrid:0] +method = individualFrequencies; +nrBands = 31; +frequencies = [20.0, 25.0, 31.5, 40.0, + 50.0, 63.0, 80.0, 100.0, + 125.0, 160.0, 200.0, 250.0, + 315.0, 400.0, 500.0, 630.0, + 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, + 5000.0, 6300.0, 8000.0, 10000.0, + 12500.0, 16000.0, 20000.0]; + +[frequencyGrid:1] +method = individualFrequencies; +nrBands = 24; +frequencies = [50.0, 63.0, 80.0, 100.0, + 125.0, 160.0, 200.0, 250.0, + 315.0, 400.0, 500.0, 630.0, + 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, + 5000.0, 6300.0, 8000.0, 10000.0]; + +[acousticEnvironment:0] +frequencyGridIndex = 0; +predelay = 0.1; +rt60 = [1.3622, 1.4486, 1.3168, 1.5787, + 1.4766, 1.3954, 1.2889, 1.3462, + 1.0759, 1.0401, 1.0970, 1.0850, + 1.0910, 1.0404, 1.0499, 1.0699, + 1.1028, 1.1714, 1.1027, 1.0666, + 1.0550, 1.0553, 1.0521, 1.0569, + 1.0421, 0.97822, 0.80487, 0.75944, + 0.71945, 0.61682, 0.60031]; + +dsr = [1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, + 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, + 8.9719e-08, 1.902e-07, 3.702e-07, 6.1341e-07, + 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, + 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, + 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, + 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, + 6.2001e-08, 2.8483e-08, 2.6267e-08]; + +[acousticEnvironment:1] +frequencyGridIndex = 1; +predelay = 0.108; +rt60 = [0.87, 0.66, 0.47, 0.41, + 0.32, 0.37, 0.28, 0.30, + 0.29, 0.29, 0.28, 0.30, + 0.31, 0.34, 0.34, 0.34, + 0.34, 0.33, 0.32, 0.29, + 0.28, 0.24, 0.24, 0.2]; + +dsr = [2.511887e-07, 1e-07, 1.2589251e-07, 1e-07, + 5.01187e-08, 5.01187e-08, 7.9432844e-08, 1e-07, + 6.309576e-08, 5.01187e-08, 7.9432844e-08, 1e-07, + 5.01187e-08, 1e-07, 7.9432844e-08, 6.309576e-08, + 7.9432844e-08, 5.01187e-08, 6.309576e-08, 3.9810708e-08, + 3.9810708e-08, 2.511887e-08, 1.9952632e-08, 1.2589251e-08]; + +earlyReflectionsSize = [4.0, 4.0, 5.0]; +absorptionCoeffs = [ 0.1, 0.2, 0.2, 0.2, 0.1, 0.1 ]; +lowComplexity = TRUE; +listenerOrigin = [-1, 0.5, 1.5]; + +[acousticEnvironment:2] +frequencyGridIndex = 1; +predelay = 0.108; +rt60 = [0.87, 0.66, 0.47, 0.41, + 0.32, 0.37, 0.28, 0.30, + 0.29, 0.29, 0.28, 0.30, + 0.31, 0.34, 0.34, 0.34, + 0.34, 0.33, 0.32, 0.29, + 0.28, 0.24, 0.24, 0.2]; + +dsr = [2.511887e-07, 1e-07, 1.2589251e-07, 1e-07, + 5.01187e-08, 5.01187e-08, 7.9432844e-08, 1e-07, + 6.309576e-08, 5.01187e-08, 7.9432844e-08, 1e-07, + 5.01187e-08, 1e-07, 7.9432844e-08, 6.309576e-08, + 7.9432844e-08, 5.01187e-08, 6.309576e-08, 3.9810708e-08, + 3.9810708e-08, 2.511887e-08, 1.9952632e-08, 1.2589251e-08]; + +earlyReflectionsSize = [3.0, 3.0, 4.0]; +absorptionCoeffs = [ 0.3, 0.2, 0.2, 0.2, 0.3, 0.1 ]; +lowComplexity = FALSE; -- GitLab From 5a911a6c9d2a0f7d77a47ccfcb7aa8db4d25e04e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 21 Feb 2024 14:03:21 +0100 Subject: [PATCH 392/498] formatting --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dmx_evs.c | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a61c381a5e..49d3c4b0fb 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ - /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index 849c90d442..d4f280fb84 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -58,7 +58,7 @@ #define STEREO_DMX_EVS_POC_FORGETTING 0.78f #define STEREO_DMX_EVS_TARGET_POC_FORGETTING 0.79f #define STEREO_DMX_EVS_POC_W_FORGETTING 0.875f -#define STEREO_DMX_EVS_SHIFT_LIMIT STEREO_DFT_ZP_NS_ENC +#define STEREO_DMX_EVS_SHIFT_LIMIT STEREO_DFT_ZP_NS_ENC #define STEREO_DMX_EVS_DMX_EGY_FORGETTING 0.25f #define STEREO_DMX_EVS_CORR_FORGETTING 0.78f @@ -88,10 +88,10 @@ #define STEREO_DMX_EVS_SWTCH_PRC_THRES_48 29 #define STEREO_DMX_EVS_SWTCH_PRC_HYS_THRES 1 -#define STEREO_DMX_EVS_IFF_AMIN 0.857696f -#define STEREO_DMX_EVS_IFF_AMAX 0.944061f -#define STEREO_DMX_EVS_IFF_FREQ 3000.0f -#define STEREO_DMX_EVS_PHA_WND_C 1.8f +#define STEREO_DMX_EVS_IFF_AMIN 0.857696f +#define STEREO_DMX_EVS_IFF_AMAX 0.944061f +#define STEREO_DMX_EVS_IFF_FREQ 3000.0f +#define STEREO_DMX_EVS_PHA_WND_C 1.8f #define STEREO_DMX_EVS_NB_SBFRM 5 #define STEREO_DMX_EVS_TRNS_DTC_INST 75.0f @@ -1103,7 +1103,6 @@ static void weighted_ave( } - return; } @@ -1303,7 +1302,6 @@ static void create_M_signal( } - /*-------------------------------------------------------------------* * apply_gain_sgc() * @@ -1342,7 +1340,6 @@ static void apply_gain_sgc( } - /*-------------------------------------------------------------------* * stereo_dmx_evs_enc() * -- GitLab From 822b65bf0e8b234d6adbc0b0d9f69e51a98722f4 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 21 Feb 2024 14:31:53 +0100 Subject: [PATCH 393/498] Additional tests commented out --- scripts/config/self_test.prm | 4 ++-- scripts/config/self_test_ltv.prm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 040434581c..5602c5a619 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -540,8 +540,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/stv+4ISM48n+non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bit -../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav +//../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bit +//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 6c656abdf7..6301755a28 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -540,8 +540,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bi -../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav +//../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bi +//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching -- GitLab From 3105cd1d67e78fa1faeabdd806331baa7cc73a3e Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 21 Feb 2024 14:54:25 +0100 Subject: [PATCH 394/498] fix ltv command line --- scripts/config/self_test_ltv.prm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 6301755a28..4964cb31c6 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -540,7 +540,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers -//../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bi +//../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 128000 48 testv/ltv_4ISM.wav bit //../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav -- GitLab From 037b546bb6b51d364cac82fde6e08b157ee6dcbd Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 21 Feb 2024 15:06:22 +0100 Subject: [PATCH 395/498] improve command lines --- scripts/config/self_test.prm | 2 +- scripts/config/self_test_ltv.prm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 5602c5a619..4d7d53e22e 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -541,7 +541,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers //../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bit -//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav +//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 3 0 2 1 BINAURAL_ROOM_REVERB 48 bit testv/stv4ISM48n+combined_render_config_brate_128000-48-binaural_room_reverb.wav // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 4964cb31c6..9a40a073ca 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -540,8 +540,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers -//../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 128000 48 testv/ltv_4ISM.wav bit -//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit out.wav +//../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 128000 48 testv/ltv48_4ISM.wav bit +//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit testv/ltv48_4ISM+combined_render_config_brate_128000-48-binaural_room_reverb.wav // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching -- GitLab From b301e223133713bdee5abbb5281f4c3139e374cd Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 21 Feb 2024 15:43:20 +0100 Subject: [PATCH 396/498] scale binaural audio channels down to avoid clipping with BINAURAL_ROOM_REVERB --- lib_com/ivas_prot.h | 4 ++++ lib_com/options.h | 2 ++ lib_dec/ivas_binRenderer_internal.c | 18 ++++++++++++++++++ lib_dec/ivas_dirac_dec.c | 7 ++++++- lib_dec/ivas_mc_param_dec.c | 7 ++++++- lib_dec/ivas_mc_paramupmix_dec.c | 7 ++++++- lib_dec/ivas_output_config.c | 2 +- 7 files changed, 43 insertions(+), 4 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d0c797e27d..aa94e4e053 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5225,6 +5225,10 @@ void ivas_binRenderer( #endif float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + , + AUDIO_CONFIG output_config /* i : output configuration */ +#endif ); void ivas_binaural_add_LFE( diff --git a/lib_com/options.h b/lib_com/options.h index 60b17001e0..0c51093178 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -191,6 +191,8 @@ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ +#define DISABLE_LIMITER + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index feb59980cf..48e0f13cff 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1916,6 +1916,10 @@ void ivas_binRenderer( #endif float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + , + AUDIO_CONFIG output_config /* i : output configuration */ +#endif ) { int16_t chIdx, k; @@ -2051,6 +2055,20 @@ void ivas_binRenderer( } #endif +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + for ( k = 0; k < numTimeSlots; k++ ) + { + v_multc( Cldfb_RealBuffer_Binaural[chIdx][k], 0.5f, Cldfb_RealBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); + v_multc( Cldfb_ImagBuffer_Binaural[chIdx][k], 0.5f, Cldfb_ImagBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); + } + } + } +#endif + /* Obtain the binaural dmx and compute the reverb */ if ( hBinRenderer->hReverb != NULL ) { diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f7f152b738..d41f8376f4 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2407,7 +2407,12 @@ void ivas_dirac_dec_render_sf( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + , + st_ivas->hDecoderConfig->output_config +#endif + ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 45ed71c978..eaab7b4952 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1825,7 +1825,12 @@ void ivas_param_mc_dec_render( #endif st_ivas->hCombinedOrientationData, hParamMC->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + , + st_ivas->hDecoderConfig->output_config +#endif + ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 2ff77228f8..9e9fea7e09 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -830,7 +830,12 @@ static void ivas_mc_paramupmix_dec_sf( st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, - Cldfb_ImagBuffer_subfr ); + Cldfb_ImagBuffer_subfr +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + , + st_ivas->hDecoderConfig->output_config +#endif + ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index db8ee3dded..e044aa76e6 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -243,7 +243,7 @@ void ivas_renderer_select( { *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING +#if 0 else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; -- GitLab From d271ebe49edb4660e1bd346c3a4ddf5606fdedf6 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 22 Feb 2024 07:37:55 +0100 Subject: [PATCH 397/498] fix for #1009, fix ISM1 non-diegetic rendering, use the correct offset and buffer for rendering the non-diegetic object, under define FIX_1009_ISM_NONDIEGETIC_PANNING, active --- lib_com/ivas_prot.h | 5 ++++- lib_com/options.h | 2 +- lib_dec/ivas_jbm_dec.c | 4 ++++ lib_dec/ivas_mono_dmx_renderer.c | 11 +++++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d0c797e27d..e091ce7305 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -769,7 +769,10 @@ void dtx_read_padding_bits( ); void ivas_apply_non_diegetic_panning( - float *output_f[], /* i/o: core-coder transport mono channel/stereo output */ +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + float *input_f, /* i : non-diegetic object */ +#endif + float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 49d3c4b0fb..28fa2ff746 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ - +#define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 89aa3f8d4c..6f4fb2f1cc 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1120,7 +1120,11 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + ivas_apply_non_diegetic_panning( p_tc[0], p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); +#else ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); +#endif } #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index ffe5cb54be..7b6552707a 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -221,7 +221,10 @@ void ivas_mono_stereo_downmix_mcmasa( *------------------------------------------------------------------------*/ void ivas_apply_non_diegetic_panning( - float *output_f[], /* i/o: core-coder transport mono channel/stereo output */ +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + float *input_f, /* i : non-diegetic object */ +#endif + float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ ) @@ -230,9 +233,13 @@ void ivas_apply_non_diegetic_panning( pan_left = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_right = 1.f - pan_left; - +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + v_multc( input_f, pan_right, output_f[1], output_frame ); + v_multc( input_f, pan_left, output_f[0], output_frame ); +#else v_multc( output_f[0], pan_right, output_f[1], output_frame ); v_multc( output_f[0], pan_left, output_f[0], output_frame ); +#endif return; } -- GitLab From 8a9b8ecfa3646476dd931aece3d465b2455a4cf8 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 10:36:41 +0100 Subject: [PATCH 398/498] split collected logs by PLC/noPLC --- ci/collect_artifacts.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ci/collect_artifacts.py b/ci/collect_artifacts.py index e665d75f16..29705dfc3d 100755 --- a/ci/collect_artifacts.py +++ b/ci/collect_artifacts.py @@ -37,16 +37,20 @@ def collect_for_sanitizer_test(file): with open(file) as f: console_log = f.readlines() - files_to_archive_noPLC = find_failed_files_for_sanitizer_test( - console_log, "logs_noPLC" - ) - files_to_archive = find_failed_files_for_sanitizer_test(console_log, "logs") + start_indicators = ["Adding config" in l for l in console_log] + idx_first_run = start_indicators.index(True) + idx_second_run = start_indicators[idx_first_run + 1:].index(True) + no_plc_part = console_log[idx_first_run:idx_second_run] + plc_part = console_log[idx_second_run:] + + files_to_archive_noPLC = find_failed_files_for_sanitizer_test(no_plc_part) + files_to_archive_PLC = find_failed_files_for_sanitizer_test(plc_part) log_folder = pathlib.Path("./LOGS_PLC") log_folder.mkdir() - for test in files_to_archive.keys(): + for test in files_to_archive_PLC.keys(): log_folder.joinpath(test).mkdir() - for test, files in files_to_archive.items(): + for test, files in files_to_archive_PLC.items(): folder = log_folder.joinpath(test) for p in files: source = pathlib.Path(p) -- GitLab From 0196b5dfe1a8a627c9b2e4bd5edb7410715392df Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 10:41:11 +0100 Subject: [PATCH 399/498] replace subfolder name for noPLC log file copying --- ci/collect_artifacts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/collect_artifacts.py b/ci/collect_artifacts.py index 29705dfc3d..ee5700b24a 100755 --- a/ci/collect_artifacts.py +++ b/ci/collect_artifacts.py @@ -64,7 +64,7 @@ def collect_for_sanitizer_test(file): for test, files in files_to_archive_noPLC.items(): folder = log_folder_noPLC.joinpath(test) for p in files: - source = pathlib.Path(p) + source = pathlib.Path(p.replace("/logs/", "/logs_noPLC/")) target = folder.joinpath(source.name) source.rename(target) -- GitLab From 3434463896c498597734a137b959090dd3b81e16 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 11:04:23 +0100 Subject: [PATCH 400/498] fix indexing --- ci/collect_artifacts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/collect_artifacts.py b/ci/collect_artifacts.py index ee5700b24a..c67445e51c 100755 --- a/ci/collect_artifacts.py +++ b/ci/collect_artifacts.py @@ -39,7 +39,7 @@ def collect_for_sanitizer_test(file): start_indicators = ["Adding config" in l for l in console_log] idx_first_run = start_indicators.index(True) - idx_second_run = start_indicators[idx_first_run + 1:].index(True) + idx_second_run = start_indicators[idx_first_run + 1:].index(True) + idx_first_run + 1 no_plc_part = console_log[idx_first_run:idx_second_run] plc_part = console_log[idx_second_run:] -- GitLab From 30a249b13af15d640dcc632d01c018cdf81e8fd7 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 22 Feb 2024 13:00:37 +0100 Subject: [PATCH 401/498] Fix for botched merge of options.h --- lib_com/options.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 22b35e05db..a4741e2861 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,6 +153,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ +#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ @@ -170,18 +171,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ -#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ -#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ -#define NONBE_FIX_947_STEREO_DMX_EVS_POC /* Orange: Fix clicks on POC */ -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC -#define NONBE_FIX_947_STEREO_DMX_ROMOPT /* Orange: ROM optimisation for POC*/ -#endif -#define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ -#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA -#define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ -#endif -#define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_LCLD_5MS /* Dlb: LCLD 5ms framing operation */ -- GitLab From 965ba198c416b89e103ce33eec2a128e3f261817 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 22 Feb 2024 14:35:08 +0100 Subject: [PATCH 402/498] Added test cases for a combined renderer configuration file --- scripts/config/self_test.prm | 4 ++-- scripts/config/self_test_ltv.prm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 4d7d53e22e..f9782c2226 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -540,8 +540,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/stv+4ISM48n+non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers -//../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bit -//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 3 0 2 1 BINAURAL_ROOM_REVERB 48 bit testv/stv4ISM48n+combined_render_config_brate_128000-48-binaural_room_reverb.wav +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 128000 48 testv/stv4ISM48n.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 3 0 2 1 BINAURAL_ROOM_REVERB 48 bit testv/stv4ISM48n+combined_render_config_brate_128000-48-binaural_room_reverb.wav // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 9a40a073ca..6b46f668f7 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -540,8 +540,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/ltv48_4ISM_non_diegetic_pan.wav_brate_256000-48_DTX_binaural.tst // 4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers -//../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 128000 48 testv/ltv48_4ISM.wav bit -//../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit testv/ltv48_4ISM+combined_render_config_brate_128000-48-binaural_room_reverb.wav +../IVAS_cod -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 128000 48 testv/ltv48_4ISM.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit testv/ltv48_4ISM+combined_render_config_brate_128000-48-binaural_room_reverb.wav // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching -- GitLab From a8dede3c41a2ee71b0ea5a5f931b9823fc7b5fba Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 22 Feb 2024 15:23:20 +0100 Subject: [PATCH 403/498] Revert "scale binaural audio channels down to avoid clipping with BINAURAL_ROOM_REVERB" This reverts commit b301e223133713bdee5abbb5281f4c3139e374cd. --- lib_com/ivas_prot.h | 4 ---- lib_com/options.h | 2 -- lib_dec/ivas_binRenderer_internal.c | 37 ----------------------------- lib_dec/ivas_dirac_dec.c | 7 +----- lib_dec/ivas_mc_param_dec.c | 7 +----- lib_dec/ivas_mc_paramupmix_dec.c | 7 +----- lib_dec/ivas_output_config.c | 2 +- 7 files changed, 4 insertions(+), 62 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index aa94e4e053..d0c797e27d 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5225,10 +5225,6 @@ void ivas_binRenderer( #endif float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - AUDIO_CONFIG output_config /* i : output configuration */ -#endif ); void ivas_binaural_add_LFE( diff --git a/lib_com/options.h b/lib_com/options.h index 12f4434116..073500f5b0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,8 +180,6 @@ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ -#define DISABLE_LIMITER - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 97a90171fd..7cbcf2dba4 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1916,10 +1916,6 @@ void ivas_binRenderer( #endif float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - AUDIO_CONFIG output_config /* i : output configuration */ -#endif ) { int16_t chIdx, k; @@ -2053,39 +2049,6 @@ void ivas_binRenderer( } } } -#endif - -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < numTimeSlots; k++ ) - { - v_multc( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], 0.5f, Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); - v_multc( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], 0.5f, Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); - } - } - } - } -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < numTimeSlots; k++ ) - { - v_multc( Cldfb_RealBuffer_Binaural[chIdx][k], 0.5f, Cldfb_RealBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); - v_multc( Cldfb_ImagBuffer_Binaural[chIdx][k], 0.5f, Cldfb_ImagBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); - } - } - } -#endif - #endif /* Obtain the binaural dmx and compute the reverb */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index d41f8376f4..f7f152b738 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2407,12 +2407,7 @@ void ivas_dirac_dec_render_sf( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - st_ivas->hDecoderConfig->output_config -#endif - ); + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index eaab7b4952..45ed71c978 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1825,12 +1825,7 @@ void ivas_param_mc_dec_render( #endif st_ivas->hCombinedOrientationData, hParamMC->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - st_ivas->hDecoderConfig->output_config -#endif - ); + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 9e9fea7e09..2ff77228f8 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -830,12 +830,7 @@ static void ivas_mc_paramupmix_dec_sf( st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, - Cldfb_ImagBuffer_subfr -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - st_ivas->hDecoderConfig->output_config -#endif - ); + Cldfb_ImagBuffer_subfr ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e044aa76e6..db8ee3dded 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -243,7 +243,7 @@ void ivas_renderer_select( { *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } -#if 0 +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; -- GitLab From 2ad0fa862aa7bd143b3e07c7023e49ebcbf65342 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 22 Feb 2024 15:36:21 +0100 Subject: [PATCH 404/498] remove left-overs from experimantal binaural-signal scaling --- lib_dec/ivas_binRenderer_internal.c | 21 +++------------------ lib_rend/ivas_prot_rend.h | 4 ---- lib_rend/lib_rend.c | 28 ++++------------------------ 3 files changed, 7 insertions(+), 46 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 7cbcf2dba4..feb59980cf 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -2114,12 +2114,7 @@ void ivas_rend_CldfbMultiBinRendProcess( float Cldfb_Out_Real[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_Out_Imag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t low_res_pre_rend_rot, - const int16_t num_subframes -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - AUDIO_CONFIG output_config /* i : output configuration */ -#endif -) + const int16_t num_subframes ) { int16_t slot_idx, ch_idx, idx, pose_idx, i, j; int16_t sf_idx; @@ -2169,19 +2164,9 @@ void ivas_rend_CldfbMultiBinRendProcess( #endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, MAX_PARAM_SPATIAL_SUBFRAMES, &head_track_post, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - output_config -#endif - ); + ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, MAX_PARAM_SPATIAL_SUBFRAMES, &head_track_post, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); #else - ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, MAX_PARAM_SPATIAL_SUBFRAMES, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - output_config -#endif - ); + ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, MAX_PARAM_SPATIAL_SUBFRAMES, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); #endif for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index cb760871e8..975a2356aa 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1901,10 +1901,6 @@ void ivas_rend_CldfbMultiBinRendProcess( float Cldfb_Out_Imag[MAX_HEAD_ROT_POSES*BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t low_res_pre_rend_rot, const int16_t num_subframes -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - AUDIO_CONFIG output_config /* i : output configuration */ -#endif ); ivas_error ivas_rend_openCldfb( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d89abbb9a4..8194de9fba 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7316,12 +7316,7 @@ static ivas_error renderSbaToMultiBinauralCldfb( float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t low_res_pre_rend_rot, - const int16_t num_subframes -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - AUDIO_CONFIG output_config /* i : output configuration */ -#endif -) + const int16_t num_subframes ) { float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -7329,12 +7324,7 @@ static ivas_error renderSbaToMultiBinauralCldfb( copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); ivas_rend_CldfbMultiBinRendProcess( sbaInput->cldfbRendWrapper.hCldfbRend, sbaInput->base.ctx.pCombinedOrientationData, &sbaInput->base.ctx.pSplitRendWrapper->multiBinPoseData, - Cldfb_RealBuffer, Cldfb_ImagBuffer, Cldfb_Out_Real, Cldfb_Out_Imag, low_res_pre_rend_rot, num_subframes -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - output_config -#endif - ); + Cldfb_RealBuffer, Cldfb_ImagBuffer, Cldfb_Out_Real, Cldfb_Out_Imag, low_res_pre_rend_rot, num_subframes ); return IVAS_ERR_OK; } @@ -7359,12 +7349,7 @@ static ivas_error renderSbaToSplitBinaural( if ( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { if ( ( renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, low_res_pre_rend_rot, - getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - outConfig -#endif - ) ) != IVAS_ERR_OK ) + getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) { return error; } @@ -7409,12 +7394,7 @@ static ivas_error renderSbaToBinaural( float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; if ( ( error = renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, 0, - getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - , - outConfig -#endif - ) ) != IVAS_ERR_OK ) + getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From f6a9546fa79d3115cddba176cc4661d3874d66f2 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 22 Feb 2024 15:44:16 +0100 Subject: [PATCH 405/498] do not swith do BRIRs for BINAURAL_ROOM_REVERB --- lib_dec/ivas_output_config.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index db8ee3dded..1e31f0aac4 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -243,12 +243,6 @@ void ivas_renderer_select( { *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING - else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; - } -#endif else { *renderer_type = RENDERER_BINAURAL_FASTCONV; -- GitLab From 69821972c1cb847b7c6b2a6c4618260c7040cc15 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 22 Feb 2024 16:09:30 +0100 Subject: [PATCH 406/498] update switch to SPLIT_REND_WITH_HEAD_ROT_DEBUG --- lib_util/render_config_reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index f9bceea7f6..678f760a0b 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2460,7 +2460,7 @@ ivas_error RenderConfigReader_read( while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); -#ifdef DEBUGGING +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); #endif if ( strcmp( item, "CODECDELAY" ) == 0 ) -- GitLab From 2842e8b1206b77e04f041e01b261fbf8065bea56 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 16:45:13 +0100 Subject: [PATCH 407/498] introduce yaml anchor for sanitizer tests and add ltv sanitizer jobs --- .gitlab-ci.yml | 160 +++++++++++++++++++++++++++---------------------- 1 file changed, 90 insertions(+), 70 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8665784309..c3a516a643 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -182,6 +182,20 @@ stages: - (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt" - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace 'false', 'true' | Set-Content -Path $_.FullName } +# to be reused in MR and LTV-scheduled sanitizer test jobs +# set CLANG_NUM and SELF_TEST_PRM_FILE in before_script section +.sanitizer-selftest-anchor: &sanitizer-selftest-anchor + stage: test + needs: ["build-codec-sanitizers-linux"] + script: + - *print-common-info + - *copy-ltv-files-to-testv-dir + - make clean + - make -j CLANG=$CLANG_NUM + - testcase_timeout=180 + - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest $SELF_TEST_PRM_FILE -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 + + # --------------------------------------------------------------- # Job templates # --------------------------------------------------------------- @@ -249,6 +263,38 @@ stages: - python3 scripts/prepare_combined_format_inputs.py - cp -r scripts/testv/* $TESTV_DIR/ +.sanitizer-selftest-on-mr: + extends: + - .test-job-linux-needs-testv-dir + - .rules-merge-request + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + expire_in: 1 week + when: always + paths: + - report-junit.xml + - report.html + expose_as: "$CI_JOB_NAME selftest results" + reports: + junit: + - report-junit.xml + +.sanitizer-selftest-ltv: + extends: + - .test-job-linux-needs-testv-dir + - .rules-main-scheduled + artifacts: + name: "$CI_JOB_NAME--sha-$CI_COMMIT_SHORT_SHA--results" + expire_in: 2 week + when: always + paths: + - report-junit.xml + - report.html + expose_as: "$CI_JOB_NAME selftest results" + reports: + junit: + - report-junit.xml + # --------------------------------------------------------------- # .pre jobs for setting up things # --------------------------------------------------------------- @@ -443,83 +489,29 @@ codec-smoke-test: # code selftest testvectors with memory-sanitizer binaries codec-msan: extends: - - .test-job-linux-needs-testv-dir - - .rules-merge-request - stage: test - needs: ["build-codec-sanitizers-linux"] - script: - - *print-common-info - - make clean - - make -j CLANG=1 - - 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: - - report-junit.xml - - report.html - expose_as: "msan selftest results" - reports: - junit: - - report-junit.xml + - .sanitizer-selftest-on-mr + before_script: + - CLANG_NUM=1 + - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" + <<: *sanitizer-selftest-anchor # code selftest testvectors with address-sanitizer binaries codec-asan: extends: - - .test-job-linux-needs-testv-dir - - .rules-merge-request - stage: test - needs: ["build-codec-sanitizers-linux"] - script: - - *print-common-info - - make clean - - make -j CLANG=2 - - 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: - - report-junit.xml - - report.html - expose_as: "asan selftest results" - reports: - junit: - - report-junit.xml + - .sanitizer-selftest-on-mr + before_script: + - CLANG_NUM=2 + - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" + <<: *sanitizer-selftest-anchor -# code selftest testvectors with address-sanitizer binaries +# code selftest testvectors with undefined-behaviour-sanitizer binaries codec-usan: extends: - - .test-job-linux-needs-testv-dir - - .rules-merge-request - stage: test - needs: ["build-codec-sanitizers-linux"] - script: - - *print-common-info - - make clean - - make -j CLANG=3 - - 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: - - report-junit.xml - - report.html - expose_as: "usan selftest results" - reports: - junit: - - report-junit.xml + - .sanitizer-selftest-on-mr + before_script: + - CLANG_NUM=3 + - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" + <<: *sanitizer-selftest-anchor # test renderer executable renderer-smoke-test: @@ -1289,6 +1281,34 @@ test-long-self-test: # --------------------------------------------------------------- # Scheduled jobs on main # --------------------------------------------------------------- + +# code selftest long testvectors with memory-sanitizer binaries +ltv-msan: + extends: + - .sanitizer-selftest-ltv + before_script: + - CLANG_NUM=1 + - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" + <<: *sanitizer-selftest-anchor + +# code selftest long testvectors with address-sanitizer binaries +ltv-asan: + extends: + - .sanitizer-selftest-ltv + before_script: + - CLANG_NUM=2 + - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" + <<: *sanitizer-selftest-anchor + +# code selftest long testvectors with undefined-behaviour-sanitizer binaries +ltv-usan: + extends: + - .sanitizer-selftest-ltv + before_script: + - CLANG_NUM=3 + - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" + <<: *sanitizer-selftest-anchor + .sanitizer-test-template: extends: - .test-job-linux -- GitLab From 10ace10cf106f75188ea757abd6add2d53148470 Mon Sep 17 00:00:00 2001 From: kiene Date: Thu, 22 Feb 2024 15:59:40 +0000 Subject: [PATCH 408/498] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3a516a643..bef6ddbd94 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -274,7 +274,7 @@ stages: paths: - report-junit.xml - report.html - expose_as: "$CI_JOB_NAME selftest results" + expose_as: "Sanitizer selftest results" reports: junit: - report-junit.xml @@ -290,7 +290,7 @@ stages: paths: - report-junit.xml - report.html - expose_as: "$CI_JOB_NAME selftest results" + expose_as: "Sanitizer selftest results" reports: junit: - report-junit.xml -- GitLab From bb28e7079670989904ecfdcfb88b32e546d5b59c Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 17:11:28 +0100 Subject: [PATCH 409/498] prepare job for schedule --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bef6ddbd94..8014930756 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -282,7 +282,6 @@ stages: .sanitizer-selftest-ltv: extends: - .test-job-linux-needs-testv-dir - - .rules-main-scheduled artifacts: name: "$CI_JOB_NAME--sha-$CI_COMMIT_SHORT_SHA--results" expire_in: 2 week @@ -1286,6 +1285,8 @@ test-long-self-test: ltv-msan: extends: - .sanitizer-selftest-ltv + rules: + - if: $SANITIZER_SCHEDULE_E before_script: - CLANG_NUM=1 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" @@ -1295,6 +1296,10 @@ ltv-msan: ltv-asan: extends: - .sanitizer-selftest-ltv + rules: + - if: $SANITIZER_SCHEDULE_E + when: delayed + start_in: 1 hours before_script: - CLANG_NUM=2 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" @@ -1304,6 +1309,10 @@ ltv-asan: ltv-usan: extends: - .sanitizer-selftest-ltv + rules: + - if: $SANITIZER_SCHEDULE_E + when: delayed + start_in: 2 hours before_script: - CLANG_NUM=3 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" -- GitLab From 154be16eaa9b41e5281db6530162d89a629a6d38 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 17:26:13 +0100 Subject: [PATCH 410/498] add timeout --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8014930756..00a04b2166 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1287,6 +1287,7 @@ ltv-msan: - .sanitizer-selftest-ltv rules: - if: $SANITIZER_SCHEDULE_E + timeout: 1 hour before_script: - CLANG_NUM=1 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" @@ -1300,6 +1301,7 @@ ltv-asan: - if: $SANITIZER_SCHEDULE_E when: delayed start_in: 1 hours + timeout: 1 hour before_script: - CLANG_NUM=2 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" @@ -1313,6 +1315,7 @@ ltv-usan: - if: $SANITIZER_SCHEDULE_E when: delayed start_in: 2 hours + timeout: 1 hour before_script: - CLANG_NUM=3 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" -- GitLab From 823f83417c14323d64ecbce425ffde25deb6714b Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 17:26:34 +0100 Subject: [PATCH 411/498] temporarily allow scheduled piepline on all branches --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 00a04b2166..556cd9c442 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main variables: IVAS_PIPELINE_NAME: 'Push pipeline: $CI_COMMIT_BRANCH' - - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main + - if: $CI_PIPELINE_SOURCE == 'schedule' variables: IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'default' # for testing -- GitLab From 1aa191a7c5de7ae0d47e3770b304daab15b66406 Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 17:40:47 +0100 Subject: [PATCH 412/498] add correct tag --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 556cd9c442..a83c70443a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1288,6 +1288,8 @@ ltv-msan: rules: - if: $SANITIZER_SCHEDULE_E timeout: 1 hour + tags: + - ivas-linux-fast before_script: - CLANG_NUM=1 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" @@ -1301,6 +1303,8 @@ ltv-asan: - if: $SANITIZER_SCHEDULE_E when: delayed start_in: 1 hours + tags: + - ivas-linux-fast timeout: 1 hour before_script: - CLANG_NUM=2 @@ -1315,6 +1319,8 @@ ltv-usan: - if: $SANITIZER_SCHEDULE_E when: delayed start_in: 2 hours + tags: + - ivas-linux-fast timeout: 1 hour before_script: - CLANG_NUM=3 -- GitLab From 57eb5cf011ba490ed645768c61cb1ffc04be608e Mon Sep 17 00:00:00 2001 From: knj Date: Thu, 22 Feb 2024 18:09:53 +0100 Subject: [PATCH 413/498] longer testcase timeout for ltv sanitizer test --- .gitlab-ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a83c70443a..4c7295102b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -183,7 +183,7 @@ stages: - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace 'false', 'true' | Set-Content -Path $_.FullName } # to be reused in MR and LTV-scheduled sanitizer test jobs -# set CLANG_NUM and SELF_TEST_PRM_FILE in before_script section +# set CLANG_NUM, SELFTEST_SANITY_TIMEOUT and SELF_TEST_PRM_FILE in before_script section .sanitizer-selftest-anchor: &sanitizer-selftest-anchor stage: test needs: ["build-codec-sanitizers-linux"] @@ -192,7 +192,7 @@ stages: - *copy-ltv-files-to-testv-dir - make clean - make -j CLANG=$CLANG_NUM - - testcase_timeout=180 + - testcase_timeout=$SELFTEST_SANITY_TIMEOUT - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest $SELF_TEST_PRM_FILE -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 @@ -491,6 +491,7 @@ codec-msan: - .sanitizer-selftest-on-mr before_script: - CLANG_NUM=1 + - SELFTEST_SANITY_TIMEOUT=180 - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" <<: *sanitizer-selftest-anchor @@ -500,6 +501,7 @@ codec-asan: - .sanitizer-selftest-on-mr before_script: - CLANG_NUM=2 + - SELFTEST_SANITY_TIMEOUT=180 - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" <<: *sanitizer-selftest-anchor @@ -509,6 +511,7 @@ codec-usan: - .sanitizer-selftest-on-mr before_script: - CLANG_NUM=3 + - SELFTEST_SANITY_TIMEOUT=180 - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" <<: *sanitizer-selftest-anchor @@ -1292,6 +1295,7 @@ ltv-msan: - ivas-linux-fast before_script: - CLANG_NUM=1 + - SELFTEST_SANITY_TIMEOUT=420 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" <<: *sanitizer-selftest-anchor @@ -1308,6 +1312,7 @@ ltv-asan: timeout: 1 hour before_script: - CLANG_NUM=2 + - SELFTEST_SANITY_TIMEOUT=420 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" <<: *sanitizer-selftest-anchor @@ -1324,6 +1329,7 @@ ltv-usan: timeout: 1 hour before_script: - CLANG_NUM=3 + - SELFTEST_SANITY_TIMEOUT=420 - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" <<: *sanitizer-selftest-anchor -- GitLab From f1d360dd646f67e166c406cba67d78456d49561d Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 09:45:02 +0100 Subject: [PATCH 414/498] increase testcase timeout even further --- .gitlab-ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c7295102b..3e63ed7a88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,8 @@ variables: - 'test-be-release' - 'test-long-self-test' GIT_CLEAN_FLAGS: -ffdxq + TESTCASE_TIMEOUT_STV_SANITIZERS: 180 + TESTCASE_TIMEOUT_LTV_SANITIZERS: 720 default: @@ -491,7 +493,7 @@ codec-msan: - .sanitizer-selftest-on-mr before_script: - CLANG_NUM=1 - - SELFTEST_SANITY_TIMEOUT=180 + - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" <<: *sanitizer-selftest-anchor @@ -501,7 +503,7 @@ codec-asan: - .sanitizer-selftest-on-mr before_script: - CLANG_NUM=2 - - SELFTEST_SANITY_TIMEOUT=180 + - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" <<: *sanitizer-selftest-anchor @@ -511,7 +513,7 @@ codec-usan: - .sanitizer-selftest-on-mr before_script: - CLANG_NUM=3 - - SELFTEST_SANITY_TIMEOUT=180 + - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py" <<: *sanitizer-selftest-anchor @@ -1295,7 +1297,7 @@ ltv-msan: - ivas-linux-fast before_script: - CLANG_NUM=1 - - SELFTEST_SANITY_TIMEOUT=420 + - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" <<: *sanitizer-selftest-anchor @@ -1312,7 +1314,7 @@ ltv-asan: timeout: 1 hour before_script: - CLANG_NUM=2 - - SELFTEST_SANITY_TIMEOUT=420 + - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" <<: *sanitizer-selftest-anchor @@ -1329,7 +1331,7 @@ ltv-usan: timeout: 1 hour before_script: - CLANG_NUM=3 - - SELFTEST_SANITY_TIMEOUT=420 + - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py" <<: *sanitizer-selftest-anchor -- GitLab From e101741f69627658810fb1d281f70275ed59e110 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 10:35:06 +0100 Subject: [PATCH 415/498] Remove xfails and issue normal fails if no diff --- .../test_codec_ROM_vs_file.py | 190 +++++------------- tests/renderer/utils.py | 13 +- 2 files changed, 57 insertions(+), 146 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 4428aeb81d..98857f4731 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -30,7 +30,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest -import itertools from tests.hrtf_binary_loading.utils import * @@ -48,17 +47,10 @@ def test_binary_file(test_info, hrtf_tag, out_fs): """ Multichannel """ -@pytest.mark.parametrize( - ("out_fmt", "out_fs", "in_fmt", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_TAGS - ) - ], -) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) +@pytest.mark.parametrize("out_fs", SAMPLE_RATE) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag): bitrate = MC_BITRATE_FOR_FORMAT[in_fmt] in_fs = 48 @@ -77,21 +69,11 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_t ) -@pytest.mark.parametrize( - ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - [HR_TRAJECTORIES_TO_TEST[0]], - OUTPUT_FORMATS_BINAURAL[:-1], - SAMPLE_RATE, - INPUT_FORMATS_MC, - HRTF_TAGS, - ) - ], -) +@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) +@pytest.mark.parametrize("out_fs", SAMPLE_RATE) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag ): @@ -116,18 +98,12 @@ def test_multichannel_binaural_headrotation( """ Ambisonics """ -@pytest.mark.parametrize( - ("bitrate", "in_fmt", "fs", "out_fmt", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - [256000, 64000], INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_TAGS - ) - ], -) -def test_sba_binaural_static(bitrate, test_info, in_fmt, fs, out_fmt, hrtf_tag): +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) +@pytest.mark.parametrize("bitrate", [256000, 64000]) +@pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) +def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -143,23 +119,13 @@ def test_sba_binaural_static(bitrate, test_info, in_fmt, fs, out_fmt, hrtf_tag): ) -@pytest.mark.parametrize( - ("bitrate", "in_fmt", "fs", "out_fmt", "trj_file", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - [256000, 64000], - INPUT_FORMATS_SBA, - SAMPLE_RATE[1:], - OUTPUT_FORMATS_BINAURAL[:-1], - [HR_TRAJECTORIES_TO_TEST[0]], - HRTF_TAGS, - ) - ], -) -def test_sba_binaural_headrotation(bitrate, test_info, in_fmt, fs, out_fmt, trj_file, hrtf_tag): +@pytest.mark.parametrize("bitrate", [256000, 64000]) +@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) +@pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) +def test_sba_binaural_headrotation(test_info, bitrate, in_fmt, fs, out_fmt, trj_file, hrtf_tag): option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -179,21 +145,11 @@ def test_sba_binaural_headrotation(bitrate, test_info, in_fmt, fs, out_fmt, trj_ """ MASA """ -@pytest.mark.parametrize( - ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - OUTPUT_FORMATS_BINAURAL[:-1], - SAMPLE_RATE[-1:], - INPUT_FORMATS_MASA["dir"], - INPUT_FORMATS_MASA["tc"], - HRTF_TAGS, - ) - ], -) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) +@pytest.mark.parametrize("fs", SAMPLE_RATE[-1:]) +@pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) +@pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: @@ -217,22 +173,12 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): ) -@pytest.mark.parametrize( - ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - INPUT_FORMATS_MASA["tc"], - INPUT_FORMATS_MASA["dir"], - OUTPUT_FORMATS_BINAURAL[:-1], - SAMPLE_RATE[-1:], - [HR_TRAJECTORIES_TO_TEST[1]], - HRTF_TAGS, - ) - ], -) +@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[1]]) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) +@pytest.mark.parametrize("fs", SAMPLE_RATE[-1:]) +@pytest.mark.parametrize("in_dir", INPUT_FORMATS_MASA["dir"]) +@pytest.mark.parametrize("in_tc", INPUT_FORMATS_MASA["tc"]) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_tag ): @@ -262,17 +208,10 @@ def test_masa_binaural_headrotation( """ ISM """ -@pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_TAGS - ) - ], -) +@pytest.mark.parametrize("out_fmt", [OUTPUT_FORMATS_BINAURAL[0]]) +@pytest.mark.parametrize("out_fs", SAMPLE_RATE) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] @@ -298,21 +237,11 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): ) -@pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - INPUT_FORMATS_ISM, - SAMPLE_RATE, - [OUTPUT_FORMATS_BINAURAL[0]], - [HR_TRAJECTORIES_TO_TEST[0]], - HRTF_TAGS, - ) - ], -) +@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) +@pytest.mark.parametrize("out_fmt", [OUTPUT_FORMATS_BINAURAL[0]]) +@pytest.mark.parametrize("out_fs", SAMPLE_RATE) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): @@ -344,17 +273,10 @@ def test_ism_binaural_headrotation( """ ISM - Room Reverb """ -@pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_TAGS - ) - ], -) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[-1:]) +@pytest.mark.parametrize("out_fs", SAMPLE_RATE) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] @@ -380,21 +302,11 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf ) -@pytest.mark.parametrize( - ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), - [ - pytest.param(*x, marks=pytest.mark.xfail(strict=True)) - if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM - else x - for x in itertools.product( - INPUT_FORMATS_ISM, - SAMPLE_RATE, - OUTPUT_FORMATS_BINAURAL[-1:], - [HR_TRAJECTORIES_TO_TEST[0]], - HRTF_TAGS, - ) - ], -) +@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[-1:]) +@pytest.mark.parametrize("out_fs", SAMPLE_RATE) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_roomreverb_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index ed8476a7f0..f8b75dbeb3 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -90,13 +90,12 @@ def check_BE( # check max_diff as well, since compare_audio_arrays will try to adjust for small delay differences diff_found = not np.allclose(ref, cut, rtol=0, atol=2) and max_diff > 2 - if diff_found: - if xfail: - pytest.xfail(f"Expected diff between CuT and REF!") - else: - pytest.fail( - f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" - ) + if diff_found and not xfail: + pytest.fail( + f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" + ) + elif not diff_found and xfail: + pytest.fail("Difference expected, but none found.") def run_renderer( -- GitLab From a6574b3431bfc868171aa02cf5a7f83674874b0a Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Fri, 23 Feb 2024 11:49:09 +0200 Subject: [PATCH 416/498] fix issue 1004 in ivas_masa_dec() --- lib_com/options.h | 2 +- lib_dec/ivas_masa_dec.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..c72e407d3f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,7 +181,7 @@ #endif #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ - +#define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index c211bea575..f7731831b7 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -136,6 +136,12 @@ ivas_error ivas_masa_decode( if ( masa_brate == IVAS_SID_5k2 ) { st->next_bit_pos = (int16_t) ( ( masa_brate / FRAMES_PER_SEC ) - 1 - SID_FORMAT_NBITS ); +#ifdef NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS + if ( ivas_format == MASA_FORMAT ) + { + hMasa->config.numberOfDirections = 1; + } +#endif } else { -- GitLab From 1dc1ea2f5d1c2b5757bc72eb975d0d9e06e3237d Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 11:16:48 +0100 Subject: [PATCH 417/498] improve parametrization to have bitrate shown in test log --- .../test_codec_ROM_vs_file.py | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 98857f4731..5a86bb4d28 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -30,6 +30,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest +import itertools from tests.hrtf_binary_loading.utils import * @@ -47,12 +48,11 @@ def test_binary_file(test_info, hrtf_tag, out_fs): """ Multichannel """ -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) -def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag): - bitrate = MC_BITRATE_FOR_FORMAT[in_fmt] +@pytest.mark.parametrize( + ("hrtf_tag", "in_fmt", "bitrate", "out_fs", "out_fmt"), + [ ( x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3] ) for x in itertools.product(HRTF_TAGS, INPUT_FORMATS_MC, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[:-1]) ] + ) +def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag, bitrate): in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -68,16 +68,13 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_t hrtf_tag, ) - -@pytest.mark.parametrize("trj_file", [HR_TRAJECTORIES_TO_TEST[0]]) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[:-1]) -@pytest.mark.parametrize("out_fs", SAMPLE_RATE) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -@pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) +@pytest.mark.parametrize( + ("hrtf_tag", "in_fmt", "bitrate", "out_fs", "out_fmt", "trj_file"), + [ ( x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3], x[4] ) for x in itertools.product(HRTF_TAGS, INPUT_FORMATS_MC, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[:-1], [HR_TRAJECTORIES_TO_TEST[0]]) ] + ) def test_multichannel_binaural_headrotation( - test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag + test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag, bitrate ): - bitrate = MC_BITRATE_FOR_FORMAT[in_fmt] in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) -- GitLab From 65dedc3346064481d9870164e0809ece017dfced Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 23 Feb 2024 11:25:34 +0100 Subject: [PATCH 418/498] Unify py->python for Windows jobs. Cleanup debugging html reports --- .gitlab-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6eb57675be..4795924c08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -405,7 +405,7 @@ build-codec-windows-msbuild: script: - *print-common-info-windows - *activate-WX-windows - - py .\scripts\strip_split_rendering.py + - python .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug # --------------------------------------------------------------- @@ -1236,7 +1236,7 @@ ivas-conformance: # Prepare reference exec, use tests and scripts from reference - $source_branch_commit_sha = $(git rev-parse HEAD) - git checkout main # This should be set to a relevant reference - - py .\scripts\strip_split_rendering.py + - python .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug - cp -force IVAS_cod.exe IVAS_cod_ref.exe - cp -force IVAS_dec.exe IVAS_dec_ref.exe @@ -1247,7 +1247,7 @@ ivas-conformance: # Reference creation - python tests/create_short_testvectors.py - python scripts/prepare_combined_format_inputs.py - - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --html=report1.html --self-contained-html --keep_files + - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files - python -m pytest tests/renderer/test_renderer.py --create_ref --keep_files @@ -1291,8 +1291,6 @@ ivas-conformance: when: always paths: - report-junit.xml - - report1.html - - report_cmd.html - report.html - Readme_IVAS_dec.txt - Readme_IVAS_enc.txt -- GitLab From b3345f4d2aa66b5dcea79549971287fded0297ff Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 11:31:04 +0100 Subject: [PATCH 419/498] skip some testcases and fix whitespace in filename --- .../hrtf_binary_loading/test_codec_ROM_vs_file.py | 14 +++++++++++--- .../test_renderer_ROM_vs_file.py | 4 ++++ tests/hrtf_binary_loading/utils.py | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 5a86bb4d28..4f0ebb88d2 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -34,7 +34,7 @@ import itertools from tests.hrtf_binary_loading.utils import * -from .constants import HRTF_TAGS, MC_BITRATE_FOR_FORMAT +from .constants import HRTF_TAGS, MC_BITRATE_FOR_FORMAT, HRTF_TAG_DIFF_FROM_ROM """ Binary file """ @@ -53,6 +53,8 @@ def test_binary_file(test_info, hrtf_tag, out_fs): [ ( x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3] ) for x in itertools.product(HRTF_TAGS, INPUT_FORMATS_MC, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[:-1]) ] ) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag, bitrate): + if bitrate == 32000: + pytest.skip("Skip paramBin until differences are fixed") in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -75,6 +77,8 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_t def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag, bitrate ): + if bitrate == 32000: + pytest.skip("Skip paramBin until differences are fixed") in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -101,6 +105,8 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): + if bitrate == 64000: + pytest.skip("Skip paramBin until differences are fixed") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -123,6 +129,8 @@ def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_sba_binaural_headrotation(test_info, bitrate, in_fmt, fs, out_fmt, trj_file, hrtf_tag): + if bitrate == 64000: + pytest.skip("Skip paramBin until differences are fixed") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -149,7 +157,7 @@ def test_sba_binaural_headrotation(test_info, bitrate, in_fmt, fs, out_fmt, trj_ @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed - if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: + if hrtf_tag == HRTF_TAG_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( @@ -180,7 +188,7 @@ def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_tag ): # TODO: remove once fixed - if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: + if hrtf_tag == HRTF_TAG_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index 921562b5bc..c45aaae4ea 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -178,6 +178,8 @@ def test_masa_binaural_static_with_binary_hrir( ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + if hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping paramBin until fixed") compare_renderer_vs_renderer_with_binary_hrir( test_info, @@ -198,6 +200,8 @@ def test_masa_binaural_headrotation_with_binary_hrir( ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + if hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping paramBin until fixed") compare_renderer_vs_renderer_with_binary_hrir( test_info, diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 2271f03432..b45cde6ec2 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -290,7 +290,7 @@ def compare_rom_vs_binary( trj_file: Optional[str] = None, ): option_str = "_".join(get_option_list_str(option_list_enc)) - file_ext = f"_{option_str or ''}_{bitrate or ''}_{in_fs or ''}-{out_fs or ''}_{out_fmt or ''}-{uuid.uuid1()} " + file_ext = f"_{option_str or ''}_{bitrate or ''}_{in_fs or ''}-{out_fs or ''}_{out_fmt or ''}-{uuid.uuid1()}" hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] -- GitLab From 970ad0b83a9d0126ffcf5ee4e383c4626420b748 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 12:57:36 +0100 Subject: [PATCH 420/498] unify skip message --- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 12 ++++++------ .../hrtf_binary_loading/test_renderer_ROM_vs_file.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 4f0ebb88d2..7b868fb57a 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -54,7 +54,7 @@ def test_binary_file(test_info, hrtf_tag, out_fs): ) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag, bitrate): if bitrate == 32000: - pytest.skip("Skip paramBin until differences are fixed") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -78,7 +78,7 @@ def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag, bitrate ): if bitrate == 32000: - pytest.skip("Skip paramBin until differences are fixed") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -106,7 +106,7 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): if bitrate == 64000: - pytest.skip("Skip paramBin until differences are fixed") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -130,7 +130,7 @@ def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_sba_binaural_headrotation(test_info, bitrate, in_fmt, fs, out_fmt, trj_file, hrtf_tag): if bitrate == 64000: - pytest.skip("Skip paramBin until differences are fixed") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -158,7 +158,7 @@ def test_sba_binaural_headrotation(test_info, bitrate, in_fmt, fs, out_fmt, trj_ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed if hrtf_tag == HRTF_TAG_DIFF_FROM_ROM: - pytest.skip("Skipped due to bug in paramBin HRTF loading") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") bitrate = 256000 metadata_file = str( TESTV_DIR.joinpath(FORMAT_TO_METADATA_FILES["MASA"].format(in_dir, in_tc, fs)) @@ -189,7 +189,7 @@ def test_masa_binaural_headrotation( ): # TODO: remove once fixed if hrtf_tag == HRTF_TAG_DIFF_FROM_ROM: - pytest.skip("Skipped due to bug in paramBin HRTF loading") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") bitrate = 256000 metadata_file = str( TESTV_DIR.joinpath(FORMAT_TO_METADATA_FILES["MASA"].format(in_dir, in_tc, fs)) diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index c45aaae4ea..e6a4214594 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -179,7 +179,7 @@ def test_masa_binaural_static_with_binary_hrir( if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") if hrtf_tag == HRTF_TAG_SAME_AS_ROM: - pytest.skip("Skipping paramBin until fixed") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") compare_renderer_vs_renderer_with_binary_hrir( test_info, @@ -201,7 +201,7 @@ def test_masa_binaural_headrotation_with_binary_hrir( if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") if hrtf_tag == HRTF_TAG_SAME_AS_ROM: - pytest.skip("Skipping paramBin until fixed") + pytest.skip("Skipping ParamBin until binary and ROM contain same data") compare_renderer_vs_renderer_with_binary_hrir( test_info, -- GitLab From 8ac3da3ccd93b224827ecc9e2c1ba9488741f9db Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 12:58:07 +0100 Subject: [PATCH 421/498] apply correct formatting --- .../test_codec_ROM_vs_file.py | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 7b868fb57a..d23c1f7c14 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -49,10 +49,17 @@ def test_binary_file(test_info, hrtf_tag, out_fs): @pytest.mark.parametrize( - ("hrtf_tag", "in_fmt", "bitrate", "out_fs", "out_fmt"), - [ ( x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3] ) for x in itertools.product(HRTF_TAGS, INPUT_FORMATS_MC, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[:-1]) ] + ("hrtf_tag", "in_fmt", "bitrate", "out_fs", "out_fmt"), + [ + (x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3]) + for x in itertools.product( + HRTF_TAGS, INPUT_FORMATS_MC, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[:-1] ) -def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag, bitrate): + ], +) +def test_multichannel_binaural_static( + test_info, in_fmt, out_fmt, out_fs, hrtf_tag, bitrate +): if bitrate == 32000: pytest.skip("Skipping ParamBin until binary and ROM contain same data") in_fs = 48 @@ -70,10 +77,20 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_t hrtf_tag, ) + @pytest.mark.parametrize( - ("hrtf_tag", "in_fmt", "bitrate", "out_fs", "out_fmt", "trj_file"), - [ ( x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3], x[4] ) for x in itertools.product(HRTF_TAGS, INPUT_FORMATS_MC, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[:-1], [HR_TRAJECTORIES_TO_TEST[0]]) ] + ("hrtf_tag", "in_fmt", "bitrate", "out_fs", "out_fmt", "trj_file"), + [ + (x[0], x[1], MC_BITRATE_FOR_FORMAT[x[1]], x[2], x[3], x[4]) + for x in itertools.product( + HRTF_TAGS, + INPUT_FORMATS_MC, + SAMPLE_RATE, + OUTPUT_FORMATS_BINAURAL[:-1], + [HR_TRAJECTORIES_TO_TEST[0]], ) + ], +) def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag, bitrate ): @@ -128,7 +145,9 @@ def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): @pytest.mark.parametrize("fs", SAMPLE_RATE[1:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) -def test_sba_binaural_headrotation(test_info, bitrate, in_fmt, fs, out_fmt, trj_file, hrtf_tag): +def test_sba_binaural_headrotation( + test_info, bitrate, in_fmt, fs, out_fmt, trj_file, hrtf_tag +): if bitrate == 64000: pytest.skip("Skipping ParamBin until binary and ROM contain same data") option_list = ["-sba", in_fmt] -- GitLab From b76f7894f503fa9edbc3c4455b46cd098e94b98b Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 14:08:48 +0100 Subject: [PATCH 422/498] remove obsolete conftest file --- tests/hrtf_binary_loading/conftest.py | 44 --------------------------- 1 file changed, 44 deletions(-) delete mode 100644 tests/hrtf_binary_loading/conftest.py diff --git a/tests/hrtf_binary_loading/conftest.py b/tests/hrtf_binary_loading/conftest.py deleted file mode 100644 index c4c8b05174..0000000000 --- a/tests/hrtf_binary_loading/conftest.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -""" - (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 - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of 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 - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. -""" - - -def pytest_addoption(parser): - parser.addoption( - "--create_ref", - action="store_true", - default=False, - ) - parser.addoption( - "--create_cut", - action="store_true", - default=False, - ) -- GitLab From 30c08b58e223feb93b18991739f89e1e8944b852 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 14:54:12 +0100 Subject: [PATCH 423/498] skip ISM paramBin cases and remove tolerance from comparison --- .../test_codec_ROM_vs_file.py | 19 ++++++++++++++++++- .../test_renderer_ROM_vs_file.py | 6 ++++++ tests/hrtf_binary_loading/utils.py | 4 ++-- tests/renderer/utils.py | 3 ++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index d23c1f7c14..192adaa766 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -34,7 +34,12 @@ import itertools from tests.hrtf_binary_loading.utils import * -from .constants import HRTF_TAGS, MC_BITRATE_FOR_FORMAT, HRTF_TAG_DIFF_FROM_ROM +from .constants import ( + HRTF_TAGS, + MC_BITRATE_FOR_FORMAT, + HRTF_TAG_DIFF_FROM_ROM, + HRTF_TAG_SAME_AS_ROM, +) """ Binary file """ @@ -237,6 +242,9 @@ def test_masa_binaural_headrotation( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): + if in_fmt == "4" and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping ParamBin until binary and ROM contain same data") + in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -269,6 +277,9 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): def test_ism_binaural_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): + if in_fmt == "4" and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping ParamBin until binary and ROM contain same data") + in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -302,6 +313,9 @@ def test_ism_binaural_headrotation( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): + if in_fmt == "4" and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping ParamBin until binary and ROM contain same data") + in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] @@ -334,6 +348,9 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf def test_ism_binaural_roomreverb_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): + if in_fmt == "4" and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping ParamBin until binary and ROM contain same data") + in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] diff --git a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py index e6a4214594..10595b63a8 100644 --- a/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py @@ -127,6 +127,9 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( def test_ism_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): + if in_fmt == "4" and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping ParamBin until binary and ROM contain same data") + try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] except: @@ -150,6 +153,9 @@ def test_ism_binaural_static_with_binary_hrir( def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): + if in_fmt == "4" and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipping ParamBin until binary and ROM contain same data") + try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] except: diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index b45cde6ec2..85d55a34d3 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -325,7 +325,7 @@ def compare_rom_vs_binary( ) out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_bin_path) - check_BE(test_info, out_rom, out_rom_fs, out_bin, out_bin_fs, xfail) + check_BE(test_info, out_rom, out_rom_fs, out_bin, out_bin_fs, xfail, 0) if keep_file == False: os.remove(bitstream_path) os.remove(out_rom_path) @@ -393,7 +393,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( ref, ref_fs = pyaudio3dtools.audiofile.readfile(ref_out) cut, cut_fs = pyaudio3dtools.audiofile.readfile(cut_out) - check_BE(test_info, ref, ref_fs, cut, cut_fs, xfail) + check_BE(test_info, ref, ref_fs, cut, cut_fs, xfail, 0) if keep_file == False: os.remove(ref_out) os.remove(cut_out) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index f8b75dbeb3..2c498c21d7 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -71,6 +71,7 @@ def check_BE( cut: np.ndarray, cut_fs: int, xfail: bool = False, + atol: int = 2 ): if ref is None or np.array_equal(ref, np.zeros_like(ref)): pytest.fail("REF signal does not exist or is zero!") @@ -89,7 +90,7 @@ def check_BE( cut = np.pad(cut, [(0, ref.shape[0] - cut.shape[0]), (0, 0)]) # check max_diff as well, since compare_audio_arrays will try to adjust for small delay differences - diff_found = not np.allclose(ref, cut, rtol=0, atol=2) and max_diff > 2 + diff_found = not np.allclose(ref, cut, rtol=0, atol=atol) if diff_found and not xfail: pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" -- GitLab From 7da50c40abd3cb4b8077646ca2053a3954e37281 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 15:09:12 +0100 Subject: [PATCH 424/498] update skipping of cases --- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 192adaa766..38f7c31bef 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -65,7 +65,7 @@ def test_binary_file(test_info, hrtf_tag, out_fs): def test_multichannel_binaural_static( test_info, in_fmt, out_fmt, out_fs, hrtf_tag, bitrate ): - if bitrate == 32000: + if bitrate == 32000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") in_fs = 48 option_list = ["-mc", in_fmt] @@ -99,7 +99,7 @@ def test_multichannel_binaural_static( def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag, bitrate ): - if bitrate == 32000: + if bitrate == 32000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") in_fs = 48 option_list = ["-mc", in_fmt] @@ -127,7 +127,7 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_SBA) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): - if bitrate == 64000: + if bitrate == 64000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -153,7 +153,7 @@ def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): def test_sba_binaural_headrotation( test_info, bitrate, in_fmt, fs, out_fmt, trj_file, hrtf_tag ): - if bitrate == 64000: + if bitrate == 64000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -181,7 +181,7 @@ def test_sba_binaural_headrotation( @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed - if hrtf_tag == HRTF_TAG_DIFF_FROM_ROM: + if hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") bitrate = 256000 metadata_file = str( @@ -212,7 +212,7 @@ def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_tag ): # TODO: remove once fixed - if hrtf_tag == HRTF_TAG_DIFF_FROM_ROM: + if hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") bitrate = 256000 metadata_file = str( -- GitLab From cec64c8e51daff56529ffbce904661816aa21c25 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 15:17:53 +0100 Subject: [PATCH 425/498] fix abs tol in checkBE --- tests/renderer/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 2c498c21d7..52d1ccf19e 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -90,7 +90,7 @@ def check_BE( cut = np.pad(cut, [(0, ref.shape[0] - cut.shape[0]), (0, 0)]) # check max_diff as well, since compare_audio_arrays will try to adjust for small delay differences - diff_found = not np.allclose(ref, cut, rtol=0, atol=atol) + diff_found = not np.allclose(ref, cut, rtol=0, atol=atol) and max_diff > atol if diff_found and not xfail: pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" -- GitLab From 03f3303843c98a168e1a06f02b572e6bcfa6392c Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 15:19:41 +0100 Subject: [PATCH 426/498] increase timeout --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3e63ed7a88..2c296290eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ variables: - 'test-long-self-test' GIT_CLEAN_FLAGS: -ffdxq TESTCASE_TIMEOUT_STV_SANITIZERS: 180 - TESTCASE_TIMEOUT_LTV_SANITIZERS: 720 + TESTCASE_TIMEOUT_LTV_SANITIZERS: 1200 default: -- GitLab From 0594f1e79cb3c8695537116aa33bad6557e85c71 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 23 Feb 2024 15:35:19 +0100 Subject: [PATCH 427/498] Revert "temporarily allow scheduled piepline on all branches" This reverts commit 823f83417c14323d64ecbce425ffde25deb6714b. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3da876ba66..9344bda913 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main variables: IVAS_PIPELINE_NAME: 'Push pipeline: $CI_COMMIT_BRANCH' - - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main variables: IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'default' # for testing -- GitLab From 350ba166491b5635fb9af9a47e4ffb83a1deb09e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 23 Feb 2024 15:56:23 +0100 Subject: [PATCH 428/498] delete code under ifdef NONBE_FIX_998_DIRAC_ROTATION --- lib_com/options.h | 2 -- lib_dec/ivas_output_config.c | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 67cda97653..1086720749 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,8 +183,6 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ -#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 7b77db1076..bb672ffb31 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -198,20 +198,10 @@ void ivas_renderer_select( nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_998_DIRAC_ROTATION - if ( nchan_internal == 4 || nchan_internal == 3 || nchan_internal == 2 ) -#else if ( nchan_internal == 2 ) -#endif { st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } -#ifndef NONBE_FIX_998_DIRAC_ROTATION - else if ( nchan_internal == 4 || nchan_internal == 3 ) - { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; - } -#endif else if ( nchan_internal == 6 || nchan_internal == 5 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 2; -- GitLab From 51704a5da7ed17583ceaef76a96c206cdfc5938c Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 08:15:56 +0100 Subject: [PATCH 429/498] increase timeout of scheduled sanitizer tests --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 6692c94d7c..d8986233fb 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -55,7 +55,7 @@ GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -re MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] TIMEOUT = ( - 60 * 15 + 60 * 20 ) # timeout of 15 minutes per en/decoding to safeguard against endless loops CONSOLE_OUT_FILE = "output_san.txt" -- GitLab From 3d06fbbe503aa936a9527581695be32cbb6edb93 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 08:20:24 +0100 Subject: [PATCH 430/498] move stage to template and remove needs --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9344bda913..6e4af2b332 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -191,8 +191,6 @@ stages: # to be reused in MR and LTV-scheduled sanitizer test jobs # set CLANG_NUM, SELFTEST_SANITY_TIMEOUT and SELF_TEST_PRM_FILE in before_script section .sanitizer-selftest-anchor: &sanitizer-selftest-anchor - stage: test - needs: ["build-codec-sanitizers-linux"] script: - *print-common-info - *copy-ltv-files-to-testv-dir @@ -272,6 +270,7 @@ stages: - cp -r scripts/testv/* $TESTV_DIR/ .sanitizer-selftest-on-mr: + stage: test extends: - .test-job-linux-needs-testv-dir - .rules-merge-request @@ -288,6 +287,7 @@ stages: - report-junit.xml .sanitizer-selftest-ltv: + stage: test extends: - .test-job-linux-needs-testv-dir artifacts: -- GitLab From aff6e83057097dd8f7a26f500d868ed0fec2160c Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 08:28:03 +0100 Subject: [PATCH 431/498] temporarily allow schedules to run on non-main --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e4af2b332..92119def79 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main variables: IVAS_PIPELINE_NAME: 'Push pipeline: $CI_COMMIT_BRANCH' - - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main + - if: $CI_PIPELINE_SOURCE == 'schedule' # Scheduled in main variables: IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'default' # for testing -- GitLab From 73dd9802ac965fb7368a1156d79cb7a37d2a8118 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 08:35:14 +0100 Subject: [PATCH 432/498] Revert "temporarily allow schedules to run on non-main" This reverts commit aff6e83057097dd8f7a26f500d868ed0fec2160c. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92119def79..6e4af2b332 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main variables: IVAS_PIPELINE_NAME: 'Push pipeline: $CI_COMMIT_BRANCH' - - if: $CI_PIPELINE_SOURCE == 'schedule' # Scheduled in main + - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main variables: IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'default' # for testing -- GitLab From d92bf72493e8ef68dc6ccd42305d764910f33b27 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 08:49:14 +0100 Subject: [PATCH 433/498] update sanitizer issue tempalte --- .gitlab/issue_templates/sanitizer_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/issue_templates/sanitizer_error.md b/.gitlab/issue_templates/sanitizer_error.md index e5b42ba2f4..f442519aba 100644 --- a/.gitlab/issue_templates/sanitizer_error.md +++ b/.gitlab/issue_templates/sanitizer_error.md @@ -28,7 +28,7 @@ or directly: make clean make -j CLANG=X ./IVAS_cod ... -eid-xor -vbr -fer bit ep_015.g192 bit_fer +networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1 ./IVAS_dec ... ``` -- GitLab From c4c4f37905e80ed9051684c92eba757b283fd445 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 08:55:03 +0100 Subject: [PATCH 434/498] remove unused split-order function under ifdef FIX_998_UNUSED_FUNCTION --- lib_rend/ivas_dirac_output_synthesis_dec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 0eb06064dd..25d119ae88 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1570,7 +1570,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( return; } - +#ifndef FIX_998_UNUSED_FUNCTION /*------------------------------------------------------------------------- * ivas_dirac_dec_get_response_split_order() * @@ -1732,7 +1732,7 @@ static void ivas_dirac_dec_get_response_split_order( return; } - +#endif /*------------------------------------------------------------------------- * ivas_dirac_dec_compute_directional_responses() @@ -1821,7 +1821,7 @@ void ivas_dirac_dec_compute_directional_responses( { set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); - +#ifndef FIX_998_UNUSED_FUNCTION if ( p_Rmat != 0 ) { ivas_dirac_dec_get_response_split_order( azimuth[k], elevation[k], direct_response_hoa, shd_rot_max_order, p_Rmat ); @@ -1832,6 +1832,7 @@ void ivas_dirac_dec_compute_directional_responses( } } else +#endif { ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); -- GitLab From bc282dbb51b678ade2c7682459fb431ddd1b4a04 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 08:56:20 +0100 Subject: [PATCH 435/498] delete code under ifdef ALLOW_HOA3_ROTATION --- apps/decoder.c | 6 +----- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 3 --- lib_dec/ivas_output_config.c | 15 --------------- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 2be9c78d87..01e6b4f3d1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,11 +306,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR -#ifdef ALLOW_HOA3_ROTATION - && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 -#endif - && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_com/options.h b/lib_com/options.h index 1086720749..f2757f11ea 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -126,7 +126,6 @@ /*#define DEBUG_OSBA */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ -/*#define ALLOW_HOA3_ROTATION*/ /* Allow outputting rotated HOA3 signals */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 58329a6ce4..e1b6a6a415 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3136,9 +3136,6 @@ static ivas_error doSanityChecks_IVAS( if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM -#endif -#ifdef ALLOW_HOA3_ROTATION - || output_config == IVAS_AUDIO_CONFIG_HOA3 #endif ) ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index bb672ffb31..e4e8f6c437 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -79,21 +79,6 @@ void ivas_renderer_select( st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; } -#ifdef ALLOW_HOA3_ROTATION - if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) - { -#ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; -#else - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; -#endif - } - } - -#endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM -- GitLab From 7bbf0ce9cd320be884f2c242625d468076bad30a Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 08:58:42 +0100 Subject: [PATCH 436/498] add separate issue templates for sanitizer errrors --- .../{sanitizer_error.md => asan_ltv_error.md} | 6 +-- .gitlab/issue_templates/msan_ltv_error.md | 46 +++++++++++++++++++ .gitlab/issue_templates/usan_ltv_error.md | 39 ++++++++++++++++ 3 files changed, 88 insertions(+), 3 deletions(-) rename .gitlab/issue_templates/{sanitizer_error.md => asan_ltv_error.md} (86%) create mode 100644 .gitlab/issue_templates/msan_ltv_error.md create mode 100644 .gitlab/issue_templates/usan_ltv_error.md diff --git a/.gitlab/issue_templates/sanitizer_error.md b/.gitlab/issue_templates/asan_ltv_error.md similarity index 86% rename from .gitlab/issue_templates/sanitizer_error.md rename to .gitlab/issue_templates/asan_ltv_error.md index f442519aba..efb359f539 100644 --- a/.gitlab/issue_templates/sanitizer_error.md +++ b/.gitlab/issue_templates/asan_ltv_error.md @@ -4,7 +4,7 @@ ### Bug description -Clang (m,a,u)san sanitizer test in pipeline found an error: +Clang ASAN sanitizer test in pipeline found an error: ``` @@ -20,13 +20,13 @@ Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/ ``` -python3 scripts/IvasBuildAndRunChecks.py --checks CLANGX -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp +python3 scripts/IvasBuildAndRunChecks.py --checks CLANG2 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp ``` or directly: ``` make clean -make -j CLANG=X +make -j CLANG=2 ./IVAS_cod ... networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1 ./IVAS_dec ... diff --git a/.gitlab/issue_templates/msan_ltv_error.md b/.gitlab/issue_templates/msan_ltv_error.md new file mode 100644 index 0000000000..cc57222658 --- /dev/null +++ b/.gitlab/issue_templates/msan_ltv_error.md @@ -0,0 +1,46 @@ +### Basic info + +- Commit SHA: + +### Bug description + +Clang MSAN sanitizer test in pipeline found an error: + + +``` + +``` + + +Link to test pipeline: XXX + +### Ways to reproduce + +Activate [origin-tracking](https://clang.llvm.org/docs/MemorySanitizer.html#msan-origins) (more detailed traceback about where the undefined value came from) by appending +``` + -fsanitize-memory-track-origins +``` +in the `Makefile` at lines 71 and 72. Note that this may increase runtime heavily. + +Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Software-development/pyivastest-howto#how-to-reproduce-tests): + + + +``` +python3 scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json +``` +or directly: + +``` +make clean +make -j CLANG=1 +./IVAS_cod ... +networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1 +./IVAS_dec ... +``` + + + +/label ~"Priority::Critical" ~Company: ~Subpart: +/label ~Type:Bug ~Status::ToDo diff --git a/.gitlab/issue_templates/usan_ltv_error.md b/.gitlab/issue_templates/usan_ltv_error.md new file mode 100644 index 0000000000..ef6562e866 --- /dev/null +++ b/.gitlab/issue_templates/usan_ltv_error.md @@ -0,0 +1,39 @@ +### Basic info + +- Commit SHA: + +### Bug description + +Clang USAN sanitizer test in pipeline found an error: + + +``` + +``` + + +Link to test pipeline: XXX + +### Ways to reproduce + +Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Software-development/pyivastest-howto#how-to-reproduce-tests): + + +``` +python3 scripts/IvasBuildAndRunChecks.py --checks CLANG3 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp +``` +or directly: + +``` +make clean +make -j CLANG=3 +./IVAS_cod ... +networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1 +./IVAS_dec ... +``` + + + +/label ~"Priority::Critical" ~Company: ~Subpart: +/label ~Type:Bug ~Status::ToDo -- GitLab From 5a208f272c7ccfc8ab66429a51babb46e8573e68 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 09:06:16 +0100 Subject: [PATCH 437/498] remove obsolete part of template --- .gitlab/issue_templates/asan_ltv_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/issue_templates/asan_ltv_error.md b/.gitlab/issue_templates/asan_ltv_error.md index efb359f539..97b3fa9ec2 100644 --- a/.gitlab/issue_templates/asan_ltv_error.md +++ b/.gitlab/issue_templates/asan_ltv_error.md @@ -20,7 +20,7 @@ Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/ ``` -python3 scripts/IvasBuildAndRunChecks.py --checks CLANG2 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp +python3 scripts/IvasBuildAndRunChecks.py --checks CLANG2 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json ``` or directly: -- GitLab From 488636747664be0b77efcae3b2a0228e53ed7949 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 09:19:01 +0100 Subject: [PATCH 438/498] enable define FIX_998_UNUSED_FUNCTION --- lib_com/options.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index caeaa8c4b9..c0447a2142 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,7 +124,7 @@ /*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/*#define DEBUG_OSBA */ +/* #define DEBUG_OSBA*/ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ @@ -163,7 +163,8 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ -#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ /* #################### End BE switches ################################## */ -- GitLab From 79cb6aa061bb44b47b673ac14d915cc935b64982 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 09:19:30 +0100 Subject: [PATCH 439/498] undo changes to ivas_output_config.c --- lib_com/options.h | 4 ++-- lib_dec/ivas_output_config.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c0447a2142..a53439dac2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,7 +124,7 @@ /*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/* #define DEBUG_OSBA*/ +/* #define DEBUG_OSBA */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ @@ -163,7 +163,7 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ -#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e4e8f6c437..c93b16dcdb 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -182,11 +182,14 @@ void ivas_renderer_select( { nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( nchan_internal == 2 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } + else if ( nchan_internal == 4 || nchan_internal == 3 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + } else if ( nchan_internal == 6 || nchan_internal == 5 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 2; -- GitLab From 2065b05e8927c8f79452340305f22abc6da11e66 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 09:52:48 +0100 Subject: [PATCH 440/498] fix compiler warnings --- lib_dec/ivas_dirac_dec.c | 8 ++++++++ lib_rend/ivas_dirac_output_synthesis_dec.c | 8 ++++++++ lib_rend/ivas_dirac_rend.c | 16 ++++++++++------ lib_rend/ivas_prot_rend.h | 4 ++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8e3f383fea..f4309dd409 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1856,8 +1856,10 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, +#endif hodirac_flag ); } else @@ -1871,8 +1873,10 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION 0, NULL, +#endif hodirac_flag ); } } @@ -2213,8 +2217,10 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, +#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, +#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, @@ -2231,8 +2237,10 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, +#ifndef FIX_998_UNUSED_FUNCTION 0, 0, +#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 25d119ae88..a1ef9a3052 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -542,8 +542,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ +#ifndef FIX_998_UNUSED_FUNCTION const int16_t sh_rot_max_order, const float *p_Rmat, /* i : rotation matrix */ +#endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport, /* i : number of transport channels*/ @@ -590,8 +592,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( elevation, md_idx, NULL, +#ifndef FIX_998_UNUSED_FUNCTION 2, p_Rmat, +#endif hodirac_flag ); } @@ -638,8 +642,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( elevation, md_idx, NULL, +#ifndef FIX_998_UNUSED_FUNCTION sh_rot_max_order, p_Rmat, +#endif hodirac_flag ); if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) @@ -1750,8 +1756,10 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t *elevation, const int16_t md_idx, const float *surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat, /* i : rotation matrix */ +#endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ) { diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index ca2760d127..8bffbf9c39 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -230,14 +230,14 @@ ivas_error ivas_spat_hSpatParamRendCom_config( if ( flag_config == DIRAC_OPEN ) { - hSpatParamRendCom->slot_size = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); + hSpatParamRendCom->slot_size = ( int16_t )( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); set_s( hSpatParamRendCom->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hSpatParamRendCom->subframe_nbslots, JBM_CLDFB_SLOTS_IN_SUBFRAME, DEFAULT_JBM_SUBFRAMES_5MS ); hSpatParamRendCom->nb_subframes = DEFAULT_JBM_SUBFRAMES_5MS; hSpatParamRendCom->subframes_rendered = 0; hSpatParamRendCom->slots_rendered = 0; hSpatParamRendCom->num_slots = DEFAULT_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME; - hSpatParamRendCom->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + hSpatParamRendCom->num_freq_bands = ( int16_t )( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hSpatParamRendCom->numSimultaneousDirections = 0; hSpatParamRendCom->numParametricDirections = 0; hSpatParamRendCom->numIsmDirections = 0; @@ -1791,8 +1791,8 @@ void computeDirectionAngles( z = *( intensity_real_z++ ) * intensityNorm; } radius = sqrtf( x * x + y * y ); - azimuth[k] = (int16_t) ( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); - elevation[k] = (int16_t) ( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); + azimuth[k] = ( int16_t )( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); + elevation[k] = ( int16_t )( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); } return; @@ -2077,8 +2077,8 @@ void rotateAziEle_DirAC( dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2; /*Conversion spherical to cartesian coordinates*/ - azi[b] = (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); - ele[b] = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); + azi[b] = ( int16_t )( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); + ele[b] = ( int16_t )( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); } pop_wmops(); @@ -2216,8 +2216,10 @@ static void ivas_masa_ext_dirac_render_sf( elevation, md_idx, surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION 0, NULL, +#endif 0 ); @@ -2372,8 +2374,10 @@ static void ivas_masa_ext_dirac_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, +#ifndef FIX_998_UNUSED_FUNCTION 0, 0, +#endif hMasaExtRend->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 80b53d508d..7173290bb5 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -470,8 +470,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ +#ifndef FIX_998_UNUSED_FUNCTION const int16_t sh_rot_max_order, const float *p_Rmat, /* i : rotation matrix */ +#endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport, /* i : number of transport channels */ @@ -538,8 +540,10 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t *elevation, const int16_t md_idx, const float *surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat, /* i : rotation matrix */ +#endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ); -- GitLab From c7f4ff07acaea1d1f4a1320e06873373e51e89e6 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 10:21:03 +0100 Subject: [PATCH 441/498] fix formatting --- lib_rend/ivas_dirac_output_synthesis_dec.c | 4 ++-- lib_rend/ivas_dirac_rend.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index a1ef9a3052..f985b514f5 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -544,7 +544,7 @@ void ivas_dirac_dec_output_synthesis_process_slot( DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ #ifndef FIX_998_UNUSED_FUNCTION const int16_t sh_rot_max_order, - const float *p_Rmat, /* i : rotation matrix */ + const float *p_Rmat, /* i : rotation matrix */ #endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ @@ -1760,7 +1760,7 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat, /* i : rotation matrix */ #endif - const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ + const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ) { int16_t k, l; diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 8bffbf9c39..7cd26526c7 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -230,14 +230,14 @@ ivas_error ivas_spat_hSpatParamRendCom_config( if ( flag_config == DIRAC_OPEN ) { - hSpatParamRendCom->slot_size = ( int16_t )( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); + hSpatParamRendCom->slot_size = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); set_s( hSpatParamRendCom->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hSpatParamRendCom->subframe_nbslots, JBM_CLDFB_SLOTS_IN_SUBFRAME, DEFAULT_JBM_SUBFRAMES_5MS ); hSpatParamRendCom->nb_subframes = DEFAULT_JBM_SUBFRAMES_5MS; hSpatParamRendCom->subframes_rendered = 0; hSpatParamRendCom->slots_rendered = 0; hSpatParamRendCom->num_slots = DEFAULT_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME; - hSpatParamRendCom->num_freq_bands = ( int16_t )( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + hSpatParamRendCom->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hSpatParamRendCom->numSimultaneousDirections = 0; hSpatParamRendCom->numParametricDirections = 0; hSpatParamRendCom->numIsmDirections = 0; @@ -1791,8 +1791,8 @@ void computeDirectionAngles( z = *( intensity_real_z++ ) * intensityNorm; } radius = sqrtf( x * x + y * y ); - azimuth[k] = ( int16_t )( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); - elevation[k] = ( int16_t )( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); + azimuth[k] = (int16_t) ( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); + elevation[k] = (int16_t) ( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); } return; @@ -2077,8 +2077,8 @@ void rotateAziEle_DirAC( dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2; /*Conversion spherical to cartesian coordinates*/ - azi[b] = ( int16_t )( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); - ele[b] = ( int16_t )( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); + azi[b] = (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); + ele[b] = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); } pop_wmops(); -- GitLab From f3e1f87fd8386e7666a22c900b062b9d6249fcfa Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 10:39:16 +0100 Subject: [PATCH 442/498] skip operating points with dubious non-BEs --- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index 38f7c31bef..eeb001e983 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -67,6 +67,8 @@ def test_multichannel_binaural_static( ): if bitrate == 32000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") + if bitrate == 160000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipped until reason for non-BE in FastConv is clarified") in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) @@ -129,6 +131,8 @@ def test_multichannel_binaural_headrotation( def test_sba_binaural_static(test_info, bitrate, in_fmt, fs, out_fmt, hrtf_tag): if bitrate == 64000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") + if bitrate == 256000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipped until reason for non-BE in FastConv is clarified") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) @@ -155,6 +159,8 @@ def test_sba_binaural_headrotation( ): if bitrate == 64000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") + if bitrate == 256000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipped until reason for non-BE in FastConv is clarified") option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) -- GitLab From 97cedcfe5cd404706320883964df74c2aaa2c283 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 26 Feb 2024 10:44:27 +0100 Subject: [PATCH 443/498] add missing skip --- tests/hrtf_binary_loading/test_codec_ROM_vs_file.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py index eeb001e983..c66792c653 100644 --- a/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +++ b/tests/hrtf_binary_loading/test_codec_ROM_vs_file.py @@ -103,6 +103,8 @@ def test_multichannel_binaural_headrotation( ): if bitrate == 32000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: pytest.skip("Skipping ParamBin until binary and ROM contain same data") + if bitrate == 160000 and hrtf_tag == HRTF_TAG_SAME_AS_ROM: + pytest.skip("Skipped until reason for non-BE in FastConv is clarified") in_fs = 48 option_list = ["-mc", in_fmt] in_file = FORMAT_TO_FILE_MC_WOEXT[in_fmt].format(in_fs) -- GitLab From ff7c953a253482aa18408affb9505921c13d1c58 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:17:27 +0100 Subject: [PATCH 444/498] address formatting comments --- lib_rend/ivas_dirac_output_synthesis_dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index f985b514f5..4e9d7db6cb 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1829,6 +1829,7 @@ void ivas_dirac_dec_compute_directional_responses( { set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); + #ifndef FIX_998_UNUSED_FUNCTION if ( p_Rmat != 0 ) { @@ -1840,15 +1841,17 @@ void ivas_dirac_dec_compute_directional_responses( } } else -#endif { +#endif ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); if ( hodirac_flag ) { ivas_dirac_dec_get_response( azimuth2[k], elevation2[k], direct_response_dir2, hDirACRend->hOutSetup.ambisonics_order ); } +#ifndef FIX_998_UNUSED_FUNCTION } +#endif if ( masa_band_mapping == NULL && hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { -- GitLab From 959debdc955415c5f37b85ed9b24db2bb532da56 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:24:43 +0100 Subject: [PATCH 445/498] delete unnecessary if conditions from ivas_dirac_dec_render_sf --- lib_dec/ivas_dirac_dec.c | 57 +++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f4309dd409..555b0f87c6 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1013,7 +1013,7 @@ void ivas_dirac_dec_read_BS( if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { next_bit_pos_orig = st->next_bit_pos; - st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); + st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 ); if ( last_bit_pos > 0 ) { st->next_bit_pos = last_bit_pos; @@ -1086,7 +1086,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ - st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); + st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits )++; @@ -1394,13 +1394,13 @@ void ivas_qmetadata_to_dirac( if ( hodirac_flag ) { - azi = (int16_t) ( azimuth + 0.5f ); - ele = (int16_t) ( elevation + 0.5f ); + azi = ( int16_t )( azimuth + 0.5f ); + ele = ( int16_t )( elevation + 0.5f ); } else { - azi = (int16_t) ( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); - ele = (int16_t) ( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); + azi = ( int16_t )( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); + ele = ( int16_t )( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); /* limit the elevation to [-90, 90] */ ele = min( 90, ele ); ele = max( -90, ele ); @@ -1736,10 +1736,10 @@ void ivas_dirac_dec_render_sf( { for ( i = 0; i < output_frame; i++ ) { - tmp[nchan_transport * i + n] = (int16_t) ( output_f[n][i] + 0.5f ); + tmp[nchan_transport * i + n] = ( int16_t )( output_f[n][i] + 0.5f ); } } - sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, (int16_t) ( output_frame * 0.05 ) ); + sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, ( int16_t )( output_frame * 0.05 ) ); dbgwrite( tmp, sizeof( int16_t ), nchan_transport * output_frame, 1, file_name ); } #endif @@ -1844,6 +1844,7 @@ void ivas_dirac_dec_render_sf( set_zero( surCohRatio, hSpatParamRendCom->num_freq_bands ); } } +#ifndef FIX_998_UNUSED_FUNCTION if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) { @@ -1856,10 +1857,8 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, -#endif hodirac_flag ); } else @@ -1873,13 +1872,23 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION 0, NULL, -#endif hodirac_flag ); } } +#else + ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, + hDirACRend, + st_ivas->hVBAPdata, + st_ivas->hMasa == NULL ? NULL : st_ivas->hMasa->data.band_mapping, + st_ivas->hMasaIsmData, + azimuth, + elevation, + md_idx, + surCohRatio, + hodirac_flag ); +#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) { @@ -2208,6 +2217,7 @@ void ivas_dirac_dec_render_sf( } /*Compute PSDs*/ +#ifndef FIX_998_UNUSED_FUNCTION if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) { ivas_dirac_dec_output_synthesis_process_slot( reference_power, @@ -2217,10 +2227,8 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, -#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, -#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, @@ -2237,10 +2245,8 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, -#ifndef FIX_998_UNUSED_FUNCTION 0, 0, -#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, @@ -2248,6 +2254,21 @@ void ivas_dirac_dec_render_sf( hodirac_flag, hDirAC->hConfig->dec_param_estim ); } +#else + ivas_dirac_dec_output_synthesis_process_slot( reference_power, + p_onset_filter, + azimuth, + elevation, + hSpatParamRendCom->diffuseness_vector[md_idx], + hSpatParamRendCom, + hDirACRend, + st_ivas->hVBAPdata, + hDirACRend->hOutSetup, + nchan_transport, + md_idx, + hodirac_flag, + hDirAC->hConfig->dec_param_estim ); +#endif if ( hDirAC->hConfig->dec_param_estim ) { @@ -2451,8 +2472,8 @@ void ivas_dirac_dec_render_sf( RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; #else - RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; - ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; + RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; #endif } -- GitLab From f26c7ed3ca1d83687aaa64a42b0eec00e0be3861 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:34:04 +0100 Subject: [PATCH 446/498] fix formatting --- lib_dec/ivas_dirac_dec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 555b0f87c6..538b2532ae 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1013,7 +1013,7 @@ void ivas_dirac_dec_read_BS( if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { next_bit_pos_orig = st->next_bit_pos; - st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 ); + st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); if ( last_bit_pos > 0 ) { st->next_bit_pos = last_bit_pos; @@ -1086,7 +1086,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ - st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); + st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits )++; @@ -1394,13 +1394,13 @@ void ivas_qmetadata_to_dirac( if ( hodirac_flag ) { - azi = ( int16_t )( azimuth + 0.5f ); - ele = ( int16_t )( elevation + 0.5f ); + azi = (int16_t) ( azimuth + 0.5f ); + ele = (int16_t) ( elevation + 0.5f ); } else { - azi = ( int16_t )( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); - ele = ( int16_t )( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); + azi = (int16_t) ( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); + ele = (int16_t) ( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); /* limit the elevation to [-90, 90] */ ele = min( 90, ele ); ele = max( -90, ele ); @@ -1736,10 +1736,10 @@ void ivas_dirac_dec_render_sf( { for ( i = 0; i < output_frame; i++ ) { - tmp[nchan_transport * i + n] = ( int16_t )( output_f[n][i] + 0.5f ); + tmp[nchan_transport * i + n] = (int16_t) ( output_f[n][i] + 0.5f ); } } - sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, ( int16_t )( output_frame * 0.05 ) ); + sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, (int16_t) ( output_frame * 0.05 ) ); dbgwrite( tmp, sizeof( int16_t ), nchan_transport * output_frame, 1, file_name ); } #endif -- GitLab From 27f615ab1b1e3309154b918abfd0e24b7acf30c7 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:45:46 +0100 Subject: [PATCH 447/498] fix compile error --- lib_dec/ivas_dirac_dec.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 538b2532ae..849caa6e8e 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1876,7 +1876,6 @@ void ivas_dirac_dec_render_sf( NULL, hodirac_flag ); } - } #else ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, hDirACRend, @@ -1889,6 +1888,7 @@ void ivas_dirac_dec_render_sf( surCohRatio, hodirac_flag ); #endif + } if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) { @@ -2255,19 +2255,19 @@ void ivas_dirac_dec_render_sf( hDirAC->hConfig->dec_param_estim ); } #else - ivas_dirac_dec_output_synthesis_process_slot( reference_power, - p_onset_filter, - azimuth, - elevation, - hSpatParamRendCom->diffuseness_vector[md_idx], - hSpatParamRendCom, - hDirACRend, - st_ivas->hVBAPdata, - hDirACRend->hOutSetup, - nchan_transport, - md_idx, - hodirac_flag, - hDirAC->hConfig->dec_param_estim ); + ivas_dirac_dec_output_synthesis_process_slot( reference_power, + p_onset_filter, + azimuth, + elevation, + hSpatParamRendCom->diffuseness_vector[md_idx], + hSpatParamRendCom, + hDirACRend, + st_ivas->hVBAPdata, + hDirACRend->hOutSetup, + nchan_transport, + md_idx, + hodirac_flag, + hDirAC->hConfig->dec_param_estim ); #endif if ( hDirAC->hConfig->dec_param_estim ) @@ -2472,8 +2472,8 @@ void ivas_dirac_dec_render_sf( RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; #else - RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; - ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; + RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; #endif } -- GitLab From b123958c5f964abf77b25bfbae56e532f290edea Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 12:05:01 +0100 Subject: [PATCH 448/498] rename NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING to NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A --- lib_com/options.h | 2 +- lib_dec/ivas_output_config.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 64c96ac769..cdd45dbd68 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,7 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_LCLD_5MS /* Dlb: LCLD 5ms framing operation */ #endif -#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ +#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 1e31f0aac4..57876353a6 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -248,7 +248,7 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_FASTCONV; } -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && !( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) -- GitLab From 00d1268de901ee67c13aaf307c71c97f89affe38 Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Mon, 26 Feb 2024 13:17:36 +0200 Subject: [PATCH 449/498] change in issue 1004 --- lib_dec/ivas_masa_dec.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index f7731831b7..3984b79c54 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -136,18 +136,19 @@ ivas_error ivas_masa_decode( if ( masa_brate == IVAS_SID_5k2 ) { st->next_bit_pos = (int16_t) ( ( masa_brate / FRAMES_PER_SEC ) - 1 - SID_FORMAT_NBITS ); -#ifdef NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS - if ( ivas_format == MASA_FORMAT ) - { - hMasa->config.numberOfDirections = 1; - } -#endif } else { st->next_bit_pos = (int16_t) ( ( masa_brate / FRAMES_PER_SEC ) - 1 ); } +#ifdef NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS + if ( ivas_format == MASA_FORMAT && ( masa_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) + { + hMasa->config.numberOfDirections = 1; + } +#endif + if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) -- GitLab From d81961eded356475a9ab9db7e5f270bc50bc6a4e Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 26 Feb 2024 14:12:49 +0100 Subject: [PATCH 450/498] issue 993: remove unused function ivas_sba_get_order(); under FIX_993_REMOVE_SBA_GET_ORDER --- lib_com/ivas_prot.h | 3 ++- lib_com/ivas_sba_config.c | 8 ++++++-- lib_com/options.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d0c797e27d..eab3f6664b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3496,12 +3496,13 @@ ivas_error ivas_cldfb_dec_reconfig( const int16_t numCldfbSyntheses_old /* i : number of CLDFB synthesis instances in previous frame */ ); +#ifndef FIX_993_REMOVE_SBA_GET_ORDER /*! r: Ambisonic (SBA) order */ int16_t ivas_sba_get_order( const int16_t nb_channels, /* i : Number of ambisonic channels */ const int16_t sba_planar /* i : SBA planar flag */ ); - +#endif /*! r: Ambisonic (SBA) order used for analysis and coding */ int16_t ivas_sba_get_analysis_order( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index 52ed4672b6..ddb59b2ed5 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -70,7 +70,11 @@ void ivas_sba_config( } else if ( sba_order < 0 ) { +#ifdef FIX_993_REMOVE_SBA_GET_ORDER + assert( !"SBA order cannot be negative!" ); +#else sba_order = ivas_sba_get_order( nb_channels, sba_planar ); +#endif } else if ( nb_channels < 0 ) { @@ -117,7 +121,7 @@ void ivas_sba_config( return; } - +#ifndef FIX_993_REMOVE_SBA_GET_ORDER /*-------------------------------------------------------------------* * ivas_sba_get_order() * @@ -147,7 +151,7 @@ int16_t ivas_sba_get_order( return ( sba_order ); } - +#endif /*-------------------------------------------------------------------* * ivas_sba_get_analysis_order() diff --git a/lib_com/options.h b/lib_com/options.h index f79b346839..e48c28c5b6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_993_REMOVE_SBA_GET_ORDER /* VA: issue 993: remove unused function ivas_sba_get_order() */ /* #################### End BE switches ################################## */ -- GitLab From 785a82d847d2392f26490bfbcf1c0d207bb09c2a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 26 Feb 2024 14:35:15 +0100 Subject: [PATCH 451/498] fix for #1012, #1013, fix JBM flush output buffer, use also the global output buffer instead of a local one. --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index f79b346839..87fdfed11d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,6 +184,7 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ +#define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 89aa3f8d4c..a7ebc61a2c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1586,8 +1586,12 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t n_slots_still_available; int16_t n_samples_to_render; DECODER_TC_BUFFER_HANDLE hTcBuffer; +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + float *p_output[MAX_CICP_CHANNELS + MAX_NUM_OBJECTS]; +#else float output[MAX_CICP_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; float *p_output[MAX_CICP_CHANNELS]; +#endif if ( !st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1632,10 +1636,17 @@ ivas_error ivas_jbm_dec_flush_renderer( hTcBuffer->n_samples_flushed = n_samples_to_render; hTcBuffer->n_samples_rendered = 0; +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) + { + p_output[ch_idx] = st_ivas->p_output_f[ch_idx]; + } +#else for ( ch_idx = 0; ch_idx < MAX_CICP_CHANNELS; ch_idx++ ) { p_output[ch_idx] = output[ch_idx]; } +#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { -- GitLab From 74d86d19d1f052394d9b99b851308ea0906c5e41 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 26 Feb 2024 15:07:34 +0100 Subject: [PATCH 452/498] add OMASA EXT self-test condition --- scripts/config/self_test.prm | 5 +++++ scripts/config/self_test_ltv.prm | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 460f9ce781..8e3ea95036 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1601,6 +1601,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_384k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst +// OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out +../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv NULL testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/ +sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit +../IVAS_dec EXT 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_sw_48-48.tst + // OSBA FOA 1ISM at 32 kbps, 48kHz in, 48kHz out, BINAURAL out diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 6839760c25..3dd51a441d 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1602,6 +1602,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_384k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst +// OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out +../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv NULL testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/ +sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit +../IVAS_dec EXT 48 bit testv/ltvOMASA_4ISM_2MASA2TC48c.wav_EXT_sw_48-48.tst + // OSBA FOA 1ISM at 32 kbps, 48kHz in, 48kHz out, BINAURAL out -- GitLab From 15b801a1bb6c999acd937c559f9b7157b8c268a1 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 26 Feb 2024 15:51:18 +0100 Subject: [PATCH 453/498] remove a line break --- scripts/config/self_test.prm | 3 +-- scripts/config/self_test_ltv.prm | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 8e3ea95036..61a179a769 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1602,8 +1602,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst // OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out -../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv NULL testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/ -sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit +../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv NULL testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec EXT 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_sw_48-48.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 3dd51a441d..feadcc61fe 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1603,8 +1603,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_BINAURAL_ROOM_REVERB_sw_48-48.tst // OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out -../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv NULL testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/ -sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit +../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv NULL testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_80k_omasatechs_4ism.bin 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec EXT 48 bit testv/ltvOMASA_4ISM_2MASA2TC48c.wav_EXT_sw_48-48.tst -- GitLab From 4586a1a30e09f4fd7aadf521def132d7556ad7db Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 26 Feb 2024 16:01:06 +0100 Subject: [PATCH 454/498] fix for #1014, fix OSBA discrete object stereo output, update TC buffer subframe information in the ISM rendering for the discrete objects --- lib_com/options.h | 1 + lib_dec/ivas_ism_renderer.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index f79b346839..12730e95f0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,6 +184,7 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ +#define NONBE_FIX_1014_OSBA_JBM_STEREO /* FhG: issue #1014: fix stereo output for OSBA*/ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 3dbc6a6190..07d6217cc4 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -168,7 +168,10 @@ void ivas_ism_render_sf( slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } - +#ifdef DEBUGGING + assert( slots_to_render == 0 ); + assert( last_sf <= st_ivas->hTcBuffer->nb_subframes ); +#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { @@ -276,7 +279,11 @@ void ivas_ism_render_sf( ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); n_samples_rendered_loop += n_samples_in_subframe; +#ifdef NONBE_FIX_1014_OSBA_JBM_STEREO + if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_STEREO ) +#else if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) +#endif { st_ivas->hTcBuffer->subframes_rendered += 1; st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -- GitLab From 1473fa6ccf8aeb5dce3ebae9cfbe0a41adfd2ff1 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 27 Feb 2024 16:38:34 +1100 Subject: [PATCH 455/498] clean up of switch SPLIT_REND_LCLD_5MS --- apps/decoder.c | 33 -- apps/renderer.c | 18 - lib_com/options.h | 5 - lib_dec/ivas_init_dec.c | 20 -- lib_dec/ivas_mc_paramupmix_dec.c | 44 --- lib_dec/ivas_stat_dec.h | 3 - lib_dec/lib_dec.c | 103 ------ lib_rend/ivas_PredDecoder.c | 194 ---------- lib_rend/ivas_PredEncoder.c | 378 -------------------- lib_rend/ivas_RMSEnvGrouping.c | 4 - lib_rend/ivas_crend.c | 2 - lib_rend/ivas_lcld_decoder.c | 77 ---- lib_rend/ivas_lcld_encoder.c | 529 ---------------------------- lib_rend/ivas_lcld_prot.h | 49 --- lib_rend/ivas_lcld_rom_tables.c | 8 - lib_rend/ivas_lcld_rom_tables.h | 16 - lib_rend/ivas_prot_rend.h | 66 ---- lib_rend/ivas_splitRend_lcld_dec.c | 44 --- lib_rend/ivas_splitRend_lcld_enc.c | 62 ---- lib_rend/ivas_splitRendererPLC.c | 73 ---- lib_rend/ivas_splitRendererPost.c | 10 - lib_rend/ivas_splitRendererPre.c | 172 --------- lib_rend/ivas_splitRenderer_utils.c | 19 - lib_rend/ivas_stat_rend.h | 4 - lib_rend/lib_rend.c | 95 ----- 25 files changed, 2028 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 10a8ce2370..aca1635eae 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -455,14 +455,9 @@ 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 ) ); @@ -475,12 +470,6 @@ 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 @@ -633,26 +622,6 @@ int main( goto cleanup; } -#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 ) ) - { - /*TODO : needs to be refined as this wont work with LCLD codec*/ - arg.renderFramesize = IVAS_RENDER_FRAMESIZE_5MS; - } - else - { - arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; - } - - if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK ) - { - return error; - } - -#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 ); @@ -665,7 +634,6 @@ 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 ) ) @@ -686,7 +654,6 @@ int main( { 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 ) diff --git a/apps/renderer.c b/apps/renderer.c index 636c6d651b..007ef477e7 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1889,7 +1889,6 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < args.inConfig.numBinBuses; ++i ) { -#ifdef SPLIT_REND_LCLD_5MS if ( numSamplesRead > 0 ) { if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) @@ -1905,23 +1904,8 @@ int main( exit( -1 ); } } -#endif if ( splitBinNeedsNewFrame ) { -#ifndef SPLIT_REND_LCLD_5MS - if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } - IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels ); - - if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } -#endif if ( ( error = IVAS_REND_FeedSplitBinauralBitstream( hIvasRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); @@ -2225,9 +2209,7 @@ cleanup: } split_rend_reader_writer_close( &hSplitRendFileReadWrite ); -#ifdef SPLIT_REND_LCLD_5MS SplitRendBFIFileReader_close( &splitRendBFIReader ); -#endif #endif for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) diff --git a/lib_com/options.h b/lib_com/options.h index f79b346839..7065d18d91 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,11 +173,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ - -#ifdef SPLIT_REND_WITH_HEAD_ROT -#define SPLIT_REND_LCLD_5MS /* Dlb: LCLD 5ms framing operation */ -#endif - #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 802c239484..1e6ac794eb 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -247,17 +247,10 @@ static ivas_error ivas_dec_init_split_rend( } } -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -266,11 +259,7 @@ static ivas_error ivas_dec_init_split_rend( } #endif -#ifdef SPLIT_REND_LCLD_5MS error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize ); -#else - error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ); -#endif return error; } #endif @@ -2559,9 +2548,6 @@ void ivas_initialize_handles_dec( st_ivas->hSplitBinRend.hMultiBinCldfbData = NULL; st_ivas->hSplitBinRend.hSplitRendBits = NULL; st_ivas->hSplitBinRend.hCldfbDataOut = NULL; -#ifndef SPLIT_REND_LCLD_5MS - st_ivas->hSplitBinRend.tdDataOut = NULL; -#endif st_ivas->hSplitBinRend.numTdSamplesPerChannelCached = 0; ivas_init_split_rend_handles( &st_ivas->hSplitBinRend.splitrend ); #endif @@ -2711,12 +2697,6 @@ void ivas_destroy_dec( free( st_ivas->hSplitBinRend.hCldfbDataOut ); st_ivas->hSplitBinRend.hCldfbDataOut = NULL; } -#ifndef SPLIT_REND_LCLD_5MS - if ( st_ivas->hSplitBinRend.tdDataOut != NULL ) - { - free( st_ivas->hSplitBinRend.tdDataOut ); - } -#endif #endif /* Parametric binaural renderer handle */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 2ff77228f8..d6b12947ef 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -66,15 +66,7 @@ const int16_t MC_PARAMUPMIX_CHIDX2[MC_PARAMUPMIX_COMBINATIONS] = { 2, 3, 6, 7 }; static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); -#ifndef SPLIT_REND_LCLD_5MS -#ifdef SPLIT_REND_WITH_HEAD_ROT -static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS], const int16_t slot_index_start ); -#else -static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); -#endif -#else static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); -#endif static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering ); @@ -234,11 +226,6 @@ void ivas_mc_paramupmix_dec_render( int16_t slots_to_render, first_sf, last_sf, subframe_idx; uint16_t slot_size, ch; float *output_f_local[MAX_OUTPUT_CHANNELS]; -#ifndef SPLIT_REND_LCLD_5MS -#ifdef SPLIT_REND_WITH_HEAD_ROT - int16_t slot_index_start; -#endif -#endif MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; hMCParamUpmix = st_ivas->hMCParamUpmix; @@ -273,25 +260,10 @@ void ivas_mc_paramupmix_dec_render( assert( slots_to_render == 0 ); #endif { -#ifndef SPLIT_REND_LCLD_5MS -#ifdef SPLIT_REND_WITH_HEAD_ROT - slot_index_start = 0; -#endif -#endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#ifndef SPLIT_REND_LCLD_5MS -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local, slot_index_start ); - - slot_index_start += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#else - ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); -#endif -#else ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); -#endif for ( ch = 0; ch < min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ) ); ch++ ) { @@ -664,22 +636,10 @@ static void ps_pred_process_sf( return; } -#ifndef SPLIT_REND_LCLD_5MS -static void ivas_mc_paramupmix_dec_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - float *output_f[MAX_OUTPUT_CHANNELS], /* i/o: synthesized core-coder transport channels */ - const int16_t slot_index_start -#else - float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ -#endif -) -#else static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ ) -#endif { int16_t i, ch, slot_idx, k; float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ @@ -694,9 +654,7 @@ static void ivas_mc_paramupmix_dec_sf( #ifdef SPLIT_REND_WITH_HEAD_ROT float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#ifdef SPLIT_REND_LCLD_5MS int16_t slot_index_start; -#endif #else float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; @@ -707,9 +665,7 @@ static void ivas_mc_paramupmix_dec_sf( push_wmops( "ivas_mc_paramupmix_dec_sf" ); #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef SPLIT_REND_LCLD_5MS slot_index_start = st_ivas->hTcBuffer->slots_rendered; -#endif #endif for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 46b2533270..dccd1391a5 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -998,9 +998,6 @@ typedef struct IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ SPLIT_REND_WRAPPER splitrend; IVAS_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE hCldfbDataOut; /*buffer to store cldfb data before binauralization*/ -#ifndef SPLIT_REND_LCLD_5MS - float *tdDataOut; /*buffer to store TD data before binauralization*/ -#endif int16_t numTdSamplesPerChannelCached; } IVAS_DEC_SPLIT_REND_WRAPPER; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 61d452d9da..fad1c0b53e 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1058,20 +1058,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( Decoder_Struct *st_ivas; AUDIO_CONFIG output_config; int32_t output_Fs; -#ifndef SPLIT_REND_LCLD_5MS - float *writePtr; - float *readPtr, *readEnd; -#endif float *pOutput[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES]; float output[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k]; float pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k]; -#ifdef SPLIT_REND_LCLD_5MS float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#else - int16_t numSamplesPerChannelCacheSize; - int16_t numSamplesPerChannelToSplitEncode; -#endif int16_t numSamplesPerChannelToDecode; int16_t i, j; ivas_error error; @@ -1080,9 +1071,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( int16_t pcm_out_flag; int16_t td_input; int16_t numPoses; -#ifdef SPLIT_REND_LCLD_5MS int16_t slots_rendered, slots_rendered_new; -#endif int16_t ro_md_flag; error = IVAS_ERR_OK; @@ -1101,7 +1090,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; -#ifdef SPLIT_REND_LCLD_5MS if ( st_ivas->hDecoderConfig->render_framesize != IVAS_RENDER_FRAMESIZE_20MS && ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) @@ -1109,35 +1097,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numSamplesPerChannelToDecode = (int16_t) ( output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); numSamplesPerChannelToDecode *= (int16_t) st_ivas->hDecoderConfig->render_framesize; } -#else - if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS && hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && - ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || - hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) - { - numSamplesPerChannelToSplitEncode = (int16_t) ( output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); - numSamplesPerChannelCacheSize = numSamplesPerChannelToDecode - numSamplesPerChannelToSplitEncode; - - if ( hSplitBinRend->tdDataOut == NULL ) - { - /* Allocate enough space to save all decoded samples that will not be split encoded directly after decoding */ - if ( ( hSplitBinRend->tdDataOut = malloc( numSamplesPerChannelCacheSize * BINAURAL_CHANNELS * numPoses * sizeof( float ) ) ) == NULL ) - { - return IVAS_ERR_FAILED_ALLOC; - } - } - } - else - { - numSamplesPerChannelToSplitEncode = (int16_t) ( output_Fs / FRAMES_PER_SEC ); - numSamplesPerChannelCacheSize = 0; - } -#endif if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { return IVAS_ERR_WRONG_PARAMS; } -#ifdef SPLIT_REND_LCLD_5MS if ( st_ivas->hTcBuffer == NULL || hIvasDec->hasBeenFedFrame ) { slots_rendered = 0; @@ -1153,55 +1117,9 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( { return error; } -#else - if ( numSamplesPerChannelToDecode == numSamplesPerChannelToSplitEncode || hSplitBinRend->numTdSamplesPerChannelCached == 0 ) - { - /* Decode and render */ - if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifdef DEBUGGING - assert( numSamplesPerChannelToDecode == *nOutSamples ); -#endif - - /* copy to cache if cache is in use */ - if ( hSplitBinRend->tdDataOut != NULL ) - { - writePtr = hSplitBinRend->tdDataOut; - readPtr = pcmBuf + numSamplesPerChannelToSplitEncode * BINAURAL_CHANNELS * numPoses; - readEnd = pcmBuf + *nOutSamples * BINAURAL_CHANNELS * numPoses; - - while ( readPtr != readEnd ) - { - *writePtr++ = *readPtr++; - } - hSplitBinRend->numTdSamplesPerChannelCached = *nOutSamples - numSamplesPerChannelToSplitEncode; - } - } - else - { - /* copy from cache */ - assert( hSplitBinRend->tdDataOut != NULL ); - - readPtr = hSplitBinRend->tdDataOut + ( numSamplesPerChannelCacheSize - hSplitBinRend->numTdSamplesPerChannelCached ) * BINAURAL_CHANNELS * numPoses; - readEnd = readPtr + numSamplesPerChannelToSplitEncode * BINAURAL_CHANNELS * numPoses; - writePtr = pcmBuf; - - while ( readPtr != readEnd ) - { - *writePtr++ = *readPtr++; - } - hSplitBinRend->numTdSamplesPerChannelCached -= numSamplesPerChannelToSplitEncode; - } -#endif /* change buffer layout */ -#ifdef SPLIT_REND_LCLD_5MS for ( i = 0; i < numSamplesPerChannelToDecode; ++i ) -#else - for ( i = 0; i < numSamplesPerChannelToSplitEncode; ++i ) -#endif { for ( j = 0; j < BINAURAL_CHANNELS * numPoses; ++j ) { @@ -1213,7 +1131,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( pOutput[i] = output[i]; } -#ifdef SPLIT_REND_LCLD_5MS if ( st_ivas->hTcBuffer == NULL ) { slots_rendered_new = 0; @@ -1231,7 +1148,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( mvr2r( hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[i][j], Cldfb_ImagBuffer_Binaural[i][j - slots_rendered], CLDFB_NO_CHANNELS_MAX ); } } -#endif max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); pcm_out_flag = ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; @@ -1252,13 +1168,8 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( st_ivas->hRenderConfig->split_rend_config.codec, st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, hSplitBinRend->hSplitRendBits, -#ifdef SPLIT_REND_LCLD_5MS Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, -#else - hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, - hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, -#endif max_band, pOutput, 1, !td_input, pcm_out_flag, ro_md_flag ) ) != IVAS_ERR_OK ) { @@ -1271,30 +1182,18 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ) { #ifndef DISABLE_LIMITER -#ifdef SPLIT_REND_LCLD_5MS ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToDecode, st_ivas->BER_detect ); -#else - ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToSplitEncode, st_ivas->BER_detect ); -#endif #endif } else { -#ifdef SPLIT_REND_LCLD_5MS ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToDecode, st_ivas->BER_detect ); -#else - ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToSplitEncode, st_ivas->BER_detect ); -#endif } #ifdef DEBUGGING st_ivas->noClipping += #endif -#ifdef SPLIT_REND_LCLD_5MS ivas_syn_output( pOutput, numSamplesPerChannelToDecode, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); -#else - ivas_syn_output( pOutput, numSamplesPerChannelToSplitEncode, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); -#endif } free( st_ivas->hSplitBinRend.hMultiBinCldfbData ); @@ -3844,11 +3743,9 @@ ivas_error IVAS_DEC_GetSplitRendBits( splitRendBits->pose_correction = hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits->pose_correction; splitRendBits->codec_frame_size_ms = hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits->codec_frame_size_ms; -#ifdef SPLIT_REND_LCLD_5MS /* data consumed, free it */ free( hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits ); hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits = NULL; -#endif return IVAS_ERR_OK; diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index 1fe552f3fa..ce791e9329 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -52,9 +52,7 @@ ivas_error CreatePredictionDecoder( const int32_t iNumBlocks ) { int16_t n; -#ifdef SPLIT_REND_LCLD_5MS int16_t m; -#endif PredictionDecoder *psPredictionDecoder = NULL; if ( ( psPredictionDecoder = (PredictionDecoder *) malloc( sizeof( PredictionDecoder ) ) ) == NULL ) @@ -64,25 +62,12 @@ ivas_error CreatePredictionDecoder( psPredictionDecoder->iChannels = iChannels; psPredictionDecoder->iNumBlocks = iNumBlocks; -#ifdef SPLIT_REND_LCLD_5MS psPredictionDecoder->iNumSubSets = LCLD_BLOCKS_PER_FRAME / psPredictionDecoder->iNumBlocks; psPredictionDecoder->iSubSetId = 0; -#endif if ( ( psPredictionDecoder->piPredChanEnable = (int32_t *) malloc( sizeof( int32_t ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } -#ifndef SPLIT_REND_LCLD_5MS - if ( ( psPredictionDecoder->piNumPredBands = (int32_t *) malloc( sizeof( int32_t ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); - } - - if ( ( psPredictionDecoder->ppfEstPredGain = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); - } -#endif if ( ( psPredictionDecoder->ppiPredBandEnable = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -103,7 +88,6 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } -#ifdef SPLIT_REND_LCLD_5MS if ( ( psPredictionDecoder->ppfPredStateReal = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD decoder Module \n" ) ); @@ -112,28 +96,18 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD decoder Module \n" ) ); } -#endif for ( n = 0; n < psPredictionDecoder->iChannels; n++ ) { -#ifdef SPLIT_REND_LCLD_5MS psPredictionDecoder->piPredChanEnable[n] = 0; -#else - if ( ( psPredictionDecoder->ppfEstPredGain[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); - } -#endif if ( ( psPredictionDecoder->ppiPredBandEnable[n] = (int32_t *) malloc( LCLD_BANDS * sizeof( int32_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } -#ifdef SPLIT_REND_LCLD_5MS for ( m = 0; m < LCLD_BANDS; m++ ) { psPredictionDecoder->ppiPredBandEnable[n][m] = 0; } -#endif if ( ( psPredictionDecoder->ppfA1Real[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); @@ -150,7 +124,6 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } -#ifdef SPLIT_REND_LCLD_5MS if ( ( psPredictionDecoder->ppfPredStateReal[n] = (float *) malloc( LCLD_BANDS * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionDecoder Module \n" ) ); @@ -159,14 +132,11 @@ ivas_error CreatePredictionDecoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionDecoder Module \n" ) ); } -#ifdef SPLIT_REND_LCLD_5MS for ( m = 0; m < LCLD_BANDS; m++ ) { psPredictionDecoder->ppfPredStateReal[n][m] = 0; psPredictionDecoder->ppfPredStateImag[n][m] = 0; } -#endif -#endif } /* pre-define these tables? */ @@ -205,33 +175,22 @@ void DeletePredictionDecoder( for ( n = 0; n < psPredictionDecoder->iChannels; n++ ) { -#ifndef SPLIT_REND_LCLD_5MS - free( psPredictionDecoder->ppfEstPredGain[n] ); -#endif free( psPredictionDecoder->ppiPredBandEnable[n] ); free( psPredictionDecoder->ppfA1Real[n] ); free( psPredictionDecoder->ppfA1Imag[n] ); free( psPredictionDecoder->ppiA1Mag[n] ); free( psPredictionDecoder->ppiA1Phase[n] ); -#ifdef SPLIT_REND_LCLD_5MS free( psPredictionDecoder->ppfPredStateReal[n] ); free( psPredictionDecoder->ppfPredStateImag[n] ); -#endif } free( psPredictionDecoder->piPredChanEnable ); -#ifndef SPLIT_REND_LCLD_5MS - free( psPredictionDecoder->piNumPredBands ); - free( psPredictionDecoder->ppfEstPredGain ); -#endif free( psPredictionDecoder->ppiPredBandEnable ); free( psPredictionDecoder->ppfA1Real ); free( psPredictionDecoder->ppfA1Imag ); free( psPredictionDecoder->ppiA1Mag ); free( psPredictionDecoder->ppiA1Phase ); -#ifdef SPLIT_REND_LCLD_5MS free( psPredictionDecoder->ppfPredStateReal ); free( psPredictionDecoder->ppfPredStateImag ); -#endif free( psPredictionDecoder ); psPredictionDecoder = NULL; @@ -239,110 +198,6 @@ void DeletePredictionDecoder( return; } -#ifndef SPLIT_REND_LCLD_5MS -#define USE_TABLE_LOOKUP -/*-------------------------------------------------------------------* - * Function ReadPredictors() - * - * - *-------------------------------------------------------------------*/ - -int32_t ReadPredictors( - PredictionDecoder *psPredictionDecoder, - IVAS_SPLIT_REND_BITS_HANDLE pBits ) -{ - int16_t iBitsRead = 0; - int32_t c; - - for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) - { - psPredictionDecoder->piPredChanEnable[c] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); - iBitsRead += 1; - - if ( psPredictionDecoder->piPredChanEnable[c] ) - { - int32_t b; - - for ( b = 0; b < LCLD_BANDS; b++ ) - { - psPredictionDecoder->ppiPredBandEnable[c][b] = 0; - } - psPredictionDecoder->piNumPredBands[c] = ivas_split_rend_bitstream_read_int32( pBits, 6 ); - iBitsRead += 6; - - for ( b = 0; b < psPredictionDecoder->piNumPredBands[c]; b++ ) - { - psPredictionDecoder->ppiPredBandEnable[c][b] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); - iBitsRead += 1; - - if ( psPredictionDecoder->ppiPredBandEnable[c][b] == 1 ) - { -#ifdef USE_TABLE_LOOKUP - int32_t iA1Mag; - int32_t iA1Phase; - float fA1Real; - float fA1Imag; - iA1Mag = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUNAT_FILTER_MAG_BITS ); - iBitsRead += PRED_QUNAT_FILTER_MAG_BITS; - iA1Phase = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUANT_FILTER_PHASE_BITS ); - iBitsRead += PRED_QUANT_FILTER_PHASE_BITS; - - psPredictionDecoder->ppiA1Mag[c][b] = iA1Mag; - psPredictionDecoder->ppiA1Phase[c][b] = iA1Phase + PRED_QUANT_FILTER_PHASE_MIN; - - fA1Real = psPredictionDecoder->pfMagLUT[iA1Mag] * psPredictionDecoder->pfP2RRealLUT[iA1Phase]; - fA1Imag = psPredictionDecoder->pfMagLUT[iA1Mag] * psPredictionDecoder->pfP2RImagLUT[iA1Phase]; - - psPredictionDecoder->ppfA1Real[c][b] = fA1Real; - psPredictionDecoder->ppfA1Imag[c][b] = fA1Imag; -#else - const float fInvMagScale = M_PI / ( 2.0 * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0 ); - const float fInvPhaseScale = M_PI / (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ); - int32_t iA1Mag; - int32_t iA1Phase; - float fA1Mag; - float fA1Phase; - float fA1Real; - float fA1Imag; - - iA1Mag = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUNAT_FILTER_MAG_BITS ); - iBitsRead += PRED_QUNAT_FILTER_MAG_BITS; - - iA1Phase = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUANT_FILTER_PHASE_BITS ); - iBitsRead += PRED_QUANT_FILTER_PHASE_BITS; - iA1Phase += PRED_QUANT_FILTER_PHASE_MIN; - - psPredictionDecoder->ppiA1Mag[c][b] = iA1Mag; - psPredictionDecoder->ppiA1Phase[c][b] = iA1Phase; - - fA1Mag = sinf( fInvMagScale * (float) iA1Mag ); - fA1Phase = fInvPhaseScale * (float) iA1Phase; - - fA1Real = fA1Mag * cosf( fA1Phase ); - fA1Imag = fA1Mag * sinf( fA1Phase ); - - psPredictionDecoder->ppfA1Real[c][b] = fA1Real; - psPredictionDecoder->ppfA1Imag[c][b] = fA1Imag; - - /* printf("Dec %f\t%f\t%f\n",fA1Real,fA1Imag,fA1Real * fA1Real + fA1Imag * fA1Imag); */ -#endif - } - } - } - else - { - int16_t b; - for ( b = 0; b < LCLD_BANDS; b++ ) - { - psPredictionDecoder->ppiPredBandEnable[c][b] = 0; - } - } - } - - return iBitsRead; -} - -#else /*-------------------------------------------------------------------* * Function ReadPredictors() * @@ -438,55 +293,7 @@ int32_t ReadPredictors( return iBitsRead; } -#endif -#ifndef SPLIT_REND_LCLD_5MS -/*-------------------------------------------------------------------* - * Function ApplyInversePredictros() - * - * - *-------------------------------------------------------------------*/ - -void ApplyInversePredictros( - PredictionDecoder *psPredictionDecoder, - float ***pppfReal, - float ***pppfImag ) -{ - int32_t c; - for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) - { - if ( psPredictionDecoder->piPredChanEnable[c] == 1 ) - { - int32_t b; - for ( b = 0; b < psPredictionDecoder->piNumPredBands[c]; b++ ) - { - if ( psPredictionDecoder->ppiPredBandEnable[c][b] == 1 ) - { - int32_t n; - float fA1Real; - float fA1Imag; - - fA1Real = psPredictionDecoder->ppfA1Real[c][b]; - fA1Imag = psPredictionDecoder->ppfA1Imag[c][b]; - for ( n = 1; n < psPredictionDecoder->iNumBlocks; n++ ) - { - float fReal; - float fImag; - - fReal = pppfReal[c][n][b] - fA1Real * pppfReal[c][n - 1][b] + fA1Imag * pppfImag[c][n - 1][b]; - fImag = pppfImag[c][n][b] - fA1Real * pppfImag[c][n - 1][b] - fA1Imag * pppfReal[c][n - 1][b]; - - pppfReal[c][n][b] = fReal; - pppfImag[c][n][b] = fImag; - } - } - } - } - } - - return; -} -#else /*-------------------------------------------------------------------* * Function ApplyInversePredictors() * @@ -547,4 +354,3 @@ void ApplyInversePredictors( return; } #endif -#endif diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 2f7cfd3900..50ac5524fb 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -40,7 +40,6 @@ #include "ivas_prot_rend.h" #include "wmc_auto.h" -#ifdef SPLIT_REND_LCLD_5MS /*-------------------------------------------------------------------* * Function activate_bit() @@ -66,7 +65,6 @@ static void deactivate_bit( { ( *state ) &= ( ~( 1 << bit_id ) ); } -#endif /*-------------------------------------------------------------------* * Function CreatePredictionEncoder() @@ -74,19 +72,12 @@ static void deactivate_bit( * *-------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS ivas_error CreatePredictionEncoder( PredictionEncoder **psPredictionEncoder_out, const int32_t iChannels, const int32_t iNumBlocks, const int32_t iNumSubSets, const int32_t iMaxNumPredBands ) -#else -ivas_error CreatePredictionEncoder( - PredictionEncoder **psPredictionEncoder_out, - const int32_t iChannels, - const int32_t iNumBlocks ) -#endif { int32_t k, n; PredictionEncoder *psPredictionEncoder = NULL; @@ -98,7 +89,6 @@ ivas_error CreatePredictionEncoder( psPredictionEncoder->iChannels = iChannels; psPredictionEncoder->iNumBlocks = iNumBlocks; -#ifdef SPLIT_REND_LCLD_5MS psPredictionEncoder->iSubSetId = 0; psPredictionEncoder->iMaxNumPredBands = iMaxNumPredBands; psPredictionEncoder->iNumSubSets = iNumSubSets; @@ -106,24 +96,11 @@ ivas_error CreatePredictionEncoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } -#else - if ( ( psPredictionEncoder->pfWindow = (float *) malloc( sizeof( float ) * iNumBlocks ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } -#endif -#ifdef SPLIT_REND_LCLD_5MS for ( n = 0; n < LCLD_PRED_WIN_LEN; n++ ) { psPredictionEncoder->pfWindow[n] = 0.54f - 0.46f * cosf( 2.0f * M_PI * ( (float) n + 0.5f ) / (float) LCLD_PRED_WIN_LEN ); } -#else - for ( n = 0; n < iNumBlocks; n++ ) - { - psPredictionEncoder->pfWindow[n] = 0.54f - 0.46f * cosf( 2.0f * M_PI * ( (float) n + 0.5f ) / (float) iNumBlocks ); - } -#endif if ( ( psPredictionEncoder->piPredChanEnable = (int32_t *) malloc( sizeof( int32_t ) * iChannels ) ) == NULL ) @@ -141,7 +118,6 @@ ivas_error CreatePredictionEncoder( psPredictionEncoder->piNumPredBands[n] = 40; // Will need to be set correctly } -#ifdef SPLIT_REND_LCLD_5MS if ( ( psPredictionEncoder->ppiPredBandEnable = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); @@ -194,50 +170,9 @@ ivas_error CreatePredictionEncoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } -#else - if ( ( psPredictionEncoder->ppfEstPredGain = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppfEstPredBitGain = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppiPredBandEnable = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppfA1Real = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppfA1Imag = (float **) malloc( sizeof( float * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppiA1Mag = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppiA1Phase = (int32_t **) malloc( sizeof( int32_t * ) * iChannels ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - -#endif for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) { -#ifndef SPLIT_REND_LCLD_5MS - if ( ( psPredictionEncoder->ppfEstPredGain[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } - if ( ( psPredictionEncoder->ppfEstPredBitGain[n] = (float *) malloc( sizeof( float ) * LCLD_BANDS ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); - } -#endif if ( ( psPredictionEncoder->ppiPredBandEnable[n] = (int32_t *) malloc( sizeof( int32_t ) * LCLD_BANDS ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); @@ -258,7 +193,6 @@ ivas_error CreatePredictionEncoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); } -#ifdef SPLIT_REND_LCLD_5MS if ( ( psPredictionEncoder->pppfInpBufReal[n] = (float **) malloc( sizeof( float * ) * LCLD_PRED_WIN_LEN ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD PredictionEncoder Module \n" ) ); @@ -313,17 +247,11 @@ ivas_error CreatePredictionEncoder( } set_zero( psPredictionEncoder->ppfPredStateRealTmp[n], LCLD_BANDS ); set_zero( psPredictionEncoder->ppfPredStateImagTmp[n], LCLD_BANDS ); -#endif for ( k = 0; k < LCLD_BANDS; k++ ) { psPredictionEncoder->ppiPredBandEnable[n][k] = 0; -#ifndef SPLIT_REND_LCLD_5MS - psPredictionEncoder->ppfA1Real[n][k] = 0.0; - psPredictionEncoder->ppfA1Imag[n][k] = 0.0; -#else psPredictionEncoder->ppfA1Real[n][k] = 0.0f; psPredictionEncoder->ppfA1Imag[n][k] = 0.0f; -#endif } } @@ -348,18 +276,12 @@ void DeletePredictionEncoder( for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) { -#ifdef SPLIT_REND_LCLD_5MS int32_t k; -#else - free( psPredictionEncoder->ppfEstPredGain[n] ); - free( psPredictionEncoder->ppfEstPredBitGain[n] ); -#endif free( psPredictionEncoder->ppiPredBandEnable[n] ); free( psPredictionEncoder->ppfA1Real[n] ); free( psPredictionEncoder->ppfA1Imag[n] ); free( psPredictionEncoder->ppiA1Mag[n] ); free( psPredictionEncoder->ppiA1Phase[n] ); -#ifdef SPLIT_REND_LCLD_5MS for ( k = 0; k < LCLD_PRED_WIN_LEN; k++ ) { free( psPredictionEncoder->pppfInpBufReal[n][k] ); @@ -373,20 +295,14 @@ void DeletePredictionEncoder( free( psPredictionEncoder->ppfPredStateImag[n] ); free( psPredictionEncoder->ppfPredStateRealTmp[n] ); free( psPredictionEncoder->ppfPredStateImagTmp[n] ); -#endif } free( psPredictionEncoder->piPredChanEnable ); free( psPredictionEncoder->piNumPredBands ); -#ifndef SPLIT_REND_LCLD_5MS - free( psPredictionEncoder->ppfEstPredGain ); - free( psPredictionEncoder->ppfEstPredBitGain ); -#endif free( psPredictionEncoder->ppiPredBandEnable ); free( psPredictionEncoder->ppfA1Real ); free( psPredictionEncoder->ppfA1Imag ); free( psPredictionEncoder->ppiA1Mag ); free( psPredictionEncoder->ppiA1Phase ); -#ifdef SPLIT_REND_LCLD_5MS free( psPredictionEncoder->pppfInpBufReal ); free( psPredictionEncoder->pppfInpBufImag ); free( psPredictionEncoder->ppfInpPrevReal ); @@ -395,7 +311,6 @@ void DeletePredictionEncoder( free( psPredictionEncoder->ppfPredStateImag ); free( psPredictionEncoder->ppfPredStateRealTmp ); free( psPredictionEncoder->ppfPredStateImagTmp ); -#endif free( psPredictionEncoder ); @@ -410,7 +325,6 @@ void DeletePredictionEncoder( * *-------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS void ComputePredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, @@ -598,205 +512,6 @@ void ComputePredictors( } } } -#else -int32_t ComputePredictors( - PredictionEncoder *psPredictionEncoder, - float ***pppfReal, - float ***pppfImag ) -{ - int32_t c; - int32_t iPredictionBits = 0; - - for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) - { - int32_t b; - psPredictionEncoder->piNumPredBands[c] = 50; - for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) - { - int32_t n; - int32_t iNumBlocks; - float fGain = 0.0; - float fBitGain = 0.0; - float *pfRxxReal; - float *pfRxxImag; - float fA1Real; - float fA1Imag; - int32_t iA1Mag; - int32_t iA1Phase; - - iNumBlocks = psPredictionEncoder->iNumBlocks; - - pfRxxReal = psPredictionEncoder->pfRxxReal; - pfRxxImag = psPredictionEncoder->pfRxxImag; - - pfRxxReal[0] = 0.0; - pfRxxImag[0] = 0.0; - for ( n = 0; n < iNumBlocks; n++ ) - { - pfRxxReal[0] += ( pppfReal[c][n][b] * pppfReal[c][n][b] + pppfImag[c][n][b] * pppfImag[c][n][b] ); - } - - pfRxxReal[1] = 0.0; - pfRxxImag[1] = 0.0; - for ( n = 1; n < iNumBlocks; n++ ) - { - pfRxxReal[1] += ( pppfReal[c][n][b] * pppfReal[c][n - 1][b] + pppfImag[c][n][b] * pppfImag[c][n - 1][b] ); - pfRxxImag[1] += ( pppfImag[c][n][b] * pppfReal[c][n - 1][b] - pppfReal[c][n][b] * pppfImag[c][n - 1][b] ); - } - - if ( pfRxxReal[0] > 1e-12f ) - { - float fA1Mag; - float fA1Phase; - float fGain2; - float fBitGain2; - - const float fMagScale = ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ) / M_PI; - const float fInvMagScale = M_PI / ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ); - const float fPhaseScale = (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ) / M_PI; - const float fInvPhaseScale = M_PI / (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ); - - /* Compute filter coefficeints */ - fA1Real = -pfRxxReal[1] / pfRxxReal[0]; - fA1Imag = -pfRxxImag[1] / pfRxxReal[0]; - - /* compute these before quant */ - /* Compute est coding gain based on quantized filter coefficients */ - fGain = 1.0f / ( 1.0f - fA1Real * fA1Real - fA1Imag * fA1Imag ); - fBitGain = 0.6f * log2f( fGain ) * (float) ( iNumBlocks ) - (float) ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); // Wrong fix (iNumBlocks-1) - - fA1Mag = sqrtf( fA1Real * fA1Real + fA1Imag * fA1Imag ); - fA1Mag = fMagScale * asinf( fA1Mag ); - iA1Mag = (int32_t) ( fA1Mag + 0.5f ); - iA1Mag = ( iA1Mag > PRED_QUANT_FILTER_MAG_MIN ) ? iA1Mag : PRED_QUANT_FILTER_MAG_MIN; - iA1Mag = ( iA1Mag < PRED_QUANT_FILTER_MAG_MAX ) ? iA1Mag : PRED_QUANT_FILTER_MAG_MAX; - fA1Mag = sinf( fInvMagScale * (float) iA1Mag ); - - fA1Phase = atan2f( fA1Imag, fA1Real ); - fA1Phase = fPhaseScale * fA1Phase; - iA1Phase = ( fA1Phase > 0.0f ) ? (int32_t) ( fA1Phase + 0.5f ) : (int32_t) ( fA1Phase - 0.5f ); - iA1Phase = ( iA1Phase > PRED_QUANT_FILTER_PHASE_MIN ) ? iA1Phase : PRED_QUANT_FILTER_PHASE_MIN; - iA1Phase = ( iA1Phase < PRED_QUANT_FILTER_PHASE_MAX ) ? iA1Phase : PRED_QUANT_FILTER_PHASE_MAX; // Is this the correct way to deal with this? should wrap? - fA1Phase = fInvPhaseScale * (float) iA1Phase; - - fA1Real = fA1Mag * cosf( fA1Phase ); - fA1Imag = fA1Mag * sinf( fA1Phase ); - - fGain2 = 1.0f / ( 1.0f - fA1Real * fA1Real - fA1Imag * fA1Imag ); - fBitGain2 = 0.6f * log2f( fGain ) * (float) ( iNumBlocks ) - (float) ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); // Wrong fix (iNumBlocks-1) - - fGain = ( fGain < fGain2 ) ? fGain : fGain2; - fBitGain = ( fBitGain < fBitGain2 ) ? fBitGain : fBitGain2; - } - else - { - psPredictionEncoder->ppfEstPredGain[c][b] = 0.0f; - fA1Real = 0.0f; - fA1Imag = 0.0f; - // iA1Real = 0; - // iA1Imag = 0; - iA1Mag = 0; - iA1Phase = 0; - fGain = -10.0f; // Fix this - } - - psPredictionEncoder->ppfEstPredGain[c][b] = fGain; - psPredictionEncoder->ppfEstPredBitGain[c][b] = fBitGain; - psPredictionEncoder->ppiPredBandEnable[c][b] = ( fBitGain > 0 ) ? 1 : 0; // Initial prediction enable - psPredictionEncoder->ppfA1Real[c][b] = fA1Real; - psPredictionEncoder->ppfA1Imag[c][b] = fA1Imag; - psPredictionEncoder->ppiA1Mag[c][b] = iA1Mag; - psPredictionEncoder->ppiA1Phase[c][b] = iA1Phase; - } - - { - /*int32_t iDone; - int32_t iPredBands; - - iDone = 0; - iPredBands = 30; - while(iPredBands > 0 && iDone == 0){ - int32_t b; - float fBitGain; - - fBitGain = -7.0; - for(b = 0; b < iPredBands; b ++){ - fBitGain -= 1.0; - if(psPredictionEncoder->ppiPredBandEnable[c][b] == 1){ - fBitGain += psPredictionEncoder->ppfEstPredBitGain[c][b]; - } - } - if(fBitGain > 0.0){ //thresh - iDone ++; - } - else{ - iPredBands --; - } - }*/ - // int32_t b; - float fBestCost; - int32_t iPredBands; - float fBitGain; - - fBestCost = 0.0; - iPredBands = 0; - fBitGain = -7.0; - for ( b = 0; b < 30; b++ ) - { // still getting this decision wrong! - fBitGain -= 1.0; - if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) - { - fBitGain += psPredictionEncoder->ppfEstPredBitGain[c][b]; - } - if ( fBitGain > fBestCost ) - { - fBestCost = fBitGain; - iPredBands = b; - } - } - - // printf("%d\t%f\n",iPredBands,fBestCost); - /*if(fBestCost < 300.0){ - iPredBands = 0; - }*/ - - if ( iPredBands > 0 ) - { - // int32_t b; - iPredictionBits += 1; - iPredictionBits += 6; - for ( b = 0; b < iPredBands; b++ ) - { - iPredictionBits += 1; - if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) - { - iPredictionBits += ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); - } - } - for ( b = iPredBands; b < LCLD_BANDS; b++ ) - { - psPredictionEncoder->ppiPredBandEnable[c][b] = 0; - } - psPredictionEncoder->piPredChanEnable[c] = 1; - psPredictionEncoder->piNumPredBands[c] = iPredBands; - } - else - { - // int32_t b; - iPredictionBits += 1; - for ( b = 0; b < LCLD_BANDS; b++ ) - { - psPredictionEncoder->ppiPredBandEnable[c][b] = 0; - } - psPredictionEncoder->piPredChanEnable[c] = 0; - psPredictionEncoder->piNumPredBands[c] = 0; - } - } - } - - return iPredictionBits; -} -#endif /*-------------------------------------------------------------------* @@ -805,7 +520,6 @@ int32_t ComputePredictors( * *-------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, @@ -859,54 +573,6 @@ void ApplyForwardPredictors( return; } -#else -void ApplyForwardPredictors( - PredictionEncoder *psPredictionEncoder, - float ***pppfReal, - float ***pppfImag ) -{ - int32_t c; - for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) - { - int32_t b; - if ( psPredictionEncoder->piPredChanEnable[c] == 1 ) - { - for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) - { - if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) - { - int32_t n; - float fOldReal; - float fOldImag; - float fA1Real; - float fA1Imag; - - fOldReal = pppfReal[c][0][b]; - fOldImag = pppfImag[c][0][b]; - fA1Real = psPredictionEncoder->ppfA1Real[c][b]; - fA1Imag = psPredictionEncoder->ppfA1Imag[c][b]; - for ( n = 1; n < psPredictionEncoder->iNumBlocks; n++ ) - { - float fReal; - float fImag; - - fReal = pppfReal[c][n][b] + fA1Real * fOldReal - fA1Imag * fOldImag; - fImag = pppfImag[c][n][b] + fA1Real * fOldImag + fA1Imag * fOldReal; - - fOldReal = pppfReal[c][n][b]; - fOldImag = pppfImag[c][n][b]; - - pppfReal[c][n][b] = fReal; - pppfImag[c][n][b] = fImag; - } - } - } - } - } - - return; -} -#endif /*-------------------------------------------------------------------* @@ -915,7 +581,6 @@ void ApplyForwardPredictors( * *-------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, IVAS_SPLIT_REND_BITS_HANDLE pBits ) @@ -979,47 +644,4 @@ int32_t WritePredictors( return iBitsWritten; } -#else -int32_t WritePredictors( - PredictionEncoder *psPredictionEncoder, - IVAS_SPLIT_REND_BITS_HANDLE pBits ) -{ - int32_t iBitsWritten = 0; - int32_t c; - - for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) - { - int32_t b; - ivas_split_rend_bitstream_write_int32( pBits, psPredictionEncoder->piPredChanEnable[c], 1 ); - iBitsWritten += 1; - - if ( psPredictionEncoder->piPredChanEnable[c] == 1 ) - { - ivas_split_rend_bitstream_write_int32( pBits, psPredictionEncoder->piNumPredBands[c], 6 ); - iBitsWritten += 6; - - for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) - { - ivas_split_rend_bitstream_write_int32( pBits, psPredictionEncoder->ppiPredBandEnable[c][b], 1 ); - iBitsWritten += 1; - - if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) - { - int32_t iA1Mag; - int32_t iA1Phase; - - iA1Mag = psPredictionEncoder->ppiA1Mag[c][b]; - iA1Phase = psPredictionEncoder->ppiA1Phase[c][b] - PRED_QUANT_FILTER_PHASE_MIN; - ivas_split_rend_bitstream_write_int32( pBits, iA1Mag, PRED_QUNAT_FILTER_MAG_BITS ); - iBitsWritten += PRED_QUNAT_FILTER_MAG_BITS; - ivas_split_rend_bitstream_write_int32( pBits, iA1Phase, PRED_QUANT_FILTER_PHASE_BITS ); - iBitsWritten += PRED_QUANT_FILTER_PHASE_BITS; - } - } - } - } - - return iBitsWritten; -} -#endif #endif diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index 81deff1759..f19f86d1ee 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -700,11 +700,7 @@ void ComputeEnvelopeGrouping( /* Perform grouping via Greedy Merge */ /* Allows control over max groups can call using 16 if want same as previous call */ -#ifdef SPLIT_REND_LCLD_5MS ComputeGreedyGroups3( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths, psRMSEnvelopeGrouping->iNumBlocks ); -#else - ComputeGreedyGroups3( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths, LCLD_BLOCKS_PER_FRAME ); -#endif /* Calc Groups from Merge Results */ *piNumGroups = 0; diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 8a45c47fdb..e55279c60f 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1605,9 +1605,7 @@ void ivas_rend_closeCldfbRend( } ivas_binRenderer_close( &pCldfbRend->hCldfbRend ); -#ifdef SPLIT_REND_LCLD_5MS ivas_binaural_hrtf_close( &pCldfbRend->hHrtfFastConv ); -#endif ivas_HRTF_fastconv_binary_close( &pCldfbRend->hHrtfFastConv ); return; diff --git a/lib_rend/ivas_lcld_decoder.c b/lib_rend/ivas_lcld_decoder.c index 067b1ede71..b98b4f4e00 100644 --- a/lib_rend/ivas_lcld_decoder.c +++ b/lib_rend/ivas_lcld_decoder.c @@ -341,18 +341,11 @@ static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, int32_t num, const ui * *------------------------------------------------------------------------------------------*/ -#ifndef SPLIT_REND_LCLD_5MS -ivas_error CreateLCLDDecoder( - LCLDDecoder **psLCLDDecoder_out, - const int32_t iSampleRate, - const int32_t iChannels ) -#else ivas_error CreateLCLDDecoder( LCLDDecoder **psLCLDDecoder_out, const int32_t iSampleRate, const int32_t iChannels, const int32_t iNumBlocks ) -#endif { int32_t n; int32_t read_length; @@ -360,27 +353,17 @@ ivas_error CreateLCLDDecoder( LCLDDecoder *psLCLDDecoder = NULL; assert( iSampleRate == 48000 ); -#ifdef SPLIT_REND_LCLD_5MS assert( iNumBlocks == 16 || iNumBlocks == 8 || iNumBlocks == 4 ); -#endif if ( ( psLCLDDecoder = (LCLDDecoder *) malloc( sizeof( LCLDDecoder ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); } psLCLDDecoder->iSampleRate = iSampleRate; psLCLDDecoder->iChannels = iChannels; -#ifdef SPLIT_REND_LCLD_5MS psLCLDDecoder->iNumBlocks = iNumBlocks; -#else - psLCLDDecoder->iNumBlocks = LCLD_BLOCKS_PER_FRAME; -#endif psLCLDDecoder->iAllocOffset = 0; -#ifdef SPLIT_REND_LCLD_5MS psLCLDDecoder->iNumBands = 0; /* read from bitstream*/ -#else - psLCLDDecoder->iNumBands = MAX_BANDS_48; /* Fix */ -#endif psLCLDDecoder->piBandwidths = c_aiBandwidths48; psLCLDDecoder->iMSMode = 0; @@ -713,11 +696,7 @@ void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder ) static void ApplyRMSEnvelope( const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iNumGroups, const int32_t *piGroupLengths, int32_t **ppiRMSEnvelope, float **ppfReal, float **ppfImag ); -#ifdef SPLIT_REND_LCLD_5MS static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag, const int32_t *piBandwidths ); -#else -static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag ); -#endif static void InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, float **ppfImag, NoiseGen *psNoiseGen ); @@ -823,17 +802,10 @@ int32_t DecodeLCLDFrame( pppfLCLDReal[n], pppfLCLDImag[n], psLCLDDecoder->psNoiseGen ); -#ifdef SPLIT_REND_LCLD_5MS ReplaceSign( psLCLDDecoder->iNumBlocks, psLCLDDecoder->iNumBands, psLCLDDecoder->pppiLCLDSignReal[n], psLCLDDecoder->pppiLCLDSignImag[n], pppfLCLDReal[n], pppfLCLDImag[n], psLCLDDecoder->piBandwidths ); -#else - ReplaceSign( psLCLDDecoder->iNumBlocks, LCLD_BANDS, - psLCLDDecoder->pppiLCLDSignReal[n], - psLCLDDecoder->pppiLCLDSignImag[n], - pppfLCLDReal[n], pppfLCLDImag[n] ); -#endif } #ifdef DEBUG_WRITE_PREDICTORS { @@ -850,11 +822,7 @@ int32_t DecodeLCLDFrame( } #endif -#ifdef SPLIT_REND_LCLD_5MS ApplyInversePredictors( psLCLDDecoder->psPredictionDecoder, pppfLCLDReal, pppfLCLDImag ); -#else - ApplyInversePredictros( psLCLDDecoder->psPredictionDecoder, pppfLCLDReal, pppfLCLDImag ); -#endif for ( n = 0; n < psLCLDDecoder->iChannels; n++ ) { @@ -926,7 +894,6 @@ static void ApplyRMSEnvelope( return; } -#ifdef SPLIT_REND_LCLD_5MS static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, @@ -935,24 +902,12 @@ static void ReplaceSign( float **ppfReal, float **ppfImag, const int32_t *piBandwidths ) -#else -static void ReplaceSign( - const int32_t iNumBlocks, - const int32_t iNumLCLDBands, - int32_t **ppiSignReal, - int32_t **ppiSignImag, - float **ppfReal, - float **ppfImag ) -#endif { int32_t b, n; -#ifdef SPLIT_REND_LCLD_5MS int32_t m, idx; -#endif for ( n = 0; n < iNumBlocks; n++ ) { -#ifdef SPLIT_REND_LCLD_5MS idx = 0; for ( b = 0; b < iNumLCLDBands; b++ ) { @@ -970,20 +925,6 @@ static void ReplaceSign( idx++; } } -#else - for ( b = 0; b < iNumLCLDBands; b++ ) - { - if ( ppiSignReal[n][b] == 1 ) - { - ppfReal[n][b] = -ppfReal[n][b]; - } - - if ( ppiSignImag[n][b] == 1 ) - { - ppfImag[n][b] = -ppfImag[n][b]; - } - } -#endif } return; @@ -1075,11 +1016,7 @@ static void InvMSCoding( { int32_t b; int32_t iFBOffset; -#ifdef SPLIT_REND_LCLD_5MS int32_t bMSPred = 0; -#else - int32_t bms = 0; -#endif iFBOffset = 0; for ( b = 0; b < iNumBands; b++ ) @@ -1087,12 +1024,10 @@ static void InvMSCoding( if ( piMSFlags[b] == 1 ) { int32_t n; -#ifdef SPLIT_REND_LCLD_5MS int32_t phaseIdx; float fPred; phaseIdx = piLRPhaseDiffs[bMSPred] - PHASE_MIN_VAL; fPred = dequantPred( piMSPredCoefs[bMSPred] ); -#endif for ( n = 0; n < piBandwidths[b]; n++ ) { int32_t k; @@ -1105,10 +1040,6 @@ static void InvMSCoding( if ( iMSMode == 3 ) { -#ifndef SPLIT_REND_LCLD_5MS - float fPred; - fPred = dequantPred( piMSPredCoefs[bms] ); -#endif pppfReal[1][k][iFBOffset] += fPred * pppfReal[0][k][iFBOffset]; pppfImag[1][k][iFBOffset] += fPred * pppfImag[0][k][iFBOffset]; } @@ -1120,10 +1051,6 @@ static void InvMSCoding( if ( iMSMode == 3 ) { -#ifndef SPLIT_REND_LCLD_5MS - int32_t phaseIdx; - phaseIdx = piLRPhaseDiffs[bms] - PHASE_MIN_VAL; -#endif cplxmult( &fRightReal, &fRightImag, c_afRotRealImag[phaseIdx][0], -c_afRotRealImag[phaseIdx][1] ); } @@ -1134,11 +1061,7 @@ static void InvMSCoding( } iFBOffset++; } -#ifdef SPLIT_REND_LCLD_5MS bMSPred++; -#else - bms++; -#endif } else { diff --git a/lib_rend/ivas_lcld_encoder.c b/lib_rend/ivas_lcld_encoder.c index bab9409157..4ad176ec0d 100644 --- a/lib_rend/ivas_lcld_encoder.c +++ b/lib_rend/ivas_lcld_encoder.c @@ -52,9 +52,6 @@ struct LCLD_ENCODER int32_t iNumBlocks; int32_t iTargetBitRate; -#ifndef SPLIT_REND_LCLD_5MS - int32_t iTargetBitsPerFrame; -#endif int32_t iNumBands; const int32_t *piBandwidths; @@ -88,7 +85,6 @@ struct LCLD_ENCODER PredictionEncoder *psPredictionEncoder; }; -#ifdef SPLIT_REND_LCLD_5MS /*------------------------------------------------------------------------------------------* * Function Quantize() * @@ -139,7 +135,6 @@ static float UnQuantize( } return fVal; } -#endif /*------------------------------------------------------------------------------------------* * Function CreateLCLDEncoder() @@ -147,7 +142,6 @@ static float UnQuantize( * *------------------------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS ivas_error CreateLCLDEncoder( LCLDEncoder **psLCLDEncoder_out, const int32_t iSampleRate, @@ -156,27 +150,15 @@ ivas_error CreateLCLDEncoder( const int32_t iAllowSidePred, const int16_t iNumBlocks, const int16_t iNumSubSets ) -#else -ivas_error CreateLCLDEncoder( - LCLDEncoder **psLCLDEncoder_out, - const int32_t iSampleRate, - const int32_t iChannels, - const int32_t iTargetBitRate, - const int32_t iAllowSidePred ) -#endif { int32_t n; LCLDEncoder *psLCLDEncoder; ivas_error error; -#ifdef SPLIT_REND_LCLD_5MS int32_t iMaxNumPredBands = 0; -#endif assert( iSampleRate == 48000 ); // Fix -#ifdef SPLIT_REND_LCLD_5MS assert( iNumBlocks == 16 || iNumBlocks == 8 || iNumBlocks == 4 ); assert( iNumSubSets > 0 && iNumSubSets <= LCLD_MAX_NUM_PRED_SUBSETS ); -#endif if ( ( psLCLDEncoder = (LCLDEncoder *) malloc( sizeof( LCLDEncoder ) ) ) == NULL ) { @@ -185,28 +167,17 @@ ivas_error CreateLCLDEncoder( psLCLDEncoder->iSampleRate = iSampleRate; psLCLDEncoder->iChannels = iChannels; -#ifdef SPLIT_REND_LCLD_5MS psLCLDEncoder->iNumBlocks = (int32_t) iNumBlocks; -#else - psLCLDEncoder->iNumBlocks = LCLD_BLOCKS_PER_FRAME; -#endif psLCLDEncoder->iAllocOffset = 0; psLCLDEncoder->iTargetBitRate = iTargetBitRate; -#ifndef SPLIT_REND_LCLD_5MS - psLCLDEncoder->iTargetBitsPerFrame = iTargetBitRate * LCLD_BLOCKS_PER_FRAME * LCLD_BANDS / iSampleRate; -#endif psLCLDEncoder->piBandwidths = c_aiBandwidths48; -#ifdef SPLIT_REND_LCLD_5MS psLCLDEncoder->iNumBands = DEF_BANDS_48; /* 22 bands = 50 CLDFB bands (rather than 23 bands) */ for ( n = 0; n < psLCLDEncoder->iNumBands; n++ ) { iMaxNumPredBands += psLCLDEncoder->piBandwidths[n]; } -#else - psLCLDEncoder->iNumBands = MAX_BANDS_48; -#endif psLCLDEncoder->iMSMode = 0; @@ -371,17 +342,10 @@ ivas_error CreateLCLDEncoder( } } -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = CreatePredictionEncoder( &( psLCLDEncoder->psPredictionEncoder ), iChannels, psLCLDEncoder->iNumBlocks, (int32_t) iNumSubSets, iMaxNumPredBands ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = CreatePredictionEncoder( &( psLCLDEncoder->psPredictionEncoder ), iChannels, psLCLDEncoder->iNumBlocks ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif *psLCLDEncoder_out = psLCLDEncoder; @@ -559,11 +523,7 @@ static int32_t WriteAllocInformation( const int32_t iAllocOffset, IVAS_SPLIT_REN static int32_t WriteLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -#ifdef SPLIT_REND_LCLD_5MS static int32_t ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, float ***pppfReal, float ***pppfImag, int32_t ***pppiSMR, const int32_t iAvailableBits, int32_t *piAllocOffset, int32_t ***pppiAlloc, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, PredictionEncoder *psPredictionEncoder ); -#else -static int32_t ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, float ***pppfReal, float ***pppfImag, int32_t ***pppiSMR, const int32_t iAvailableBits, int32_t *piAllocOffset, int32_t ***pppiAlloc, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, int32_t **ppiPredEnable, float **ppfA1Real, float **ppfA1Imag ); -#endif /*------------------------------------------------------------------------------------------* * Function EncodeLCLDFrame() @@ -584,9 +544,7 @@ int32_t EncodeLCLDFrame( int32_t iNumMSBands = 0; iAvailableBits = available_bits; // HCBR for now iBitsWritten = 0; -#ifdef SPLIT_REND_LCLD_5MS assert( available_bits <= pBits->buf_len * 8 ); -#endif /* Do MS calc here */ if ( psLCLDEncoder->iChannels == 2 ) @@ -737,14 +695,7 @@ int32_t EncodeLCLDFrame( psLCLDEncoder->pppiQLCLDImag, psLCLDEncoder->pppiLCLDSignReal, psLCLDEncoder->pppiLCLDSignImag, -#ifdef SPLIT_REND_LCLD_5MS psLCLDEncoder->psPredictionEncoder ); -#else - psLCLDEncoder->psPredictionEncoder->ppiPredBandEnable, - psLCLDEncoder->psPredictionEncoder->ppfA1Real, - psLCLDEncoder->psPredictionEncoder->ppfA1Imag ); - -#endif iBitsWritten += WriteAllocInformation( psLCLDEncoder->iAllocOffset, pBits ); @@ -787,7 +738,6 @@ int32_t GetNumGroups( LCLDEncoder *psLCLDEncoder ) * *------------------------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS enum MSPred_Types { MS_PHASE_AND_PRED = 0, /* LR phase alignment + real-valued M/S prediction */ @@ -878,9 +828,6 @@ static int32_t MSModeCalculation( int32_t tabIdx = 0; float fNumLines = (float) ( iNumBlocks * piBandwidths[b] * 2 ); /* per band per channel */ float fLevelToSMRdBFactor = (float) c_aiDefaultTheta48[b] / (float) ( 1 << PERCEPTUAL_MODEL_SLGAIN_SHIFT ); /* frequency dependent SMR slope in psy model */ -#ifndef SPLIT_REND_LCLD_5MS - fLevelToSMRdBFactor = (float) c_aiDefaultTheta48[b] / 16.0f; /* this is a bug due to a change of PERCEPTUAL_MODEL_SLGAIN_SHIFT */ -#endif fLeftEnergy = 0.0f; fRightEnergy = 0.0f; fMidEnergy = 0.0f; @@ -996,10 +943,8 @@ static int32_t MSModeCalculation( /* find the best M/S Pred type */ iMSPredType = MS_PHASE_AND_PRED; -#ifdef SPLIT_REND_LCLD_5MS iMSPredType = ( pfMSPredBitGain[MS_PRED_ONLY] > pfMSPredBitGain[iMSPredType] ? MS_PRED_ONLY : iMSPredType ); iMSPredType = ( pfMSPredBitGain[MS_PHASE_ONLY] > pfMSPredBitGain[iMSPredType] ? MS_PHASE_ONLY : iMSPredType ); -#endif /* plain M/S */ iMsInfoBits = CountMSBits( iNumBands, MS_SOME, piMSFlags, NULL, NULL ); @@ -1124,316 +1069,6 @@ static int32_t MSModeCalculation( return iNumMSBands; } -#else -static int32_t MSModeCalculation( - const int32_t iNumBlocks, - const int32_t iNumBands, - const int32_t *piBandwidths, - float ***pppfReal, - float ***pppfImag, - int32_t *piMSMode, - int32_t *piLRPhaseDiffs, - int32_t *piMSPredCoefs, - const int32_t iAllowSidePred, - int32_t *piMSFlags ) -{ - int32_t b; - int32_t iFBOffset; - int32_t iNumMSBands; - int32_t piMSPredFlags[MAX_BANDS]; - int32_t iNumMSPredBands = 0; - float msBitsReduction = 0.0f; - float msPredBitsReduction = 0.0f; - int32_t msBits; - int32_t msPredBits; - float fPred; -#if defined SIMPLE_PHASE - void( *pFuncPhaseRotateOptions[4] ) = { &rot_zero, &rot_p_pi_2, &rot_pm_pi, &rot_m_pi_2 }; -#endif - const float one_by_log10_2 = 3.32192809488736f; - - set_l( piMSPredFlags, 0, MAX_BANDS ); - *piMSMode = 0; - iFBOffset = 0; - iNumMSBands = 0; - for ( b = 0; b < iNumBands; b++ ) - { - int32_t n; - float fLeftEnergy; - float fRightEnergy; - float fMidEnergy; - float fSideEnergy; - float fLRRatio; - float fMSRatio; - float fMSPredRatio; - float fMidEnergyPred; - float fSideEnergyPred; - float fLRCovReal = 0.0f; - float fLRCovImag = 0.0f; - int32_t iPhase; - int32_t iPred; - int32_t tabIdx = 0; - - fLeftEnergy = 0.0f; - fRightEnergy = 0.0f; - fMidEnergy = 0.0; - fSideEnergy = 0.0; - - for ( n = 0; n < piBandwidths[b]; n++ ) - { - int32_t k; - for ( k = 0; k < iNumBlocks; k++ ) - { - float fMidReal; - float fMidImag; - float fSideReal; - float fSideImag; - - fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); - fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); - fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); - fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); - - fLeftEnergy += ( pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset] ); - fRightEnergy += ( pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); - fMidEnergy += ( fMidReal * fMidReal + fMidImag * fMidImag ); - fSideEnergy += ( fSideReal * fSideReal + fSideImag * fSideImag ); - - fLRCovReal += ( pppfReal[0][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); - fLRCovImag += ( pppfImag[0][k][iFBOffset] * pppfReal[1][k][iFBOffset] - pppfImag[1][k][iFBOffset] * pppfReal[0][k][iFBOffset] ); - } - - iFBOffset++; - } - - /* compute L/R phase difference if high coherence */ - if ( fLRCovReal * fLRCovReal + fLRCovImag * fLRCovImag > 0.5f * fLeftEnergy * fRightEnergy ) - { - float fPhase = (float) atan2( fLRCovImag, fLRCovReal ); // ToDo: replace by atan2f() - iPhase = quantPhase( fPhase ); - } - else - { - iPhase = 0; - } - piLRPhaseDiffs[b] = iPhase; - - /* adjust covariance based on phase rotation */ -#ifdef SIMPLE_PHASE - cplxmult( &fLRCovReal, &fLRCovImag, c_afRotRealImagSimple[iPhase][0], -c_afRotRealImagSimple[iPhase][1] ); -#else - tabIdx = iPhase - PHASE_MIN_VAL; - cplxmult( &fLRCovReal, &fLRCovImag, c_afRotRealImag[tabIdx][0], -c_afRotRealImag[tabIdx][1] ); -#endif - /* compute MS prediction coefficient based on LR covariance*/ - fMidEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy + 2.0f * fLRCovReal ); - fSideEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy - 2.0f * fLRCovReal ); - - /* M/S prediction */ - fPred = fMidEnergyPred == 0.0f ? 0.0f : 0.25f * ( fLeftEnergy - fRightEnergy ) / fMidEnergyPred; - iPred = quantPred( fPred ); - fPred = dequantPred( iPred ); - piMSPredCoefs[b] = iPred; - - /* evaluation */ - fSideEnergyPred += ( fPred * fPred * fMidEnergyPred - 2.0f * fPred * 0.25f * ( fLeftEnergy - fRightEnergy ) ); - /* -= fPred * fPred * fMidEnergyPred doesn't work because fPred is quantized and does not match MS/MM exactly */ - fMSPredRatio = log10f( ( fMidEnergyPred + 1e-12f ) / ( fSideEnergyPred + 1e-12f ) ); - - fLeftEnergy = log10f( fLeftEnergy + 1e-12f ); - fRightEnergy = log10f( fRightEnergy + 1e-12f ); - fMidEnergy = log10f( fMidEnergy + 1e-12f ); - fSideEnergy = log10f( fSideEnergy + 1e-12f ); - - if ( fLeftEnergy > fRightEnergy ) - { - fLRRatio = fLeftEnergy - fRightEnergy; - } - else - { - fLRRatio = fRightEnergy - fLeftEnergy; - } - - if ( fMidEnergy > fSideEnergy ) - { - fMSRatio = fMidEnergy - fSideEnergy; - } - else - { - fMSRatio = fSideEnergy - fMidEnergy; - } - - if ( fMSRatio > fLRRatio ) - { - iNumMSBands++; - piMSFlags[b] = 1; - } - else - { - piMSFlags[b] = 0; - } - - if ( fMSRatio > fLRRatio ) - { - float maskThresShift_dB_by_10 = ( fMSRatio - fLRRatio ) * (float) c_aiDefaultTheta48[b] / 16.0f; - msBitsReduction += (float) ( piBandwidths[b] * iNumBlocks * 2 ) * one_by_log10_2 * maskThresShift_dB_by_10; /* * 2 for real/imag */ - } - - if ( fMSPredRatio > fLRRatio ) - { - float maskThresShift_dB_by_10 = ( fMSPredRatio - fLRRatio ) * (float) c_aiDefaultTheta48[b] / 16.0f; - msPredBitsReduction += (float) ( piBandwidths[b] * iNumBlocks * 2 ) * one_by_log10_2 * maskThresShift_dB_by_10; - iNumMSPredBands++; - piMSPredFlags[b] = 1; - } - else - { - piMSPredFlags[b] = 0; - } - } - - msPredBits = CountMSBits( iNumBands, 3, piMSPredFlags, piLRPhaseDiffs, piMSPredCoefs ); - msPredBitsReduction = max( msPredBitsReduction - (float) msPredBits, 0.0f ); - msBits = CountMSBits( iNumBands, 2, piMSFlags, NULL, NULL ); - msBitsReduction = max( msBitsReduction - (float) msBits, 0.0f ); -#ifdef DEBUG_WRITE_MS_PRED - { - static FILE *fid = 0; - if ( !fid ) - { - fid = fopen( "bit_red.txt", "wt" ); - } - fprintf( fid, "%.1f %.1f %d %d\n", msBitsReduction, msPredBitsReduction, msBits, msPredBits ); - } -#endif - - if ( iAllowSidePred && msPredBitsReduction > 1.1f * msBitsReduction ) - { - *piMSMode = 3; - for ( b = 0; b < iNumBands; b++ ) - { - piMSFlags[b] = piMSPredFlags[b]; - } - iNumMSBands = iNumMSPredBands; - } - else if ( iNumMSBands == iNumBands ) - { - *piMSMode = 1; - } - else if ( iNumMSBands > 0 ) - { - *piMSMode = 2; - } - else - { - *piMSMode = 0; - } - - if ( *piMSMode > 0 ) - { - iFBOffset = 0; - for ( b = 0; b < iNumBands; b++ ) - { -#if defined SIMPLE_PHASE - void ( *pFuncPhaseRotate )( float *, float * ) = pFuncPhaseRotateOptions[piLRPhaseDiffs[b]]; -#endif - if ( piMSFlags[b] == 1 ) - { - int32_t n; - for ( n = 0; n < piBandwidths[b]; n++ ) - { - int32_t k; - for ( k = 0; k < iNumBlocks; k++ ) - { - float fMidReal; - float fMidImag; - float fSideReal; - float fSideImag; - - if ( *piMSMode == 3 ) - { -#ifdef SIMPLE_PHASE - ( *pFuncPhaseRotate )( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset] ); -#else - int32_t phaseIdx; - - phaseIdx = piLRPhaseDiffs[b] - PHASE_MIN_VAL; - cplxmult( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset], c_afRotRealImag[phaseIdx][0], c_afRotRealImag[phaseIdx][1] ); -#endif - } - - fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); - fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); - fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); - fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); - - if ( *piMSMode == 3 ) - { - fPred = dequantPred( piMSPredCoefs[b] ); - fSideReal -= fPred * fMidReal; - fSideImag -= fPred * fMidImag; - } - - pppfReal[0][k][iFBOffset] = fMidReal; - pppfReal[1][k][iFBOffset] = fSideReal; - pppfImag[0][k][iFBOffset] = fMidImag; - pppfImag[1][k][iFBOffset] = fSideImag; - } - iFBOffset++; - } - } - else - { - iFBOffset += piBandwidths[b]; - } - } - } - -#ifdef DEBUG_WRITE_MS_PRED - { - static FILE *fid = 0; - if ( !fid ) - { - fid = fopen( "ms_mode_enc_raw.txt", "wt" ); - } - writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumBands, iNumBands, fid, piMSFlags ); - } -#endif - if ( *piMSMode == 3 ) - { - /* Differential Coding of Phase Data*/ - PrepEncode( piLRPhaseDiffs, piMSFlags, iNumBands ); - PrepEncode( piMSPredCoefs, piMSFlags, iNumBands ); -#ifdef DEBUG_WRITE_MS_PRED - { - static FILE *fid = 0; - if ( !fid ) - { - fid = fopen( "ms_mode_enc.txt", "wt" ); - } - writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSBands, iNumBands, fid, piMSFlags ); - } -#endif - /* Differential Coding*/ -#ifndef SIMPLE_PHASE - EncodePhase( piLRPhaseDiffs, iNumMSBands, PHASE_DIFF_DIM ); -#endif - EncodePredCoef( piMSPredCoefs, iNumMSBands ); -#ifdef DEBUG_WRITE_MS_PRED - { - static FILE *fid = 0; - if ( !fid ) - { - fid = fopen( "ms_mode_enc_diff.txt", "wt" ); - } - writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSBands, iNumBands, fid, piMSFlags ); - } -#endif - } - - return iNumMSBands; -} -#endif static void RemoveRMSEnvelope( @@ -1473,7 +1108,6 @@ static void RemoveRMSEnvelope( return; } -#ifdef SPLIT_REND_LCLD_5MS static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, const int32_t *piGroupLengths, @@ -1585,149 +1219,6 @@ static void QuantizeSpectrumDPCM_Opt( } /* bandwidth */ } /* bands */ } -#else -static void QuantizeSpectrumDPCM_Opt( - const int32_t iNumGroups, - const int32_t *piGroupLengths, - const int32_t iNumBands, - const int32_t *piBandwidths, - int32_t **ppiAlloc, - float **ppfReal, - float **ppfImag, - int32_t **ppiQReal, - int32_t **ppiQImag, - int32_t **ppiSignReal, - int32_t **ppiSignImag, - int32_t *piPredEnable, - float *pfA1Real, - float *pfA1Imag ) /* Pass in 2 previous value buffers NULLABLE */ -{ - int32_t b, m, n, iBlockOffset; - float fVal, fPrevReal, fPrevImag, fPredReal, fPredImag; - int32_t iFBOffset; - int32_t k, iAlloc, iQuantValue, iMaxQuantVal; - float fSCFGain, fInvSCFGain; - - iFBOffset = 0; - for ( b = 0; b < iNumBands; b++ ) - { - for ( m = 0; m < piBandwidths[b]; m++ ) - { - iBlockOffset = 0; - fPrevReal = 0.0; - fPrevImag = 0.0; - for ( n = 0; n < iNumGroups; n++ ) - { - iAlloc = ppiAlloc[n][b]; - iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; - fSCFGain = c_afScaleFactor[iAlloc]; - fInvSCFGain = c_afInvScaleFactor[iAlloc]; - - if ( piPredEnable[iFBOffset] == 1 ) - { - for ( k = 0; k < piGroupLengths[n]; k++ ) - { - fPredReal = 0.0; - fPredImag = 0.0; - - fPredReal = pfA1Real[iFBOffset] * fPrevReal - pfA1Imag[iFBOffset] * fPrevImag; - fPredImag = pfA1Real[iFBOffset] * fPrevImag + pfA1Imag[iFBOffset] * fPrevReal; - - fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; - if ( fVal > 0.0 ) - { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); - ppiSignReal[iBlockOffset][iFBOffset] = 0; - } - else - { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); - ppiSignReal[iBlockOffset][iFBOffset] = 1; - } - iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; - - ppiQReal[iBlockOffset][iFBOffset] = iQuantValue; - - fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; - if ( fVal > 0.0 ) - { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); - ppiSignImag[iBlockOffset][iFBOffset] = 0; - } - else - { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); - ppiSignImag[iBlockOffset][iFBOffset] = 1; - } - - iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; - ppiQImag[iBlockOffset][iFBOffset] = iQuantValue; - - - if ( ppiSignReal[iBlockOffset][iFBOffset] == 0 ) - { - fPrevReal = fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; - } - else - { - fPrevReal = -fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; - } - if ( ppiSignImag[iBlockOffset][iFBOffset] == 0 ) - { - fPrevImag = fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; - } - else - { - fPrevImag = -fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; - } - - iBlockOffset++; - } - } - else - { - for ( k = 0; k < piGroupLengths[n]; k++ ) - { - fVal = ppfReal[iBlockOffset][iFBOffset]; - if ( fVal > 0.0 ) - { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); - ppiSignReal[iBlockOffset][iFBOffset] = 0; - } - else - { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); - ppiSignReal[iBlockOffset][iFBOffset] = 1; - } - iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; - - ppiQReal[iBlockOffset][iFBOffset] = iQuantValue; - - fVal = ppfImag[iBlockOffset][iFBOffset]; - if ( fVal > 0.0 ) - { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); - ppiSignImag[iBlockOffset][iFBOffset] = 0; - } - else - { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); - ppiSignImag[iBlockOffset][iFBOffset] = 1; - } - iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; - ppiQImag[iBlockOffset][iFBOffset] = iQuantValue; - iBlockOffset++; - } - } - } - - iFBOffset++; - } - } - - return; -} -#endif static int32_t CountLCLDBits( const int32_t iNumGroups, @@ -2220,13 +1711,7 @@ static int32_t ComputeAllocation( int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, -#ifdef SPLIT_REND_LCLD_5MS PredictionEncoder *psPredictionEncoder ) -#else - int32_t **ppiPredEnable, - float **ppfA1Real, - float **ppfA1Imag ) -#endif { int32_t iBitsUsed, iDone, iDelta; int32_t b, k, n; @@ -2260,13 +1745,11 @@ static int32_t ComputeAllocation( } } -#ifdef SPLIT_REND_LCLD_5MS if ( psPredictionEncoder->iNumSubSets > 1 ) { mvr2r( psPredictionEncoder->ppfPredStateReal[n], psPredictionEncoder->ppfPredStateRealTmp[n], LCLD_BANDS ); mvr2r( psPredictionEncoder->ppfPredStateImag[n], psPredictionEncoder->ppfPredStateImagTmp[n], LCLD_BANDS ); } -#endif QuantizeSpectrumDPCM_Opt( piNumGroups[n], (const int32_t *) ppiGroupLengths[n], @@ -2279,7 +1762,6 @@ static int32_t ComputeAllocation( pppiQImag[n], pppiSignReal[n], pppiSignImag[n], -#ifdef SPLIT_REND_LCLD_5MS psPredictionEncoder->iNumSubSets, psPredictionEncoder->iSubSetId, psPredictionEncoder->ppiPredBandEnable[n], @@ -2287,21 +1769,12 @@ static int32_t ComputeAllocation( psPredictionEncoder->ppfA1Imag[n], psPredictionEncoder->ppfPredStateRealTmp[n], psPredictionEncoder->ppfPredStateImagTmp[n] ); -#else - ppiPredEnable[n], - ppfA1Real[n], - ppfA1Imag[n] ); -#endif iBitsUsed += CountLCLDBits( piNumGroups[n], (const int32_t *) ppiGroupLengths[n], iNumBands, piBandwidths, -#ifdef SPLIT_REND_LCLD_5MS (const int32_t *) psPredictionEncoder->ppiPredBandEnable[n], -#else - (const int32_t *) ppiPredEnable[n], -#endif pppiAlloc[n], pppiQReal[n], pppiQImag[n] ); @@ -2348,7 +1821,6 @@ static int32_t ComputeAllocation( } } -#ifdef SPLIT_REND_LCLD_5MS if ( psPredictionEncoder->iNumSubSets > 1 ) { for ( n = 0; n < iChannels; n++ ) @@ -2361,7 +1833,6 @@ static int32_t ComputeAllocation( psPredictionEncoder->iSubSetId = 0; } } -#endif // printf("%d\n",*piAllocOffset); // printf("%d\t%d\t%d\n",pppiAlloc[0][0][0],pppiAlloc[0][0][1],pppiAlloc[0][0][22]); diff --git a/lib_rend/ivas_lcld_prot.h b/lib_rend/ivas_lcld_prot.h index f83ef8ae8b..6fbc250fcc 100644 --- a/lib_rend/ivas_lcld_prot.h +++ b/lib_rend/ivas_lcld_prot.h @@ -42,7 +42,6 @@ typedef struct LCLD_ENCODER LCLDEncoder; -#ifdef SPLIT_REND_LCLD_5MS ivas_error CreateLCLDEncoder( LCLDEncoder **psLCLDEncoder_out, const int32_t iSampleRate, @@ -51,14 +50,6 @@ ivas_error CreateLCLDEncoder( const int32_t iAllowSidePred, const int16_t iNumBlocks, const int16_t iNumSubSets ); -#else -ivas_error CreateLCLDEncoder( - LCLDEncoder **psLCLDEncoder, - const int32_t iSampleRate, - const int32_t iChannels, - const int32_t iTargetBitRate, - const int32_t iAllowSidePred ); -#endif void DeleteLCLDEncoder( LCLDEncoder *psLCLDEncoder @@ -79,18 +70,11 @@ int32_t GetNumGroups( typedef struct LCLD_DECODER LCLDDecoder; -#ifndef SPLIT_REND_LCLD_5MS -ivas_error CreateLCLDDecoder( - LCLDDecoder **psLCLDDecoder_out, - const int32_t iSampleRate, - const int32_t iChannels ); -#else ivas_error CreateLCLDDecoder( LCLDDecoder **psLCLDDecoder_out, const int32_t iSampleRate, const int32_t iChannels, const int32_t iNumBlocks ); -#endif void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder @@ -243,7 +227,6 @@ typedef struct PREDICTION_ENCODER int32_t iChannels; int32_t iNumBlocks; -#ifdef SPLIT_REND_LCLD_5MS int32_t iSubSetId; int32_t iNumSubSets; int32_t iMaxNumPredBands; @@ -255,7 +238,6 @@ typedef struct PREDICTION_ENCODER float **ppfPredStateImagTmp; float **ppfInpPrevReal; /* channels, bands */ float **ppfInpPrevImag; -#endif float *pfWindow; float pfRxxReal[2]; @@ -263,10 +245,6 @@ typedef struct PREDICTION_ENCODER int32_t *piPredChanEnable; int32_t *piNumPredBands; -#ifndef SPLIT_REND_LCLD_5MS - float **ppfEstPredGain; - float **ppfEstPredBitGain; -#endif int32_t **ppiPredBandEnable; float **ppfA1Real; @@ -276,7 +254,6 @@ typedef struct PREDICTION_ENCODER int32_t **ppiA1Phase; } PredictionEncoder; -#ifdef SPLIT_REND_LCLD_5MS ivas_error CreatePredictionEncoder( PredictionEncoder **psPredictionEncoder_out, const int32_t iChannels, @@ -284,31 +261,16 @@ ivas_error CreatePredictionEncoder( const int32_t iNumSubSets, const int32_t iMaxNumPredBands ); -#else -ivas_error CreatePredictionEncoder( - PredictionEncoder **psPredictionEncoder_out, - const int32_t iChannels, - const int32_t iNumBlocks -); -#endif void DeletePredictionEncoder( PredictionEncoder *psPredictionEncoder ); -#ifdef SPLIT_REND_LCLD_5MS void ComputePredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, float ***pppfImag ); -#else -int32_t ComputePredictors( - PredictionEncoder *psPredictionEncoder, - float ***pppfReal, - float ***pppfImag -); -#endif void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, @@ -325,19 +287,12 @@ typedef struct PREDICTION_DECODER { int32_t iChannels; int32_t iNumBlocks; - #ifdef SPLIT_REND_LCLD_5MS int32_t iSubSetId; int32_t iNumSubSets; float **ppfPredStateReal; float **ppfPredStateImag; - #endif int32_t *piPredChanEnable; - #ifndef SPLIT_REND_LCLD_5MS - int32_t *piNumPredBands; - - float **ppfEstPredGain; - #endif int32_t **ppiPredBandEnable; float **ppfA1Real; @@ -367,11 +322,7 @@ int32_t ReadPredictors( IVAS_SPLIT_REND_BITS_HANDLE pBits ); -#ifdef SPLIT_REND_LCLD_5MS void ApplyInversePredictors( -#else -void ApplyInversePredictros( -#endif PredictionDecoder *psPredictionDecoder, float ***pppfReal, float ***pppfImag diff --git a/lib_rend/ivas_lcld_rom_tables.c b/lib_rend/ivas_lcld_rom_tables.c index 0499ded47c..c562624ffa 100644 --- a/lib_rend/ivas_lcld_rom_tables.c +++ b/lib_rend/ivas_lcld_rom_tables.c @@ -39,14 +39,6 @@ /* clang-format off */ -#ifndef SPLIT_REND_LCLD_5MS -const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2] = { - { 1.0f, 0.0f }, /* zero */ - { 0.0f, 1.0f }, /* pi/2 */ - { -1.0f, 0.0f }, /* pi */ - { 0.0f, -1.0f }, /* 3*pi/2 */ -}; -#endif /* phi = (-12:12)'/12 *pi; tmp = [cos(phi),sin(phi)]; tmp = tmp';sprintf('{%.8ff, %.8ff},\n',tmp(:)) */ const float c_afRotRealImag[PHASE_MAX_VAL - PHASE_MIN_VAL + 1][2] = diff --git a/lib_rend/ivas_lcld_rom_tables.h b/lib_rend/ivas_lcld_rom_tables.h index 15a8e29211..8deb0aadf5 100644 --- a/lib_rend/ivas_lcld_rom_tables.h +++ b/lib_rend/ivas_lcld_rom_tables.h @@ -45,16 +45,12 @@ #define LCLD_BLOCKS_PER_FRAME ( 16 ) #define LCLD_MAX_BLOCKS_PER_FRAME ( 16 ) #define LCLD_BANDS ( 60 ) -#ifdef SPLIT_REND_LCLD_5MS #define LCLD_PRED_WIN_LEN ( 16 ) #define LCLD_MAX_NUM_PRED_SUBSETS ( 8 ) -#endif #define MAX_BANDS ( 23 ) #define MAX_BANDS_48 ( 23 ) -#ifdef SPLIT_REND_LCLD_5MS #define DEF_BANDS_48 ( 22 ) -#endif #define ENV_MIN ( -64 ) #define ENV_MAX ( 64 ) @@ -95,15 +91,6 @@ #define PHASE_DIFF_DIM ( 2 ) #define PHASE_BAND0_BITS ( 5 ) -#ifndef SPLIT_REND_LCLD_5MS -#define SIMPLE_PHASE_MAX_VAL ( 3 ) -#define SIMPLE_PHASE_MIN_VAL ( 0 ) -#define SIMPLE_PHASE_BITS ( 2 ) -#define SIMPLE_PHASE_QUANT_FACTOR ( 2.0f / _PI_ ) - -#define TON_QUOTA_ABS_THRESHOLD ( 8.0f ) -#define TON_QUOTA_INC_THRESHOLD ( 4.0f ) -#endif #define PERCEPTUAL_MODEL_SLGAIN_SHIFT ( 8 ) //#define USE_DEMOD_TABLES @@ -111,9 +98,6 @@ #define HUFF_DEC_TABLE_SIZE ( 16 ) extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; -#ifndef SPLIT_REND_LCLD_5MS -extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; -#endif extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 80b53d508d..3767a7fea2 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1466,7 +1466,6 @@ void ivas_init_split_post_rend_handles( SPLIT_POST_REND_WRAPPER *hSplitRendWrapper ); -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitBinRend, const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, @@ -1475,22 +1474,11 @@ ivas_error ivas_split_renderer_open( const int16_t pcm_out_flag, const int16_t num_subframes ); -#else -ivas_error ivas_split_renderer_open( - SPLIT_REND_WRAPPER *hSplitBinRend, - const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, - const int32_t output_Fs, - const int16_t cldfb_in_flag, - const int16_t pcm_out_flag, - const int16_t is_5ms_frame -); -#endif void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend ); -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_splitBinLCLDEncOpen( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, const int32_t iSampleRate, @@ -1499,14 +1487,6 @@ ivas_error ivas_splitBinLCLDEncOpen( const int16_t iNumBlocks, const int16_t iNumIterations ); -#else -ivas_error ivas_splitBinLCLDEncOpen( - BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, - const int32_t iSampleRate, - const int16_t iChannels, - const int32_t iDataRate -); -#endif void ivas_splitBinLCLDEncClose( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc @@ -1520,7 +1500,6 @@ void ivas_splitBinLCLDEncProcess( IVAS_SPLIT_REND_BITS_HANDLE pBits ); -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_splitBinLCLDDecOpen( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, const int32_t iSampleRate, @@ -1528,13 +1507,6 @@ ivas_error ivas_splitBinLCLDDecOpen( const int16_t iNumBlocks, const int16_t iNumIterations ); -#else -ivas_error ivas_splitBinLCLDDecOpen( - BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, - const int32_t iSampleRate, - const int16_t iChannels -); -#endif void ivas_splitBinLCLDDecClose( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec @@ -1644,7 +1616,6 @@ void ivas_splitBinRendPLCClose( SPLIT_REND_PLC_HANDLE* phSplitRendPLC ); -#ifdef SPLIT_REND_LCLD_5MS void ivas_splitBinRendPLCsaveState( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -1653,16 +1624,7 @@ void ivas_splitBinRendPLCsaveState( const int16_t iNumBlocks, const int16_t iNumIterations ); -#else -void ivas_splitBinRendPLCsaveState( - SPLIT_REND_PLC_HANDLE hSplitRendPLC, - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t num_chs -); -#endif -#ifdef SPLIT_REND_LCLD_5MS void ivas_splitBinRendPLC_xf( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -1671,16 +1633,7 @@ void ivas_splitBinRendPLC_xf( const int16_t iNumBlocks, const int16_t iNumIterations ); -#else -void ivas_splitBinRendPLC_xf( - SPLIT_REND_PLC_HANDLE hSplitRendPLC, - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t num_chs -); -#endif -#ifdef SPLIT_REND_LCLD_5MS void ivas_splitBinRendPLC( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -1689,14 +1642,6 @@ void ivas_splitBinRendPLC( const int16_t iNumBlocks, const int16_t iNumIterations ); -#else -void ivas_splitBinRendPLC( - SPLIT_REND_PLC_HANDLE hSplitRendPLC, - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t num_chs -); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG void ivas_log_cldfb2wav_data( @@ -1977,12 +1922,10 @@ int32_t ivas_split_rend_bitstream_read_int32( const int32_t bits ); -#ifdef SPLIT_REND_LCLD_5MS int32_t get_bit( const int32_t state, const int32_t bit_id ); -#endif void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend @@ -2034,7 +1977,6 @@ void ivas_split_rend_get_quant_params( int16_t *num_complex_bands ); -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_split_rend_choose_default_codec( IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ @@ -2042,14 +1984,6 @@ ivas_error ivas_split_rend_choose_default_codec( const int16_t pcm_out_flag, /* i : flag to indicate PCM output */ const int16_t num_subframes /* i : number of subframes */ ); -#else -ivas_error ivas_split_rend_choose_default_codec( - IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ - int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ - const int16_t cldfb_in_flag, /* i : flag indicating rendering in CLDFB */ - const int16_t pcm_out_flag /* i : flag to indicate PCM output */ -); -#endif #endif diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index feb11fe89b..9493d076af 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -48,19 +48,12 @@ * *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_splitBinLCLDDecOpen( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, const int32_t iSampleRate, const int16_t iChannels, const int16_t iNumBlocks, const int16_t iNumIterations ) -#else -ivas_error ivas_splitBinLCLDDecOpen( - BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, - const int32_t iSampleRate, - const int16_t iChannels ) -#endif { int16_t n; BIN_HR_SPLIT_LCLD_DEC_HANDLE splitBinLCLDDec; @@ -75,17 +68,10 @@ ivas_error ivas_splitBinLCLDDecOpen( splitBinLCLDDec->iChannels = iChannels; -#ifndef SPLIT_REND_LCLD_5MS - if ( ( error = CreateLCLDDecoder( &splitBinLCLDDec->psLCLDDecoder, iSampleRate, iChannels ) ) != IVAS_ERR_OK ) - { - return error; - } -#else if ( ( error = CreateLCLDDecoder( &splitBinLCLDDec->psLCLDDecoder, iSampleRate, iChannels, iNumBlocks ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( ( splitBinLCLDDec->pppfDecLCLDReal = (float ***) malloc( iChannels * sizeof( float ** ) ) ) == NULL ) { @@ -125,10 +111,8 @@ ivas_error ivas_splitBinLCLDDecOpen( { return error; } -#ifdef SPLIT_REND_LCLD_5MS splitBinLCLDDec->iNumBlocks = iNumBlocks; splitBinLCLDDec->iNumIterations = iNumIterations; -#endif *hSplitBinLCLDDec = splitBinLCLDDec; @@ -192,9 +176,7 @@ void ivas_splitBinLCLDDecProcess( const int16_t bfi ) { int16_t k, n; -#ifdef SPLIT_REND_LCLD_5MS int16_t itr; -#endif push_wmops( "ivas_splitBinLCLDDecProcess" ); assert( hSplitBinLCLDDec != NULL ); @@ -207,14 +189,11 @@ void ivas_splitBinLCLDDecProcess( #endif if ( !bfi ) { -#ifdef SPLIT_REND_LCLD_5MS for ( itr = 0; itr < hSplitBinLCLDDec->iNumIterations; itr++ ) { -#endif /* Initialized with zeros....... */ for ( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) { -#ifdef SPLIT_REND_LCLD_5MS for ( k = 0; k < hSplitBinLCLDDec->iNumBlocks; k++ ) { hSplitBinLCLDDec->pppfDecLCLDReal[n][k] = Cldfb_Out_Real[n][hSplitBinLCLDDec->iNumBlocks * itr + k]; @@ -222,15 +201,6 @@ void ivas_splitBinLCLDDecProcess( set_f( hSplitBinLCLDDec->pppfDecLCLDReal[n][k], 0, CLDFB_NO_CHANNELS_MAX ); set_f( hSplitBinLCLDDec->pppfDecLCLDImag[n][k], 0, CLDFB_NO_CHANNELS_MAX ); } -#else - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) - { - hSplitBinLCLDDec->pppfDecLCLDReal[n][k] = Cldfb_Out_Real[n][k]; - hSplitBinLCLDDec->pppfDecLCLDImag[n][k] = Cldfb_Out_Imag[n][k]; - set_f( hSplitBinLCLDDec->pppfDecLCLDReal[n][k], 0, CLDFB_NO_CHANNELS_MAX ); - set_f( hSplitBinLCLDDec->pppfDecLCLDImag[n][k], 0, CLDFB_NO_CHANNELS_MAX ); - } -#endif } DecodeLCLDFrame( hSplitBinLCLDDec->psLCLDDecoder, pBits, hSplitBinLCLDDec->pppfDecLCLDReal, hSplitBinLCLDDec->pppfDecLCLDImag ); @@ -257,32 +227,18 @@ void ivas_splitBinLCLDDecProcess( if ( hSplitBinLCLDDec->hSplitRendPLC->prev_bfi != 0 ) { /* cross-fade recovered frame into good frame */ -#ifdef SPLIT_REND_LCLD_5MS ivas_splitBinRendPLC_xf( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations ); -#else - ivas_splitBinRendPLC_xf( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); -#endif } -#ifdef SPLIT_REND_LCLD_5MS } -#endif } else { /* do PLC for lost split renderer frame */ -#ifdef SPLIT_REND_LCLD_5MS ivas_splitBinRendPLC( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations ); -#else - ivas_splitBinRendPLC( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); -#endif } /* save PLC state */ -#ifdef SPLIT_REND_LCLD_5MS ivas_splitBinRendPLCsaveState( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations ); -#else - ivas_splitBinRendPLCsaveState( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); -#endif pop_wmops(); diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index c18d188d1d..6903989dd1 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -47,7 +47,6 @@ * *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_splitBinLCLDEncOpen( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, const int32_t iSampleRate, @@ -55,13 +54,6 @@ ivas_error ivas_splitBinLCLDEncOpen( const int32_t iDataRate, const int16_t iNumBlocks, const int16_t iNumIterations ) -#else -ivas_error ivas_splitBinLCLDEncOpen( - BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, - const int32_t iSampleRate, - const int16_t iChannels, - const int32_t iDataRate ) -#endif { BIN_HR_SPLIT_LCLD_ENC_HANDLE splitBinLCLDEnc; ivas_error error; @@ -74,17 +66,10 @@ ivas_error ivas_splitBinLCLDEncOpen( splitBinLCLDEnc->pLcld_enc = NULL; /* place holder for CLDFB encoder handle*/ splitBinLCLDEnc->iChannels = iChannels; -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = CreateLCLDEncoder( &( splitBinLCLDEnc->psLCLDEncoder ), iSampleRate, iChannels, iDataRate, 1, iNumBlocks, (int16_t) CLDFB_NO_COL_MAX / iNumBlocks ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = CreateLCLDEncoder( &( splitBinLCLDEnc->psLCLDEncoder ), iSampleRate, iChannels, iDataRate, 1 ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( ( splitBinLCLDEnc->pppfLCLDReal = (float ***) malloc( iChannels * sizeof( float ** ) ) ) == NULL ) { @@ -107,10 +92,8 @@ ivas_error ivas_splitBinLCLDEncOpen( } } -#ifdef SPLIT_REND_LCLD_5MS splitBinLCLDEnc->iNumIterations = iNumIterations; splitBinLCLDEnc->iNumBlocks = iNumBlocks; -#endif #ifdef CLDFB_DEBUG splitBinLCLDEnc->numFrame = 0; @@ -180,11 +163,7 @@ void ivas_splitBinLCLDEncProcess( const int32_t available_bits, IVAS_SPLIT_REND_BITS_HANDLE pBits ) { -#ifdef SPLIT_REND_LCLD_5MS int32_t iBitsWritten, itr, available_bits_itr, rem_itr, available_bits_local; -#else - int32_t iBitsWritten; -#endif push_wmops( "ivas_splitBinLCLDEncProcess" ); assert( hSplitBinLCLDEnc != NULL ); @@ -192,11 +171,8 @@ void ivas_splitBinLCLDEncProcess( assert( Cldfb_In_Imag != NULL ); assert( pBits != NULL ); -#ifdef SPLIT_REND_LCLD_5MS available_bits_local = available_bits; -#endif /* A conversion is needed for the 3d pointer interface here ........ */ -#ifdef SPLIT_REND_LCLD_5MS for ( itr = 0; itr < hSplitBinLCLDEnc->iNumIterations; itr++ ) { @@ -211,40 +187,19 @@ void ivas_splitBinLCLDEncProcess( hSplitBinLCLDEnc->pppfLCLDImag[n][k] = Cldfb_In_Imag[n][hSplitBinLCLDEnc->iNumBlocks * itr + k]; } } -#else - for ( int32_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) - { - for ( int32_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) - { - hSplitBinLCLDEnc->pppfLCLDReal[n][k] = Cldfb_In_Real[n][k]; - hSplitBinLCLDEnc->pppfLCLDImag[n][k] = Cldfb_In_Imag[n][k]; - } - } -#endif #ifdef CLDFB_DEBUG int16_t readByte = 0; -#ifdef SPLIT_REND_LCLD_5MS for ( int16_t k = 0; k < hSplitBinLCLDEnc->iNumBlocks; k++ ) -#else - for ( int16_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) -#endif { for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { for ( int16_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) { -#ifdef SPLIT_REND_LCLD_5MS readByte = fread( &hSplitBinLCLDEnc->pppfLCLDReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); if ( readByte != 1 ) break; readByte = fread( &hSplitBinLCLDEnc->pppfLCLDReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); -#else - readByte = fread( &Cldfb_In_Real[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); - if ( readByte != 1 ) - break; - readByte = fread( &Cldfb_In_Imag[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); -#endif } } } @@ -256,11 +211,7 @@ void ivas_splitBinLCLDEncProcess( else { printf( "Writing zeroes...\n" ); -#ifdef SPLIT_REND_LCLD_5MS for ( int16_T k = 0; k < hSplitBinLCLDEnc->iNumBlocks; k++ ) -#else - for ( int16_T k = 0; k < CLDFB_NO_COL_MAX; k++ ) -#endif { for ( int16_t b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { @@ -273,30 +224,17 @@ void ivas_splitBinLCLDEncProcess( } } #endif -#ifdef SPLIT_REND_LCLD_5MS EncodeLCLDFrame( hSplitBinLCLDEnc->psLCLDEncoder, hSplitBinLCLDEnc->pppfLCLDReal, hSplitBinLCLDEnc->pppfLCLDImag, &iBitsWritten, available_bits_itr, pBits ); -#else - EncodeLCLDFrame( hSplitBinLCLDEnc->psLCLDEncoder, hSplitBinLCLDEnc->pppfLCLDReal, hSplitBinLCLDEnc->pppfLCLDImag, &iBitsWritten, available_bits, pBits ); -#endif -#ifdef SPLIT_REND_LCLD_5MS available_bits_local -= iBitsWritten; #ifdef DEBUGGING assert( available_bits_local >= 0 ); #endif -#else -#ifdef DEBUGGING - if ( iBitsWritten > available_bits ) - assert( iBitsWritten <= available_bits ); -#endif -#endif #ifdef CLDFB_DEBUG printf( "Bits written = %d\n", iBitsWritten ); #endif -#ifdef SPLIT_REND_LCLD_5MS } -#endif pop_wmops(); return; diff --git a/lib_rend/ivas_splitRendererPLC.c b/lib_rend/ivas_splitRendererPLC.c index 197be5a394..114233fcf6 100644 --- a/lib_rend/ivas_splitRendererPLC.c +++ b/lib_rend/ivas_splitRendererPLC.c @@ -74,10 +74,8 @@ static void adaptive_polar_ext_plc( float xf_alp[CLDFB_PLC_XF], float xf_bet[CLDFB_PLC_XF] #endif -#ifdef SPLIT_REND_LCLD_5MS , const int16_t iNumCols -#endif ) { float uth[CLDFB_NO_COL_MAX], uthu[CLDFB_NO_COL_MAX], urh[CLDFB_NO_COL_MAX]; @@ -86,10 +84,6 @@ static void adaptive_polar_ext_plc( float start_real, start_imag, abs_fac, abs_fac_powj, comp_fac, fac_powj_real, fac_powj_imag, temp, abs2inv; float fac_ph_real, fac_ph_imag, rat_real, rat_imag, abs_temp; int32_t k, j; -#ifndef SPLIT_REND_LCLD_5MS - int16_t iNumCols; - iNumCols = CLDFB_NO_COL_MAX; -#endif /* reset of accumulators */ ph_adj = 0.0f; @@ -409,7 +403,6 @@ void ivas_splitBinRendPLCClose( * *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS void ivas_splitBinRendPLCsaveState( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -417,22 +410,11 @@ void ivas_splitBinRendPLCsaveState( const int16_t num_chs, const int16_t iNumBlocks, const int16_t iNumIterations ) -#else -void ivas_splitBinRendPLCsaveState( - SPLIT_REND_PLC_HANDLE hSplitRendPLC, - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t num_chs ) -#endif { int16_t k, n; /* Save Cldfb frame */ -#ifdef SPLIT_REND_LCLD_5MS for ( k = 0; k < ( iNumBlocks * iNumIterations ); k++ ) -#else - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) -#endif { for ( n = 0; n < num_chs; n++ ) { @@ -451,7 +433,6 @@ void ivas_splitBinRendPLCsaveState( * Cross-fade of preceding bad frame into good frame *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS void ivas_splitBinRendPLC_xf( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -459,13 +440,6 @@ void ivas_splitBinRendPLC_xf( const int16_t num_chs, const int16_t iNumBlocks, const int16_t iNumIterations ) -#else -void ivas_splitBinRendPLC_xf( - SPLIT_REND_PLC_HANDLE hSplitRendPLC, - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t num_chs ) -#endif { int16_t n, i, k; @@ -484,13 +458,8 @@ void ivas_splitBinRendPLC_xf( #if CLDFB_PLC_XF > 0 for ( k = 0; k < CLDFB_PLC_XF; k++ ) { -#ifdef SPLIT_REND_LCLD_5MS Cldfb_RealBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_RealBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k + ( iNumBlocks * iNumIterations )][i]; Cldfb_ImagBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_ImagBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k + ( iNumBlocks * iNumIterations )][i]; -#else - Cldfb_RealBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_RealBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k + CLDFB_NO_COL_MAX][i]; - Cldfb_ImagBuffer_Binaural[n][k][i] = hSplitRendPLC->CldfbPLC_state.xf_bet[n][i][k] * Cldfb_ImagBuffer_Binaural[n][k][i] + hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k + CLDFB_NO_COL_MAX][i]; -#endif } #endif } @@ -506,7 +475,6 @@ void ivas_splitBinRendPLC_xf( * Conceal bad frame *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS void ivas_splitBinRendPLC( SPLIT_REND_PLC_HANDLE hSplitRendPLC, float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -514,13 +482,6 @@ void ivas_splitBinRendPLC( const int16_t num_chs, const int16_t iNumBlocks, const int16_t iNumIterations ) -#else -void ivas_splitBinRendPLC( - SPLIT_REND_PLC_HANDLE hSplitRendPLC, - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t num_chs ) -#endif { int32_t i, n, k; float fade_fac; @@ -528,11 +489,9 @@ void ivas_splitBinRendPLC( #if CLDFB_PLC_XF > 0 float xf_alp[CLDFB_PLC_XF]; #endif -#ifdef SPLIT_REND_LCLD_5MS int16_t iNumCols, fade_start_cntr, mute_cntr, fade_val; iNumCols = iNumBlocks * iNumIterations; -#endif /* Indicate that next transition will be from a bad frame */ hSplitRendPLC->prev_bfi = 1; @@ -549,11 +508,7 @@ void ivas_splitBinRendPLC( { for ( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) { -#ifdef SPLIT_REND_LCLD_5MS for ( k = 0; k < iNumCols; k++ ) -#else - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) -#endif { prev_real[k] = hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k][i]; prev_imag[k] = hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k][i]; @@ -564,17 +519,11 @@ void ivas_splitBinRendPLC( , xf_alp, hSplitRendPLC->CldfbPLC_state.xf_bet[n][i] #endif -#ifdef SPLIT_REND_LCLD_5MS , iNumCols -#endif ); -#ifdef SPLIT_REND_LCLD_5MS for ( k = 0; k < iNumCols; k++ ) -#else - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) -#endif { Cldfb_RealBuffer_Binaural[n][k][i] = rec_real[k]; hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k][i] = rec_real[k]; @@ -583,11 +532,7 @@ void ivas_splitBinRendPLC( } #if CLDFB_PLC_XF > 0 -#ifdef SPLIT_REND_LCLD_5MS for ( k = iNumCols; k < iNumCols + CLDFB_PLC_XF; k++ ) -#else - for ( k = CLDFB_NO_COL_MAX; k < CLDFB_NO_COL_MAX + CLDFB_PLC_XF; k++ ) -#endif { hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinReal[n][k][i] = rec_real[k]; hSplitRendPLC->CldfbPLC_state.Cldfb_Prev_BinImag[n][k][i] = rec_imag[k]; @@ -598,7 +543,6 @@ void ivas_splitBinRendPLC( /* Check bf counter */ -#ifdef SPLIT_REND_LCLD_5MS fade_start_cntr = SR_PLC_FADE_START * CLDFB_NO_COL_MAX / iNumCols; mute_cntr = SR_PLC_MUTE * CLDFB_NO_COL_MAX / iNumCols; @@ -631,23 +575,6 @@ void ivas_splitBinRendPLC( hSplitRendPLC->bf_count = mute_cntr; } } -#else - if ( hSplitRendPLC->bf_count++ >= SR_PLC_FADE_START ) - { - if ( hSplitRendPLC->bf_count < SR_PLC_MUTE ) - { - fade_fac = powf( 10, ( hSplitRendPLC->bf_count - SR_PLC_FADE_START ) * SR_PLC_FADE_DEGREE / 20.0f ); - v_multc( &Cldfb_RealBuffer_Binaural[0][0][0], fade_fac, &Cldfb_RealBuffer_Binaural[0][0][0], (int16_t) ( (CLDFB_NO_COL_MAX) *num_chs * CLDFB_NO_CHANNELS_MAX ) ); - v_multc( &Cldfb_ImagBuffer_Binaural[0][0][0], fade_fac, &Cldfb_ImagBuffer_Binaural[0][0][0], (int16_t) ( (CLDFB_NO_COL_MAX) *num_chs * CLDFB_NO_CHANNELS_MAX ) ); - } - else - { - set_zero( &Cldfb_RealBuffer_Binaural[0][0][0], (int16_t) ( (CLDFB_NO_COL_MAX) *num_chs * CLDFB_NO_CHANNELS_MAX ) ); - set_zero( &Cldfb_ImagBuffer_Binaural[0][0][0], (int16_t) ( (CLDFB_NO_COL_MAX) *num_chs * CLDFB_NO_CHANNELS_MAX ) ); - hSplitRendPLC->bf_count = SR_PLC_MUTE; - } - } -#endif return; } diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 3a4172020e..002229d8b8 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -1289,15 +1289,6 @@ static void interpolate_rend_md( gd2 = rot_md[idx2 - 1][sf_idx][band_idx].gd; gd4 = rot_md[idx2 - 1][sf_idx][band_idx].gd2; } -#if 0 - diff = gd1 / gd2; - pitch_gain_l = gd2 * powf( diff, 1.0f - interp_pitch_fact ); - pitch_gain_l = max( 0.0f, pitch_gain_l ); - - diff = gd3 / gd4; - pitch_gain_r = gd4 * powf( diff, 1.0f - interp_pitch_fact ); - pitch_gain_r = max( 0.0f, pitch_gain_r ); -#else diff = gd1 - gd2; pitch_gain_l = gd1 - ( diff * interp_pitch_fact ); pitch_gain_l = max( 0.0f, pitch_gain_l ); @@ -1305,7 +1296,6 @@ static void interpolate_rend_md( diff = gd3 - gd4; pitch_gain_r = gd3 - ( diff * interp_pitch_fact ); pitch_gain_r = max( 0.0f, pitch_gain_r ); -#endif for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index b9dd7e9a7a..25bc04dfb5 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -640,69 +640,9 @@ static void ComputeCoeffs( } } -#if 0 - if ( 1 ) - { -#endif gd2 = 0.0f; sigma_d = 0.0f; hMd->gd = 0.0f; -#if 0 - } - else - { - - sigma_d = cov_ii_norm_re[0][0] + cov_ii_norm_re[1][1] + cov_ii_norm_re[0][1] + cov_ii_norm_re[1][0] + EPSILON; - - rho_hat = max( EPSILON, sqrtf( postpred_cov_re[0][0] * postpred_cov_re[1][1] ) ); - rho_hat = postpred_cov_re[0][1] / rho_hat; - rho = max( EPSILON, sqrtf( cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1] ) ); - rho = cov_oo_norm_re[0][1] / rho; - rho_hat = min( max( rho_hat, -0.9999f ), 0.9999f ); - rho = min( max( rho, -0.9999f ), 0.9999f ); - - // Compute decorrelator gain : gd2 = 0; - gd = 0; - gd2 = 0; - - aa = ( sigma_d * sigma_d ) * ( ( rho_hat * rho_hat ) - 1 ) + EPSILON; - bb = -( rho_hat * rho_hat ) * sigma_d * ( cov_oo_norm_re[0][0] + cov_oo_norm_re[1][1] ); - cc = ( rho_hat * rho_hat ) * cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1]; - cc -= cov_oo_norm_re[0][1] * cov_oo_norm_re[0][1]; - - sign = +1.0f; - if ( rho < ( rho_hat - 0.0001 ) ) - { - bb -= 2 * sigma_d * cov_oo_norm_re[0][1]; - sign = -1.0f; - } - else if ( rho > ( rho_hat + 0.0001 ) ) - { - bb += 2 * sigma_d * cov_oo_norm_re[0][1]; - } - dd = bb * bb - ( 4 * aa * cc ); - if ( dd >= 0 ) - { - float gd2_1, gd2_2; - gd2_1 = ( -bb + sqrtf( dd ) ) / ( 2 * aa ); - gd2_2 = ( -bb - sqrtf( dd ) ) / ( 2 * aa ); - if ( ( gd2_1 >= 0 ) && ( gd2_2 >= 0 ) ) - { - gd2 = min( gd2_1, gd2_2 ); - } - else - { - gd2 = max( 0, max( gd2_1, gd2_2 ) ); - } - gd = sign * sqrtf( gd2 ); - } - - gd = min( IVAS_SPLIT_REND_D_MAX_VAL, max( gd, IVAS_SPLIT_REND_D_MIN_VAL ) ); - hMd->gd = SPLIT_REND_DECOR_ALPHA * gd + ( 1 - SPLIT_REND_DECOR_ALPHA ) * hMd->gd; - gd2 = min( gd2, cov_oo_norm_re[0][0] / sigma_d ); - gd2 = min( gd2, cov_oo_norm_re[1][1] / sigma_d ); - } -#endif /* 0 */ if ( postpred_cov_re[0][0] > EPSILON ) { @@ -1457,17 +1397,6 @@ void ivas_rend_CldfbSplitPreRendProcess( QuaternionsPost[sf_idx].z = 0.0f; } -#if 0 - read_off = pBits->bits_read; - write_off = pBits->bits_written; - ivas_splitBinPostRendMdDec( - pBits, - hBinHrSplitPreRend->hBinHrSplitPostRend, - pMultiBinPoseData ); - pMultiBinPoseData->poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; - pBits->bits_read = read_off; - pBits->bits_written = write_off; -#else hBinHrSplitPreRend->hBinHrSplitPostRend->low_Res = 1; set_fix_rotation_mat( hBinHrSplitPreRend->hBinHrSplitPostRend->fix_pos_rot_mat, pMultiBinPoseData ); set_pose_types( hBinHrSplitPreRend->hBinHrSplitPostRend->pose_type, pMultiBinPoseData ); @@ -1486,7 +1415,6 @@ void ivas_rend_CldfbSplitPreRendProcess( for ( b = 0; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { hBinHrSplitPreRend->hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b] = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; -#if 1 BIN_HR_SPLIT_REND_MD_HANDLE hMd; hMd = &hBinHrSplitPreRend->hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; minv = -1.4f; @@ -1523,12 +1451,10 @@ void ivas_rend_CldfbSplitPreRendProcess( hMd->pred_mat_im[ch1][ch2] = quant_val * step; } } -#endif } } } -#endif for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) { mvr2r( (float *) Cldfb_In_BinReal[0][sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES], (float *) Cldfb_RealBuffer_Binaural_5ms[0], MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX ); @@ -1795,39 +1721,18 @@ void ivas_init_split_rend_handles( * *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS static ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const int32_t OutSampleRate, const int16_t num_subframes ) -#else -static ivas_error split_renderer_open_lc3plus( - SPLIT_REND_WRAPPER *hSplitRendWrapper, - const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, - const int32_t OutSampleRate, - const int16_t is_5ms_frame ) -#endif { ivas_error error; int16_t i, delayBufferLength; LC3PLUS_CONFIG config; -#ifdef SPLIT_REND_LCLD_5MS config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000; config.ivas_frame_duration_us = ( pSplitRendConfig->dof == 0 ) ? config.lc3plus_frame_duration_us * num_subframes : 20000; -#else - if ( is_5ms_frame ) - { - config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000; - config.ivas_frame_duration_us = ( pSplitRendConfig->dof == 0 ) ? config.lc3plus_frame_duration_us : 20000; - } - else - { - config.lc3plus_frame_duration_us = 5000; - config.ivas_frame_duration_us = 20000; - } -#endif config.samplerate = OutSampleRate; config.channels = BINAURAL_CHANNELS; @@ -1885,7 +1790,6 @@ static ivas_error split_renderer_open_lc3plus( * *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, @@ -1893,15 +1797,6 @@ ivas_error ivas_split_renderer_open( const int16_t cldfb_in_flag, const int16_t pcm_out_flag, const int16_t num_subframes ) -#else -ivas_error ivas_split_renderer_open( - SPLIT_REND_WRAPPER *hSplitRendWrapper, - const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, - const int32_t OutSampleRate, - const int16_t cldfb_in_flag, - const int16_t pcm_out_flag, - const int16_t is_5ms_frame ) -#endif { ivas_error error, ch, num_ch; #ifndef SPLIT_REND_WITH_HEAD_ROT @@ -2008,21 +1903,13 @@ ivas_error ivas_split_renderer_open( { if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ) { -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, num_subframes ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, is_5ms_frame ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } else { -#ifdef SPLIT_REND_LCLD_5MS int16_t iNumBlocksPerFrame; iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; @@ -2030,12 +1917,6 @@ ivas_error ivas_split_renderer_open( { return error; } -#else - if ( ( error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ) ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } } @@ -2195,9 +2076,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( uint8_t useLc3plus; float *in_delayed[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; int16_t i; -#ifdef SPLIT_REND_LCLD_5MS int32_t num_slots; -#endif push_wmops( "ivas_renderMultiTDBinToSplitBinaural" ); @@ -2230,14 +2109,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( actual_md_bits = pBits->bits_written; if ( ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) || ( !useLc3plus && !pcm_out_flag ) ) { -#ifndef SPLIT_REND_LCLD_5MS - if ( !useLc3plus && codec_frame_size_ms != 20 && !pcm_out_flag ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_INPUT_BUFFER_SIZE, "Unsupported framing for LCLD codec!" ); - } -#else num_slots = ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) ? CLDFB_NO_COL_MAX : ( hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ); -#endif num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; /* CLDFB Analysis*/ @@ -2261,11 +2133,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( #endif for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { -#ifdef SPLIT_REND_LCLD_5MS for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) -#else - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) -#endif { cldfbAnalysis_ts( &( in_delayed[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), Cldfb_In_BinReal[pos_idx * BINAURAL_CHANNELS + ch][slot_idx], Cldfb_In_BinImag[pos_idx * BINAURAL_CHANNELS + ch][slot_idx], @@ -2291,17 +2159,10 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( if ( !useLc3plus ) { -#ifdef SPLIT_REND_LCLD_5MS available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); actual_md_bits = pBits->bits_written - actual_md_bits; available_bits -= actual_md_bits; pBits->codec_frame_size_ms = codec_frame_size_ms; -#else - available_bits = SplitRendBitRate * L_FRAME48k / 48000; - actual_md_bits = pBits->bits_written - actual_md_bits; - available_bits -= actual_md_bits; - pBits->codec_frame_size_ms = 20; -#endif ivas_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits ); } @@ -2328,11 +2189,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( { if ( !useLc3plus ) { -#ifdef SPLIT_REND_LCLD_5MS bit_len = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); -#else - bit_len = SplitRendBitRate / FRAMES_PER_SEC; -#endif } else { @@ -2451,17 +2308,10 @@ ivas_error ivas_renderMultiBinToSplitBinaural( /* Needs to be done at runtime. If this was in another API function, * there would be no guarantee that the user did not change * the split rendering config before calling the main rendering function */ -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = ivas_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, 0 ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, cldfb_in_flag, pcm_out_flag ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( cldfb_in_flag == 0 ) @@ -2497,38 +2347,24 @@ ivas_error ivas_renderMultiBinToSplitBinaural( if ( splitCodec == IVAS_SPLIT_REND_CODEC_LCLD ) { -#ifdef SPLIT_REND_LCLD_5MS available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); actual_md_bits = pBits->bits_written - actual_md_bits; available_bits -= actual_md_bits; pBits->codec_frame_size_ms = codec_frame_size_ms; -#else - available_bits = SplitRendBitRate * L_FRAME48k / 48000; - actual_md_bits = pBits->bits_written - actual_md_bits; - available_bits -= actual_md_bits; -#endif ivas_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits ); } else { -#ifdef SPLIT_REND_LCLD_5MS int16_t ch, slot_idx, num_slots, ivas_fs; ivas_fs = (int16_t) hSplitBin->hLc3plusEnc->config.ivas_frame_duration_us / 1000; num_slots = (int16_t) ( CLDFB_NO_COL_MAX * ivas_fs ) / 20; -#else - int16_t ch, slot_idx; -#endif /* CLDFB synthesis of main pose */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX]; float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX]; -#ifdef SPLIT_REND_LCLD_5MS for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) -#else - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) -#endif { Cldfb_In_BinReal_p[slot_idx] = Cldfb_In_BinReal[ch][slot_idx]; Cldfb_In_BinImag_p[slot_idx] = Cldfb_In_BinImag[ch][slot_idx]; @@ -2536,11 +2372,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( #ifndef SPLIT_REND_WITH_HEAD_ROT cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels * CLDFB_NO_COL_MAX, hSplitBin->hCldfbHandles->cldfbAna[ch] ); #else -#ifdef SPLIT_REND_LCLD_5MS cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); -#else - cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * CLDFB_NO_COL_MAX, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); -#endif #endif } @@ -2585,11 +2417,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( { if ( splitCodec == IVAS_SPLIT_REND_CODEC_LCLD ) { -#ifdef SPLIT_REND_LCLD_5MS bit_len = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); -#else - bit_len = SplitRendBitRate / FRAMES_PER_SEC; -#endif } else { diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index c330a63f88..da9ba62801 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -724,11 +724,7 @@ ivas_error ivas_split_rend_validate_config( if ( pSplitRendConfig->codec_frame_size_ms != 0 ) /* 0 means "default for current codec", will be set to actual value at a later stage */ { -#ifdef SPLIT_REND_LCLD_5MS if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD && pSplitRendConfig->codec_frame_size_ms != 5 && pSplitRendConfig->codec_frame_size_ms != 10 && pSplitRendConfig->codec_frame_size_ms != 20 ) -#else - if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD && pSplitRendConfig->codec_frame_size_ms != 20 ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Invalid framing for LCLD codec" ); } @@ -1053,7 +1049,6 @@ void ivas_init_multi_bin_pose_data( * *------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_LCLD_5MS ivas_error ivas_split_rend_choose_default_codec( IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ @@ -1061,14 +1056,6 @@ ivas_error ivas_split_rend_choose_default_codec( const int16_t pcm_out_flag, /* i : flag to indicate PCM output */ const int16_t num_subframes /* i : number of subframes */ ) -#else -ivas_error ivas_split_rend_choose_default_codec( - IVAS_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ - int16_t *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ - const int16_t cldfb_in_flag, /* i : flag indicating rendering in TD */ - const int16_t pcm_out_flag /* i : flag to indicate PCM output */ -) -#endif { if ( pcm_out_flag == 0 ) { @@ -1087,11 +1074,7 @@ ivas_error ivas_split_rend_choose_default_codec( switch ( *pCodec ) { case IVAS_SPLIT_REND_CODEC_LCLD: -#ifdef SPLIT_REND_LCLD_5MS *pCodec_frame_size_ms = num_subframes * 5; -#else - *pCodec_frame_size_ms = 20; -#endif break; case IVAS_SPLIT_REND_CODEC_LC3PLUS: case IVAS_SPLIT_REND_CODEC_NONE: @@ -1106,7 +1089,6 @@ ivas_error ivas_split_rend_choose_default_codec( } #endif -#ifdef SPLIT_REND_LCLD_5MS /*-------------------------------------------------------------------* * Function get_bit() * @@ -1119,4 +1101,3 @@ int32_t get_bit( { return ( state & ( 1 << bit_id ) ); } -#endif diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index d5701c81f6..516d6a7ee2 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1455,10 +1455,8 @@ typedef struct ivas_binaural_head_rot_split_rendering_lcld_enc_struct FILE *cldfbIn; int16_t numFrame; #endif -#ifdef SPLIT_REND_LCLD_5MS int16_t iNumIterations; int16_t iNumBlocks; -#endif } BIN_HR_SPLIT_LCLD_ENC, *BIN_HR_SPLIT_LCLD_ENC_HANDLE; @@ -1492,10 +1490,8 @@ typedef struct ivas_binaural_head_rot_split_rendering_lcld_dec_struct int16_t numFrame; #endif SPLIT_REND_PLC_HANDLE hSplitRendPLC; -#ifdef SPLIT_REND_LCLD_5MS int16_t iNumBlocks; int16_t iNumIterations; -#endif } BIN_HR_SPLIT_LCLD_DEC, *BIN_HR_SPLIT_LCLD_DEC_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index fec022e19f..cef7480443 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3041,7 +3041,6 @@ static void clearInputMasa( } #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef SPLIT_REND_LCLD_5MS static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer, @@ -3051,17 +3050,6 @@ static ivas_error initSplitRend( const AUDIO_CONFIG outConfig, const int16_t cldfb_in_flag, const int16_t num_subframes ) -#else -static ivas_error initSplitRend( - SPLIT_REND_WRAPPER *pSplitRendWrapper, - IVAS_REND_AudioBuffer *pSplitRendEncBuffer, - const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, - IVAS_REND_HeadRotData headRotData, - const int32_t outputSampleRate, - const AUDIO_CONFIG outConfig, - const int16_t cldfb_in_flag, - const int16_t is_5ms_frame ) -#endif { ivas_error error; IVAS_REND_AudioBufferConfig bufConfig; @@ -3077,17 +3065,10 @@ static ivas_error initSplitRend( ivas_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData ); } -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, num_subframes ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, is_5ms_frame ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /*allocate for CLDFB in and change to TD during process if needed*/ bufConfig.numSamplesPerChannel = MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL; @@ -3811,7 +3792,6 @@ ivas_error IVAS_REND_AddInput( int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, getAudioConfigType( inConfig ) ); -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) { return error; @@ -3821,17 +3801,6 @@ ivas_error IVAS_REND_AddInput( { return error; } -#else - if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } #endif @@ -4308,12 +4277,10 @@ ivas_error IVAS_REND_GetDelay( { latency_ns += IVAS_FB_DEC_DELAY_NS; } -#ifdef SPLIT_REND_LCLD_5MS else if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hSplitBinLCLDDec != NULL ) { latency_ns += IVAS_FB_DEC_DELAY_NS; } -#endif max_latency_ns = max( max_latency_ns, latency_ns ); } } @@ -4705,7 +4672,6 @@ int16_t IVAS_REND_FeedRenderConfig( cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) { return error; @@ -4715,17 +4681,6 @@ int16_t IVAS_REND_FeedRenderConfig( { return error; } -#else - if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } #endif @@ -6903,10 +6858,8 @@ static ivas_error renderSplitBinauralWithPostRot( int16_t outBufNumSamplesPerChannel, outBufNumColPerChannel; int16_t numSamplesPerChannelCacheSize, numColPerChannelCacheSize; float *readPtr, *writePtr; -#ifdef SPLIT_REND_LCLD_5MS LC3PLUS_CONFIG config; int16_t iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; -#endif isPostRendInputCldfb = 0; push_wmops( "renderSplitBinauralWithPostRot" ); @@ -6916,7 +6869,6 @@ static ivas_error renderSplitBinauralWithPostRot( hSplitBin = &splitBinInput->splitPostRendWrapper; convertBitsBufferToInternalBitsBuff( *splitBinInput->hBits, &bits ); -#ifdef SPLIT_REND_LCLD_5MS config.lc3plus_frame_duration_us = bits.codec_frame_size_ms * 1000; if ( pCombinedOrientationData->num_subframes != MAX_PARAM_SPATIAL_SUBFRAMES ) { @@ -6949,41 +6901,16 @@ static ivas_error renderSplitBinauralWithPostRot( config.channels = BINAURAL_CHANNELS; config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; -#endif if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD && splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec == NULL ) { -#ifdef SPLIT_REND_LCLD_5MS if ( ( error = ivas_splitBinLCLDDecOpen( &splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec, *splitBinInput->base.ctx.pOutSampleRate, BINAURAL_CHANNELS, iNumBlocksPerFrame, iNumLCLDIterationsPerFrame ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_splitBinLCLDDecOpen( &splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec, *splitBinInput->base.ctx.pOutSampleRate, BINAURAL_CHANNELS ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } else if ( bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && splitBinInput->splitPostRendWrapper.hLc3plusDec == NULL ) { -#ifndef SPLIT_REND_LCLD_5MS - LC3PLUS_CONFIG config; - - if ( outAudio.config.numSamplesPerChannel == 240 ) - { - config.lc3plus_frame_duration_us = bits.codec_frame_size_ms * 1000; - config.ivas_frame_duration_us = ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ? config.lc3plus_frame_duration_us : 20000; - } - else - { - config.lc3plus_frame_duration_us = 5000; - config.ivas_frame_duration_us = 20000; - } - config.channels = BINAURAL_CHANNELS; - config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; - -#endif if ( ( error = IVAS_LC3PLUS_DEC_Open( config, &splitBinInput->splitPostRendWrapper.hLc3plusDec ) ) != IVAS_ERR_OK ) { @@ -7027,20 +6954,12 @@ static ivas_error renderSplitBinauralWithPostRot( { isPostRendInputCldfb = 1; } -#ifdef SPLIT_REND_LCLD_5MS preRendFrameSize_ms = (int16_t) ( config.ivas_frame_duration_us ) / 1000; -#else - preRendFrameSize_ms = bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ? (int16_t) ( hSplitBin->hLc3plusDec->config.ivas_frame_duration_us ) / 1000 : 20; -#endif numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * ( preRendFrameSize_ms - bits.codec_frame_size_ms ) / 1000 ); outBufNumColPerChannel = MAX_PARAM_SPATIAL_SUBFRAMES; -#ifdef SPLIT_REND_LCLD_5MS numColPerChannelCacheSize = ( iNumBlocksPerFrame * iNumLCLDIterationsPerFrame ) - outBufNumColPerChannel; -#else - numColPerChannelCacheSize = CLDFB_NO_COL_MAX - outBufNumColPerChannel; -#endif for ( sf_idx = 0; sf_idx < pCombinedOrientationData->num_subframes; sf_idx++ ) { @@ -7063,11 +6982,7 @@ static ivas_error renderSplitBinauralWithPostRot( /* cache the remaining 15ms */ splitBinInput->numCachedSamples = numColPerChannelCacheSize; writePtr = splitBinInput->bufferData; -#ifdef SPLIT_REND_LCLD_5MS for ( slotIdx = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slotIdx < ( iNumBlocksPerFrame * iNumLCLDIterationsPerFrame ); ++slotIdx ) -#else - for ( slotIdx = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx ) -#endif { for ( chnlIdx = 0; chnlIdx < BINAURAL_CHANNELS; ++chnlIdx ) { @@ -7135,7 +7050,6 @@ static ivas_error renderSplitBinauralWithPostRot( else { copyBufferTo2dArray( splitBinInput->base.inputBuffer, tmpCrendBuffer ); -#ifdef SPLIT_REND_LCLD_5MS if ( splitBinInput->numCachedSamples == 0 ) { preRendFrameSize_ms = (int16_t) ( config.ivas_frame_duration_us ) / 1000; @@ -7147,7 +7061,6 @@ static ivas_error renderSplitBinauralWithPostRot( { splitBinInput->numCachedSamples -= outAudio.config.numSamplesPerChannel; } -#endif } /* apply pose correction if enabled */ @@ -8512,18 +8425,10 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); hIvasRend->splitRendEncBuffer.config.is_cldfb = cldfb_in_flag; -#ifdef SPLIT_REND_LCLD_5MS if ( hIvasRend->hRendererConfig->split_rend_config.dof == 0 || hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { hIvasRend->splitRendEncBuffer.config.numSamplesPerChannel = outAudio.config.numSamplesPerChannel; } -#else - if ( hIvasRend->hRendererConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && - ( hIvasRend->hRendererConfig->split_rend_config.dof == 0 || hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) - { - hIvasRend->splitRendEncBuffer.config.numSamplesPerChannel = hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms * hIvasRend->num_subframes * (int16_t) ( hIvasRend->sampleRateOut / 1000 ); - } -#endif else { hIvasRend->splitRendEncBuffer.config.numSamplesPerChannel = (int16_t) ( hIvasRend->sampleRateOut / FRAMES_PER_SEC ); -- GitLab From a30bba1b80f8ce4c8494756e65306398e5ecc9f7 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 27 Feb 2024 17:06:48 +1100 Subject: [PATCH 456/498] clang fixes --- lib_dec/lib_dec.c | 2 +- lib_rend/ivas_RMSEnvGrouping.c | 4 ++-- lib_rend/ivas_splitRendererPLC.c | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index fad1c0b53e..d06e882f4d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1118,7 +1118,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( return error; } -/* change buffer layout */ + /* change buffer layout */ for ( i = 0; i < numSamplesPerChannelToDecode; ++i ) { for ( j = 0; j < BINAURAL_CHANNELS * numPoses; ++j ) diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index f19f86d1ee..b67b8c1f75 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -698,8 +698,8 @@ void ComputeEnvelopeGrouping( psRMSEnvelopeGrouping->psGMNodes[n].psNext = NULL; } -/* Perform grouping via Greedy Merge */ -/* Allows control over max groups can call using 16 if want same as previous call */ + /* Perform grouping via Greedy Merge */ + /* Allows control over max groups can call using 16 if want same as previous call */ ComputeGreedyGroups3( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths, psRMSEnvelopeGrouping->iNumBlocks ); /* Calc Groups from Merge Results */ diff --git a/lib_rend/ivas_splitRendererPLC.c b/lib_rend/ivas_splitRendererPLC.c index 114233fcf6..299430f28e 100644 --- a/lib_rend/ivas_splitRendererPLC.c +++ b/lib_rend/ivas_splitRendererPLC.c @@ -75,8 +75,7 @@ static void adaptive_polar_ext_plc( float xf_bet[CLDFB_PLC_XF] #endif , - const int16_t iNumCols -) + const int16_t iNumCols ) { float uth[CLDFB_NO_COL_MAX], uthu[CLDFB_NO_COL_MAX], urh[CLDFB_NO_COL_MAX]; float ph_adj, ph_diff, ph_adj_t, quot, drho, srho, diff, dth, sth, fac_real, fac_imag; @@ -413,7 +412,7 @@ void ivas_splitBinRendPLCsaveState( { int16_t k, n; -/* Save Cldfb frame */ + /* Save Cldfb frame */ for ( k = 0; k < ( iNumBlocks * iNumIterations ); k++ ) { for ( n = 0; n < num_chs; n++ ) @@ -520,8 +519,7 @@ void ivas_splitBinRendPLC( xf_alp, hSplitRendPLC->CldfbPLC_state.xf_bet[n][i] #endif , - iNumCols - ); + iNumCols ); for ( k = 0; k < iNumCols; k++ ) { @@ -542,7 +540,7 @@ void ivas_splitBinRendPLC( } -/* Check bf counter */ + /* Check bf counter */ fade_start_cntr = SR_PLC_FADE_START * CLDFB_NO_COL_MAX / iNumCols; mute_cntr = SR_PLC_MUTE * CLDFB_NO_COL_MAX / iNumCols; -- GitLab From 006bb8f647a131962b8ab849ddd447e22a8a077c Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 27 Feb 2024 11:45:08 +0100 Subject: [PATCH 457/498] remove explicit 5ms test cases from self_test.prm --- scripts/config/self_test.prm | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 4d7d53e22e..339f7e50a5 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -685,10 +685,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit ../IVAS_dec 5_1_2 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_5_1_2.tst -// SBA at 48 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_binaural_ht_fr5.tst - // SBA at 64 kbps, 32kHz in, 32kHz out, FOA out, DTX, random FER at 5% ../IVAS_cod -dtx -sba 1 64000 32 testv/stvFOA32c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error @@ -806,10 +802,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst -// SBA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv3OA48c.wav_SBA_512000_48-48_binaural_ht_fr5.tst - // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 48 testv/stvFOA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvFOA48c.wav_sw_48-48_BINAURAL.tst @@ -1236,18 +1228,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit ../IVAS_dec 7_1_4 48 bit testv/stv714MC48c.wav_MC714_160000_48-48_MC714.tst -// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, fr 5ms -../IVAS_cod -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit -../IVAS_dec -fr 5 BINAURAL_ROOM_IR 48 bit testv/stv714MC48c.wav_MC714_160000_48-48_MC_binaural_room_fr5.tst - -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, with headtracking, BINAURAL out, fr 5ms -../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_binaural_ht_fr5.tst - -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_binaural_ht_fr5.tst - // Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5% ../IVAS_cod -mc 5_1_2 32000 48 testv/stv512MC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -- GitLab From d8c6014430cb9d84c7863c4ba341c5f3f825feb2 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 27 Feb 2024 12:01:04 +0100 Subject: [PATCH 458/498] fix CI --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2682a7fdf1..e86dc9458c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -553,7 +553,7 @@ pytest-compare-20ms-and-5ms-rendering: - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 || exit_code1=$? - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 || exit_code2=$? - zero_errors=$(cat report-junit-5ms.xml report-junit-10ms.xml | grep -c 'errors="0"') || true - - exit_code = 0 + - exit_code=0 - if [ $exit_code -eq 1] || [ $exit_code2 -eq 1]; then exit_code=1; fi - *merge-request-comparison-check artifacts: -- GitLab From e228d75c4137c258ba5ade7e3f4e8a14fb108357 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 27 Feb 2024 13:04:14 +0100 Subject: [PATCH 459/498] fix CI --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e86dc9458c..ebbf74dbe2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -553,8 +553,10 @@ pytest-compare-20ms-and-5ms-rendering: - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 || exit_code1=$? - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 || exit_code2=$? - zero_errors=$(cat report-junit-5ms.xml report-junit-10ms.xml | grep -c 'errors="0"') || true + # map to usual values + - if [ $zero_errors -eq 2 ]; then zero_errors=1; else zero_errors=0; fi - exit_code=0 - - if [ $exit_code -eq 1] || [ $exit_code2 -eq 1]; then exit_code=1; fi + - if [ $exit_code1 -eq 1] || [ $exit_code2 -eq 1]; then exit_code=1; fi - *merge-request-comparison-check artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" -- GitLab From 30751c5582ab140f6a3ef334dd80234683d4a469 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 27 Feb 2024 13:05:14 +0100 Subject: [PATCH 460/498] implement downmixing of HOA3 to stereo for the reverberator input --- lib_com/options.h | 3 +- lib_dec/ivas_binRenderer_internal.c | 50 ++++++++++++++++++++++------- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cdd45dbd68..86ea6322c7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,8 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_LCLD_5MS /* Dlb: LCLD 5ms framing operation */ #endif -#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */ +//#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A /* FhG: issue 987: solution a: switch to SD */ +#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_B /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index feb59980cf..97b80e3f1a 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -952,22 +952,48 @@ static void ivas_binaural_obtain_DMX( set_zero( outRealRightPtr, CLDFB_NO_CHANNELS_MAX ); set_zero( outImagRightPtr, CLDFB_NO_CHANNELS_MAX ); - for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) - { - float foa_const = hBinRenderer->hReverb->foa_enc[chIdx][1]; +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_B + /*Ambisonics input requires different processing*/ + if ( hBinRenderer->nInChannels == 16 ) + { + float *inRealPtr_W, *inImagPtr_W; + float *inRealPtr_Y, *inImagPtr_Y; - inRealPtr = (float *) &( RealBuffer[chIdx][k][0] ); - inImagPtr = (float *) &( ImagBuffer[chIdx][k][0] ); + inRealPtr_W = (float *) &( RealBuffer[0][k][0] ); + inImagPtr_W = (float *) &( ImagBuffer[0][k][0] ); + + inRealPtr_Y = (float *) &( RealBuffer[1][k][0] ); + inImagPtr_Y = (float *) &( ImagBuffer[1][k][0] ); for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { - outRealLeftPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f + foa_const ); - outImagLeftPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f + foa_const ); - - outRealRightPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f - foa_const ); - outImagRightPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f - foa_const ); - } - } + outRealLeftPtr[bandIdx] = inRealPtr_W[bandIdx] + inRealPtr_Y[bandIdx]; + outImagLeftPtr[bandIdx] = inImagPtr_W[bandIdx] + inImagPtr_Y[bandIdx]; + + outRealRightPtr[bandIdx] = inRealPtr_W[bandIdx] - inRealPtr_Y[bandIdx]; + outImagRightPtr[bandIdx] = inImagPtr_W[bandIdx] - inImagPtr_Y[bandIdx]; + } + } + else +#endif + { + for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) + { + float foa_const = hBinRenderer->hReverb->foa_enc[chIdx][1]; + + inRealPtr = (float *) &( RealBuffer[chIdx][k][0] ); + inImagPtr = (float *) &( ImagBuffer[chIdx][k][0] ); + + for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) + { + outRealLeftPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f + foa_const ); + outImagLeftPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f + foa_const ); + + outRealRightPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f - foa_const ); + outImagRightPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f - foa_const ); + } + } + } } } -- GitLab From fb3c47a76822ba026a2a603e044ff0852736beb0 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 27 Feb 2024 13:14:26 +0100 Subject: [PATCH 461/498] fix formatting --- lib_dec/ivas_binRenderer_internal.c | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 97b80e3f1a..b48a352a71 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -954,15 +954,15 @@ static void ivas_binaural_obtain_DMX( #ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_B /*Ambisonics input requires different processing*/ - if ( hBinRenderer->nInChannels == 16 ) - { + if ( hBinRenderer->nInChannels == 16 ) + { float *inRealPtr_W, *inImagPtr_W; float *inRealPtr_Y, *inImagPtr_Y; inRealPtr_W = (float *) &( RealBuffer[0][k][0] ); inImagPtr_W = (float *) &( ImagBuffer[0][k][0] ); - inRealPtr_Y = (float *) &( RealBuffer[1][k][0] ); + inRealPtr_Y = (float *) &( RealBuffer[1][k][0] ); inImagPtr_Y = (float *) &( ImagBuffer[1][k][0] ); for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) @@ -970,30 +970,30 @@ static void ivas_binaural_obtain_DMX( outRealLeftPtr[bandIdx] = inRealPtr_W[bandIdx] + inRealPtr_Y[bandIdx]; outImagLeftPtr[bandIdx] = inImagPtr_W[bandIdx] + inImagPtr_Y[bandIdx]; - outRealRightPtr[bandIdx] = inRealPtr_W[bandIdx] - inRealPtr_Y[bandIdx]; + outRealRightPtr[bandIdx] = inRealPtr_W[bandIdx] - inRealPtr_Y[bandIdx]; outImagRightPtr[bandIdx] = inImagPtr_W[bandIdx] - inImagPtr_Y[bandIdx]; - } - } - else + } + } + else #endif - { - for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) - { - float foa_const = hBinRenderer->hReverb->foa_enc[chIdx][1]; - - inRealPtr = (float *) &( RealBuffer[chIdx][k][0] ); - inImagPtr = (float *) &( ImagBuffer[chIdx][k][0] ); - - for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) - { - outRealLeftPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f + foa_const ); - outImagLeftPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f + foa_const ); - - outRealRightPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f - foa_const ); - outImagRightPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f - foa_const ); - } - } - } + { + for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) + { + float foa_const = hBinRenderer->hReverb->foa_enc[chIdx][1]; + + inRealPtr = (float *) &( RealBuffer[chIdx][k][0] ); + inImagPtr = (float *) &( ImagBuffer[chIdx][k][0] ); + + for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) + { + outRealLeftPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f + foa_const ); + outImagLeftPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f + foa_const ); + + outRealRightPtr[bandIdx] += inRealPtr[bandIdx] * ( 1.f - foa_const ); + outImagRightPtr[bandIdx] += inImagPtr[bandIdx] * ( 1.f - foa_const ); + } + } + } } } -- GitLab From 80e9d9f14fc472c5bde5c7f6be264127aa7414ea Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 27 Feb 2024 13:31:34 +0100 Subject: [PATCH 462/498] improve verbosity of 5/10ms BE test --- .gitlab-ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ebbf74dbe2..aac618e440 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -548,16 +548,17 @@ pytest-compare-20ms-and-5ms-rendering: - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 ### run pytest - exit_code=0 - # dummy, is needed for using the comparison anchor later - - non_be_flag=0 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 || exit_code1=$? - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 || exit_code2=$? - - zero_errors=$(cat report-junit-5ms.xml report-junit-10ms.xml | grep -c 'errors="0"') || true - # map to usual values - - if [ $zero_errors -eq 2 ]; then zero_errors=1; else zero_errors=0; fi - - exit_code=0 - - if [ $exit_code1 -eq 1] || [ $exit_code2 -eq 1]; then exit_code=1; fi - - *merge-request-comparison-check + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 || exit_code5=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 || exit_code10=$? + - zero_errors5=$(cat report-junit-5ms.xml | grep -c 'errors="0"') || true + - zero_errors10=$(cat report-junit-10ms.xml | grep -c 'errors="0"') || true + - zero_errors=1 + - if [ $zero_errors5 -eq 0 ]; then echo "run error in with 5ms rendering encountered"; zero_errors=0 ; fi + - if [ $zero_errors10 -eq 0 ]; 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 ]; 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 -- GitLab From 29e3f74b44c1af98a699b7b7095b61ab2ebc3ff7 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 27 Feb 2024 13:53:28 +0100 Subject: [PATCH 463/498] run 5/10ms BE test always as long as the code compiles under Linux --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aac618e440..e3ab34a85c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -533,6 +533,7 @@ pytest-compare-20ms-and-5ms-rendering: - .test-job-linux - .rules-merge-request stage: test + needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"] script: - *print-common-info - *disable-limiter -- GitLab From 5200e49dd7222c5663f51eeca8ae6752a0eb93f2 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 27 Feb 2024 14:07:11 +0100 Subject: [PATCH 464/498] fix shell commands for 5/10 ms BE test --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3ab34a85c..1352eb875b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -554,12 +554,12 @@ pytest-compare-20ms-and-5ms-rendering: - zero_errors5=$(cat report-junit-5ms.xml | grep -c 'errors="0"') || true - zero_errors10=$(cat report-junit-10ms.xml | grep -c 'errors="0"') || true - zero_errors=1 - - if [ $zero_errors5 -eq 0 ]; then echo "run error in with 5ms rendering encountered"; zero_errors=0 ; fi - - if [ $zero_errors10 -eq 0 ]; then echo "run error in with 10ms rendering encountered"; zero_errors=0 ; fi + - 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 ]; exit $EXIT_CODE_FAIL; fi + - if [ $exit_code -eq 1 ]; 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 -- GitLab From f4fa0d24d474fbafe718e7c3bd017860b51407d8 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 27 Feb 2024 16:52:35 +0100 Subject: [PATCH 465/498] synch self_test.prm and self_test_ltv.prm --- scripts/config/self_test_ltv.prm | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 623f474e92..6bdeaaf0a8 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -685,10 +685,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 48000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec 5_1_2 48 bit testv/ltv48_HOA3.wav_SBA_48000_48-48_5_1_2.tst -// SBA at 48 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -sba 3 48000 48 testv/ltv48_HOA3.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_48000_48-48_binaural_ht_fr5.tst - // SBA at 64 kbps, 32kHz in, 32kHz out, FOA out, DTX, random FER at 5% ../IVAS_cod -dtx -sba 1 64000 32 testv/ltv32_FOA.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error @@ -806,10 +802,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 512000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_512000_48-48_Binaural_Headrot_EXOF.tst -// SBA at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -sba 3 512000 48 testv/ltv48_HOA3.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_HOA3.wav_SBA_512000_48-48_binaural_ht_fr5.tst - // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 48 testv/ltv48_FOA.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_FOA.wav_sw_48-48_BINAURAL.tst @@ -1237,18 +1229,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 160000 48 testv/ltv48_MC714.wav bit ../IVAS_dec 7_1_4 48 bit testv/ltv48_MC714.wav_MC714_160000_48-48_MC714.tst -// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out, fr 5ms -../IVAS_cod -mc 7_1_4 160000 48 testv/ltv48_MC714.wav bit -../IVAS_dec -fr 5 BINAURAL_ROOM_IR 48 bit testv/ltv48_MC714.wav_MC714_160000_48-48_MC_binaural_room_fr5.tst - -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, with headtracking, BINAURAL out, fr 5ms -../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC714_512000_48-48_MC_binaural_ht_fr5.tst - -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out, fr 5ms -../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC51.wav bit -../IVAS_dec -fr 5 -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC51_512000_48-48_MC_binaural_ht_fr5.tst - // Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5% ../IVAS_cod -mc 5_1_2 32000 48 testv/ltv48_MC512.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -- GitLab From 8f787919d58bc9b0ef98fd2cc99df1c48c18cc33 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 28 Feb 2024 08:01:59 +0100 Subject: [PATCH 466/498] fix for #1014, #1015, #1016, update info about rendered frames and slots in the TC buffer in the correct way in the discrete ISM renderer --- lib_com/options.h | 2 +- lib_dec/ivas_ism_renderer.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 12730e95f0..736211a7f2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,7 +184,7 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ -#define NONBE_FIX_1014_OSBA_JBM_STEREO /* FhG: issue #1014: fix stereo output for OSBA*/ +#define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 07d6217cc4..d5364a4bb6 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -279,8 +279,10 @@ void ivas_ism_render_sf( ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); n_samples_rendered_loop += n_samples_in_subframe; -#ifdef NONBE_FIX_1014_OSBA_JBM_STEREO - if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_STEREO ) +#ifdef NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO + /* update rendered subframe and slots info for all cases apart from a following crend call, the update will + then happen in the crend call*/ + if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) #else if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) #endif -- GitLab From dcf6b7e71574b62efbe4684d2ae8528f43c3668b Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 28 Feb 2024 08:05:35 +0100 Subject: [PATCH 467/498] fix for #1014, #1015, #1016, adress formatting comment --- lib_dec/ivas_ism_renderer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index d5364a4bb6..6f5a2d90eb 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -172,6 +172,7 @@ void ivas_ism_render_sf( assert( slots_to_render == 0 ); assert( last_sf <= st_ivas->hTcBuffer->nb_subframes ); #endif + num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { -- GitLab From 644c1857bb7961bba88b305d430f45625a993933 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:35:35 +0100 Subject: [PATCH 468/498] [cleanup] accept FIX_777_COMBI_RENDER_CONFIG_FILE --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 00b3446f52..6eb8d096c6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 678f760a0b..a6229dc659 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2301,11 +2301,7 @@ ivas_error RenderConfigReader_read( /* RT60 */ else if ( strcmp( item, "RT60" ) == 0 ) { -#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) -#else - if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) -#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; @@ -2315,11 +2311,7 @@ ivas_error RenderConfigReader_read( /* DSR */ else if ( strcmp( item, "DSR" ) == 0 ) { -#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) -#else - if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) -#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; -- GitLab From 66f4cdf7abcb75de309a68286f208848f6998fb2 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 10:39:53 +0100 Subject: [PATCH 469/498] add --decoder_only option and use it in test_param_files.py --- .../test_param_file.py | 88 +++++++++++-------- tests/conftest.py | 15 ++++ 2 files changed, 66 insertions(+), 37 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 824608066c..226b0794bc 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -127,6 +127,7 @@ def convert_test_string_to_tag(test_string): @pytest.mark.parametrize("test_tag", list(param_file_test_dict.keys())) def test_param_file_tests( record_property, + decoder_only, dut_encoder_frontend: EncoderFrontend, dut_decoder_frontend: DecoderFrontend, ref_encoder_frontend: EncoderFrontend, @@ -185,18 +186,19 @@ def test_param_file_tests( # -> construct bitstream filename bitstream_file = f"{testv_base}_{tag_str}.192" - encode( - dut_encoder_frontend, - ref_encoder_frontend, - reference_path, - dut_base_path, - bitrate, - sampling_rate, - testv_file, - bitstream_file, - enc_split, - update_ref, - ) + if not decoder_only: + encode( + dut_encoder_frontend, + ref_encoder_frontend, + reference_path, + dut_base_path, + bitrate, + sampling_rate, + testv_file, + bitstream_file, + enc_split, + update_ref, + ) if sba_br_switching_dtx == 1 and not keep_files: is_exist = os.path.exists(cut_file) if is_exist: @@ -230,6 +232,7 @@ def test_param_file_tests( sim_split, update_ref, rootdir, + decoder_only, ) # check for eid-xor command line @@ -255,6 +258,7 @@ def test_param_file_tests( eid_split, update_ref, rootdir, + decoder_only, ) # evaluate decoder options @@ -320,6 +324,7 @@ def test_param_file_tests( dec_split, update_ref, tracefile_dec, + decoder_only, ) if update_ref in [0, 2]: @@ -373,14 +378,15 @@ def test_param_file_tests( # remove DUT output files when test result is OK (to save disk space) if not keep_files: - os.remove(f"{dut_base_path}/param_file/enc/{bitstream_file}") os.remove(f"{dut_base_path}/param_file/dec/{output_file}") - if sim_opts != "": - os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") - os.remove(f"{dut_base_path}/param_file/enc/{netsim_trace_outfile}") - os.remove(f"{dut_base_path}/param_file/dec/{tracefile_dec}") - elif eid_opts != "": - os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") + if not decoder_only: + os.remove(f"{dut_base_path}/param_file/enc/{bitstream_file}") + if sim_opts != "": + os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") + os.remove(f"{dut_base_path}/param_file/enc/{netsim_trace_outfile}") + os.remove(f"{dut_base_path}/param_file/dec/{tracefile_dec}") + elif eid_opts != "": + os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") def encode( @@ -449,6 +455,7 @@ def simulate( sim_opts_list, update_ref, rootdir, + decoder_only, ): """ Call network simulator on REF and/or DUT encoder output. @@ -477,21 +484,20 @@ def simulate( else: assert False, f"networkSimulator_g192 not available for {platform.system()}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): + cmd_opts = sim_opts_list + if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)) or decoder_only: # call network simulator on REF encoder output - cmd_opts = sim_opts_list cmd_opts[1] = f"{ref_out_dir}/{netsim_infile}" - cmd_opts[2] = f"{ref_out_dir}/{netsim_outfile}" # ref_out_file - cmd_opts[3] = f"{ref_out_dir}/{netsim_tracefile}" - run(netsim + cmd_opts, check=False) - - if update_ref in [0, 2]: + elif update_ref in [0, 2]: # call network simulator on DUT encoder output - cmd_opts = sim_opts_list cmd_opts[1] = f"{dut_out_dir}/{netsim_infile}" - cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file + + if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)): + cmd_opts[3] = f"{ref_out_dir}/{netsim_tracefile}" + elif update_ref in [0, 2]: cmd_opts[3] = f"{dut_out_dir}/{netsim_tracefile}" - run(netsim + cmd_opts, check=False) + + run(netsim + cmd_opts, check=False) def error_insertion( @@ -500,6 +506,7 @@ def error_insertion( eid_opts_list, update_ref, rootdir, + decoder_only, ): """ Call eid-xor to insert frame erasure on REF and/or DUT encoder output. @@ -522,19 +529,21 @@ def error_insertion( else: assert False, f"eid-xor not available for {platform.system()}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): + cmd_opts = eid_opts_list + + if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)) or decoder_only: # call eid-xor on REF encoder output - cmd_opts = eid_opts_list cmd_opts[-3] = f"{ref_out_dir}/{eid_xor_infile}" - cmd_opts[-1] = f"{ref_out_dir}/{eid_xor_outfile}" # ref_out_file - run(eid_xor + cmd_opts, check=False) - - if update_ref in [0, 2]: + elif update_ref in [0, 2]: # call eid-xor on DUT encoder output - cmd_opts = eid_opts_list cmd_opts[-3] = f"{dut_out_dir}/{eid_xor_infile}" + + if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)): + cmd_opts[-1] = f"{ref_out_dir}/{eid_xor_outfile}" # ref_out_file + elif update_ref in [0, 2]: cmd_opts[-1] = f"{dut_out_dir}/{eid_xor_outfile}" # ref_out_file - run(eid_xor + cmd_opts, check=False) + + run(eid_xor + cmd_opts, check=False) def decode( @@ -549,6 +558,7 @@ def decode( dec_opts_list, update_ref, tracefile_dec, + decoder_only, ): """ Call REF and/or DUT decoder. @@ -589,6 +599,10 @@ def decode( x if x != "tracefile_dec" else f"{dut_out_dir}/{tracefile_dec}" for x in dec_opts_list ] + + if decoder_only: + dut_in_file = ref_in_file + # call DUT decoder decoder_frontend.run( output_config, diff --git a/tests/conftest.py b/tests/conftest.py index 1e54c4ed07..76572eadd4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -191,6 +191,13 @@ def pytest_addoption(parser): default=20, ) + parser.addoption( + "--decoder_only", + help="Only run decoder parts of tests in 'codec_be_on_mr_nonselection'. Use ref encoder output bitstreams.", + action="store_true", + default=False, + ) + @pytest.fixture(scope="session", autouse=True) def update_ref(request): """ @@ -692,6 +699,14 @@ def dut_base_path(request) -> str: return path +@pytest.fixture(scope="session", autouse=True) +def decoder_only(request) -> bool: + """ + Return value of cmdl param --decoder_only + """ + return request.config.getoption("--decoder_only") + + def pytest_configure(config): config.addinivalue_line("markers", "serial: mark test to run only in serial") config.addinivalue_line( -- GitLab From 7dfe775561973d6e2566a0894feb97e25fec5137 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:40:28 +0100 Subject: [PATCH 470/498] [cleanup] accept FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI --- lib_com/ari_hm.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 0e9a18085c..7fe4d282d1 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -280,11 +280,7 @@ void tcx_hm_modify_envelope( const int16_t L_frame /* i : number of spectral lines */ ) { -#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI int32_t h, x, k; -#else - int16_t k, h, x; -#endif Word16 inv_shape[2 * kTcxHmParabolaHalfWidth + 1]; /* Q15 */ if ( gain == 0 ) diff --git a/lib_com/options.h b/lib_com/options.h index 6eb8d096c6..0b344c9d78 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ -- GitLab From b6b0e802846184f0b4cc32591f13fd14a077bb79 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:41:46 +0100 Subject: [PATCH 471/498] [cleanup] accept FIX_699_FILE_READER_JBM_TSM --- apps/decoder.c | 4 ---- apps/encoder.c | 4 ---- lib_com/options.h | 1 - 3 files changed, 9 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index aca1635eae..ac560234ce 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2301,11 +2301,7 @@ 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; diff --git a/apps/encoder.c b/apps/encoder.c index 835c4d18f9..b00f4f75fd 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -686,11 +686,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; } diff --git a/lib_com/options.h b/lib_com/options.h index 0b344c9d78..a29183f7e5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ -- GitLab From 55e32cf99cf47905c5e045e10c269db19aa4d5da Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:43:20 +0100 Subject: [PATCH 472/498] [cleanup] accept FIX_997_REMOVE_SPAR_DEC_UPMIXER --- lib_com/ivas_prot.h | 8 --- lib_com/options.h | 1 - lib_dec/ivas_spar_decoder.c | 134 ------------------------------------ 3 files changed, 143 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index e091ce7305..840a459c79 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4368,14 +4368,6 @@ void ivas_spar_dec_upmixer_sf( const int16_t nchan_internal /* i : number of internal channels */ ); -#ifndef FIX_997_REMOVE_SPAR_DEC_UPMIXER -void ivas_spar_dec_upmixer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output[], /* i/o: input/output audio channels */ - const int16_t nchan_internal, /* i : number of internal channels */ - const int16_t output_frame /* i : output frame length */ -); -#endif /* MD module */ ivas_error ivas_spar_md_enc_open( ivas_spar_md_enc_state_t **hMdEnc, /* i/o: SPAR MD encoder handle */ diff --git a/lib_com/options.h b/lib_com/options.h index a29183f7e5..5d054f07b2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 776f606c4d..2e0f4ae0eb 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1250,19 +1250,11 @@ void ivas_spar_dec_set_render_map( return; } -#ifdef FIX_997_REMOVE_SPAR_DEC_UPMIXER /*-------------------------------------------------------------------* * ivas_spar_dec_set_render_params() * * IVAS SPAR set rendering parameters *-------------------------------------------------------------------*/ -#else -/*-------------------------------------------------------------------* - * ivas_spar_dec_upmixer() - * - * IVAS SPAR upmixer - *-------------------------------------------------------------------*/ -#endif void ivas_spar_dec_set_render_params( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -1369,132 +1361,6 @@ void ivas_spar_dec_digest_tc( return; } -#ifndef FIX_997_REMOVE_SPAR_DEC_UPMIXER -/*-------------------------------------------------------------------* - * ivas_spar_dec_upmixer() - * - * - *-------------------------------------------------------------------*/ - -void ivas_spar_dec_upmixer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output[], /* i/o: input/output audio channels */ - const int16_t nchan_internal, /* i : number of internal channels */ - const int16_t output_frame /* i : output frame length */ -) -{ - SPAR_DEC_HANDLE hSpar; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - int16_t nchan_transport, nchan_out; - int16_t subframe_idx, n, i; - int16_t n_samples_sf; - float *output_f_local[MAX_OUTPUT_CHANNELS]; - float Pcm_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float *pPcm_tmp[MAX_OUTPUT_CHANNELS]; - int16_t nchan_internal_total; - int16_t sba_ch_offset; - - hSpar = st_ivas->hSpar; - nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport; - nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; - n_samples_sf = JBM_CLDFB_SLOTS_IN_SUBFRAME * NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); - - nchan_internal_total = nchan_internal; - sba_ch_offset = 0; - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - nchan_internal_total += st_ivas->nchan_ism; - sba_ch_offset = st_ivas->nchan_ism; - } - - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) - { - output_f_local[n] = output[n + sba_ch_offset]; - } - - for ( n = 0; n < nchan_internal_total; n++ ) - { - st_ivas->hTcBuffer->tc[n] = output[n]; - } - - /*---------------------------------------------------------------------* - * TD decorrelation - *---------------------------------------------------------------------*/ - - for ( i = 0; i < nchan_internal; i++ ) - { - pPcm_tmp[i] = Pcm_tmp[i]; - } - - if ( hSpar->hMdDec->td_decorr_flag ) - { - if ( hSpar->hTdDecorr ) - { - ivas_td_decorr_process( hSpar->hTdDecorr, output_f_local, pPcm_tmp, output_frame ); - - if ( hSpar->hTdDecorr->num_apd_outputs >= ( nchan_internal - nchan_transport ) ) - { - for ( i = 0; i < nchan_internal - nchan_transport; i++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal_total - 1 - i], output_frame ); - } - } - else - { - for ( i = 0; i < nchan_internal - nchan_transport; i++ ) - { - set_zero( st_ivas->hTcBuffer->tc[nchan_internal_total - 1 - i], output_frame ); - } - - for ( i = 0; i < hSpar->hTdDecorr->num_apd_outputs; i++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal_total - 1 - i], output_frame ); - } - } - } - } - - ivas_spar_dec_set_render_params( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - - if ( st_ivas->hDirAC != 0 ) - { - ivas_dirac_dec_set_md_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - } - - for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) - { - ivas_spar_dec_upmixer_sf( st_ivas, output_f_local, nchan_internal ); - - for ( n = 0; n < nchan_out; n++ ) - { - output_f_local[n] += n_samples_sf; - } - - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); - } - - for ( n = 0; n < nchan_internal_total; n++ ) - { - st_ivas->hTcBuffer->tc[n] = NULL; - } - - if ( st_ivas->hDirAC != NULL && st_ivas->hSpatParamRendCom != NULL ) - { - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) - { - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_CLDFB_TIMESLOTS ) % hSpatParamRendCom->dirac_md_buffer_length; - } - else - { - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; - } - } - - return; -} -#endif /*-------------------------------------------------------------------* * ivas_spar_dec_upmixer_sf() -- GitLab From acc9810984a3378aeb7b755a302f303a3572237e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:44:49 +0100 Subject: [PATCH 473/498] [cleanup] accept FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5d054f07b2..e0a29920c5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index d631bfeec2..31018089c1 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -143,13 +143,6 @@ ivas_error ivas_jbm_dec_tc( { hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); } -#ifndef FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO - - if ( st_ivas->renderer_type == RENDERER_MC && st_ivas->hDecoderConfig->nchan_out == 1 ) - { - ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); - } -#endif } else if ( st_ivas->ivas_format == ISM_FORMAT ) { -- GitLab From 1b8737802723ad2b93ddf44837fb797952ed0bfe Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:46:47 +0100 Subject: [PATCH 474/498] [cleanup] accept FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN --- lib_com/options.h | 1 - lib_dec/ivas_ism_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e0a29920c5..192c87c7a2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 1d0f523222..4c0c0601cc 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -355,13 +355,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; -#ifndef FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - tc_nchan_allocate_new = 2 * BINAURAL_CHANNELS; - tc_nchan_full_new = tc_nchan_allocate_new; - } -#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { -- GitLab From d50098d3c1cb654348a23a95c06bdeb361c20af2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:48:30 +0100 Subject: [PATCH 475/498] [cleanup] accept FIX_1001_ARI_HM_OVERFLOW --- lib_com/ari_hm.c | 8 -------- lib_com/options.h | 1 - lib_com/prot.h | 8 -------- lib_dec/ari_hm_dec.c | 8 -------- lib_enc/ari_hm_enc.c | 16 ---------------- 5 files changed, 41 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 7fe4d282d1..b0d65b4404 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -205,11 +205,7 @@ int16_t CountIndexBits( *-------------------------------------------------------------------*/ int16_t tcx_hm_render( -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, /* i : pitch lag */ -#else - const int16_t lag, /* i : pitch lag */ -#endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ) @@ -269,11 +265,7 @@ int16_t tcx_hm_render( void tcx_hm_modify_envelope( const Word16 gain, /* i : HM gain (Q11) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ Word32 env[], /* i/o: envelope (Q16) */ diff --git a/lib_com/options.h b/lib_com/options.h index 192c87c7a2..72393d1d2d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 10477f3587..9a88ea6d19 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -7830,22 +7830,14 @@ int16_t DecodeIndex( #define GET_ADJ2( T, L, F ) ( ( ( L ) << ( F ) ) - ( T ) ) int16_t tcx_hm_render( -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, /* i : pitch lag */ -#else - const int16_t lag, /* i : pitch lag */ -#endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ); void tcx_hm_modify_envelope( const Word16 gain, /* i : HM gain (Q11) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ Word32 env[], /* i/o: envelope (Q16) */ diff --git a/lib_dec/ari_hm_dec.c b/lib_dec/ari_hm_dec.c index 2a0e8bde04..d061a7d633 100644 --- a/lib_dec/ari_hm_dec.c +++ b/lib_dec/ari_hm_dec.c @@ -120,11 +120,7 @@ void tcx_hm_decode( int16_t *hm_bits /* o : bit consumption */ ) { -#ifdef FIX_1001_ARI_HM_OVERFLOW int32_t lag; -#else - int16_t lag; -#endif int32_t tmpL; int16_t NumTargetBits, fract_res; Word16 p[2 * kTcxHmParabolaHalfWidth + 1], gain; @@ -148,11 +144,7 @@ void tcx_hm_decode( /* Convert the index to lag */ UnmapIndex( prm_hm[1], L_frame >= 256, LtpPitchLag, ( NumTargetBits <= kSmallerLagsTargetBitsThreshold ) || ( L_frame < 256 ), &fract_res, &tmpL ); -#ifdef FIX_1001_ARI_HM_OVERFLOW lag = tmpL; -#else - lag = (int16_t) tmpL; -#endif /* Render the harmonic model */ if ( tcx_hm_render( lag, fract_res, p ) ) diff --git a/lib_enc/ari_hm_enc.c b/lib_enc/ari_hm_enc.c index 0a18a007ab..0b255f19b6 100644 --- a/lib_enc/ari_hm_enc.c +++ b/lib_enc/ari_hm_enc.c @@ -418,11 +418,7 @@ static void PeakFilter( static float tcx_hm_get_re( const float x[], /* i : absolute spectrum */ const Word16 gain, /* i : HM gain (Q11) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ const Word32 env[], /* i : envelope (Q16) */ @@ -471,11 +467,7 @@ static float tcx_hm_get_re( static void tcx_hm_quantize_gain( const float x[], /* i : absolute spectrum */ const Word32 env[], /* i : envelope (Q16) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, Word16 p[], /* i : harmonic model (Q13) */ const int16_t L_frame, /* i : number of spectral lines */ @@ -565,11 +557,7 @@ void tcx_hm_analyse( int16_t *hm_bits /* o : bit consumption */ ) { -#ifdef FIX_1001_ARI_HM_OVERFLOW int32_t lag; -#else - int16_t lag; -#endif int32_t tmpL; int16_t fract_res; float fspec[N_MAX_ARI], RelativeScore; @@ -595,11 +583,7 @@ void tcx_hm_analyse( /* Convert the index to lag */ UnmapIndex( prm_hm[1], L_frame >= 256, LtpPitchLag, ( targetBits - *hm_bits <= kSmallerLagsTargetBitsThreshold ) || ( L_frame < 256 ), &fract_res, &tmpL ); -#ifdef FIX_1001_ARI_HM_OVERFLOW lag = tmpL; -#else - lag = (int16_t) tmpL; -#endif /* Render harmonic model */ tcx_hm_render( lag, fract_res, p ); -- GitLab From 5c7128e0bf202819fd893bc52c501fc717fbf780 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:49:55 +0100 Subject: [PATCH 476/498] [cleanup] accept FIX_901_PARAMMC_DEAD_CODE --- lib_com/ivas_cnst.h | 8 - lib_com/ivas_mc_param_com.c | 135 --------------- lib_com/ivas_prot.h | 22 --- lib_com/ivas_rom_com.c | 61 ------- lib_com/ivas_stat_com.h | 7 - lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec.c | 114 ------------ lib_enc/ivas_mc_param_enc.c | 334 ------------------------------------ 8 files changed, 682 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index db4e1a7c5b..e4946e9725 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1390,17 +1390,9 @@ typedef enum #define PARAM_MC_ICC_ERROR_BIAS_FAC (1.15f) /* factor for favouring past ICC maps in the adaptive ICC map decision */ #define PARAM_MC_TRANSIENT_BAND_STEP 2 /* Number of parameter bands combined in case of a transient frame*/ #define PARAM_MC_MAX_DECORR_CLDFB_BANDS 20 /* Maximum number of CLDFB bands with decorrelation */ -#ifdef FIX_901_PARAMMC_DEAD_CODE #define PARAM_MC_MAX_TRANSPORT_CHANS 3 /* Number of down mix channels */ -#else -#define PARAM_MC_MAX_TRANSPORT_CHANS 4 /* Number of down mix channels */ -#endif #define PARAM_MC_MAX_ILD_REF_CHANNELS 2 /* Maximum number of reference channels for a coded ILD */ -#ifdef FIX_901_PARAMMC_DEAD_CODE #define PARAM_MC_NUM_CONFIGS 14 /* Number of available Parametric MC configurations */ -#else -#define PARAM_MC_NUM_CONFIGS 15 /* Number of available Parametric MC configurations */ -#endif #define PARAM_MC_MAX_BAND_LFE 1 /* Number of parameter bands for LFE coding */ #define PARAM_MC_SZ_ICC_MAP 11 /* Maximum number of transmitted ICCs per parameter band */ #define PARAM_MC_SZ_ILD_MAP 12 /* Maximum number of transmitted channel energies per band*/ diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index 5a11a90d86..b080263506 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -87,22 +87,11 @@ uint16_t ivas_param_mc_get_configuration_index( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - const int16_t lfe_index, /* i : channel index of LFE */ -#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t i; -#endif uint16_t config_index; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t nchan_setup; - - nchan_setup = ivas_mc_ls_setup_get_num_channels( mc_ls_setup ); -#endif /* get coding band mappings */ set_s( hMetadataPMC->coding_band_mapping, 0, PARAM_MC_MAX_PARAMETER_BANDS ); @@ -135,26 +124,12 @@ void ivas_param_mc_metadata_open( assert( 0 && "nbands must be 20 or 14!" ); } -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* create map of all possible ICCs */ - ivas_param_mc_create_full_icc_mapping( nchan_setup, lfe_index, hMetadataPMC->icc_map_full, &hMetadataPMC->icc_map_size_full ); -#endif hMetadataPMC->icc_mapping_conf = ivas_param_mc_conf[config_index].icc_mapping_conf; hMetadataPMC->ild_mapping_conf = ivas_param_mc_conf[config_index].ild_mapping_conf; hMetadataPMC->ild_factors = ivas_param_mc_conf[config_index].ild_factors; -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* set default ICC maps */ - for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) - { - ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[i] ); - } -#endif /* init remaining flags and indices */ hMetadataPMC->param_frame_idx = 0; -#ifndef FIX_901_PARAMMC_DEAD_CODE - hMetadataPMC->flag_use_adaptive_icc_map = 0; -#endif hMetadataPMC->bAttackPresent = 0; hMetadataPMC->attackIndex = 0; hMetadataPMC->lfe_on = 1; @@ -209,32 +184,6 @@ void ivas_param_mc_set_coded_bands( return; } -#ifndef FIX_901_PARAMMC_DEAD_CODE -/*------------------------------------------------------------------------- - * ivas_param_mc_metadata_close() - * - * Parametric MC parameter coding state close function - *------------------------------------------------------------------------*/ - -void ivas_param_mc_metadata_close( - HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ -) -{ - uint16_t i; - - /* adaptive ICC mapping */ - for ( i = 0; i < 2; i++ ) - { - if ( hMetadataPMC->icc_map_full[i] ) - { - free( hMetadataPMC->icc_map_full[i] ); - hMetadataPMC->icc_map_full[i] = NULL; - } - } - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_param_mc_getNumTransportChannels() @@ -258,85 +207,6 @@ int16_t ivas_param_mc_getNumTransportChannels( return nchan_transport; } -#ifndef FIX_901_PARAMMC_DEAD_CODE -/*------------------------------------------------------------------------- - * ivas_param_mc_create_full_icc_mapping() - * - * create the map of all possible ICCs for a certain internal setup - * indicated by the number of channels and LFE index - *------------------------------------------------------------------------*/ - -void ivas_param_mc_create_full_icc_mapping( - const int16_t n_channels, /* i : number of channels with LFE for the internal setup */ - const int16_t lfe_index, /* i : channel index of the LFE */ - int16_t *icc_map[2], /* o : map of all possible ICCs */ - int16_t *icc_map_size_full /* o : number of all possible ICCs */ -) -{ - int16_t i, k, l; - - l = 0; - - /* number of all possible ICCs is the number of non-diagonal upper elements of a - * ICC matrix for all channels not including the LFE plus one static ICC for the - * combination (LFE/center) */ - *icc_map_size_full = ( n_channels - 2 ) * ( n_channels - 1 ) / 2 + 1; - - /* allocate memory for the map */ - for ( i = 0; i < 2; i++ ) - { - icc_map[i] = (int16_t *) malloc( *icc_map_size_full * sizeof( int16_t ) ); - } - - /* create map (non-LFE ICCs) */ - for ( i = 0; i < n_channels; i++ ) - { - if ( i != lfe_index ) - { - for ( k = i + 1; k < n_channels; k++ ) - { - if ( k != lfe_index ) - { - icc_map[0][l] = i; - icc_map[1][l] = k; - l++; - } - } - } - } - - /* last one is the fixed mapping center -> LFE */ - assert( l == *icc_map_size_full - 1 ); - - icc_map[0][l] = 2; - icc_map[1][l] = lfe_index; - - return; -} - -/*------------------------------------------------------------------------- - * ivas_param_mc_default_icc_map() - * - * get the default ICC map for a certain internal setup - * indicated by the number of channels from the table ROM - *------------------------------------------------------------------------*/ - -void ivas_param_mc_default_icc_map( - const PARAM_MC_ICC_MAPPING *hIccMapping, /* i : ICC mapping table */ - int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from ROM table */ -) -{ - int16_t i; - - for ( i = 0; i < hIccMapping->icc_map_size_lfe; i++ ) - { - icc_map[i][0] = hIccMapping->icc_mapping[i][0]; - icc_map[i][1] = hIccMapping->icc_mapping[i][1]; - } - - return; -} -#endif /*------------------------------------------------------------------------- @@ -419,11 +289,6 @@ static int16_t ivas_param_mc_get_num_param_bands( case IVAS_128k: num_parameter_bands = 14; break; -#ifndef FIX_901_PARAMMC_DEAD_CODE - case IVAS_160k: - num_parameter_bands = 20; - break; -#endif } break; default: diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 840a459c79..f0fe6d3cb4 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3808,9 +3808,6 @@ void ivas_mc_paramupmix_dec_render( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - const int16_t lfe_index, /* i : channel index of LFE */ -#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ); @@ -3819,18 +3816,6 @@ void ivas_param_mc_set_coded_bands( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); -#ifndef FIX_901_PARAMMC_DEAD_CODE -void ivas_param_mc_metadata_close( - HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ -); - -void ivas_param_mc_create_full_icc_mapping( - const int16_t n_channels, /* i : number of channels with LFE for the internal setup */ - const int16_t lfe_index, /* i : channel index of the LFE */ - int16_t *icc_map[2], /* o : map of all possible ICCs */ - int16_t *icc_map_size_full /* o : number of all possible ICCs */ -); -#endif /*! r: number of IVAS transport channels */ int16_t ivas_param_mc_getNumTransportChannels( const int32_t ivas_total_bitrate, /* i : IVAS total bitrate */ @@ -3895,13 +3880,6 @@ void ivas_param_mc_dec( float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ); -#ifndef FIX_901_PARAMMC_DEAD_CODE -void ivas_param_mc_default_icc_map( - const PARAM_MC_ICC_MAPPING * hIccMapping, /* i : handle to ICC mapping configuration */ - int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from the configuration */ -); - -#endif /*! r: number of cldfb synthesis instances */ int16_t param_mc_get_num_cldfb_syntheses( Decoder_Struct *st_ivas /* i : IVAS decoder structure */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 8ab2c86821..68169f10d4 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1973,24 +1973,6 @@ const float ivas_param_mc_ild_fac_CICP19_3tc[12] = 0.5f }; -#ifndef FIX_901_PARAMMC_DEAD_CODE -const float ivas_param_mc_ild_fac_CICP19_4tc[12] = -{ - 0.35f, - 0.35f, - 0.17f, - 0.22f, - 0.2f, - 0.2f, - 0.2f, - 0.5f, - 0.5f, - 0.5f, - 0.5f, - 0.2f, -}; - -#endif const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = { 5, @@ -2054,17 +2036,6 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc = {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} }; -#ifndef FIX_901_PARAMMC_DEAD_CODE -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = -{ - 11, - 12, - {0,1,2,4,5,6,7,8,9,10,11,3}, - {1,1,2,1,1,1,1,1,1,1,1,2}, - {{0},{1},{0,1},{0},{1},{0},{1},{2},{3},{2},{3},{0,1}} -}; - -#endif const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = { 4, @@ -2165,24 +2136,6 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc = } }; -#ifndef FIX_901_PARAMMC_DEAD_CODE -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = -{ - 8, - 9, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 0, 6 }, /* L/LBS */ - { 1, 7 }, /* R/RBS */ - { 8, 10 }, /*UFL/UBL */ - { 9, 11 }, /*UFR/UBR */ - { 2, 3 } /* C/LFE */ - } -}; - -#endif const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = { /* CICP6 48000 */ @@ -2339,20 +2292,6 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_dmx_fac_CICP19_3tc[0], &ivas_param_mc_ild_fac_CICP19_3tc[0] } -#ifndef FIX_901_PARAMMC_DEAD_CODE - , - /* CICP19 160000 */ - { - MC_LS_SETUP_7_1_4, - 12, - 4, - IVAS_160k, - &ivas_param_mc_ild_mapping_CICP19_4tc, - &ivas_param_mc_icc_mapping_CICP19_4tc, - &ivas_param_mc_dmx_fac_CICP19_4tc[0], - &ivas_param_mc_ild_fac_CICP19_4tc[0] - } -#endif }; const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 1f55909a23..6feb8efd99 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -595,15 +595,8 @@ typedef struct ivas_parametric_mc_metadata_struct { const PARAM_MC_ILD_MAPPING *ild_mapping_conf; const PARAM_MC_ICC_MAPPING *icc_mapping_conf; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t icc_mapping[PARAM_MC_PARAMETER_FRAMES][PARAM_MC_SZ_ICC_MAP][2]; - int16_t *icc_map_full[2]; -#endif int16_t icc_map_size_full; int16_t param_frame_idx; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t flag_use_adaptive_icc_map; -#endif const float *ild_factors; int16_t coding_band_mapping[PARAM_MC_MAX_PARAMETER_BANDS]; int16_t nbands_in_param_frame[PARAM_MC_PARAMETER_FRAMES]; diff --git a/lib_com/options.h b/lib_com/options.h index 72393d1d2d..1942bd5405 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 45ed71c978..70f01eb927 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -114,9 +114,6 @@ ivas_error ivas_param_mc_dec_open( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; -#ifndef FIX_901_PARAMMC_DEAD_CODE - IVAS_OUTPUT_SETUP hTransportSetup; -#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -148,9 +145,6 @@ ivas_error ivas_param_mc_dec_open( output_Fs = st_ivas->hDecoderConfig->output_Fs; output_config = st_ivas->hDecoderConfig->output_config; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifndef FIX_901_PARAMMC_DEAD_CODE - hTransportSetup = st_ivas->hTransSetup; -#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; hParamMC->hoa_encoder = NULL; @@ -231,11 +225,7 @@ ivas_error ivas_param_mc_dec_open( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); -#endif /* init arrays for quantized parameters */ if ( ( hParamMC->icc_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ) ) == NULL ) @@ -558,9 +548,6 @@ ivas_error ivas_param_mc_dec_reconfig( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; -#ifndef FIX_901_PARAMMC_DEAD_CODE - IVAS_OUTPUT_SETUP hTransportSetup; -#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -589,9 +576,6 @@ ivas_error ivas_param_mc_dec_reconfig( output_Fs = st_ivas->hDecoderConfig->output_Fs; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifndef FIX_901_PARAMMC_DEAD_CODE - hTransportSetup = st_ivas->hTransSetup; -#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; @@ -635,29 +619,9 @@ ivas_error ivas_param_mc_dec_reconfig( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* deallocate the full icc map, gets newly allocated in the metadata open function */ - - for ( k = 0; k < 2; k++ ) - { -#ifdef DEBUGGING - assert( hParamMC->hMetadataPMC->icc_map_full[k] != NULL ); -#endif - if ( hParamMC->hMetadataPMC->icc_map_full[k] != NULL ) - { - free( hParamMC->hMetadataPMC->icc_map_full[k] ); - hParamMC->hMetadataPMC->icc_map_full[k] = NULL; - } - } - -#endif mvs2s( hParamMC->band_grouping, band_grouping_old, hParamMC->hMetadataPMC->num_parameter_bands + 1 ); -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); -#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 ) @@ -1114,9 +1078,6 @@ void ivas_param_mc_dec_close( /* parameter decoding */ if ( hParamMC->hMetadataPMC != NULL ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_close( hParamMC->hMetadataPMC ); -#endif free( hParamMC->hMetadataPMC ); hParamMC->hMetadataPMC = NULL; } @@ -1233,9 +1194,6 @@ void ivas_param_mc_dec_read_BS( int16_t num_param_bands; int16_t metadata_bit_pos; int16_t i, j, k; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t l; -#endif int16_t icc_map_size; int16_t icc_map_size_wo_lfe; int16_t ild_map_size; @@ -1324,67 +1282,6 @@ void ivas_param_mc_dec_read_BS( num_lfe_bands = 0; } -#ifndef FIX_901_PARAMMC_DEAD_CODE - if ( hMetadataPMC->flag_use_adaptive_icc_map == 1 ) - { - int16_t icc_mapping_index[PARAM_MC_SZ_ICC_MAP]; - - k = 0; - for ( i = 0; i < hMetadataPMC->icc_map_size_full - 1; i++ ) - { - if ( bit_buffer[bit_pos++] == 1 ) - { - icc_mapping_index[k++] = i; - } - } - - /* last one is always C/LFE */ - icc_mapping_index[k] = hMetadataPMC->icc_map_size_full - 1; - - /* save icc mapping of the previous frame*/ - /* build icc map for the current frame */ - for ( k = 0; k < icc_map_size; k++ ) - { - hMetadataPMC->icc_mapping[param_frame_idx][k][0] = hMetadataPMC->icc_map_full[0][icc_mapping_index[k]]; - hMetadataPMC->icc_mapping[param_frame_idx][k][1] = hMetadataPMC->icc_map_full[1][icc_mapping_index[k]]; - } - - if ( hMetadataPMC->bAttackPresent ) - { - for ( k = 0; k < icc_map_size; k++ ) - { - for ( l = 0; l < PARAM_MC_PARAMETER_FRAMES; l++ ) - { - hMetadataPMC->icc_mapping[l][k][0] = hMetadataPMC->icc_map_full[0][icc_mapping_index[k]]; - hMetadataPMC->icc_mapping[l][k][1] = hMetadataPMC->icc_map_full[1][icc_mapping_index[k]]; - } - } - } - else - { - for ( k = 0; k < icc_map_size; k++ ) - { - hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx][k][0] = hMetadataPMC->icc_map_full[0][icc_mapping_index[k]]; - hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx][k][1] = hMetadataPMC->icc_map_full[1][icc_mapping_index[k]]; - } - } - } - else - { - if ( hMetadataPMC->bAttackPresent ) - { - for ( l = 0; l < PARAM_MC_PARAMETER_FRAMES; l++ ) - { - ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[param_frame_idx] ); - } - } - else - { - ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx] ); - } - } - -#endif ivas_param_mc_bs_decode_parameter_values( bit_buffer, &bit_pos, bits_to_copy, &st->BER_detect, hMetadataPMC, &hMetadataPMC->icc_coding, icc_map_size_wo_lfe, icc_map_size, num_lfe_bands, band_step, num_param_bands, hParamMC->icc_q ); if ( !st->BER_detect ) @@ -2731,15 +2628,9 @@ static void ivas_param_mc_dequantize_cov( int16_t l; float *Cyp; float ap; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t param_frame_idx; -#endif const PARAM_MC_ILD_MAPPING *h_ild_mapping; float Cy_state_int[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; -#ifndef FIX_901_PARAMMC_DEAD_CODE - param_frame_idx = hParamMC->hMetadataPMC->param_frame_idx; -#endif set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); h_ild_mapping = hParamMC->hMetadataPMC->ild_mapping_conf; @@ -2780,13 +2671,8 @@ static void ivas_param_mc_dequantize_cov( /* replace some estimated ICCs with transmitted values */ for ( k = 0; k < hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe; k++ ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1]] = icc_q[k]; - Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0]] = icc_q[k]; -#else Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1]] = icc_q[k]; Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0]] = icc_q[k]; -#endif } if ( param_band_index >= PARAM_MC_MAX_BAND_LFE || !hParamMC->hMetadataPMC->lfe_on ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index b32bb1ce5d..4269103937 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -62,10 +62,6 @@ static void ivas_param_mc_parameter_quantizer( const float *x, const int16_t L, static void ivas_param_mc_transient_detection( PARAM_MC_ENC_HANDLE hParamMC, TRAN_DET_HANDLE hTranDet, int16_t *bAttackPresent, int16_t *attackIdx ); -#ifndef FIX_901_PARAMMC_DEAD_CODE -static void ivas_param_mc_enc_find_icc_map( PARAM_MC_ENC_HANDLE hParamMC, float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], const int16_t nchan_input, const int16_t nchan_transport ); - -#endif static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t freq_idx, const int16_t nchan_input, const int16_t nchan_transport, int16_t *ILD_idx_out, float ILD_q[PARAM_MC_SZ_ILD_MAP] ); @@ -89,9 +85,6 @@ ivas_error ivas_param_mc_enc_open( ) { int16_t i; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t k, l; -#endif IVAS_FB_CFG *fb_cfg; PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; @@ -157,29 +150,7 @@ ivas_error ivas_param_mc_enc_open( } /* open/init parameter coding */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); -#endif -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* init icc index states */ - for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) - { - set_s( hParamMC->icc_map_index[i], -1, PARAM_MC_SZ_ICC_MAP ); - - for ( l = 0; l < hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_lfe; l++ ) - { - for ( k = 0; k < hParamMC->hMetadataPMC.icc_map_size_full; k++ ) - { - if ( hParamMC->hMetadataPMC.icc_mapping[i][l][0] == hParamMC->hMetadataPMC.icc_map_full[0][k] && hParamMC->hMetadataPMC.icc_mapping[i][l][1] == hParamMC->hMetadataPMC.icc_map_full[1][k] ) - { - hParamMC->icc_map_index[i][l] = k; - } - } - } - } -#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) @@ -246,9 +217,6 @@ ivas_error ivas_param_mc_enc_reconfig( ) { int16_t i; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t k, l; -#endif PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; MC_LS_SETUP mc_input_setup; @@ -293,47 +261,9 @@ ivas_error ivas_param_mc_enc_reconfig( /* get dmx factors */ hParamMC->dmx_factors = ivas_param_mc_conf[config_index].dmx_fac; -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* deallocate the full icc map, gets newly allocated in the metadata open function */ - for ( i = 0; i < 2; i++ ) - { -#ifdef DEBUGGING - assert( hParamMC->hMetadataPMC.icc_map_full[i] != NULL ); -#endif - if ( hParamMC->hMetadataPMC.icc_map_full[i] != NULL ) - { - free( hParamMC->hMetadataPMC.icc_map_full[i] ); - hParamMC->hMetadataPMC.icc_map_full[i] = NULL; - } - } - -#endif /* open/init parameter coding */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); -#endif - -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* init icc index states */ - for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) - { - set_s( hParamMC->icc_map_index[i], -1, PARAM_MC_SZ_ICC_MAP ); - - for ( l = 0; l < hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_lfe; l++ ) - { - for ( k = 0; k < hParamMC->hMetadataPMC.icc_map_size_full; k++ ) - { - if ( hParamMC->hMetadataPMC.icc_mapping[i][l][0] == hParamMC->hMetadataPMC.icc_map_full[0][k] && hParamMC->hMetadataPMC.icc_mapping[i][l][1] == hParamMC->hMetadataPMC.icc_map_full[1][k] ) - { - hParamMC->icc_map_index[i][l] = k; - } - } - } - } -#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) { @@ -396,9 +326,6 @@ void ivas_param_mc_enc_close( return; } -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); -#endif ivas_FB_mixer_close( &( *hParamMC )->hFbMixer, sampling_rate, 0 ); free( ( *hParamMC ) ); @@ -532,18 +459,6 @@ void ivas_param_mc_enc( ivas_param_mc_quantize_ilds( hParamMC, Cy_sum[k], Cx_sum[k], k, nchan_inp, st_ivas->nchan_transport, ILD_idx, ILD_q[k] ); } -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* get icc map */ - if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) - { - ivas_param_mc_enc_find_icc_map( hParamMC, Cx_sum, Cy_sum, ILD_q, nchan_inp, st_ivas->nchan_transport ); - } - else - { - ivas_param_mc_default_icc_map( hParamMC->hMetadataPMC.icc_mapping_conf, hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx] ); - } - -#endif /* ICC parameter quantization */ for ( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) { @@ -1010,230 +925,6 @@ static void ivas_param_mc_param_est_enc( return; } -#ifndef FIX_901_PARAMMC_DEAD_CODE -/*------------------------------------------------------------------------- - * ivas_param_mc_enc_find_icc_map() - * - * decide which ICCs out of all possible ICCs should be sent - *------------------------------------------------------------------------*/ - -static void ivas_param_mc_enc_find_icc_map( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix for the downmixed frame */ - float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix for the original frame */ - float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], /* i : quantized ILDs */ - const int16_t nchan_input, /* i : number of input channels */ - const int16_t nchan_transport /* i : number of transport channels */ -) -{ - float Cproto_band[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - float Cx_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float mat_mult_buffer1[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - float mapped_error[55]; /* max number of possible mappings for 7.1+4 */ - int16_t icc_map_index[PARAM_MC_SZ_ICC_MAP]; - int16_t map_idx; - float *sorted_error_desc[PARAM_MC_SZ_ICC_MAP]; - int16_t cur_param_band, k, m, i; - int16_t bandstep; - int16_t last_element, el; - int16_t num_parameter_bands; - int16_t ch_idx1, ch_idx2; - int16_t icc_map_size; - int16_t icc_map_size_wo_lfe; - float Nrqq[MAX_OUTPUT_CHANNELS]; - float a[MAX_OUTPUT_CHANNELS]; - float Cy_band[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - - /* Initialisations */ - num_parameter_bands = hParamMC->hMetadataPMC.nbands_coded; - bandstep = hParamMC->hMetadataPMC.bAttackPresent ? 2 : 1; - set_f( mapped_error, 0.0f, 55 ); - set_s( icc_map_index, -1, PARAM_MC_SZ_ICC_MAP ); - icc_map_size_wo_lfe = hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_wo_lfe; - icc_map_size = hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_lfe; - - set_zero( Cy_band, nchan_input * nchan_input ); - - /* Estimate the target covariance like in the decoder using the - * already available qunantised ICLDs */ - for ( cur_param_band = 0; cur_param_band < num_parameter_bands; cur_param_band += bandstep ) - { - if ( hParamMC->hMetadataPMC.bAttackPresent || hParamMC->hMetadataPMC.coding_band_mapping[cur_param_band] == hParamMC->hMetadataPMC.param_frame_idx ) - { - /* transfer Cx_sum band to columnwise matrix */ - for ( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 ) - { - for ( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) - { - Cx_band[ch_idx1 + nchan_transport * ch_idx2] = Cx_sum[cur_param_band][ch_idx1][ch_idx2]; - } - } - - /* get estimated Cy from Cx and proto matrix */ - matrix_product( hParamMC->dmx_factors, nchan_input, nchan_transport, 0, - Cx_band, nchan_transport, nchan_transport, 0, - mat_mult_buffer1 ); - - matrix_product( mat_mult_buffer1, nchan_input, nchan_transport, 0, - hParamMC->dmx_factors, nchan_input, nchan_transport, 1, - Cproto_band ); - - set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); - - /*get back Nrg*/ - for ( k = 0; k < nchan_input; k++ ) - { - float ref_ener = 0.0f; - int16_t ref_channel_cnt; - int16_t ref_channel_idx; - - for ( ref_channel_cnt = 0; ref_channel_cnt < hParamMC->hMetadataPMC.ild_mapping_conf->num_ref_channels[k]; ref_channel_cnt++ ) - { - ref_channel_idx = hParamMC->hMetadataPMC.ild_mapping_conf->ref_channel_idx[k][ref_channel_cnt]; - ref_ener += Cx_band[ref_channel_idx + ref_channel_idx * nchan_transport]; - } - Nrqq[hParamMC->hMetadataPMC.ild_mapping_conf->ild_index[k]] = powf( 10, ILD_q[cur_param_band][k] / 10.0f ) * hParamMC->hMetadataPMC.ild_factors[k] * ref_ener; - } - - /* apply quantized ICLDs in the estimated covariance */ - for ( k = 0; k < nchan_input; k++ ) - { - a[k] = sqrtf( Nrqq[k] ) / ( sqrtf( Cproto_band[k + nchan_input * k] ) + EPSILON ); - v_multc( Cproto_band + k * nchan_input, a[k], Cproto_band + k * nchan_input, nchan_input ); - } - - for ( k = 0; k < nchan_input; k++ ) - { - int16_t l; - float *Cyp = Cproto_band + k; - float ap = a[k]; - - for ( l = 0; l < nchan_input; l++ ) - { - ( *Cyp ) *= ap; - Cyp += nchan_input; - } - } - - /* transfer Cy_sum band to columnwise matrix */ - for ( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) - { - for ( ch_idx2 = 0; ch_idx2 < nchan_input; ++ch_idx2 ) - { - Cy_band[ch_idx1 + nchan_transport * ch_idx2] = Cy_sum[cur_param_band][ch_idx1][ch_idx2]; - } - } - - /* apply quantized ICLDs on the input covariance */ - for ( k = 0; k < nchan_input; k++ ) - { - a[k] = sqrtf( Nrqq[k] ) / ( sqrtf( Cy_band[k + nchan_input * k] ) + EPSILON ); - v_multc( Cy_band + k * nchan_input, a[k], Cy_band + k * nchan_input, nchan_input ); - } - - for ( k = 0; k < nchan_input; k++ ) - { - int16_t l; - float *Cyp = Cy_band + k; - float ap = a[k]; - - for ( l = 0; l < nchan_input; l++ ) - { - ( *Cyp ) *= ap; - Cyp += nchan_input; - } - } - - /* for all possible mappings, get the cumulated error between estimated and real Cy */ - for ( map_idx = 0; map_idx < hParamMC->hMetadataPMC.icc_map_size_full - 1; map_idx++ ) - { - int16_t idx0 = hParamMC->hMetadataPMC.icc_map_full[0][map_idx]; - int16_t idx1 = hParamMC->hMetadataPMC.icc_map_full[1][map_idx]; - mapped_error[map_idx] += fabsf( Cproto_band[idx0 + idx1 * nchan_input] - Cy_band[idx0 + idx1 * nchan_input] ); - } - } - } - - /* put a small bias on the error for the past transmitted indices*/ - if ( !hParamMC->hMetadataPMC.bAttackPresent ) - { - for ( i = 0; i < icc_map_size_wo_lfe; i++ ) - { - mapped_error[hParamMC->icc_map_index[hParamMC->hMetadataPMC.param_frame_idx][i]] *= PARAM_MC_ICC_ERROR_BIAS_FAC; - } - } - - /* get the mappings with the biggest expected errors as those who will be transmitted */ - for ( i = 0; i < hParamMC->hMetadataPMC.icc_map_size_full - 1; i++ ) - { - for ( k = 0; k < icc_map_size_wo_lfe; k++ ) - { - if ( icc_map_index[k] == -1 ) - { - /* not filled yet, take the value */ - icc_map_index[k] = i; - sorted_error_desc[k] = &mapped_error[i]; - break; - } - else if ( mapped_error[i] > *sorted_error_desc[k] ) - { - /* push all others down and insert value here */ - for ( m = icc_map_size_wo_lfe - 1; m >= k + 1; m-- ) - { - icc_map_index[m] = icc_map_index[m - 1]; - sorted_error_desc[m] = sorted_error_desc[m - 1]; - } - icc_map_index[k] = i; - sorted_error_desc[k] = &mapped_error[i]; - break; - } - } - } - - /* the indices in ascending order, simple bubble sort */ - for ( last_element = icc_map_size_wo_lfe - 1; last_element >= 0; last_element-- ) - { - for ( el = 0; el < last_element; el++ ) - { - if ( icc_map_index[el] > icc_map_index[el + 1] ) - { - int16_t swp_el = icc_map_index[el]; - icc_map_index[el] = icc_map_index[el + 1]; - icc_map_index[el + 1] = swp_el; - } - } - } - - /* last icc map element is always the C/LFE icc */ - icc_map_index[icc_map_size - 1] = hParamMC->hMetadataPMC.icc_map_size_full - 1; - - /* create map and map index, map index is sorted in ascending order*/ - if ( hParamMC->hMetadataPMC.bAttackPresent ) - { - for ( k = 0; k < PARAM_MC_PARAMETER_FRAMES; k++ ) - { - for ( i = 0; i < icc_map_size; i++ ) - { - hParamMC->hMetadataPMC.icc_mapping[k][i][0] = hParamMC->hMetadataPMC.icc_map_full[0][icc_map_index[i]]; - hParamMC->hMetadataPMC.icc_mapping[k][i][1] = hParamMC->hMetadataPMC.icc_map_full[1][icc_map_index[i]]; - } - mvs2s( icc_map_index, hParamMC->icc_map_index[k], icc_map_size ); - } - } - else - { - for ( i = 0; i < icc_map_size; i++ ) - { - hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][i][0] = hParamMC->hMetadataPMC.icc_map_full[0][icc_map_index[i]]; - hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][i][1] = hParamMC->hMetadataPMC.icc_map_full[1][icc_map_index[i]]; - } - - mvs2s( icc_map_index, hParamMC->icc_map_index[hParamMC->hMetadataPMC.param_frame_idx], icc_map_size ); - } - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_param_mc_quantize_ilds() @@ -1471,13 +1162,8 @@ static void ivas_param_mc_quantize_iccs( /* Reduce set of parameters and quantize them */ for ( k = 0; k < num_iccs_to_code; ++k ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][0]; - tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][1]; -#else tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][0]; tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][1]; -#endif ICC_vect[k] = Cy[tmp_map[0]][tmp_map[1]]; } @@ -1655,26 +1341,6 @@ static void ivas_param_mc_write_bs( nbands = hParamMC->hMetadataPMC.nbands_coded / band_step + ( ( hParamMC->hMetadataPMC.nbands_coded % band_step ) ? 1 : 0 ); } -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* Encoding of the ICC mapping done as simple bitmap */ - if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) - { - uint16_t *bit_buffer_icc_mapping = &bit_buffer[*bit_pos]; - - for ( i = 0; i < hParamMC->hMetadataPMC.icc_map_size_full - 1; i++ ) - { - bit_buffer_icc_mapping[i] = 0; - } - - for ( i = 0; i < icc_map_size_wo_lfe; i++ ) - { - bit_buffer_icc_mapping[hParamMC->icc_map_index[hParamMC->hMetadataPMC.param_frame_idx][i]] = 1; - } - - *bit_pos += hParamMC->hMetadataPMC.icc_map_size_full - 1; - } - -#endif ivas_param_mc_encode_parameter( ICC_idx, &hParamMC->hMetadataPMC, &hParamMC->hMetadataPMC.icc_coding, nbands, band_step, icc_map_size_wo_lfe, icc_map_size, bit_buffer, bit_pos ); -- GitLab From 589ef91e302eaf44cc60c0a0fd337fc2268423e5 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:50:49 +0100 Subject: [PATCH 477/498] [cleanup] accept FIX_1008_EXTORIENT_TARGET_INTERPOLATION --- lib_com/options.h | 1 - lib_rend/ivas_rotation.c | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1942bd5405..6873d94adc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index b9f05c9f2d..48c52995cb 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -898,18 +898,7 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->num_subframes = num_subframes; ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; -#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION - if ( num_subframes == 1 ) - { - ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 2000; - } - else - { -#endif ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; -#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION - } -#endif ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; -- GitLab From 21f0026a3b0988b3a262a7fe03358bd5842d9fcc Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:56:04 +0100 Subject: [PATCH 478/498] [cleanup] accept NONBE_FIX_978_MC_TDREND_REVERB --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 ---- lib_dec/ivas_ism_dec.c | 4 ---- lib_dec/ivas_objectRenderer_internal.c | 8 -------- 4 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6873d94adc..d3b35a40e1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 1e6ac794eb..f91b897ea7 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2010,11 +2010,7 @@ ivas_error ivas_init_decoder( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif // DEBUG { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 4c0c0601cc..1a43d3ef07 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,11 +199,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 8a3189bc99..907affdae1 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -187,11 +187,7 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hRenderConfig != NULL && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { if ( ( error = ivas_reverb_process( st_ivas->hReverb, st_ivas->transport_config, 0, tc_local, p_reverb_signal, 0 ) ) != IVAS_ERR_OK ) { @@ -206,11 +202,7 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hRenderConfig != NULL && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { /* add reverb to rendered signals */ v_add( reverb_signal[0], output_f_local[0], output_f_local[0], output_frame ); -- GitLab From 6bb65670ee6f8f723622d65a59e817f501f9e46f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:58:01 +0100 Subject: [PATCH 479/498] [cleanup] accept NONBE_FIX_984_OMASA_EXT_OUTPUT --- apps/decoder.c | 28 --------------- apps/renderer.c | 4 --- lib_com/ivas_cnst.h | 4 --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 20 ----------- lib_dec/ivas_jbm_dec.c | 20 ----------- lib_dec/ivas_masa_dec.c | 31 ---------------- lib_dec/ivas_omasa_dec.c | 47 ------------------------ lib_dec/ivas_output_config.c | 4 --- lib_dec/ivas_sba_dec.c | 4 --- lib_dec/ivas_stat_dec.h | 4 --- lib_dec/lib_dec.c | 26 -------------- lib_enc/ivas_masa_enc.c | 12 ------- lib_rend/ivas_output_init.c | 2 -- lib_util/masa_file_writer.c | 70 ------------------------------------ lib_util/masa_file_writer.h | 4 --- 17 files changed, 283 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ac560234ce..142c8a4ac6 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1990,12 +1990,8 @@ 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; @@ -2501,7 +2497,6 @@ 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; @@ -2510,19 +2505,14 @@ static ivas_error decodeG192( { 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; @@ -2657,7 +2647,6 @@ 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; @@ -2665,19 +2654,14 @@ static ivas_error decodeG192( { 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; @@ -3352,7 +3336,6 @@ 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; @@ -3361,19 +3344,14 @@ static ivas_error decodeVoIP( { 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; @@ -3459,7 +3437,6 @@ 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; @@ -3468,19 +3445,14 @@ static ivas_error decodeVoIP( { 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; diff --git a/apps/renderer.c b/apps/renderer.c index 007ef477e7..8a9e0b48f8 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2110,11 +2110,7 @@ int main( } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput, NULL ) ) != IVAS_ERR_OK ) /* NULL -> use default metadata delay settings */ -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e4946e9725..4960db4712 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -118,13 +118,9 @@ typedef enum RENDERER_NON_DIEGETIC_DOWNMIX, RENDERER_OSBA_STEREO, RENDERER_OSBA_AMBI, -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT RENDERER_OSBA_LS, RENDERER_OMASA_OBJECT_EXT, RENDERER_OMASA_MIX_EXT -#else - RENDERER_OSBA_LS -#endif } RENDERER_TYPE; #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f0fe6d3cb4..e0e3a40dff 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5768,7 +5768,6 @@ void ivas_omasa_rearrange_channels( const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT ivas_error ivas_omasa_combine_separate_ism_with_masa_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -5791,7 +5790,6 @@ void ivas_omasa_render_objects_from_mix( const int16_t output_frame /* i : output frame length per channel */ ); -#endif void ivas_omasa_dirac_rend_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ diff --git a/lib_com/options.h b/lib_com/options.h index d3b35a40e1..7a1293a32f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f91b897ea7..ffb0dbacd0 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -385,7 +385,6 @@ ivas_error ivas_dec_setup( st_ivas->nchan_transport = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* this should be non-zero if original input format was MASA_ISM_FORMAT */ st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2]; @@ -401,7 +400,6 @@ ivas_error ivas_dec_setup( element_mode_flag = 1; } -#endif if ( st_ivas->ini_frame > 0 ) { /* reconfigure in case a change of operation mode is detected */ @@ -1156,11 +1154,7 @@ ivas_error ivas_init_decoder( hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); hDecoderConfig->nchan_out += st_ivas->nchan_ism; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { hDecoderConfig->nchan_out = st_ivas->nchan_transport + st_ivas->nchan_ism; } @@ -2112,7 +2106,6 @@ ivas_error ivas_init_decoder( return error; } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { @@ -2137,7 +2130,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && @@ -3001,7 +2993,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbSyntheses = 0; } break; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: *numCldfbAnalyses = st_ivas->nchan_transport; *numCldfbSyntheses = st_ivas->hDecoderConfig->nchan_out; @@ -3010,7 +3001,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses = st_ivas->nchan_transport + 1; *numCldfbSyntheses = 0; break; -#endif default: assert( 0 && "Renderer not handled for CLDFB reservation." ); } @@ -3149,16 +3139,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, "Wrong set-up: Acoustic environment is not supported in this output configuration." ); } } -#ifndef NONBE_FIX_984_OMASA_EXT_OUTPUT - - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 31018089c1..851d1397e7 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -311,7 +311,6 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* external output */ if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -323,7 +322,6 @@ ivas_error ivas_jbm_dec_tc( ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, output_frame ); } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { @@ -400,7 +398,6 @@ ivas_error ivas_jbm_dec_tc( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); @@ -415,15 +412,6 @@ ivas_error ivas_jbm_dec_tc( /* Extract objects from MASA, output MASA + all objects (i.e., extracted and separated objects) */ ivas_omasa_render_objects_from_mix( st_ivas, p_output, st_ivas->nchan_ism, output_frame ); } -#else - /* sanity check in case of bitrate switching */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - - ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); -#endif ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } @@ -906,7 +894,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); @@ -914,7 +901,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else { -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); @@ -949,9 +935,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( delay_signal( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif } else if ( st_ivas->ivas_format == MC_FORMAT ) { @@ -1217,13 +1201,11 @@ ivas_error ivas_jbm_dec_render( { ivas_omasa_dirac_rend_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT || st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, *nSamplesRendered ); } -#endif } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { @@ -2731,10 +2713,8 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_PARAM_ISM: case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: case RENDERER_OMASA_MIX_EXT: -#endif case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: buffer_mode = TC_BUFFER_MODE_RENDERER; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 3984b79c54..3957fa0c5f 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -250,7 +250,6 @@ ivas_error ivas_masa_decode( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* read 2 bits: '00' - MASA format at the encoder @@ -270,20 +269,6 @@ ivas_error ivas_masa_decode( { hMasa->config.input_ivas_format = MASA_ISM_FORMAT; } -#else - /* read the MASA_ISM_FORMAT bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; - if ( byteBuffer == 1 ) - { - hMasa->config.input_ivas_format = MASA_ISM_FORMAT; - } - else - { - hMasa->config.input_ivas_format = MASA_FORMAT; - } - /* reserved bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; -#endif *nb_bits_read += MASA_HEADER_BITS; /* read number of directions */ @@ -365,13 +350,11 @@ ivas_error ivas_masa_decode( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx, st_ivas->hSpatParamRendCom->dirac_md_buffer_length ); } -#endif else { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, @@ -491,12 +474,10 @@ ivas_error ivas_masa_decode( dirac_bs_md_write_idx = st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx; /* Store the write-index for this frame */ ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0 ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx = ( st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hSpatParamRendCom->dirac_md_buffer_length; } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -616,14 +597,12 @@ ivas_error ivas_masa_dec_open( } ism_total_brate = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* ISM metadata */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */ ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) @@ -694,13 +673,11 @@ ivas_error ivas_masa_dec_open( nchan_transport = 1; nchan_to_allocate = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC ) ) { /* addtl channel for CNG */ @@ -1499,16 +1476,12 @@ ivas_error ivas_masa_dec_reconfigure( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->nchan_ism = 0; /* Initialization if it has not been already read from the end of the bitstream at the same time with reading of the format: nchan_ism is needed in MASA format because for the EXT output in MASA-only (pre-rendering mode of OMASA) the number of ISMs to output correct number of empty objects is needed */ } -#else - st_ivas->nchan_ism = 0; -#endif st_ivas->ism_mode = ISM_MODE_NONE; } @@ -1564,13 +1537,11 @@ ivas_error ivas_masa_dec_reconfigure( /* addtl channel for CNG */ tc_nchan_to_allocate++; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { tc_nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; tc_nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) { @@ -2546,13 +2517,11 @@ static int16_t ivas_decode_masaism_metadata( { hMasaIsmData->energy_ratio_ism[dir][meta_write_index][b] = energy_ratio_ism[i][band][dir]; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hMasaIsmData->hExtData != NULL ) { hMasaIsmData->hExtData->masa_render_masa_to_total[meta_write_index][b] = hMasaIsmData->masa_to_total_energy_ratio[i][band]; } -#endif } } } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index ab032e2440..763c37a709 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -32,9 +32,7 @@ #include "options.h" #include -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #include -#endif #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" @@ -45,13 +43,11 @@ #endif #include "wmc_auto.h" -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*------------------------------------------------------------------------- * Local constants *------------------------------------------------------------------------*/ #define EXT_RENDER_IIR_FAC 0.95f -#endif /*-------------------------------------------------------------------* * ivas_omasa_data_open() @@ -107,7 +103,6 @@ ivas_error ivas_omasa_data_open( set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT hMasaIsmData->hExtData = NULL; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -141,7 +136,6 @@ ivas_error ivas_omasa_data_open( hMasaIsmData->hExtData = hExtData; } -#endif st_ivas->hMasaIsmData = hMasaIsmData; return IVAS_ERR_OK; @@ -175,14 +169,12 @@ void ivas_omasa_data_close( ( *hMasaIsmData )->delayBuffer = NULL; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( *hMasaIsmData )->hExtData != NULL ) { free( ( *hMasaIsmData )->hExtData ); ( *hMasaIsmData )->hExtData = NULL; } -#endif free( *hMasaIsmData ); *hMasaIsmData = NULL; @@ -305,7 +297,6 @@ ivas_error ivas_omasa_dec_config( /* ISM MD reconfig. */ n_MD = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* the full number of hIsmMetaData are needed for EXT output */ @@ -347,33 +338,6 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); } -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - n_MD = 1; - - if ( st_ivas->hIsmMetaData[0] == NULL ) - { - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n_MD = st_ivas->nchan_ism; - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); - - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; @@ -403,14 +367,9 @@ ivas_error ivas_omasa_dec_config( } /* objects renderer reconfig. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hMasaIsmData != NULL || st_ivas->hIsmRendererData != NULL ) { /* this calls also ivas_ism_renderer_close() closing st_ivas->hIsmRendererData used by the EXT renderers. also cleans st_ivas->hMasaIsmData */ -#else - if ( st_ivas->hMasaIsmData != NULL ) - { -#endif ivas_omasa_separate_object_renderer_close( st_ivas ); } @@ -463,7 +422,6 @@ ivas_error ivas_omasa_dec_config( } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { /* Allocate 'hIsmRendererData' handle */ @@ -490,7 +448,6 @@ ivas_error ivas_omasa_dec_config( } } -#endif /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -692,7 +649,6 @@ ivas_error ivas_omasa_ism_metadata_dec( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); @@ -709,7 +665,6 @@ ivas_error ivas_omasa_ism_metadata_dec( st_ivas->hMasaIsmData->elevation_separated_ism[block] = elevation_ism; } } -#endif } return IVAS_ERR_OK; @@ -835,7 +790,6 @@ void ivas_omasa_rearrange_channels( return; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*-------------------------------------------------------------------------* * ivas_omasa_combine_separate_ism_with_masa_open() @@ -1305,4 +1259,3 @@ void ivas_omasa_render_objects_from_mix( return; } -#endif diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index c93b16dcdb..1be9e61829 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -419,7 +419,6 @@ void ivas_renderer_select( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { *renderer_type = RENDERER_OMASA_OBJECT_EXT; @@ -432,9 +431,6 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DISABLE; } -#else - *renderer_type = RENDERER_DISABLE; -#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 897df0c96f..af102dd96e 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -693,11 +693,7 @@ void ivas_sba_dec_digest_tc( int16_t ch_idx, nchan_transport; /* set the md map */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDirAC || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) -#else - if ( st_ivas->hDirAC ) -#endif { ivas_dirac_dec_set_md_map( st_ivas, nCldfbSlots ); } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index dccd1391a5..4deb6748e2 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -873,7 +873,6 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* Data structure for MASA_ISM EXT rendering */ typedef struct ivas_masa_ism_ext_data_structure { @@ -886,7 +885,6 @@ typedef struct ivas_masa_ism_ext_data_structure float masa_render_masa_to_total[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR][CLDFB_NO_CHANNELS_MAX]; } MASA_ISM_EXT_DATA, *MASA_ISM_EXT_DATA_HANDLE; -#endif /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure @@ -918,9 +916,7 @@ typedef struct ivas_masa_ism_data_structure int16_t delayBuffer_size; int16_t delayBuffer_nchan; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_ISM_EXT_DATA_HANDLE hExtData; -#endif } MASA_ISM_DATA, *MASA_ISM_DATA_HANDLE; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d06e882f4d..4e9dc2ac03 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1436,16 +1436,13 @@ ivas_error IVAS_DEC_GetNumObjects( uint16_t *numObjects /* o : number of objects for which the decoder has been configured */ ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { @@ -1455,9 +1452,6 @@ ivas_error IVAS_DEC_GetNumObjects( } } if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || is_masa_ism ) -#else - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { *numObjects = hIvasDec->st_ivas->nchan_ism; } @@ -1491,12 +1485,10 @@ ivas_error IVAS_DEC_GetFormat( *format = IVAS_DEC_BS_UNKOWN; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( *format == IVAS_DEC_BS_MASA && hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { *format = IVAS_DEC_BS_MASA_ISM; } -#endif return IVAS_ERR_OK; } @@ -1605,10 +1597,8 @@ ivas_error IVAS_DEC_GetObjectMetadata( { Decoder_Struct *st_ivas; ISM_METADATA_HANDLE hIsmMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -1616,7 +1606,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } st_ivas = hIvasDec->st_ivas; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { if ( hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -1625,9 +1614,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } } if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT && is_masa_ism == 0 ) -#else - if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -1639,11 +1625,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( hIsmMeta = st_ivas->hIsmMetaData[objectIdx]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIsmMeta == NULL || zero_flag || ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( hIsmMeta == NULL || zero_flag ) -#endif { metadata->azimuth = 0.f; metadata->elevation = 0.f; @@ -2222,18 +2204,10 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef SPLIT_REND_WITH_HEAD_ROT nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0], hDecoderConfig->output_config ) ); #else nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0] ) ); -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], hDecoderConfig->output_config ) ); -#else - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0] ) ); -#endif #endif nSamples[2] = (int16_t) roundf( (float) st_ivas->binaural_latency_ns * hDecoderConfig->output_Fs / 1000000000.f ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index ac46219e40..831e343d72 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -418,7 +418,6 @@ ivas_error ivas_masa_encode( } else { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { /* use the MASA number of transport channels bit to signal if there are 3 or 4 objects */ @@ -433,18 +432,14 @@ ivas_error ivas_masa_encode( } else { -#endif /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; } if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( nchan_ism <= 3 ) { push_next_indice( hMetaData, nchan_ism, MASA_HEADER_BITS ); @@ -454,13 +449,6 @@ ivas_error ivas_masa_encode( push_next_indice( hMetaData, nchan_ism - 1, MASA_HEADER_BITS ); } hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#else - /* signal MASA_ISM_FORMAT to decoder */ - push_next_indice( hMetaData, 1, 1 ); - /* write reserved bit */ - push_next_indice( hMetaData, 0, MASA_HEADER_BITS - 1 ); - hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#endif } else { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 1ac22a5543..5d7d4d610f 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -337,12 +337,10 @@ int16_t ivas_get_nchan_buffers_dec( nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_ism > 0 ) { nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; } -#endif } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 1f708d7b1b..12bcd65b19 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -41,20 +41,12 @@ typedef struct masaMetaDelayStorage { MASA_DECRIPTIVE_META descriptiveMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t prevDelay; -#else - uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; -#endif } MASA_META_DELAY_STORAGE; struct MasaFileWriter @@ -96,23 +88,16 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ uint8_t delayNsf -#else - MASA_META_DELAY_STORAGE *delayStorage /* i/o: Storage for 10 ms of metadata and related descriptive metadata */ -#endif ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t storeReadOffset; -#endif /* Move meta to delay and output. Always use two directions as the metadata is prepared to contain zero energy second direction * if there is 1dir meta. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* stable state expected results delay change expected results delayNsf = 2 delayNsf = 3 delayNsf = 3 (from 2) delayNsf = 2 (from 3) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[0] (prev ext[1]) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[1] (prev ext[2]) @@ -183,43 +168,6 @@ static void delayMasaMetadata( } } -#else - for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES - DELAY_MASA_PARAM_DEC_SFR; sf++ ) - { - for ( band = 0; band < MASA_FREQUENCY_BANDS; band++ ) - { - uint16_t temp_u16; - uint8_t temp_u8; - for ( dir = 0; dir < MASA_MAXIMUM_DIRECTIONS; dir++ ) - { - temp_u16 = delayStorage->directionIndex[dir][sf][band]; - delayStorage->directionIndex[dir][sf][band] = extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directionIndex[dir][sf][band]; - extOutMeta->directionIndex[dir][sf][band] = temp_u16; - - temp_u8 = delayStorage->directToTotalRatio[dir][sf][band]; - delayStorage->directToTotalRatio[dir][sf][band] = extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directToTotalRatio[dir][sf][band]; - extOutMeta->directToTotalRatio[dir][sf][band] = temp_u8; - - temp_u8 = delayStorage->spreadCoherence[dir][sf][band]; - delayStorage->spreadCoherence[dir][sf][band] = extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->spreadCoherence[dir][sf][band]; - extOutMeta->spreadCoherence[dir][sf][band] = temp_u8; - } - - temp_u8 = delayStorage->surroundCoherence[sf][band]; - delayStorage->surroundCoherence[sf][band] = extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->surroundCoherence[sf][band]; - extOutMeta->surroundCoherence[sf][band] = temp_u8; - - temp_u8 = delayStorage->diffuseToTotalRatio[sf][band]; - delayStorage->diffuseToTotalRatio[sf][band] = extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->diffuseToTotalRatio[sf][band]; - extOutMeta->diffuseToTotalRatio[sf][band] = temp_u8; - } - } -#endif /* Finalize descriptive meta by using new frame except for number of directions which is the larger of the two */ currentNumberOfDirections = extOutMeta->descriptiveMeta.numberOfDirections; @@ -229,10 +177,8 @@ static void delayMasaMetadata( } delayStorage->descriptiveMeta.numberOfDirections = currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayStorage->prevDelay = delayNsf; -#endif return; } @@ -275,9 +221,7 @@ ivas_error MasaFileWriter_open( if ( !delayCompensationEnabled ) { self->delayStorage = calloc( sizeof( MASA_META_DELAY_STORAGE ), 1 ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT self->delayStorage->prevDelay = DELAY_MASA_PARAM_DEC_SFR; -#endif } *masaWriter = self; @@ -294,12 +238,8 @@ ivas_error MasaFileWriter_open( ivas_error MasaFileWriter_writeFrame( MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ) { if ( self == NULL ) @@ -311,7 +251,6 @@ ivas_error MasaFileWriter_writeFrame( int16_t i, sf, dir, numDirections; uint8_t writeTempOther[MASA_FREQUENCY_BANDS]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* If delay storage has been reserved, then we are in the normal mode for the decoder * (i.e., no delay compensation for PCM) which means that metadata should be delayed * by two or three subframes (10 or 15 ms). Descriptive metadata is a combined result. */ @@ -321,15 +260,6 @@ ivas_error MasaFileWriter_writeFrame( delayMasaMetadata( hMasaExtOutMeta, self->delayStorage, delayFrames ); } -#else - /* If delay storage has been reserved, then we are in the normal mode for the decoder - * (i.e., no delay compensation for PCM) which means that metadata should be delayed - * by two subframes (10 ms). Descriptive metadata is a combined result. */ - if ( self->delayStorage ) - { - delayMasaMetadata( hMasaExtOutMeta, self->delayStorage ); - } -#endif numDirections = hMasaExtOutMeta->descriptiveMeta.numberOfDirections + 1; diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index 11495a53f0..c6caf0a3f9 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -49,12 +49,8 @@ ivas_error MasaFileWriter_open( ivas_error MasaFileWriter_writeFrame( MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ); void MasaFileWriter_close( -- GitLab From aed5ed563aa9b3b850f0ab8a0a2f7d8f91579082 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:58:46 +0100 Subject: [PATCH 480/498] [cleanup] accept NONBE_FIX_1000_G1_G2_SWB_TBE --- lib_com/options.h | 1 - lib_com/swb_tbe_com.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7a1293a32f..8e54f7d35e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index 8e21ef1748..310c583218 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -939,12 +939,10 @@ void GenShapedSHBExcitation( den = 4.0f * c0 * c2 - c4 * c4; -#ifdef NONBE_FIX_1000_G1_G2_SWB_TBE if ( den == 0.0f ) { den = 1e-7f; } -#endif g1 = ( c3 * c4 - 2 * c1 * c2 ) / den; g2 = ( c1 * c4 - 2 * c0 * c3 ) / den; @@ -972,7 +970,6 @@ void GenShapedSHBExcitation( else { /* normalize gain */ -#ifdef NONBE_FIX_1000_G1_G2_SWB_TBE temp = 0.0f; if ( g1 + g2 == 0.0f ) { @@ -980,9 +977,6 @@ void GenShapedSHBExcitation( } g = g2 / ( g1 + g2 + temp ); -#else - g = g2 / ( g1 + g2 ); -#endif /* quantization of the mixing factor */ cbsize = 1 << NUM_BITS_SHB_VF; -- GitLab From bb1f29a75903483a18ce26e305b02ff2c98b03b0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:59:32 +0100 Subject: [PATCH 481/498] [cleanup] accept NONBE_FIX_999_JBM_MCT_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8e54f7d35e..e640cbc495 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 851d1397e7..128754273c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1682,11 +1682,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); } -#ifdef NONBE_FIX_999_JBM_MCT_FLUSH else if ( renderer_type_old == RENDERER_BINAURAL_OBJECTS_TD ) -#else - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) -#endif { if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { @@ -1695,12 +1691,10 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); } -#ifdef NONBE_FIX_999_JBM_MCT_FLUSH else { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong renderer in MCT VoIP renderer flushing!" ); } -#endif } else { -- GitLab From 1252e78bf92b727a13f3c145778a588b57c55946 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 11:00:14 +0100 Subject: [PATCH 482/498] [cleanup] accept NONBE_FIX_991_PARAMBIN_BINARY_HRTF --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 4 - lib_dec/ivas_init_dec.c | 4 - lib_dec/ivas_ism_dec.c | 8 -- lib_rend/ivas_dirac_dec_binaural_functions.c | 84 -------------------- lib_rend/ivas_prot_rend.h | 4 - lib_rend/ivas_stat_rend.h | 16 ---- lib_rend/lib_rend.c | 18 ----- 8 files changed, 139 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e640cbc495..59c66a6a6b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ #define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8e3f383fea..cd277123bb 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -872,11 +872,7 @@ ivas_error ivas_dirac_dec_config( if ( st_ivas->hDiracDecBin == NULL ) #endif { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index ffb0dbacd0..b92dc19ded 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1989,11 +1989,7 @@ ivas_error ivas_init_decoder( } } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 1a43d3ef07..b23b16ca63 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -263,11 +263,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -298,11 +294,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f4e55a63d4..f318efbf53 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -119,17 +119,9 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( COM static void formulate2x2MixingMatrix( float Ein1, float Ein2, float CinRe, float CinIm, float Eout1, float Eout2, float CoutRe, float CoutIm, float Q[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], const float regularizationFactor ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue ); -#endif -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked ); -#endif static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); @@ -149,11 +141,7 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -185,9 +173,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->hReverb = NULL; hDiracDecBin->h_freq_domain_decorr_ap_params = NULL; hDiracDecBin->h_freq_domain_decorr_ap_state = NULL; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = NULL; -#endif } output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -239,11 +225,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || @@ -258,11 +240,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL ) #endif { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -326,9 +304,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT st_ivas->hDiracDecBin[pos_idx] = hDiracDecBin; @@ -1316,11 +1292,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1363,11 +1335,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1377,11 +1345,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -1770,11 +1734,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1817,11 +1777,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1831,11 +1787,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -2219,11 +2171,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin->processMtxImPrev[chA][chB + 2][bin] = hDiracDecBin->processMtxIm[chA][chB + 2][bin]; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked ); -#endif hDiracDecBin->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; hDiracDecBin->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; @@ -2998,12 +2946,8 @@ static void getDirectPartGains( const uint8_t renderStereoOutputInsteadOfBinaural, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t isHeadtracked -#endif ) { float aziRad, eleRad; @@ -3049,11 +2993,7 @@ static void getDirectPartGains( { if ( aziDeg == gainCache->azi && eleDeg == gainCache->ele ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE ); -#endif } else { @@ -3063,11 +3003,7 @@ static void getDirectPartGains( { rotateAziEle( (float) aziDeg, (float) eleDeg, &aziDeg, &eleDeg, Rmat, 0 ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE ); -#endif } } @@ -3084,21 +3020,15 @@ static void hrtfShGetHrtf( float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t useCachedValue -#endif ) { int16_t k; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF float( *hrtfShCoeffsReInt )[16][60]; float( *hrtfShCoeffsImInt )[16][60]; hrtfShCoeffsReInt = hHrtfParambin->hrtfShCoeffsRe; hrtfShCoeffsImInt = hHrtfParambin->hrtfShCoeffsIm; -#endif *lRealp = 0.0f; *lImagp = 0.0f; @@ -3112,17 +3042,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif } } else @@ -3136,17 +3059,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif gainCache->shVec[k] = shVec[k]; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 3767a7fea2..196ed72f5e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -245,11 +245,7 @@ void ivas_masa_ext_rend_parambin_render( ); ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ); void ivas_dirac_dec_close_binaural_data( diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 516d6a7ee2..672f264211 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -500,7 +500,6 @@ typedef struct ivas_diffuse_distribution_data_structure } DIFFUSE_DISTRIBUTION_DATA, *DIFFUSE_DISTRIBUTION_HANDLE; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Parametric binaural renderer HRTF structure */ typedef struct ivas_hrtfs_parambin_struct { @@ -512,7 +511,6 @@ typedef struct ivas_hrtfs_parambin_struct float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif /* Parametric binaural data structure */ typedef struct ivas_dirac_dec_binaural_data_structure @@ -549,9 +547,7 @@ typedef struct ivas_dirac_dec_binaural_data_structure ivas_td_decorr_state_t *hTdDecorr; float reqularizationFactor; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#endif DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; @@ -1331,18 +1327,6 @@ typedef struct ivas_hrtfs_fastconv_struct } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; -#ifndef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -typedef struct ivas_hrtfs_parambin_struct -{ - float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - - float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; - float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; - float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; - -} HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif typedef struct ivas_hrtfs_statistics_struct { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index cef7480443..a6ddac23a9 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -9167,11 +9167,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif int16_t nBins; int32_t output_Fs; RENDERER_TYPE renderer_type; @@ -9185,11 +9181,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF phHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#else - hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -9259,11 +9251,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ @@ -9271,11 +9259,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( hDiracDecBin->hReverb == NULL ) #endif { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9316,9 +9300,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( /* External renderer uses constant regularization factor */ hDiracDecBin->reqularizationFactor = 0.4f; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT inputMasa->hMasaExtRend->hDiracDecBin[pos_idx] = hDiracDecBin; -- GitLab From 9ea4cb60830d03d232afa7e78d9e29d17db6229f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 11:01:21 +0100 Subject: [PATCH 483/498] [cleanup] accept NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE --- lib_com/options.h | 1 - lib_dec/ivas_mct_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 59c66a6a6b..2f26539d5c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ #define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index bfa2a6ad07..1df83b0ce5 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -774,10 +774,8 @@ static ivas_error ivas_mc_dec_reconfig( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); /* transfer subframe info from DirAC or ParamMC to central tc buffer */ -#ifdef NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE if ( st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { -#endif if ( last_mc_mode == MC_MODE_PARAMMC ) { st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; @@ -794,9 +792,7 @@ static ivas_error ivas_mc_dec_reconfig( st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#ifdef NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE } -#endif /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv render what still fits in the new granularity */ -- GitLab From 2cc5e4f83d8cb896cecde44badee6a806b5b6a4e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 11:05:52 +0100 Subject: [PATCH 484/498] formatting --- lib_com/ari_hm.c | 2 +- lib_com/ivas_mc_param_com.c | 3 +-- lib_com/prot.h | 2 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 +++----- lib_rend/ivas_rotation.c | 2 +- lib_util/masa_file_writer.c | 7 +++---- lib_util/masa_file_writer.h | 2 +- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index b0d65b4404..d3c78833c6 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -205,7 +205,7 @@ int16_t CountIndexBits( *-------------------------------------------------------------------*/ int16_t tcx_hm_render( - const int32_t lag, /* i : pitch lag */ + const int32_t lag, /* i : pitch lag */ const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ) diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index b080263506..e44e51a8be 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -86,7 +86,7 @@ uint16_t ivas_param_mc_get_configuration_index( *------------------------------------------------------------------------*/ void ivas_param_mc_metadata_open( - const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ + const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ) @@ -208,7 +208,6 @@ int16_t ivas_param_mc_getNumTransportChannels( } - /*------------------------------------------------------------------------- * ivas_param_mc_get_num_param_bands() * diff --git a/lib_com/prot.h b/lib_com/prot.h index 9a88ea6d19..87f01a9161 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -7830,7 +7830,7 @@ int16_t DecodeIndex( #define GET_ADJ2( T, L, F ) ( ( ( L ) << ( F ) ) - ( T ) ) int16_t tcx_hm_render( - const int32_t lag, /* i : pitch lag */ + const int32_t lag, /* i : pitch lag */ const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f318efbf53..33a33cdcf3 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -140,7 +140,7 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR *------------------------------------------------------------------------*/ ivas_error ivas_dirac_dec_init_binaural_data( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ ) { @@ -2947,8 +2947,7 @@ static void getDirectPartGains( float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; @@ -3021,8 +3020,7 @@ static void hrtfShGetHrtf( float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { int16_t k; float( *hrtfShCoeffsReInt )[16][60]; diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 48c52995cb..adf6bec226 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -898,7 +898,7 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->num_subframes = num_subframes; ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; - ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; + ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 12bcd65b19..73ce19d593 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -88,9 +88,8 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ - MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ - uint8_t delayNsf -) + MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ + uint8_t delayNsf ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; @@ -237,7 +236,7 @@ ivas_error MasaFileWriter_open( *---------------------------------------------------------------------*/ ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ ) diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index c6caf0a3f9..3644881f35 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -48,7 +48,7 @@ ivas_error MasaFileWriter_open( ); ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ ); -- GitLab From 81f977c7131ab434dd698b1cca0bad6977454133 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 11:25:00 +0100 Subject: [PATCH 485/498] implement --decoder_only for masa tests --- .../test_masa_enc_dec.py | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py index 4f8872fc36..51fd1870e9 100644 --- a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py @@ -109,6 +109,7 @@ def test_masa_enc_dec( output_mode, get_mld, get_mld_lim, + decoder_only, ): # Input parameters in_fs = 48 @@ -153,7 +154,7 @@ def test_masa_enc_dec( dec_met_output_ref = None dec_met_output_dut = None - if update_ref == 2 or update_ref == 1: + if (update_ref == 2 or update_ref == 1): # Encode REF ivas_enc( ref_encoder_frontend, @@ -176,17 +177,20 @@ def test_masa_enc_dec( ) if update_ref == 2 or update_ref == 0: - # Encode DUT - ivas_enc( - dut_encoder_frontend, - masa_channel_count, - masa_path, - ivas_br, - in_fs, - input_audio_path, - output_bitstream_dut, - dtx, - ) + if decoder_only: + output_bitstream_dut = output_bitstream_ref + else: + # Encode DUT + ivas_enc( + dut_encoder_frontend, + masa_channel_count, + masa_path, + ivas_br, + in_fs, + input_audio_path, + output_bitstream_dut, + dtx, + ) # Decode DUT ivas_dec( @@ -256,16 +260,6 @@ def test_masa_enc_dec( record_property("MLD", "0") print("Comparison bit exact") - # remove_output( - # keep_files, - # output_bitstream_ref, - # output_bitstream_dut, - # dec_output_ref, - # dec_output_dut, - # dec_met_output_ref, - # dec_met_output_dut, - # ) - ######################################################### # -------------------- test function -------------------- -- GitLab From 1a3b444e1928f1e4e4f12a37091e96a36ccfea31 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 12:15:49 +0100 Subject: [PATCH 486/498] implement --decoder_only for sba tests --- .../test_sba_bs_enc.py | 221 ++++++++++-------- 1 file changed, 119 insertions(+), 102 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index 3f394b0c2a..fb10b2974e 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -104,6 +104,7 @@ def test_pca_enc( fs, get_mld, get_mld_lim, + decoder_only, ): pca = True tag = tag + fs + "c" @@ -114,27 +115,28 @@ def test_pca_enc( sba_order = "+1" output_config = "FOA" - # enc - sba_enc( - dut_encoder_frontend, - test_vector_path, - ref_encoder_frontend, - reference_path, - dut_base_path, - None, - tag, - fs, - ivas_br, - dtx, - None, - max_bw, - sba_order, - update_ref, - gain_flag, - keep_files, - cut_testv=True, - pca=pca, - ) + if not decoder_only: + # enc + sba_enc( + dut_encoder_frontend, + test_vector_path, + ref_encoder_frontend, + reference_path, + dut_base_path, + None, + tag, + fs, + ivas_br, + dtx, + None, + max_bw, + sba_order, + update_ref, + gain_flag, + keep_files, + cut_testv=True, + pca=pca, + ) # dec sba_dec( @@ -153,6 +155,7 @@ def test_pca_enc( update_ref, gain_flag, keep_files, + decoder_only, get_mld=get_mld, get_mld_lim=get_mld_lim, pca=pca, @@ -186,6 +189,7 @@ def test_sba_enc_system( SID, get_mld, get_mld_lim, + decoder_only, ): if dtx == "1" and ivas_br not in ["13200", "16400", "24400", "32000", "64000"]: # skip high bitrates for DTX until DTX issue is resolved @@ -215,28 +219,30 @@ def test_sba_enc_system( cut_gain = ".004" else: cut_gain = "1.0" - # enc - sba_enc( - dut_encoder_frontend, - test_vector_path, - ref_encoder_frontend, - reference_path, - dut_base_path, - br_switch_file_path, - tag, - fs, - ivas_br, - dtx, - SID, - max_bw, - sba_order, - update_ref, - gain_flag, - keep_files, - cut_gain=cut_gain, - create_dutenc=True, - cut_testv=True, - ) + + if not decoder_only: + # enc + sba_enc( + dut_encoder_frontend, + test_vector_path, + ref_encoder_frontend, + reference_path, + dut_base_path, + br_switch_file_path, + tag, + fs, + ivas_br, + dtx, + SID, + max_bw, + sba_order, + update_ref, + gain_flag, + keep_files, + cut_gain=cut_gain, + create_dutenc=True, + cut_testv=True, + ) # dec sba_dec( @@ -255,6 +261,7 @@ def test_sba_enc_system( update_ref, gain_flag, keep_files, + decoder_only, get_mld=get_mld, get_mld_lim=get_mld_lim, ) @@ -278,6 +285,7 @@ def test_spar_hoa2_enc_system( tag, get_mld, get_mld_lim, + decoder_only, ): fs = "48" dtx = "0" @@ -288,25 +296,26 @@ def test_spar_hoa2_enc_system( sba_order = "+2" output_config = "HOA2" - # enc - sba_enc( - dut_encoder_frontend, - test_vector_path, - ref_encoder_frontend, - reference_path, - dut_base_path, - None, - tag, - fs, - ivas_br, - dtx, - None, - max_bw, - sba_order, - update_ref, - gain_flag, - keep_files, - ) + if not decoder_only: + # enc + sba_enc( + dut_encoder_frontend, + test_vector_path, + ref_encoder_frontend, + reference_path, + dut_base_path, + None, + tag, + fs, + ivas_br, + dtx, + None, + max_bw, + sba_order, + update_ref, + gain_flag, + keep_files, + ) # dec sba_dec( @@ -325,6 +334,7 @@ def test_spar_hoa2_enc_system( update_ref, gain_flag, keep_files, + decoder_only, get_mld=get_mld, get_mld_lim=get_mld_lim, ) @@ -348,6 +358,7 @@ def test_spar_hoa3_enc_system( tag, get_mld, get_mld_lim, + decoder_only, ): fs = "48" dtx = "0" @@ -358,25 +369,26 @@ def test_spar_hoa3_enc_system( sba_order = "+3" output_config = "HOA3" - # enc - sba_enc( - dut_encoder_frontend, - test_vector_path, - ref_encoder_frontend, - reference_path, - dut_base_path, - None, - tag, - fs, - ivas_br, - dtx, - None, - max_bw, - sba_order, - update_ref, - gain_flag, - keep_files, - ) + if not decoder_only: + # enc + sba_enc( + dut_encoder_frontend, + test_vector_path, + ref_encoder_frontend, + reference_path, + dut_base_path, + None, + tag, + fs, + ivas_br, + dtx, + None, + max_bw, + sba_order, + update_ref, + gain_flag, + keep_files, + ) # dec sba_dec( @@ -395,6 +407,7 @@ def test_spar_hoa3_enc_system( update_ref, gain_flag, keep_files, + decoder_only, get_mld=get_mld, get_mld_lim=get_mld_lim, ) @@ -422,6 +435,7 @@ def test_sba_enc_BWforce_system( sample_rate_bw_idx, get_mld, get_mld_lim, + decoder_only, ): if dtx == "1" and ivas_br not in ["32000", "64000"]: # skip high bitrates for DTX until DTX issue is resolved @@ -437,26 +451,27 @@ def test_sba_enc_BWforce_system( sba_order = "+1" output_config = "FOA" - # enc - sba_enc( - dut_encoder_frontend, - test_vector_path, - ref_encoder_frontend, - reference_path, - dut_base_path, - None, - tag, - fs, - ivas_br, - dtx, - None, - bw, - sba_order, - update_ref, - gain_flag, - keep_files, - cut_testv=True, - ) + if not decoder_only: + # enc + sba_enc( + dut_encoder_frontend, + test_vector_path, + ref_encoder_frontend, + reference_path, + dut_base_path, + None, + tag, + fs, + ivas_br, + dtx, + None, + bw, + sba_order, + update_ref, + gain_flag, + keep_files, + cut_testv=True, + ) # dec sba_dec( @@ -475,6 +490,7 @@ def test_sba_enc_BWforce_system( update_ref, gain_flag, keep_files, + decoder_only, get_mld=get_mld, get_mld_lim=get_mld_lim, ) @@ -642,6 +658,7 @@ def sba_dec( update_ref, gain_flag, keep_files, + decoder_only, get_mld=False, get_mld_lim=0, pca=False, @@ -693,7 +710,7 @@ def sba_dec( decoder_frontend.run( output_config, sampling_rate, - dut_in_pkt, + dut_in_pkt if not decoder_only else ref_in_pkt, dut_out_raw, ) -- GitLab From cab508e68eb1043244d1c18555f1fccd50450000 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 12:17:48 +0100 Subject: [PATCH 487/498] format changed files --- .../test_masa_enc_dec.py | 2 +- .../test_param_file.py | 22 ++++++++++++++----- .../test_sba_bs_enc.py | 2 +- tests/conftest.py | 16 +++++++++----- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py index 51fd1870e9..75b01db382 100644 --- a/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py @@ -154,7 +154,7 @@ def test_masa_enc_dec( dec_met_output_ref = None dec_met_output_dut = None - if (update_ref == 2 or update_ref == 1): + if update_ref == 2 or update_ref == 1: # Encode REF ivas_enc( ref_encoder_frontend, diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 226b0794bc..0a494d7248 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -382,11 +382,15 @@ def test_param_file_tests( if not decoder_only: os.remove(f"{dut_base_path}/param_file/enc/{bitstream_file}") if sim_opts != "": - os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") + os.remove( + f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192" + ) os.remove(f"{dut_base_path}/param_file/enc/{netsim_trace_outfile}") os.remove(f"{dut_base_path}/param_file/dec/{tracefile_dec}") elif eid_opts != "": - os.remove(f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192") + os.remove( + f"{dut_base_path}/param_file/enc/{testv_base}_{tag_str}.192" + ) def encode( @@ -485,7 +489,11 @@ def simulate( assert False, f"networkSimulator_g192 not available for {platform.system()}" cmd_opts = sim_opts_list - if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)) or decoder_only: + if ( + update_ref == 1 + or (update_ref == 2 and not os.path.exists(ref_out_file)) + or decoder_only + ): # call network simulator on REF encoder output cmd_opts[1] = f"{ref_out_dir}/{netsim_infile}" elif update_ref in [0, 2]: @@ -531,7 +539,11 @@ def error_insertion( cmd_opts = eid_opts_list - if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)) or decoder_only: + if ( + update_ref == 1 + or (update_ref == 2 and not os.path.exists(ref_out_file)) + or decoder_only + ): # call eid-xor on REF encoder output cmd_opts[-3] = f"{ref_out_dir}/{eid_xor_infile}" elif update_ref in [0, 2]: @@ -599,7 +611,7 @@ def decode( x if x != "tracefile_dec" else f"{dut_out_dir}/{tracefile_dec}" for x in dec_opts_list ] - + if decoder_only: dut_in_file = ref_in_file diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index fb10b2974e..e088196ff1 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -638,7 +638,7 @@ def sba_enc( with open(dut_pkt_file, "rb") as fp_in: with open(dut_pkt_file_cut, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) - if not keep_files: + if not keep_files: os.remove(dut_pkt_file) diff --git a/tests/conftest.py b/tests/conftest.py index 76572eadd4..1d2726dc44 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -192,11 +192,12 @@ def pytest_addoption(parser): ) parser.addoption( - "--decoder_only", - help="Only run decoder parts of tests in 'codec_be_on_mr_nonselection'. Use ref encoder output bitstreams.", - action="store_true", - default=False, - ) + "--decoder_only", + help="Only run decoder parts of tests in 'codec_be_on_mr_nonselection'. Use ref encoder output bitstreams.", + action="store_true", + default=False, + ) + @pytest.fixture(scope="session", autouse=True) def update_ref(request): @@ -569,7 +570,10 @@ def dut_decoder_frontend(dut_decoder_path, request) -> DecoderFrontend: Return a :class:`conftest.DecoderFrontend` instance as DUT for the test session. """ decoder = DecoderFrontend( - dut_decoder_path, "DUT", timeout=request.config.getoption("--testcase_timeout"), fr=request.config.option.dut_fr + dut_decoder_path, + "DUT", + timeout=request.config.getoption("--testcase_timeout"), + fr=request.config.option.dut_fr, ) yield decoder -- GitLab From 86ef7ef817b232300ba9fe8cc4dacaeb06f82212 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 12:18:56 +0100 Subject: [PATCH 488/498] use --decoder_only in 5ms/10ms comparison test --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1352eb875b..caa8267bff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -549,8 +549,8 @@ pytest-compare-20ms-and-5ms-rendering: - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 ### run pytest - exit_code=0 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 || exit_code5=$? - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 || exit_code10=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 --decoder_only || exit_code5=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 --decoder_only || exit_code10=$? - zero_errors5=$(cat report-junit-5ms.xml | grep -c 'errors="0"') || true - zero_errors10=$(cat report-junit-10ms.xml | grep -c 'errors="0"') || true - zero_errors=1 -- GitLab From 5431b64c6ec8eb265803b9548b0955b8256435b0 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 12:59:54 +0100 Subject: [PATCH 489/498] fix bug with netsim application --- tests/codec_be_on_mr_nonselection/test_param_file.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 0a494d7248..459964a186 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -496,14 +496,18 @@ def simulate( ): # call network simulator on REF encoder output cmd_opts[1] = f"{ref_out_dir}/{netsim_infile}" + cmd_opts[2] = f"{ref_out_dir}/{netsim_outfile}" # ref_out_file elif update_ref in [0, 2]: # call network simulator on DUT encoder output cmd_opts[1] = f"{dut_out_dir}/{netsim_infile}" + cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)): cmd_opts[3] = f"{ref_out_dir}/{netsim_tracefile}" + cmd_opts[2] = f"{ref_out_dir}/{netsim_outfile}" # ref_out_file elif update_ref in [0, 2]: cmd_opts[3] = f"{dut_out_dir}/{netsim_tracefile}" + cmd_opts[2] = f"{dut_out_dir}/{netsim_outfile}" # dut_out_file run(netsim + cmd_opts, check=False) -- GitLab From f93cf20eeb5c88ac3d80a7cb10e6f8ec64c69019 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 13:21:48 +0100 Subject: [PATCH 490/498] fix error in file removal --- tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index e088196ff1..01ac63afac 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -675,15 +675,15 @@ def sba_dec( if gain_flag != -1: short_tag_ext += f"_Gain{gain_flag}" if pca: - short_tag_ext += f"_pca" + short_tag_ext += "_pca" if SID == 1: - short_tag_ext += f"_SID_cut" + short_tag_ext += "_SID_cut" # to avoid conflicting names in case of parallel test execution, differentiate all cases long_tag_ext = "" if gain_flag != -1: long_tag_ext += f"_Gain{gain_flag}" if SID == 1: - long_tag_ext += f"_SID_cut" + long_tag_ext += "_SID_cut" dut_out_dir = f"{dut_base_path}/sba_bs/raw" ref_out_dir = f"{reference_path}/sba_bs/raw" @@ -706,11 +706,14 @@ def sba_dec( ) if update_ref == 0: + if decoder_only: + dut_in_pkt = ref_in_pkt + # call DUT decoder decoder_frontend.run( output_config, sampling_rate, - dut_in_pkt if not decoder_only else ref_in_pkt, + dut_in_pkt dut_out_raw, ) -- GitLab From cbfe430d127a91f56565824749a2421990810e48 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 13:53:10 +0100 Subject: [PATCH 491/498] correct file removal --- tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py | 5 +++-- tests/conftest.py | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index 01ac63afac..4f4c1a3271 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -713,7 +713,7 @@ def sba_dec( decoder_frontend.run( output_config, sampling_rate, - dut_in_pkt + dut_in_pkt, dut_out_raw, ) @@ -738,5 +738,6 @@ def sba_dec( # remove DUT output files when test result is OK (to save disk space) if not keep_files: - os.remove(dut_in_pkt) os.remove(dut_out_raw) + if not decoder_only: + os.remove(dut_in_pkt) diff --git a/tests/conftest.py b/tests/conftest.py index 1d2726dc44..bbe16f4715 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -506,10 +506,8 @@ class DecoderFrontend: try: if not os.path.exists(str(input_bitstream_path) + eid_output_suffix): result = run(eid_command, check=True) - except Exception as e: - print(result.stderr) - print(result.stdout) - pytest.fail(f"eid-xor operation failed!") + except Exception: + pytest.fail("eid-xor operation failed!") input_bitstream_path += eid_output_suffix -- GitLab From 9af5b4d83c65cdc88c94ee4bd413507e6758ac97 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 28 Feb 2024 14:39:55 +0100 Subject: [PATCH 492/498] add shorter renderer framesize tests to coverage report --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index caa8267bff..ee7c7ea915 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2040,6 +2040,8 @@ coverage-test-on-main-scheduled: - python3 tests/create_short_testvectors.py - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut - lcov -c -d obj -o coverage_stv.info # extract coverage of short test vectors here -- GitLab From 0be39a6acaa2be01d34de00c4ef2dd41ddc06fa9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 28 Feb 2024 16:35:11 +0100 Subject: [PATCH 493/498] delete code under ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A --- lib_com/options.h | 3 +-- lib_dec/ivas_binRenderer_internal.c | 2 +- lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 42c1122dab..fa896a857a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,8 +183,7 @@ #define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ -//#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A /* FhG: issue 987: solution a: switch to SD */ -#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_B /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ +#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index b48a352a71..68d630909f 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -952,7 +952,7 @@ static void ivas_binaural_obtain_DMX( set_zero( outRealRightPtr, CLDFB_NO_CHANNELS_MAX ); set_zero( outImagRightPtr, CLDFB_NO_CHANNELS_MAX ); -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_B +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /*Ambisonics input requires different processing*/ if ( hBinRenderer->nInChannels == 16 ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 57876353a6..c93b16dcdb 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -248,11 +248,7 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_FASTCONV; } -#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A - if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && !( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) -#endif { /* force HOA3 domain for rotation*/ *internal_config = IVAS_AUDIO_CONFIG_HOA3; -- GitLab From 4864891a1528f499e6fd596d8793fbe032b1e157 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 28 Feb 2024 16:50:53 +0100 Subject: [PATCH 494/498] do not initialize foa_enc when generating reverb from an ambisonics signal --- lib_dec/ivas_binRenderer_internal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 68d630909f..58d24b87ae 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1280,7 +1280,11 @@ ivas_error ivas_binRenderer_open( if ( hBinRenderer->hReverb != NULL ) { +#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING + if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && hBinRenderer->nInChannels != 16 ) +#else if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) +#endif { for ( k = 0; k < 11; k++ ) { -- GitLab From 002745f9b6d0ce470d4dc5e17e6bd452dea89161 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 29 Feb 2024 12:10:30 +0100 Subject: [PATCH 495/498] Remove "sba_order < 0" conditions --- lib_com/ivas_sba_config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index ddb59b2ed5..eb4e8e49be 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -64,19 +64,19 @@ void ivas_sba_config( int16_t *element_mode /* o : element mode of the core coder */ ) { +#ifndef FIX_993_REMOVE_SBA_GET_ORDER if ( ( sba_order < 0 ) && ( nb_channels < 0 ) ) { assert( 0 && "Either order or number of channels must be positive" ); } else if ( sba_order < 0 ) { -#ifdef FIX_993_REMOVE_SBA_GET_ORDER - assert( !"SBA order cannot be negative!" ); -#else sba_order = ivas_sba_get_order( nb_channels, sba_planar ); -#endif } else if ( nb_channels < 0 ) +#else + if ( nb_channels < 0 ) +#endif { nb_channels = ivas_sba_get_nchan( sba_order, sba_planar ); } -- GitLab From b4c0d7fcc038ae3c813394c9b9da6fc2c3dab24d Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 29 Feb 2024 12:18:45 +0100 Subject: [PATCH 496/498] Remove setting of nb_channels - the parameter is not really used --- lib_com/ivas_sba_config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index eb4e8e49be..f7f32c6a9a 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -74,13 +74,13 @@ void ivas_sba_config( sba_order = ivas_sba_get_order( nb_channels, sba_planar ); } else if ( nb_channels < 0 ) -#else - if ( nb_channels < 0 ) -#endif { nb_channels = ivas_sba_get_nchan( sba_order, sba_planar ); } else +#else + if ( nb_channels > 0 ) +#endif { if ( sba_planar ) { -- GitLab From ae8cdf891373d650a62fe2659804eed96ce63039 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 5 Mar 2024 15:20:26 +0100 Subject: [PATCH 497/498] add helper script for removing unsupported testcases --- ci/remove_unsupported_testcases.py | 112 +++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 ci/remove_unsupported_testcases.py diff --git a/ci/remove_unsupported_testcases.py b/ci/remove_unsupported_testcases.py new file mode 100644 index 0000000000..1c2b05e44b --- /dev/null +++ b/ci/remove_unsupported_testcases.py @@ -0,0 +1,112 @@ +__copyright__ = """ +(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 +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of 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 +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +from pathlib import Path +import argparse + +# Enter tag of testcases to remove here WITHOUT the leading // +TESTCASES = [ + "SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", + "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, exo, random FER at 5%", + "SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", + "Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", + "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR", + "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out (Model from file)", + "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file)", + "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 32kHz out, BINAURAL out (Model from file)", + "3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file)", + "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out (Model from file)", + "Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", + "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR, exo", + "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, random FER at 5%", + "OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out", + "OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out", + "OSBA FOA 4ISM at 384 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR (Model from file) out", + "4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers", + "OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out", + "OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out", + "OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out", + "OSBA FOA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL (Model from file) out", + "SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", + "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, exo, random FER at 5%", + "SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", + "Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", + "Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching", + "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR", + "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out (Model from file)", + "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file)", + "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 32kHz out, BINAURAL out (Model from file)", + "3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file)", + "OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5%, bandwidth switching", + "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out (Model from file)", + "Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", + "OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching", + "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR, exo", + "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, random FER at 5%", + "OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out", + "OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out", + "OSBA FOA 4ISM at 384 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR (Model from file) out", + "4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers", + "OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out", + "OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out", + "OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out", + "OSBA FOA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL (Model from file) out", +] + + +def remove_testcases(cfg: Path, testcases: list): + """ + Go through file line by line and copy all testcases except the given ones + """ + with open(cfg, "r") as f: + content_in = f.readlines() + + content_out = list() + copy_flag = True + for line in content_in: + if any([tc in line for tc in testcases]): + copy_flag = False + + if copy_flag: + content_out.append(line) + elif line == "\n": + copy_flag = True + + with open(cfg, "w") as f: + f.write("".join(content_out)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("cfg_files", nargs="+", type=Path) + args = parser.parse_args() + + for f in args.cfg_files: + remove_testcases(f, TESTCASES) -- GitLab From 5962bcc968a7344cbe33bba452a2533538e18046 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 6 Mar 2024 09:39:35 +0100 Subject: [PATCH 498/498] add hrtf testcases back --- ci/remove_unsupported_testcases.py | 34 ------------------------------ 1 file changed, 34 deletions(-) diff --git a/ci/remove_unsupported_testcases.py b/ci/remove_unsupported_testcases.py index 1c2b05e44b..fbf2d8453c 100644 --- a/ci/remove_unsupported_testcases.py +++ b/ci/remove_unsupported_testcases.py @@ -33,51 +33,17 @@ import argparse # Enter tag of testcases to remove here WITHOUT the leading // TESTCASES = [ - "SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", - "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, exo, random FER at 5%", - "SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", - "Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", - "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR", - "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out (Model from file)", - "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file)", - "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 32kHz out, BINAURAL out (Model from file)", - "3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file)", - "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out (Model from file)", - "Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", - "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR, exo", - "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, random FER at 5%", "OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out", "OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out", - "OSBA FOA 4ISM at 384 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR (Model from file) out", "4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers", "OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out", - "OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out", - "OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out", - "OSBA FOA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL (Model from file) out", - "SBA at 48 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", - "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, exo, random FER at 5%", - "SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR", - "Planar SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", "Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching", - "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR", - "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL out (Model from file)", - "Multi-channel 5_1_4 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out (Model from file)", - "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 32kHz out, BINAURAL out (Model from file)", - "3 ISM with metadata at 192 kbps, 48 kHz in, 48 kHz out, BINAURAL out (Model from file)", "OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5%, bandwidth switching", - "Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out (Model from file)", - "Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR", "OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching", - "2 ISM with metadata at 128 kbps, 48 kHz in, 32 kHz out, BINAURAL out (Model from file), HR, exo", - "1 ISM with metadata at 80 kbps, 48 kHz in, 16 kHz out, BINAURAL out (Model from file), HR, random FER at 5%", "OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out", "OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out", - "OSBA FOA 4ISM at 384 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR (Model from file) out", "4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers", "OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out", - "OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out", - "OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out", - "OSBA FOA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL (Model from file) out", ] -- GitLab