diff --git a/apps/decoder.c b/apps/decoder.c index cdd5e309686d595053eee513ef1fb21f7811875f..76bd23bbf7dedb7b1d8bc284ee1837dc9411b099 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -43,9 +43,7 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" -#endif #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "options.h" @@ -117,9 +115,7 @@ typedef struct Word16 non_diegetic_pan_gain_fx; /* Q15 */ bool renderConfigEnabled; char *renderConfigFilename; -#ifdef SPLIT_REND_WITH_HEAD_ROT char *outputMdFilename; -#endif IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; bool tsmEnabled; IVAS_RENDER_FRAMESIZE renderFramesize; @@ -136,11 +132,7 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#else -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); @@ -157,10 +149,8 @@ int main( bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */ DecArguments arg; ivas_error error = IVAS_ERR_UNKNOWN; -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_BITS_DATA splitRendBits; uint8_t splitRendBitsBuf[ISAR_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES]; -#endif /* Any handles that require cleanup must be declared here and initialized to NULL */ IVAS_DEC_HANDLE hIvasDec = NULL; @@ -185,9 +175,7 @@ int main( reset_mem( USE_BYTES ); #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT splitRendBits.bits_buf = splitRendBitsBuf; -#endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments @@ -235,7 +223,6 @@ int main( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { fprintf( stdout, "Output metadata file: %s\n", arg.outputWavFilename ); @@ -246,7 +233,6 @@ int main( fprintf( stdout, "Output metadata file: %s\n", arg.outputMdFilename ); } else -#endif { fprintf( stdout, "Output synthesis file: %s\n", arg.outputWavFilename ); } @@ -280,11 +266,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - 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 - ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -384,12 +366,8 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ - 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 && - arg.Opt_non_diegetic_pan == 0 -#endif - ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && + arg.Opt_non_diegetic_pan == 0 ) { fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -425,7 +403,6 @@ int main( fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------------------------* * Configure Split rendering *------------------------------------------------------------------------------------------*/ @@ -447,7 +424,6 @@ int main( arg.enableHeadRotation = true; } -#endif /*------------------------------------------------------------------------------------------* * Configure VoIP mode @@ -473,7 +449,6 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.Opt_non_diegetic_pan == 0 ) @@ -481,13 +456,6 @@ int main( fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" ); goto cleanup; } -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" ); - goto cleanup; - } -#endif if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK ) { @@ -513,7 +481,6 @@ int main( renderConfig.directivity_fx[i * 3 + 2] = (Word16) ( renderConfig.directivity[i * 3 + 2] * ( ( 1u << 15 ) - 1 ) ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -538,7 +505,6 @@ int main( fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } } -#endif if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { @@ -557,13 +523,9 @@ int main( } renderConfig.roomAcoustics.override = true; } -#ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5; -#endif -#endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { @@ -793,11 +755,7 @@ int main( } else { -#ifdef SPLIT_REND_WITH_HEAD_ROT error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); -#else - error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf ); -#endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) @@ -935,7 +893,6 @@ static IVAS_AUDIO_CONFIG cmdline2config( { output_config = IVAS_AUDIO_CONFIG_BINAURAL; } -#ifdef SPLIT_REND_WITH_HEAD_ROT else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CODED" ) == 0 ) { output_config = IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; @@ -944,7 +901,6 @@ static IVAS_AUDIO_CONFIG cmdline2config( { output_config = IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; } -#endif else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_IR" ) == 0 ) { output_config = IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR; @@ -1012,9 +968,7 @@ static bool parseCmdlIVAS_dec( arg->renderConfigFilename = NULL; arg->Opt_dpid_on = 0; -#ifdef SPLIT_REND_WITH_HEAD_ROT arg->outputMdFilename = NULL; -#endif arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->Opt_non_diegetic_pan = 0; @@ -1262,7 +1216,6 @@ static bool parseCmdlIVAS_dec( } i += 2; } -#ifdef SPLIT_REND_WITH_HEAD_ROT else if ( strcmp( argv_to_upper, "-OM" ) == 0 ) { arg->outputMdFilename = argv[i + 1]; @@ -1274,7 +1227,6 @@ static bool parseCmdlIVAS_dec( } i += 2; } -#endif else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 ) { i++; @@ -1441,14 +1393,12 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { fprintf( stderr, "Error: Output split rendering metadata file is supported for BINAURAL_SPLIT_PCM output config. only\n\n" ); usage_dec(); return false; } -#endif } else { @@ -1525,13 +1475,8 @@ static void usage_dec( void ) fprintf( stdout, "Mandatory parameters:\n" ); fprintf( stdout, "---------------------\n" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, BINAURAL_SPLIT_CODED, BINAURAL_SPLIT_PCM, EXT\n" ); -#else - fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); - fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, EXT\n" ); -#endif fprintf( stdout, " By default, channel order and loudspeaker positions are equal to the\n" ); fprintf( stdout, " encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker\n" ); fprintf( stdout, " layout file. See readme.txt for details.\n" ); @@ -1571,9 +1516,7 @@ static void usage_dec( void ) fprintf( stdout, "-rvf File : Reference vector specified by external trajectory File\n" ); fprintf( stdout, " works only in combination with '-otr ref_vec' and 'ref_vec_lev' modes\n" ); fprintf( stdout, "-render_config File : Renderer configuration File\n" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stdout, "-om File : Metadata output File for BINAURAL_SPLIT_PCM OutputConf (only for Fs = 48 kHz)\n" ); -#endif fprintf( stdout, "-non_diegetic_pan P : panning mono non-diegetic sound to stereo with paning P, -90<= P <=90,\n" ); fprintf( stdout, " left or l or 90->left, right or r or -90->right, center or c or 0->middle\n" ); fprintf( stdout, "-exof File : External orientation File for external orientation trajectory\n" ); @@ -1600,15 +1543,11 @@ static void usage_dec( void ) *---------------------------------------------------------------------*/ static ivas_error initOnFirstGoodFrame( - IVAS_DEC_HANDLE hIvasDec, /* i/o: */ - const DecArguments arg, /* i : */ - const int16_t numInitialBadFrames, /* i : */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - int16_t *numOutSamples, /* i/o: */ - int16_t *vec_pos_len, /* i/o: */ -#else - const uint16_t numOutSamples, /* i : */ -#endif + IVAS_DEC_HANDLE hIvasDec, /* i/o: */ + const DecArguments arg, /* i : */ + const int16_t numInitialBadFrames, /* i : */ + int16_t *numOutSamples, /* i/o: */ + int16_t *vec_pos_len, /* i/o: */ int16_t *pFullDelayNumSamples, /* o : */ int16_t *pRemainingDelayNumSamples, /* o : */ int32_t *delayTimeScale, /* o : */ @@ -1617,13 +1556,8 @@ static ivas_error initOnFirstGoodFrame( MasaFileWriter **ppMasaWriter, /* o : */ IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], /* o : */ int16_t *pNumOutChannels, /* o : */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - uint16_t *pNumObj, /* o : */ - SplitFileReadWrite **splitRendWriter -#else - uint16_t *pNumObj /* o : */ -#endif -) + uint16_t *pNumObj, /* o : */ + SplitFileReadWrite **splitRendWriter ) { ivas_error error = IVAS_ERR_UNKNOWN; @@ -1634,12 +1568,10 @@ static ivas_error initOnFirstGoodFrame( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) { pFullDelayNumSamples[0] = 0; } -#endif if ( !arg.delayCompensationEnabled ) { @@ -1661,7 +1593,6 @@ static ivas_error initOnFirstGoodFrame( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) { /* Open split rendering metadata writer */ @@ -1670,10 +1601,8 @@ static ivas_error initOnFirstGoodFrame( ISAR_SPLIT_REND_CODEC splitRendCodec; int16_t splitRendCodecFrameSizeMs; ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t splitRendIsarFrameSizeMs; int16_t lc3plusHighRes; -#endif if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK ) { @@ -1684,15 +1613,9 @@ static ivas_error initOnFirstGoodFrame( if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS &splitRendIsarFrameSizeMs, -#endif - &splitRendCodecFrameSizeMs -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - &lc3plusHighRes -#endif - ) ) != IVAS_ERR_OK ) + &splitRendCodecFrameSizeMs, + &lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) ); return error; @@ -1706,14 +1629,10 @@ static ivas_error initOnFirstGoodFrame( delayTimeScale_temp, splitRendCodec, poseCorrection, - splitRendCodecFrameSizeMs -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, - lc3plusHighRes -#endif - ) ) != IVAS_ERR_OK ) + lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; @@ -1733,14 +1652,10 @@ static ivas_error initOnFirstGoodFrame( delayTimeScale_temp, splitRendCodec, poseCorrection, - splitRendCodecFrameSizeMs -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, - lc3plusHighRes -#endif - ) ) != IVAS_ERR_OK ) + lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; @@ -1750,23 +1665,19 @@ static ivas_error initOnFirstGoodFrame( if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) { -#endif /* Open audio writer and write all previously skipped bad frames now that frame size is known */ if ( ( error = AudioFileWriter_open( ppAfWriter, arg.outputWavFilename, arg.output_Fs, *pNumOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output file %s\n", arg.outputWavFilename ); return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif int16_t *zeroBuf = malloc( pcmFrameSize * sizeof( int16_t ) ); memset( zeroBuf, 0, pcmFrameSize * sizeof( int16_t ) ); for ( int16_t i = 0; i < numInitialBadFrames; ++i ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( *splitRendWriter != NULL ) { ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; @@ -1776,12 +1687,8 @@ static ivas_error initOnFirstGoodFrame( splitRendBitsZero.buf_len = 0; splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS splitRendBitsZero.codec_frame_size_ms = 0; splitRendBitsZero.isar_frame_size_ms = 20; -#else - splitRendBitsZero.codec_frame_size_ms = 20; -#endif if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) { @@ -1791,19 +1698,10 @@ static ivas_error initOnFirstGoodFrame( } else { -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( *pRemainingDelayNumSamples < *numOutSamples ) -#else - if ( *pRemainingDelayNumSamples < numOutSamples ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, *numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nOutput audio file writer error\n" ); return error; @@ -1812,15 +1710,9 @@ static ivas_error initOnFirstGoodFrame( } else { -#ifdef SPLIT_REND_WITH_HEAD_ROT *pRemainingDelayNumSamples -= *numOutSamples; -#else - *pRemainingDelayNumSamples -= numOutSamples; -#endif } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif } free( zeroBuf ); @@ -1906,7 +1798,6 @@ static ivas_error initOnFirstGoodFrame( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( *splitRendWriter != NULL ) { if ( numOutSamples == NULL || vec_pos_len == NULL ) @@ -1926,7 +1817,6 @@ static ivas_error initOnFirstGoodFrame( return error; } } -#endif return IVAS_ERR_OK; } @@ -1945,9 +1835,7 @@ static ivas_error decodeG192( RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_BITS_DATA *splitRendBits, -#endif IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) @@ -1974,9 +1862,7 @@ static ivas_error decodeG192( IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 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 } }; int16_t vec_pos_update, vec_pos_len; -#ifdef SPLIT_REND_WITH_HEAD_ROT SplitFileReadWrite *splitRendWriter = NULL; -#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { @@ -2074,7 +1960,6 @@ static ivas_error decodeG192( { IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( headRotReader == NULL ) { for ( i = 0; i < num_subframes; i++ ) @@ -2092,7 +1977,6 @@ static ivas_error decodeG192( } else { -#endif for ( i = 0; i < num_subframes; i++ ) { if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) @@ -2101,17 +1985,11 @@ static ivas_error decodeG192( goto cleanup; } } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif for ( i = 0; i < num_subframes; i++ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -2170,7 +2048,6 @@ static ivas_error decodeG192( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (Word16 *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) @@ -2184,7 +2061,6 @@ static ivas_error decodeG192( } else { -#endif if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -2192,9 +2068,7 @@ static ivas_error decodeG192( } nSamplesRendered += nSamplesRendered_loop; nSamplesToRender -= nSamplesRendered_loop; -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif if ( needNewFrame ) { @@ -2225,11 +2099,7 @@ static ivas_error decodeG192( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, nOutSamples, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj ) ) != IVAS_ERR_OK ) -#endif { goto cleanup; } @@ -2243,7 +2113,6 @@ static ivas_error decodeG192( /* Write current frame */ if ( decodedGoodFrame ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) @@ -2255,7 +2124,6 @@ static ivas_error decodeG192( if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) { -#endif if ( delayNumSamples < nOutSamples ) { if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) @@ -2269,9 +2137,7 @@ static ivas_error decodeG192( { delayNumSamples -= nOutSamples; } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif } /* Write ISm metadata to external file(s) */ @@ -2385,11 +2251,7 @@ static ivas_error decodeG192( 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; @@ -2509,18 +2371,14 @@ static ivas_error decodeG192( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( afWriter != NULL ) { -#endif if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif /*------------------------------------------------------------------------------------------* * Close files and deallocate resources @@ -2530,9 +2388,7 @@ static ivas_error decodeG192( cleanup: -#ifdef SPLIT_REND_WITH_HEAD_ROT split_rend_reader_writer_close( &splitRendWriter ); -#endif AudioFileWriter_close( &afWriter ); MasaFileWriter_close( &masaWriter ); for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) @@ -2779,7 +2635,6 @@ static ivas_error decodeVoIP( { IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( headRotReader == NULL ) { for ( i = 0; i < num_subframes; i++ ) @@ -2797,7 +2652,6 @@ static ivas_error decodeVoIP( } else { -#endif for ( i = 0; i < num_subframes; i++ ) { if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) @@ -2807,18 +2661,12 @@ static ivas_error decodeVoIP( 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 ) + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, + DEFAULT_AXIS ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -2945,15 +2793,10 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT SplitFileReadWrite *splitRendWriter = NULL; if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, NULL, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, nOutSamples, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, - &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj ) ) != IVAS_ERR_OK ) -#endif { goto cleanup; } diff --git a/apps/encoder.c b/apps/encoder.c index a7229dff54fbb688b1718fd803e8dfc84891ed90..8404747dc088e1321e4fa0b9e6e394369123d135 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -681,11 +681,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/apps/isar_post_rend.c b/apps/isar_post_rend.c index d9095054beead45053c678af29cbdcf0aa62bb24..4b478f7c20439392b053c7c3776f9b53791f4561 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -33,17 +33,6 @@ #include "lib_isar_post_rend.h" //#undef IVAS_FLOAT_FIXED -#ifndef SPLIT_REND_WITH_HEAD_ROT - -int main( int argc, char **argv ) -{ - (void) argc; - (void) argv; - ISAR_POST_REND_void_func(); - return 0; -} - -#else #include #include @@ -734,13 +723,9 @@ int main( bitsBuffer.config.bufLenInBytes = 0; bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS bitsBuffer.config.codec_frame_size_ms = 5; bitsBuffer.config.isar_frame_size_ms = 20; bitsBuffer.config.lc3plusHighRes = 0; -#else - bitsBuffer.config.codec_frame_size_ms = 20; -#endif CmdlnArgs args = parseCmdlnArgs( argc, argv ); @@ -764,9 +749,7 @@ int main( SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t inFileSampleRate = 0; -#endif strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 ); hSplitRendFileReadWrite = NULL; if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) @@ -775,14 +758,10 @@ int main( args.inMetadataFilePaths[0], &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, - &bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms, &inFileSampleRate, - &bitsBuffer.config.lc3plusHighRes -#endif - ); + &bitsBuffer.config.lc3plusHighRes ); if ( error != IVAS_ERR_OK ) { fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] ); @@ -803,14 +782,10 @@ int main( args.inputFilePath, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, - &bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms, &inFileSampleRate, - &bitsBuffer.config.lc3plusHighRes -#endif - ); + &bitsBuffer.config.lc3plusHighRes ); if ( error != IVAS_ERR_OK ) { fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath ); @@ -819,17 +794,11 @@ int main( audioReader = NULL; } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - int32_t inFileSampleRate = 0; -#endif if ( audioReader != NULL ) { error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate ); } - else -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - if ( hSplitRendFileReadWrite == NULL ) -#endif + else if ( hSplitRendFileReadWrite == NULL ) { inFileSampleRate = args.sampleRate; } @@ -891,13 +860,9 @@ int main( if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, - bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, - bitsBuffer.config.lc3plusHighRes -#endif - ) ) != IVAS_ERR_OK ) + bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1258,5 +1223,3 @@ int main( #undef WMC_TOOL_SKIP - -#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/apps/renderer.c b/apps/renderer.c index fa716c892345d4fc13ec13c2196584c4cf379f7b..8d7cb86c98f7a0baa5f323043e0227bd7e3e2fd4 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -45,10 +45,8 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #include "split_rend_bfi_file_reader.h" -#endif #include "vector3_pair_file_reader.h" #include "wmc_auto.h" @@ -155,13 +153,9 @@ typedef struct OutputConfig outConfig; char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; -#ifdef SPLIT_REND_WITH_HEAD_ROT char outMetadataFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; -#endif char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; -#ifdef SPLIT_REND_WITH_HEAD_ROT char splitRendBFIFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; -#endif char referenceVectorFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char referenceRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char externalOrientationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; @@ -208,10 +202,8 @@ typedef enum CmdLnOptionId_inputMetadata, CmdLnOptionId_listFormats, CmdLnOptionId_inputGain, -#ifdef SPLIT_REND_WITH_HEAD_ROT CmdLnOptionId_outputMetadata, CmdLnOptionId_SplitRendBFIFile, -#endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, CmdLnOptionId_framing, @@ -237,11 +229,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_inputMetadata, .match = "input_metadata", .matchShort = "im", -#ifdef SPLIT_REND_WITH_HEAD_ROT .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode", -#else - .description = "Space-separated list of path to metadata files for ISM or MASA inputs", -#endif }, { .id = CmdLnOptionId_outputFile, @@ -267,7 +255,6 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "T", .description = "Head rotation trajectory file for simulation of head tracking (only for binaural outputs)", }, -#ifdef SPLIT_REND_WITH_HEAD_ROT { .id = CmdLnOptionId_outputMetadata, .match = "output_metadata", @@ -280,7 +267,6 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "prbfi", .description = "Split rendering option: bfi file", }, -#endif { .id = CmdLnOptionId_refRotFile, .match = "reference_rotation_file", @@ -438,44 +424,24 @@ static void printSupportedAudioConfigs( void ); static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static void convertOutputBuffer_fx( const Word32 *Word32Buffer, const Word16 numSamplesPerChannel, const Word16 numChannels, -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 *intBuffer, const Word16 cldfb_in_flag, IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbSyn, - Word16 out_q -#else - Word16 *intBuffer, - Word16 out_q -#endif -); + Word16 out_q ); static void convertInputBuffer_fx( const Word16 *intBuffer, const Word16 numIntSamplesPerChannel, const Word16 numFloatSamplesPerChannel, const Word16 numChannels, -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 *Word32Buffer, Word16 in_q_factor, const int16_t cldfb_in_flag, IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbAna, - Word16 *out_q_factor -#else - Word32 *Word32Buffer, - Word16 in_q_factor -#endif -); -#else -static void convertInputBuffer( const int16_t *intBuffer, const int16_t numIntSamplesPerChannel, const int16_t numFloatSamplesPerChannel, const int16_t numChannels, float *floatBuffer ); - -static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); -static void convertOutputBuffer_fx( const Word32 *Word32Buffer, const Word16 numSamplesPerChannel, const Word16 numChannels, Word16 *intBuffer, Word16 q_factor ); -static void convertInputBuffer_fx( const Word16 *intBuffer, const Word16 numIntSamplesPerChannel, const Word16 numFloatSamplesPerChannel, const Word16 numChannels, Word32 *Int32Buffer, Word16 in_q_factor ); -#endif + Word16 *out_q_factor ); /*------------------------------------------------------------------------------------------* @@ -702,7 +668,6 @@ static float dBToLin( } -#ifdef SPLIT_REND_WITH_HEAD_ROT static int16_t get_cldfb_in_flag( const IVAS_AUDIO_CONFIG audioConfig, const IVAS_RENDER_CONFIG_DATA *renderConfig ) @@ -737,7 +702,6 @@ static int16_t is_split_pre_rend_mode( return flag; } -#endif /*------------------------------------------------------------------------------------------* @@ -754,12 +718,10 @@ int main( RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; RotFileReader *referenceRotReader = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS]; IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS]; int16_t cldfb_in_flag, CLDFBframeSize_smpls; SplitRendBFIFileReader *splitRendBFIReader = NULL; -#endif Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; @@ -780,9 +742,7 @@ int main( AudioFileWriter *audioWriter; int32_t inBufferSize; int32_t outBufferSize; -#ifdef SPLIT_REND_WITH_HEAD_ROT int32_t bitsBufferSize; -#endif int16_t *inpInt16Buffer; float *inFloatBuffer; int16_t *outInt16Buffer; @@ -790,17 +750,13 @@ int main( Word32 *inInt32Buffer; Word32 gain_fx; float *outFloatBuffer; -#ifdef SPLIT_REND_WITH_HEAD_ROT uint8_t *bitsBufferData = NULL; -#endif IVAS_REND_AudioBuffer inBuffer; IVAS_REND_AudioBuffer outBuffer; -#ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_REND_BitstreamBuffer bitsBuffer; SplitFileReadWrite *hSplitRendFileReadWrite; int16_t delayNumSamples_temp; int32_t delayTimeScale_temp; -#endif int16_t numSamplesRead; int16_t delayNumSamples = -1; int16_t delayNumSamples_orig = 0; @@ -821,7 +777,6 @@ int main( hMasaMetadata[i] = NULL; } -#ifdef SPLIT_REND_WITH_HEAD_ROT hSplitRendFileReadWrite = NULL; CLDFBframeSize_smpls = 0; cldfb_in_flag = 0; @@ -831,14 +786,9 @@ int main( bitsBuffer.config.bufLenInBytes = 0; bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS bitsBuffer.config.codec_frame_size_ms = 5; bitsBuffer.config.isar_frame_size_ms = 20; bitsBuffer.config.lc3plus_highres = 0; -#else - bitsBuffer.config.codec_frame_size_ms = 20; -#endif -#endif for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { lfeRoutingConfigs[i] = NULL; @@ -897,13 +847,11 @@ int main( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( !isEmptyString( args.splitRendBFIFilePath ) ) { convert_backslash( args.splitRendBFIFilePath ); SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader ); } -#endif if ( !isEmptyString( args.externalOrientationFilePath ) ) { if ( RotationFileReader_open( args.externalOrientationFilePath, &externalOrientationFileReader ) != IVAS_ERR_OK ) @@ -1231,28 +1179,16 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) ) { fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split pre-rendering mode is enabled. Exiting. \n" ); exit( -1 ); } -#else - if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) - { - fprintf( stderr, "\nExternal Renderer Config is only supported for binaural output configurations. Exiting. \n" ); - exit( -1 ); - } -#endif if ( ( error = IVAS_REND_GetRenderConfig( hIvasRend, &renderConfig ) ) != IVAS_ERR_OK ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n", ivas_error_to_string( error ) ); -#else - fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed\n" ); -#endif exit( -1 ); } @@ -1280,28 +1216,18 @@ int main( renderConfig.roomAcoustics.override = 1; } -#ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * 5; -#endif -#endif if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed: %s\n", ivas_error_to_string( error ) ); -#else - fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed\n" ); -#endif exit( -1 ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT CLDFBframeSize_smpls = frameSize_smpls * 2; cldfb_in_flag = get_cldfb_in_flag( args.outConfig.audioConfig, &renderConfig ); -#endif } if ( ( error = IVAS_REND_SetOrientationTrackingMode( hIvasRend, args.orientation_tracking ) ) != IVAS_ERR_OK ) @@ -1556,7 +1482,6 @@ int main( exit( -1 ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( cldfb_in_flag ) { if ( ( error = IVAS_REND_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate ) ) != IVAS_ERR_OK ) @@ -1572,12 +1497,8 @@ int main( IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, - &bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - &bitsBuffer.config.isar_frame_size_ms -#endif - ); + &bitsBuffer.config.codec_frame_size_ms, + &bitsBuffer.config.isar_frame_size_ms ); if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK ) { @@ -1591,14 +1512,10 @@ int main( delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, - bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, - bitsBuffer.config.lc3plus_highres -#endif - ) ) != IVAS_ERR_OK ) + bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath ); exit( -1 ); @@ -1613,12 +1530,8 @@ int main( IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, - &bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - &bitsBuffer.config.isar_frame_size_ms -#endif - ); + &bitsBuffer.config.codec_frame_size_ms, + &bitsBuffer.config.isar_frame_size_ms ); if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK ) { @@ -1632,35 +1545,27 @@ int main( delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, - bitsBuffer.config.codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, - bitsBuffer.config.lc3plus_highres -#endif - ) ) != IVAS_ERR_OK ) + bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath ); exit( -1 ); } } -#endif if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath ); exit( -1 ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( cldfb_in_flag == 0 ) { inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); @@ -1722,21 +1627,6 @@ int main( bitsBuffer.config.bitsRead = 0; bitsBuffer.config.bitsWritten = 0; bitsBuffer.config.bufLenInBytes = bitsBufferSize; -#else - inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); - outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) ); - outInt32Buffer = malloc( outBufferSize * sizeof( Word32 ) ); - inInt32Buffer = malloc( inBufferSize * sizeof( Word32 ) ); - outFloatBuffer = malloc( outBufferSize * sizeof( float ) ); - - inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; - inBuffer.config.numChannels = (int16_t) totalNumInChannels; - - outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; - outBuffer.config.numChannels = (int16_t) numOutChannels; - outBuffer.data_fx = outInt32Buffer; - inBuffer.data_fx = inInt32Buffer; -#endif #ifdef WMOPS reset_stack(); @@ -1779,15 +1669,10 @@ int main( } /* Convert from int to float and from interleaved to packed */ -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 Q_out; *outBuffer.pq_fact = 16 - ( gd_bits ); convertInputBuffer_fx( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inInt32Buffer, *outBuffer.pq_fact, inBuffer.config.is_cldfb, cldfbAna, &Q_out ); *outBuffer.pq_fact = Q_out; -#else - *outBuffer.pq_fact = 16 - ( gd_bits ); - convertInputBuffer_fx( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inInt32Buffer, *outBuffer.pq_fact ); -#endif int16_t num_subframes, sf_idx; num_subframes = (int16_t) args.render_framesize; @@ -1845,11 +1730,7 @@ int main( exit( -1 ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, headRot, Pos, DEFAULT_AXIS, sf_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, headRot, Pos, sf_idx ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -2002,7 +1883,6 @@ int main( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_REND_GetSplitBinauralBitstream( hIvasRend, outBuffer, &bitsBuffer ) ) != IVAS_ERR_OK ) @@ -2013,30 +1893,19 @@ int main( } else { -#endif if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer ) ) != IVAS_ERR_OK ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) ); -#else - fprintf( stderr, "Error in getting samples\n" ); -#endif exit( -1 ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif int16_t num_out_channels; num_out_channels = outBuffer.config.numChannels; /* Convert from float to int and from packed to interleaved. * Values in outFloatBuffer are guaranteed to be within range INT16_MIN:INT16_MAX */ -#ifdef SPLIT_REND_WITH_HEAD_ROT convertOutputBuffer_fx( outInt32Buffer, outBuffer.config.numSamplesPerChannel, num_out_channels, outInt16Buffer, cldfb_in_flag, cldfbSyn, *outBuffer.pq_fact ); -#else - convertOutputBuffer_fx( outInt32Buffer, outBuffer.config.numSamplesPerChannel, num_out_channels, outInt16Buffer, *outBuffer.pq_fact ); -#endif if ( delayNumSamples == -1 ) { @@ -2058,7 +1927,6 @@ int main( zeroPad = delayNumSamples; } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( is_split_pre_rend_mode( &args ) ) { if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, @@ -2071,7 +1939,6 @@ int main( if ( audioWriter != NULL ) { -#endif if ( delayNumSamples * num_out_channels < outBufferSize ) { if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK ) @@ -2085,13 +1952,10 @@ int main( { delayNumSamples -= (int16_t) ( outBufferSize / num_out_channels ); } - -#ifdef SPLIT_REND_WITH_HEAD_ROT } bitsBuffer.config.bitsRead = 0; bitsBuffer.config.bitsWritten = 0; -#endif /* Write MASA metadata for MASA outputs */ @@ -2197,10 +2061,8 @@ int main( } /* add zeros at the end to have equal length of synthesized signals */ -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( audioWriter != NULL ) { -#endif for ( zeroPadToWrite = zeroPad; zeroPadToWrite > frameSize_smpls; zeroPadToWrite -= frameSize_smpls ) { memset( outInt16Buffer, 0, outBufferSize * sizeof( int16_t ) ); @@ -2218,9 +2080,7 @@ int main( exit( -1 ); } zeroPadToWrite = 0; -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) @@ -2245,18 +2105,15 @@ int main( free( inInt32Buffer ); cleanup: -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( bitsBufferData != NULL ) { free( bitsBufferData ); } -#endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { MasaFileReader_close( &masaReaders[i] ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( cldfb_in_flag ) { IVAS_REND_closeCldfb( cldfbAna, cldfbSyn ); @@ -2264,7 +2121,6 @@ cleanup: split_rend_reader_writer_close( &hSplitRendFileReadWrite ); SplitRendBFIFileReader_close( &splitRendBFIReader ); -#endif for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { @@ -2574,13 +2430,8 @@ static bool parseOrientationTracking( static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ) { -#ifndef SPLIT_REND_WITH_HEAD_ROT - char charBuf[21]; - charBuf[20] = '\0'; -#else char charBuf[25]; charBuf[24] = '\0'; -#endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); charBuf[sizeof( charBuf ) - 1] = '\0'; @@ -2655,7 +2506,6 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( { return IVAS_AUDIO_CONFIG_BINAURAL; } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( strcmp( charBuf, "BINAURAL_SPLIT_PCM" ) == 0 ) { return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; @@ -2664,7 +2514,6 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( { return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } -#endif if ( strcmp( charBuf, "BINAURAL_ROOM_IR" ) == 0 ) { return IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR; @@ -2797,10 +2646,8 @@ static CmdlnArgs defaultArgs( args.numInMetadataFiles = 0; clearString( args.headRotationFilePath ); -#ifdef SPLIT_REND_WITH_HEAD_ROT clearString( args.outMetadataFilePath ); clearString( args.splitRendBFIFilePath ); -#endif clearString( args.referenceVectorFilePath ); clearString( args.referenceRotationFilePath ); clearString( args.customHrtfFilePath ); @@ -2893,7 +2740,6 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; -#ifdef SPLIT_REND_WITH_HEAD_ROT case CmdLnOptionId_outputMetadata: assert( numOptionValues == 1 ); strncpy( args->outMetadataFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -2902,7 +2748,6 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->splitRendBFIFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; -#endif case CmdLnOptionId_referenceVectorFile: assert( numOptionValues == 1 ); strncpy( args->referenceVectorFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -3921,10 +3766,8 @@ static void printSupportedAudioConfigs( void ) "ISMx (input only)", "MASAx", "BINAURAL (output only)", -#ifdef SPLIT_REND_WITH_HEAD_ROT "BINAURAL_SPLIT_PCM", "BINAURAL_SPLIT_CODED", -#endif "BINAURAL_ROOM_IR (output only)", "BINAURAL_ROOM_REVERB (output only)", }; @@ -4020,23 +3863,16 @@ static void convertInputBuffer_fx( const Word16 numIntSamplesPerChannel, const Word16 numFloatSamplesPerChannel, const Word16 numChannels, -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 *Word32Buffer, Word16 in_q_factor, const int16_t cldfb_in_flag, IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbAna, - Word16 *out_q_factor -#else - Word32 *Word32Buffer, - Word16 in_q_factor -#endif -) + Word16 *out_q_factor ) { Word16 chnl, smpl, i; i = 0; -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( cldfb_in_flag ) { Word16 slotIdx, numCldfbBands, numFloatPcmSamples; @@ -4077,7 +3913,6 @@ static void convertInputBuffer_fx( } ELSE { -#endif FOR( smpl = 0; smpl < numFloatSamplesPerChannel; ++smpl ) { FOR( chnl = 0; chnl < numChannels; ++chnl ) @@ -4094,10 +3929,8 @@ static void convertInputBuffer_fx( ++i; } } -#ifdef SPLIT_REND_WITH_HEAD_ROT *out_q_factor = in_q_factor; } -#endif return; } @@ -4114,23 +3947,16 @@ static void convertOutputBuffer_fx( const Word32 *Word32Buffer, const Word16 numSamplesPerChannel, const Word16 numChannels, -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 *intBuffer, const Word16 cldfb_in_flag, IVAS_CLDFB_FILTER_BANK_HANDLE *cldfbSyn, - Word16 out_q -#else - Word16 *intBuffer, - Word16 out_q -#endif -) + Word16 out_q ) { Word16 chnl, smpl, i; Word32 temp_fx; Word32 temp_fx1; i = 0; -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( cldfb_in_flag ) { Word16 slotIdx, numCldfbBands, numPcmSamples, b, temp_out_q = 0; @@ -4194,7 +4020,6 @@ static void convertOutputBuffer_fx( } ELSE { -#endif FOR( smpl = 0; smpl < numSamplesPerChannel; ++smpl ) { @@ -4215,9 +4040,7 @@ static void convertOutputBuffer_fx( ++i; } } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif return; } diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 5ffbb56e7b76aab664cc32da7a0f614df9a3b27c..2317dc95e4c0ccfdfa660c87d576fc7be3e32447 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -3077,13 +3077,8 @@ enum #define SYNC_BAD_FRAME (UWord16) 0x6B20 /* synchronization word of a "bad" frame */ #define G192_BIN0 (UWord16) 0x007F /* binary "0" according to ITU-T G.192 */ #define G192_BIN1 (UWord16) 0x0081 /* binary "1" according to ITU-T G.192 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT #define DEGREE_180 (Word32)(180.0 *ONE_IN_Q22) #define DEGREE_360 (Word32)(360.0 *ONE_IN_Q22) -#else -#define DEGREE_180 (Word32)(180.0 *ONE_IN_Q23) -#define DEGREE_360 (Word32)(360.0 *ONE_IN_Q23) -#endif extern const Word16 Idx2Freq_Tbl[]; #define chk_fs(fs) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index e1114a4f361e5a8f4c15beab29d9e349ea4d508e..175b23c3b08a1fe3e78a9479ca3d0ec706815065 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -219,7 +219,6 @@ typedef struct _IVAS_JBM_TRACE_DATA } IVAS_JBM_TRACE_DATA; -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------------------* * Split rendering API constants, structures, and enums *----------------------------------------------------------------------------------*/ @@ -276,38 +275,31 @@ typedef struct _ISAR_SPLIT_REND_BITS_DATA int16_t codec_frame_size_ms; ISAR_SPLIT_REND_CODEC codec; ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t isar_frame_size_ms; int16_t lc3plus_highres; -#endif } ISAR_SPLIT_REND_BITS_DATA, *ISAR_SPLIT_REND_BITS_HANDLE; typedef struct _ISAR_SPLIT_REND_CONFIG { - int32_t splitRendBitRate; /*Bit rate for split rendering mode, if "pcm_out" is set then "splitRendBitRate" is used as a limit for MD bitrate */ - int16_t hq_mode; /*High quality 3DOF mode with additional side information. Requires more pre-renditions. */ - int16_t dof; /*flag to specify if pose correction is needed for 1, 2 or 3 degree of freedoms*/ - /*The axis can be set dynamically per frame based on a file input */ - /*possible values: - 1 - (1dof correction. By default YAW correction) - 2 - (2dof correction. By default YAW and PITCH correction) - 3 - (3dof correction. By default YAW, PITCH and ROLL correction) - */ - int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */ -#endif + int32_t splitRendBitRate; /*Bit rate for split rendering mode, if "pcm_out" is set then "splitRendBitRate" is used as a limit for MD bitrate */ + int16_t hq_mode; /*High quality 3DOF mode with additional side information. Requires more pre-renditions. */ + int16_t dof; /*flag to specify if pose correction is needed for 1, 2 or 3 degree of freedoms*/ + /*The axis can be set dynamically per frame based on a file input */ + /*possible values: + 1 - (1dof correction. By default YAW correction) + 2 - (2dof correction. By default YAW and PITCH correction) + 3 - (3dof correction. By default YAW, PITCH and ROLL correction) + */ + int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ + int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */ int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; ISAR_SPLIT_REND_CODEC codec; ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t lc3plus_highres; -#endif } ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE; -#endif /*----------------------------------------------------------------------------------* * Renderer API structures and enums @@ -354,9 +346,7 @@ typedef struct _IVAS_RENDER_CONFIG IVAS_RENDER_TYPE_OVERRIDE renderer_type_override; #endif IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics; -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; -#endif float directivity[IVAS_MAX_NUM_OBJECTS * 3]; Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15} } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; @@ -365,9 +355,7 @@ typedef struct { int16_t numSamplesPerChannel; int16_t numChannels; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t is_cldfb; -#endif } IVAS_REND_AudioBufferConfig; typedef struct diff --git a/lib_com/delay_comp_fx.c b/lib_com/delay_comp_fx.c index 0398eb671a638c4c81a91908908983e17b8cbced..7bc574c3c846ed36d8d88c4a14872456095219b7 100644 --- a/lib_com/delay_comp_fx.c +++ b/lib_com/delay_comp_fx.c @@ -52,10 +52,8 @@ Word32 get_delay_fx( /* o : delay value in ms const Word32 io_fs, /* i : input/output sampling frequency Q0*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */ -#ifdef SPLIT_REND_WITH_HEAD_ROT , const AUDIO_CONFIG output_config /* i : decoder output config */ -#endif ) { Word32 delay; /*Q0*/ @@ -107,19 +105,15 @@ Word32 get_delay_fx( /* o : delay value in ms delay = IVAS_DEC_DELAY_NS; /*Q0*/ move32(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) { -#endif if ( hCldfb != NULL ) { /* compensate for filterbank delay */ delay = L_add( delay, IVAS_FB_DEC_DELAY_NS ); /*Q0*/ } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif test(); if ( EQ_16( ivas_format, MASA_FORMAT ) || EQ_16( ivas_format, MASA_ISM_FORMAT ) ) { diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 14c37a593b96b6d7a2a53e774444b011b8b6acda..e46f901c6f7fbf681d26b15cb19a38c9619ca0e0 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -98,12 +98,8 @@ typedef enum * input data errors * *----------------------------------------*/ IVAS_ERR_INVALID_BITSTREAM = 0x2000, -#ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM, IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM_CONFIG, -#endif -#endif /*----------------------------------------* * hardware errors * @@ -142,10 +138,8 @@ typedef enum IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING, IVAS_ERR_INVALID_ER_PARAM, IVAS_ERR_DIRECTIVITY_PATTERN_ID_MISSING, -#ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_ERR_LC3PLUS_INVALID_BITRATE, IVAS_ERR_INVALID_SPLIT_REND_CONFIG, -#endif /*----------------------------------------* * unknown error * @@ -244,12 +238,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Wrong mode"; case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED: return "Head rotation not supported"; -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_ERR_LC3PLUS_INVALID_BITRATE: return "Specified split rendering bit rate is not supported"; case IVAS_ERR_INVALID_SPLIT_REND_CONFIG: return "Specified split rendering configuration is invalid"; -#endif case IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED: return "External orientation not supported"; case IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED: diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index d989a1f68d07cf5052f2b551d628c2e7f02f0bb6..15a44f3b6b4f933a2b3ad11dbe063874bca3048d 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3699,18 +3699,11 @@ ivas_error ivas_allocate_binaural_hrtf_fx( void ivas_binRenderer_fx( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, -#endif COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ const Word16 numTimeSlots, /* i : number of time slots to render */ -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 Cldfb_RealBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ Word32 Cldfb_ImagBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ -#else - Word32 Cldfb_RealBuffer_Binaural_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - Word32 Cldfb_ImagBuffer_Binaural_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ -#endif Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ Word16 *Q_in /* i : LS signals exp */ @@ -5942,7 +5935,6 @@ float deg2rad( Word32 deg2rad_fx( Word32 degrees ); -#ifdef SPLIT_REND_WITH_HEAD_ROT void Quat2EulerDegree_fx( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ Word32 *yaw_fx, /* o : yaw */ @@ -5967,7 +5959,6 @@ void modify_Rmat_q_fx( Word16 q_cur, /* i : current q factor for rotation matrix */ Word16 q_new /* i : target q factor for rotation matrix */ ); -#endif /*=============================================================================================*/ /* clang-format off */ diff --git a/lib_com/ivas_rotation_com.c b/lib_com/ivas_rotation_com.c index 6e31f96d5b13bed79fd99209745e40ee8752b95b..78a0837ab41197d83544338508a5575c5876201d 100644 --- a/lib_com/ivas_rotation_com.c +++ b/lib_com/ivas_rotation_com.c @@ -78,8 +78,6 @@ void Euler2Quat_fx( } -#ifdef SPLIT_REND_WITH_HEAD_ROT - /*------------------------------------------------------------------------- * Copy_Quat_fx() * @@ -234,7 +232,6 @@ void Quat2EulerDegree_fx( return; } -#endif /*------------------------------------------------------------------------- * deg2rad() diff --git a/lib_com/options.h b/lib_com/options.h index a7c2f1b53d191993429ce11fd99e8025e64ab09d..3c18202549af9c2f2184cbfaed86a1fed881f2f6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -103,15 +103,9 @@ /* #################### Start BASOP porting switches ############################ */ -#define SPLIT_REND_WITH_HEAD_ROT /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT -#define SPLIT_REND_POSE_CORRECTION_UNUSED_BITS -#define ISAR_BITSTREAM_UPDATE_LC3PLUS /* FhG: Multiple improvements to the ISAR bitstream when LC3plus is used. See MR 1456 for details. */ #define FIX_1372_ISAR_POST_REND -#endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ - //#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ @@ -123,22 +117,11 @@ #define FIX_OLD_BINARY_FILE /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ - #endif //#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ -#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_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 NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ -#define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ -#define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ -#define FIX_1001_ARI_HM_OVERFLOW /* FhG: (no changes needed in BASOP) fix for undef behaviour in in the harmonic TCX model arithmetic coder */ -#define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #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_991_PARAMBIN_BINARY_HRTF */ /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ -#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 */ #define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index e899d32f9a9a66accde339fe97c2f9973c716c3e..ca754b11003032e18220d1e0d294d28cf9999bc5 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -1626,10 +1626,8 @@ Word32 get_delay_fx( /* o : delay value in ms const Word32 io_fs, /* i : input/output sampling frequency */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */ -#ifdef SPLIT_REND_WITH_HEAD_ROT , const AUDIO_CONFIG output_config /* i : decoder output config */ -#endif ); diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index d53d6c76dbf998eefaf286f7f86c24f9313131a6..b37b9bd6d94817571e215742ddd9f5b4c2fa4779 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -61,12 +61,8 @@ static void ivas_binRenderer_filterModule_fx( Word32 CLDFB_real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : real part of LS signals Q_curr*/ Word32 CLDFB_imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : imag part of LS signals Q_curr*/ const Word16 numTimeSlots, /* i : number of time slots to process */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ - const Word16 pos_idx, /* i : pose index */ -#else - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ -#endif + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ + const Word16 pos_idx, /* i : pose index */ Word16 Q_curr ) { Word16 bandIdx, k, chIdx, tapIdx; @@ -74,25 +70,15 @@ static void ivas_binRenderer_filterModule_fx( Word16 Q_filterStates; const Word32 *filterTapsLeftRealPtr_fx, *filterTapsLeftImagPtr_fx, *filterTapsRightRealPtr_fx, *filterTapsRightImagPtr_fx; Word16 shift_q; -#ifdef SPLIT_REND_WITH_HEAD_ROT Q_filterStates = hBinRenderer->hBinRenConvModule->Q_filterStates[pos_idx]; move16(); -#else - Q_filterStates = hBinRenderer->hBinRenConvModule->Q_filterStatesLeft; - move16(); -#endif FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT filterStatesLeftRealPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx][0] ); filterStatesLeftImagPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx][0] ); -#else - filterStatesLeftRealPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx][0] ); - filterStatesLeftImagPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx][0] ); -#endif /* SPLIT_REND_WITH_HEAD_ROT */ filterTapsLeftRealPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx]; // Q29 filterTapsLeftImagPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsLeftImag_fx[bandIdx][chIdx]; // Q29 @@ -136,11 +122,7 @@ static void ivas_binRenderer_filterModule_fx( outImagLeft_fx = W_shr( outImagLeft_fx, shift_q ); // Q_curr outRealRight_fx = W_shr( outRealRight_fx, shift_q ); // Q_curr outImagRight_fx = W_shr( outImagRight_fx, shift_q ); // Q_curr -#ifdef SPLIT_REND_WITH_HEAD_ROT hBinRenderer->hBinRenConvModule->Q_filterStates[pos_idx] = Q_curr; -#else - hBinRenderer->hBinRenConvModule->Q_filterStatesLeft = Q_curr; -#endif move16(); } @@ -194,18 +176,11 @@ static ivas_error ivas_binRenderer_convModuleOpen( const Word16 renderer_type, const Word16 isLoudspeaker, const AUDIO_CONFIG input_config, -#ifdef SPLIT_REND_WITH_HEAD_ROT const HRTFS_FASTCONV_HANDLE hHrtf, - const Word16 num_poses -#else - const HRTFS_FASTCONV_HANDLE hHrtf -#endif -) + const Word16 num_poses ) { Word16 bandIdx, chIdx; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif BINRENDERER_CONV_MODULE_HANDLE_FX hBinRenConvModule; @@ -331,7 +306,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( hBinRenConvModule->filterStatesLeftReal_fx = (Word32 ****) malloc( num_poses * sizeof( Word32 *** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); @@ -388,45 +362,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } -#else - IF( ( hBinRenConvModule->filterStatesLeftReal_fx = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } - - IF( ( hBinRenConvModule->filterStatesLeftImag_fx = (Word32 ***) malloc( hBinRenderer->conv_band * sizeof( Word32 ** ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } - - - FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) - { - IF( ( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } - - IF( ( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] = (Word32 **) malloc( hBinRenderer->nInChannels * sizeof( Word32 * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } - - - FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) - { - IF( ( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } - - IF( ( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] = (Word32 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } - } - } -#endif /* set memories */ FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { @@ -467,12 +402,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( IF( EQ_16( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { /* set the memories to zero */ -#ifndef SPLIT_REND_WITH_HEAD_ROT - set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] ); - set32_fx( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] ); - hBinRenConvModule->Q_filterStatesLeft = 31; - move16(); -#endif /* !SPLIT_REND_WITH_HEAD_ROT */ IF( isLoudspeaker ) { hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx] = hHrtf->leftBRIRReal_fx[bandIdx][tmp]; @@ -483,13 +412,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } ELSE { -#ifndef SPLIT_REND_WITH_HEAD_ROT - /* set the memories to zero */ - set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTaps ); - set32_fx( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTaps ); - hBinRenConvModule->Q_filterStatesLeft = 31; - move16(); -#endif /* SPLIT_REND_WITH_HEAD_ROT */ IF( isLoudspeaker ) { hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx] = hHrtf->leftHRIRReal_fx[bandIdx][tmp]; @@ -532,7 +454,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) @@ -567,7 +488,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } } -#endif hBinRenderer->hBinRenConvModule = hBinRenConvModule; @@ -1126,7 +1046,6 @@ static void ivas_binaural_obtain_DMX_fx( } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * ivas_rend_openCldfbRend() * @@ -1229,7 +1148,6 @@ ivas_error ivas_rend_openCldfbRend( return error; } -#endif /*------------------------------------------------------------------------- * ivas_binRenderer_open() @@ -1268,7 +1186,6 @@ ivas_error ivas_binRenderer_open_fx( move16(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; @@ -1279,7 +1196,6 @@ ivas_error ivas_binRenderer_open_fx( hBinRenderer->numPoses = 1; move16(); } -#endif /* Declare some common variables needed for renderer */ /* Which format used for binaural rendering (needed for late reverb) ? MC or SBA */ @@ -1336,17 +1252,10 @@ ivas_error ivas_binRenderer_open_fx( IVAS_OUTPUT_SETUP out_setup; /* Allocate memories and buffers needed for convolutional module in CICP19 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, IVAS_AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv, hBinRenderer->numPoses ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, IVAS_AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif ivas_output_init( &out_setup, IVAS_AUDIO_CONFIG_7_1_4 ); IF( st_ivas->hoa_dec_mtx == NULL ) @@ -1364,17 +1273,10 @@ ivas_error ivas_binRenderer_open_fx( ELSE { /* Allocate memories and buffers needed for convolutional module */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hHrtfFastConv, hBinRenderer->numPoses ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hHrtfFastConv ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) { @@ -1499,18 +1401,12 @@ ivas_error ivas_binRenderer_open_fx( * Close convolution module handle of fastconv binaural renderer *------------------------------------------------------------------------*/ static void ivas_binRenderer_convModuleClose_fx( -#ifdef SPLIT_REND_WITH_HEAD_ROT BINAURAL_RENDERER_HANDLE *hBinRenderer, /* i/o: fastconv binaural renderer handle */ const Word16 num_poses /* i : number of poses */ -#else - BINAURAL_RENDERER_HANDLE *hBinRenderer /* i/o: fastconv binaural renderer handle */ -#endif ) { Word16 bandIdx, chIdx; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 posIdx; -#endif BINRENDERER_CONV_MODULE_HANDLE_FX hBinRenConvModule; @@ -1548,7 +1444,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterTapsRightImag_fx ); hBinRenConvModule->filterTapsRightImag_fx = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( posIdx = 0; posIdx < num_poses; posIdx++ ) { FOR( bandIdx = 0; bandIdx < ( *hBinRenderer )->conv_band; bandIdx++ ) @@ -1574,25 +1469,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterStatesLeftImag_fx[posIdx] ); hBinRenConvModule->filterStatesLeftImag_fx[posIdx] = NULL; } -#else - FOR( bandIdx = 0; bandIdx < ( *hBinRenderer )->conv_band; bandIdx++ ) - { - FOR( chIdx = 0; chIdx < ( *hBinRenderer )->nInChannels; chIdx++ ) - { - free( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx] ); - hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx] = NULL; - - free( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] ); - hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] = NULL; - } - - free( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx] ); - hBinRenConvModule->filterStatesLeftReal_fx[bandIdx] = NULL; - - free( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] ); - hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] = NULL; - } -#endif free( hBinRenConvModule->filterStatesLeftReal_fx ); hBinRenConvModule->filterStatesLeftReal_fx = NULL; @@ -1623,11 +1499,7 @@ void ivas_binRenderer_close_fx( IF( ( *hBinRenderer )->hBinRenConvModule != NULL ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_binRenderer_convModuleClose_fx( hBinRenderer, ( *hBinRenderer )->numPoses ); -#else - ivas_binRenderer_convModuleClose_fx( hBinRenderer ); -#endif } IF( ( *hBinRenderer )->hReverb != NULL ) @@ -1798,29 +1670,20 @@ void ivas_binaural_add_LFE_fx( void ivas_binRenderer_fx( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, -#endif - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ - const Word16 numTimeSlots, /* i : number of time slots to render */ -#ifdef SPLIT_REND_WITH_HEAD_ROT + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ + const Word16 numTimeSlots, /* i : number of time slots to render */ Word32 Cldfb_RealBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ Word32 Cldfb_ImagBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ -#else - Word32 Cldfb_RealBuffer_Binaural_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals Q_in*/ - Word32 Cldfb_ImagBuffer_Binaural_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals Q_in*/ -#endif - Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals Q_in*/ - Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals Q_in*/ - Word16 *Q_in /* i : LS signals exp */ + Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals Q_in*/ + Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals Q_in*/ + Word16 *Q_in /* i : LS signals exp */ ) { Word16 chIdx, i, j, k; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx, num_poses; Word32 RealBuffer_local[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 ImagBuffer_local[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif // to be checked: feasibility with 32 bit buffers Word64 Cldfb_RealBuffer_Binaural_64fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; @@ -1828,14 +1691,11 @@ void ivas_binRenderer_fx( push_wmops( "fastconv_binaural_rendering" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT num_poses = hBinRenderer->numPoses; -#endif /* Compute Convolution */ /* memory reset for the binaural output */ -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) @@ -1864,18 +1724,6 @@ void ivas_binRenderer_fx( Copy32( ImagBuffer_fx[chIdx][k], ImagBuffer_local[chIdx][k], CLDFB_NO_CHANNELS_MAX ); } } -#else - FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - FOR( k = 0; k < numTimeSlots; k++ ) - { - set32_fx( Cldfb_RealBuffer_Binaural_fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); - set32_fx( Cldfb_ImagBuffer_Binaural_fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); - set64_fx( Cldfb_RealBuffer_Binaural_64fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); - set64_fx( Cldfb_ImagBuffer_Binaural_64fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); - } - } -#endif /* Head rotation in HOA3 or CICPx */ test(); @@ -1914,11 +1762,7 @@ void ivas_binRenderer_fx( hBinRenderer->nInChannels, hBinRenderer->conv_band, numTimeSlots, hBinRenderer->hoa_dec_mtx ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_binRenderer_filterModule_fx( Cldfb_RealBuffer_Binaural_64fx, Cldfb_ImagBuffer_Binaural_64fx, RealBuffer_fx, ImagBuffer_fx, numTimeSlots, hBinRenderer, 0, *Q_in ); -#else - ivas_binRenderer_filterModule_fx( Cldfb_RealBuffer_Binaural_64fx, Cldfb_ImagBuffer_Binaural_64fx, RealBuffer_fx, ImagBuffer_fx, numTimeSlots, hBinRenderer, *Q_in ); -#endif FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { @@ -1926,22 +1770,14 @@ void ivas_binRenderer_fx( { FOR( k = 0; k < CLDFB_NO_CHANNELS_MAX; k++ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT Cldfb_RealBuffer_Binaural_fx[0][i][j][k] = W_extract_l( W_shr( Cldfb_RealBuffer_Binaural_64fx[i][j][k], 29 ) ); //(*Q_in + 29) - 29 move32(); Cldfb_ImagBuffer_Binaural_fx[0][i][j][k] = W_extract_l( W_shr( Cldfb_ImagBuffer_Binaural_64fx[i][j][k], 29 ) ); //(*Q_in + 29) - 29 move32(); -#else - Cldfb_RealBuffer_Binaural_fx[i][j][k] = W_extract_l( W_shr( Cldfb_RealBuffer_Binaural_64fx[i][j][k], 29 ) ); //(*Q_in + 29) - 29 - move32(); - Cldfb_ImagBuffer_Binaural_fx[i][j][k] = W_extract_l( W_shr( Cldfb_ImagBuffer_Binaural_64fx[i][j][k], 29 ) ); //(*Q_in + 29) - 29 - move32(); -#endif } } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( pMultiBinPoseData != NULL ) { IF( GT_16( pMultiBinPoseData->num_poses, 1 ) ) @@ -2032,7 +1868,6 @@ void ivas_binRenderer_fx( } } } -#endif /* Obtain the binaural dmx and compute the reverb */ IF( hBinRenderer->hReverb != NULL ) @@ -2074,18 +1909,12 @@ void ivas_binRenderer_fx( { FOR( k = 0; k < numTimeSlots; k++ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { /* Combine first and second parts to generate binaural output signal with room effect */ v_add_32( Cldfb_RealBuffer_Binaural_fx[pos_idx][chIdx][k], reverbRe_fx[chIdx][k], Cldfb_RealBuffer_Binaural_fx[pos_idx][chIdx][k], hBinRenderer->conv_band ); // Q_in v_add_32( Cldfb_ImagBuffer_Binaural_fx[pos_idx][chIdx][k], reverbIm_fx[chIdx][k], Cldfb_ImagBuffer_Binaural_fx[pos_idx][chIdx][k], hBinRenderer->conv_band ); // Q_in } -#else - /* Combine first and second parts to generate binaural output signal with room effect */ - v_add_32( Cldfb_RealBuffer_Binaural_fx[chIdx][k], reverbRe_fx[chIdx][k], Cldfb_RealBuffer_Binaural_fx[chIdx][k], hBinRenderer->conv_band ); // Q_in - v_add_32( Cldfb_ImagBuffer_Binaural_fx[chIdx][k], reverbIm_fx[chIdx][k], Cldfb_ImagBuffer_Binaural_fx[chIdx][k], hBinRenderer->conv_band ); // Q_in -#endif } } } @@ -2093,7 +1922,6 @@ void ivas_binRenderer_fx( return; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * ivas_rend_CldfbMultiBinRendProcess() * @@ -2174,4 +2002,3 @@ void ivas_rend_CldfbMultiBinRendProcess( return; } -#endif diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index e843a82f9149f5f48bdbe58a0dbb9995d0960407..b0bfb9fdcf1b518f1fe3ddc44082648662d2f738 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -978,9 +978,7 @@ ivas_error ivas_dirac_dec_config_fx( Word16 need_parambin; Word16 dec_param_estim_old; Word16 dec_param_estim_new; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 num_poses, pos_idx; -#endif error = IVAS_ERR_OK; move32(); @@ -1011,7 +1009,6 @@ ivas_error ivas_dirac_dec_config_fx( move16(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT num_poses = 1; move16(); IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) @@ -1019,7 +1016,6 @@ ivas_error ivas_dirac_dec_config_fx( num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; move16(); } -#endif sparfoa_flag = 0; move16(); @@ -1067,11 +1063,7 @@ ivas_error ivas_dirac_dec_config_fx( IF( !need_parambin ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#else - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); -#endif } need_dirac_rend = 0; @@ -1144,11 +1136,7 @@ ivas_error ivas_dirac_dec_config_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0] == NULL ) -#else - IF( st_ivas->hDiracDecBin == NULL ) -#endif { #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF IF( NE_32( ( error = ivas_dirac_dec_init_binaural_data_fx( st_ivas, &( st_ivas->hHrtfParambin ) ) ), IVAS_ERR_OK ) ) @@ -1164,75 +1152,41 @@ ivas_error ivas_dirac_dec_config_fx( /* This is required to keep BE in rate switching. This probably means that 1TC and 2TC MASA perform differently. */ test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params != NULL && !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && st_ivas->nSCE > 0 ) ) -#else - IF( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params != NULL && !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && st_ivas->nSCE > 0 ) ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_decorr_close_fx( &st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params, &st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_state ); // done -#else - ivas_dirac_dec_decorr_close_fx( &st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params, &st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_state ); // done -#endif } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ), IVAS_ERR_OK ) ) -#endif { return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* copy td-decorr flag to split renderer side rendereres */ FOR( pos_idx = 1; pos_idx < num_poses; pos_idx++ ) { st_ivas->hDiracDecBin[pos_idx]->useTdDecorr = st_ivas->hDiracDecBin[0]->useTdDecorr; } IF( !st_ivas->hDiracDecBin[0]->useTdDecorr ) -#else - IF( !st_ivas->hDiracDecBin->useTdDecorr ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params == NULL ) -#else - IF( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params == NULL ) -#endif { Word16 frequency_axis_fx[CLDFB_NO_CHANNELS_MAX]; ivas_dirac_dec_get_frequency_axis_fx( frequency_axis_fx, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSpatParamRendCom->num_freq_bands ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_dirac_dec_decorr_open_fx( &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params ), &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_state ), st_ivas->hSpatParamRendCom->num_freq_bands, BINAURAL_CHANNELS, BINAURAL_CHANNELS, DIRAC_SYNTHESIS_PSD_LS, frequency_axis_fx, BINAURAL_CHANNELS, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = ivas_dirac_dec_decorr_open_fx( &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params ), &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_state ), st_ivas->hSpatParamRendCom->num_freq_bands, BINAURAL_CHANNELS, BINAURAL_CHANNELS, - DIRAC_SYNTHESIS_PSD_LS, frequency_axis_fx, BINAURAL_CHANNELS, st_ivas->hDecoderConfig->output_Fs ) ), - IVAS_ERR_OK ) ) - { - return error; - } -#endif } } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { st_ivas->hDiracDecBin[pos_idx]->reqularizationFactor_fx = configure_reqularization_factor_fx( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); } -#else - st_ivas->hDiracDecBin->reqularizationFactor_fx = configure_reqularization_factor_fx( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); - move16(); -#endif } } } @@ -2279,13 +2233,8 @@ void ivas_dirac_dec_render_sf_fx( /*CLDFB: last output channels reserved to LFT for CICPx*/ Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#else - Word32 Cldfb_RealBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif Word16 index = 0, num_freq_bands = 0; move16(); move16(); @@ -2300,7 +2249,6 @@ void ivas_dirac_dec_render_sf_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( Word16 p = 0; p < MAX_HEAD_ROT_POSES; p++ ) { FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) @@ -2312,16 +2260,6 @@ void ivas_dirac_dec_render_sf_fx( } } } -#else - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) - { - set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); - set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); - } - } -#endif /* local copies of azi, ele, diffuseness */ Word16 azimuth[CLDFB_NO_CHANNELS_MAX]; @@ -4093,7 +4031,6 @@ void ivas_dirac_dec_render_sf_fx( input_q = Q6; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { IF( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) @@ -4110,28 +4047,19 @@ void ivas_dirac_dec_render_sf_fx( move16(); } } -#endif ivas_binRenderer_fx( st_ivas->hBinRenderer, -#ifdef SPLIT_REND_WITH_HEAD_ROT ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, -#endif st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); -#ifndef SPLIT_REND_WITH_HEAD_ROT - Scale_sig32( Cldfb_RealBuffer_Binaural_fx[0][0], i_mult( BINAURAL_CHANNELS, i_mult( MAX_PARAM_SPATIAL_SUBFRAMES, CLDFB_NO_CHANNELS_MAX ) ), sub( Q6, input_q ) ); // Q6 - Scale_sig32( Cldfb_ImagBuffer_Binaural_fx[0][0], i_mult( BINAURAL_CHANNELS, i_mult( MAX_PARAM_SPATIAL_SUBFRAMES, CLDFB_NO_CHANNELS_MAX ) ), sub( Q6, input_q ) ); // Q6 -#else Word16 pos_idx; FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) { Scale_sig32( &Cldfb_RealBuffer_Binaural_fx[pos_idx][0][0][0], i_mult( BINAURAL_CHANNELS, i_mult( MAX_PARAM_SPATIAL_SUBFRAMES, CLDFB_NO_CHANNELS_MAX ) ), sub( Q6, input_q ) ); // Q6 Scale_sig32( &Cldfb_ImagBuffer_Binaural_fx[pos_idx][0][0][0], i_mult( BINAURAL_CHANNELS, i_mult( MAX_PARAM_SPATIAL_SUBFRAMES, CLDFB_NO_CHANNELS_MAX ) ), sub( Q6, input_q ) ); // Q6 } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) @@ -4146,7 +4074,6 @@ void ivas_dirac_dec_render_sf_fx( } } } -#endif /* Inverse CLDFB*/ FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) @@ -4157,17 +4084,10 @@ void ivas_dirac_dec_render_sf_fx( Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[0][ch][i]; move32(); ImagBuffer_fx[i] = Cldfb_ImagBuffer_Binaural_fx[0][ch][i]; move32(); -#else - RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[ch][i]; - move32(); - ImagBuffer_fx[i] = Cldfb_ImagBuffer_Binaural_fx[ch][i]; - move32(); -#endif } scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( ( Q6 - 1 ), st_ivas->cldfbSynDec[ch]->Q_cldfb_state ) ); // Q6-1 diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 312011c73b53bd0f12a30c1bce520135b4a685f7..f00ea46767ca397a2f8cab00e83a864764572631 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -42,11 +42,9 @@ #include "prot_fx.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "lib_isar_pre_rend.h" #include "isar_prot.h" #include "isar_stat.h" -#endif /*-------------------------------------------------------------------* @@ -57,7 +55,6 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, Word16 *num_bits_re static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas ); @@ -255,16 +252,10 @@ static ivas_error ivas_dec_init_split_rend( move16(); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS error = ISAR_PRE_REND_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, mixed_td_cldfb_flag ); move16(); -#else - error = ISAR_PRE_REND_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, mixed_td_cldfb_flag ); - move16(); -#endif return error; } -#endif /*-------------------------------------------------------------------* * ivas_dec_setup() @@ -734,7 +725,6 @@ ivas_error ivas_dec_setup( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------* * reconfig split rendering as renderer might change after bitrate switching *-----------------------------------------------------------------*/ @@ -746,7 +736,6 @@ ivas_error ivas_dec_setup( return error; } } -#endif /*----------------------------------------------------------------* * Reset bitstream pointers @@ -1187,12 +1176,8 @@ IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics *--------------------------------------------------------------------*/ test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_STEREO ) && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) -#else -IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { IF( NE_32( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ), IVAS_ERR_OK ) ) { @@ -1382,7 +1367,6 @@ ivas_error ivas_init_decoder_fx( } #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------* * Initialize binuaral split rendering *-----------------------------------------------------------------*/ @@ -1395,7 +1379,6 @@ ivas_error ivas_init_decoder_fx( return error; } } -#endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles @@ -2291,11 +2274,7 @@ ivas_error ivas_init_decoder_fx( move16(); } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else - IF( EQ_32( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) @@ -2344,7 +2323,6 @@ ivas_error ivas_init_decoder_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( 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 ) ), @@ -2353,17 +2331,6 @@ ivas_error ivas_init_decoder_fx( IF( NE_32( ( 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 == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( NE_32( ( 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( NE_32( ( 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; @@ -2528,9 +2495,7 @@ ivas_error ivas_init_decoder_fx( { IF( st_ivas->hBinRenderer->render_lfe ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#endif { /* Account for filterbank delay */ binauralization_delay_ns = L_add( binauralization_delay_ns, IVAS_FB_DEC_DELAY_NS ); @@ -2880,14 +2845,10 @@ void ivas_initialize_handles_dec( /* rendering handles */ st_ivas->hBinRenderer = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { st_ivas->hDiracDecBin[i] = NULL; } -#else - st_ivas->hDiracDecBin = NULL; -#endif st_ivas->hDirACRend = NULL; st_ivas->hSpatParamRendCom = NULL; st_ivas->hLsSetUpConversion = NULL; @@ -2915,13 +2876,11 @@ void ivas_initialize_handles_dec( st_ivas->hExtOrientationData = NULL; st_ivas->hCombinedOrientationData = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT st_ivas->hSplitBinRend = NULL; for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { st_ivas->hTdRendHandles[i] = NULL; } -#endif /* JBM handles */ st_ivas->hTcBuffer = NULL; st_ivas->hJbmMetadata = NULL; @@ -3058,7 +3017,6 @@ void ivas_destroy_dec_fx( /* Fastconv binaural renderer handle */ ivas_binRenderer_close_fx( &st_ivas->hBinRenderer ); -#ifdef SPLIT_REND_WITH_HEAD_ROT /* TD binaural renderer handles */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { @@ -3068,21 +3026,12 @@ void ivas_destroy_dec_fx( ivas_td_binaural_close_fx( &st_ivas->hTdRendHandles[i] ); } } -#endif /* Parametric binaural renderer handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#else - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); -#endif /* Crend handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); -#endif /* Reverb handle */ ivas_reverb_close( &st_ivas->hReverb ); @@ -3253,11 +3202,7 @@ void ivas_init_dec_get_num_cldfb_instances( move16(); } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0]->useTdDecorr ) -#else - IF( st_ivas->hDiracDecBin->useTdDecorr ) -#endif { *numCldfbAnalyses = add( *numCldfbAnalyses, 2 ); move16(); @@ -3518,11 +3463,7 @@ void ivas_init_dec_get_num_cldfb_instances_ivas_fx( move16(); } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0]->useTdDecorr ) -#else - IF( st_ivas->hDiracDecBin->useTdDecorr ) -#endif { *numCldfbAnalyses = add( *numCldfbAnalyses, 2 ); move16(); @@ -3810,22 +3751,16 @@ static ivas_error doSanityChecks_IVAS( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && NE_32( output_Fs, 48000 ) ) { 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 ) { test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) -#endif { return IVAS_ERROR( IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED, "Wrong set-up: Head-rotation not supported in this configuration" ); } diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index ff4f45eca2a5f27b3c1092fa9d4f7b94d787817d..13e888af3ac3412a35df0a51ef3d1a4bd6d95e6a 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -196,18 +196,10 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_param_ism_dec_close_fx( &( st_ivas->hParamIsmDec ), &( st_ivas->hSpatParamRendCom ), st_ivas->hDecoderConfig->output_config ); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { /* close the parametric binaural renderer */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#else - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); -#endif /* Open the TD Binaural renderer */ test(); IF( st_ivas->hHrtfTD == NULL || st_ivas->hBinRendererTd == NULL ) @@ -218,11 +210,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else - IF( EQ_32( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) @@ -248,32 +236,14 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { /* close the parametric binaural renderer */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#else - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); -#endif /* Open Crend Binaural renderer */ -#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( 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 == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( 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 == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #endif -#else -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - IF( NE_32( ( 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 ) ) - { - return error; - } -#else - IF( NE_32( ( 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 - { - return error; - } -#endif st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; move32(); @@ -291,11 +261,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( } test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { /* open the parametric binaural renderer */ IF( NE_32( ( error = ivas_dirac_dec_binaural_copy_hrtfs_fx( &st_ivas->hHrtfParambin ) ), IVAS_ERR_OK ) ) @@ -348,11 +314,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( } /* close the crend binaural renderer */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); -#endif } } @@ -393,18 +355,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( tc_nchan_full_new = tc_nchan_tc_new; move16(); -#ifndef FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN - test(); - test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) - { - tc_nchan_allocate_new = 2 * BINAURAL_CHANNELS; - move16(); - tc_nchan_full_new = tc_nchan_allocate_new; - move16(); - } - -#endif test(); test(); test(); diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 5552b3dc27d5b3eb0db93a72d0ba714059511577..09e3c0e6ced9f1ae5c3b4e10d3cd1a679cacc762 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -527,11 +527,7 @@ static ivas_error ivas_param_ism_rendering_init_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) -#endif { /* computation of proto matrix */ ivas_ism_get_proto_matrix_fx( hOutSetup, nchan_transport, hParamIsmRendering->proto_matrix_fx ); @@ -708,13 +704,8 @@ ivas_error ivas_param_ism_dec_open_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || - EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) ) -#endif { /* Initialize efap handle */ IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), hOutSetup.ls_azimuth_fx, hOutSetup.ls_elevation_fx, hOutSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) @@ -737,11 +728,7 @@ ivas_error ivas_param_ism_dec_open_fx( test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { IF( NE_32( ( error = ivas_dirac_allocate_parameters_fx( hSpatParamRendCom, 1 ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index f2a7f6549b0876511fb15dc78fbaa8c9721fe068..c21f182da9717b3e9cb9fb22c423695770df4818 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -175,25 +175,6 @@ ivas_error ivas_jbm_dec_tc_fx( { hp20_fx_32( p_output_fx[n], output_frame, st_ivas->mem_hp20_out_fx[n], output_Fs ); } -#ifndef FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO - - test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) - { - s = Q16 - Q11; - move16(); - s = sub( s, find_guarded_bits_fx( st_ivas->nchan_transport ) ); - FOR( i = 0; i < s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); ++i ) - { - Scale_sig32( p_output_fx[i], output_frame, s ); // Q(11+s) - } - ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, output_frame, p_output_fx, p_output_fx ); - FOR( i = 0; i < s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); ++i ) - { - Scale_sig32( p_output_fx[i], output_frame, negate( s ) ); // Q11 - } - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { @@ -1642,7 +1623,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( test(); test(); /* delay the objects here for all renderers where it is needed */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || @@ -1651,14 +1631,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( EQ_16( st_ivas->renderer_type, RENDERER_OSBA_LS ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) && ( NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || - EQ_16( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || - EQ_16( st_ivas->renderer_type, RENDERER_OSBA_LS ) || - EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) -#endif { FOR( n = 0; n < st_ivas->nchan_ism; n++ ) { @@ -1862,9 +1834,7 @@ ivas_error ivas_jbm_dec_render_fx( const Word16 output_q_factor = Q11; move16(); SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 nchan_out_syn_output; -#endif push_wmops( "ivas_dec_render" ); /*----------------------------------------------------------------* @@ -2036,7 +2006,6 @@ ivas_error ivas_jbm_dec_render_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* Binaural rendering */ IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) { @@ -2055,16 +2024,6 @@ ivas_error ivas_jbm_dec_render_fx( } } } -#else - /* Binaural rendering */ - IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) - { - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) - { - return error; - } - } -#endif ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { st_ivas->hCrendWrapper->p_io_qfactor = &st_ivas->hCrendWrapper->io_qfactor; @@ -2084,17 +2043,10 @@ ivas_error ivas_jbm_dec_render_fx( scale_sig32( p_output_fx[i], *nSamplesRendered, negate( sub( 11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q11 } -#if defined SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif FOR( i = 0; i < nchan_out; i++ ) { @@ -2314,7 +2266,6 @@ ivas_error ivas_jbm_dec_render_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { if ( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, @@ -2325,28 +2276,16 @@ ivas_error ivas_jbm_dec_render_fx( } else { -#endif -#if defined SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs ) ), - IVAS_ERR_OK ) ) - { - return error; - } -#endif ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx ); -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif FOR( i = 0; i < nchan_in; i++ ) { @@ -2370,7 +2309,6 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { IF( NE_32( ( error = ivas_td_binaural_renderer_sf_splitBinaural( st_ivas, p_output_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) @@ -2380,16 +2318,13 @@ ivas_error ivas_jbm_dec_render_fx( } else { -#endif IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) { return error; } ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx ); -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif } } ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) ) @@ -2401,10 +2336,8 @@ ivas_error ivas_jbm_dec_render_fx( /* Rendering */ IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) && !st_ivas->hDecoderConfig->Opt_Headrotation ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT /*handled in CLDFB domain already*/ IF( NE_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#endif { ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_output_fx, p_output_fx ); } @@ -2614,7 +2547,6 @@ ivas_error ivas_jbm_dec_render_fx( move16(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { FOR( i = 0; i < st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; i++ ) @@ -2626,7 +2558,6 @@ ivas_error ivas_jbm_dec_render_fx( move16(); IF( st_ivas->hDecoderConfig->Opt_Limiter ) -#endif { IF( NE_32( st_ivas->ivas_format, MONO_FORMAT ) ) { @@ -2636,11 +2567,7 @@ ivas_error ivas_jbm_dec_render_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_syn_output_fx( p_output_fx, output_q_factor, *nSamplesRendered, nchan_out_syn_output, data ); -#else - ivas_syn_output_fx( p_output_fx, output_q_factor, *nSamplesRendered, nchan_out, data ); -#endif *nSamplesAvailableNext = st_ivas->hTcBuffer->n_samples_available; move16(); @@ -2679,9 +2606,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( Word32 *p_output_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; #endif Word16 nchan_in, nchan_out; -#ifndef SPLIT_REND_WITH_HEAD_ROT - Word16 gd_bits, shift, n_chan_inp, i; -#endif IF( !st_ivas->hDecoderConfig->Opt_tsm ) { return IVAS_ERR_OK; @@ -2776,47 +2700,12 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( st_ivas->hCrendWrapper->p_io_qfactor = &st_ivas->hCrendWrapper->io_qfactor; *st_ivas->hCrendWrapper->p_io_qfactor = 11; move16(); -#if defined SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; } -#else - shift = MAX_16; - move16(); - n_chan_inp = add( st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hIntSetup.num_lfe ); - - FOR( i = 0; i < n_chan_inp; i++ ) - { - shift = s_min( shift, L_norm_arr( p_output_fx[i], hTcBuffer->n_samples_granularity ) ); - } - - gd_bits = sub( find_guarded_bits_fx( imult1616( hTcBuffer->subframe_nbslots[0], hTcBuffer->n_samples_granularity ) ), shift ); - - *st_ivas->hCrendWrapper->p_io_qfactor = sub( *st_ivas->hCrendWrapper->p_io_qfactor, gd_bits ); - move16(); - - FOR( i = 0; i < n_chan_inp; i++ ) - { - scale_sig32( p_output_fx[i], hTcBuffer->n_samples_granularity, sub( *st_ivas->hCrendWrapper->p_io_qfactor, Q11 ) ); // Q(*st_ivas->hCrendWrapper->p_io_qfactor) - } - - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, - NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ), - IVAS_ERR_OK ) ) - { - return error; - } - - FOR( i = 0; i < n_chan_inp; i++ ) - { - scale_sig32( p_output_fx[i], hTcBuffer->n_samples_granularity, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q(11) - } - *st_ivas->hCrendWrapper->p_io_qfactor = Q11; - move16(); -#endif } } ELSE @@ -2844,29 +2733,16 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( *st_ivas->hCrendWrapper->p_io_qfactor = 11; move16(); -#if defined SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ), - IVAS_ERR_OK ) ) - { - return error; - } -#endif ivas_binaural_add_LFE_fx( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc_fx, p_output_fx ); } -#ifdef NONBE_FIX_999_JBM_MCT_FLUSH ELSE IF( EQ_16( renderer_type_old, RENDERER_BINAURAL_OBJECTS_TD ) ) -#else - ELSE IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) -#endif { IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) { @@ -2874,12 +2750,10 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( } ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->tc_fx, p_output_fx ); } -#ifdef NONBE_FIX_999_JBM_MCT_FLUSH ELSE { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong renderer in MCT VoIP renderer flushing!" ); } -#endif } ELSE { @@ -2982,9 +2856,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( *nSamplesRendered = n_samples_to_render; move16(); /* Only write out the valid data*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDecoderConfig->Opt_Limiter ) -#endif { IF( NE_16( st_ivas->ivas_format, MONO_FORMAT ) ) { diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index e87683562a1e927806fdbb09ad1e2172f4335e45..8bf808ed6cfe3ec1868b6337956f0ac07b94e826 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1589,9 +1589,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( Word16 numCldfbAnalyses_old, numCldfbSyntheses_old; ivas_error error; Word32 ism_total_brate; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif error = IVAS_ERR_OK; move16(); @@ -1622,13 +1620,8 @@ ivas_error ivas_masa_dec_reconfigure_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend == NULL ) || ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin[0] == NULL ) ) -#else - IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend == NULL ) || - ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin == NULL ) ) -#endif { /* init a new DirAC dec */ if ( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) @@ -1641,11 +1634,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( IF( st_ivas->hDirAC != NULL ) { /* close all unnecessary parametric decoding and rendering */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#else - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); -#endif ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); @@ -1696,11 +1685,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin[0] != NULL ) -#else - IF( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin != NULL ) -#endif { if ( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) { @@ -1756,11 +1741,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend != NULL ) || ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin[0] != NULL ) ) -#else - IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend != NULL ) || ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin != NULL ) ) -#endif { if ( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) { @@ -1778,11 +1759,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend != NULL ) || ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin[0] != NULL ) ) -#else - IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend != NULL ) || ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin != NULL ) ) -#endif { if ( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ) != IVAS_ERR_OK ) { @@ -1792,7 +1769,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { IF( st_ivas->hDiracDecBin[pos_idx] != NULL ) @@ -1802,14 +1778,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( move16(); } } -#else - IF( st_ivas->hDiracDecBin != NULL ) - { - /* regularization factor is bitrate-dependent */ - st_ivas->hDiracDecBin->reqularizationFactor_fx = configure_reqularization_factor_fx( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); - move16(); - } -#endif test(); IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) /* note: switching within OMASA is handled in ivas_omasa_dec_config() */ @@ -1817,17 +1785,9 @@ ivas_error ivas_masa_dec_reconfigure_fx( /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0] != NULL ) -#else - IF( st_ivas->hDiracDecBin != NULL ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2064,11 +2024,7 @@ void ivas_spar_param_to_masa_param_mapping_fx( move16(); hSpatParamRendCom->numSimultaneousDirections = 1; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT hDiffuseDist = st_ivas->hDiracDecBin[0]->hDiffuseDist; -#else - hDiffuseDist = st_ivas->hDiracDecBin->hDiffuseDist; -#endif nchan_transport = st_ivas->nchan_transport; move16(); band_grouping = hDirAC->band_grouping; diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index c499780584c145b441e800e5500964e8b9f0d499..1ee6d6cede436d386749f86de10f924c6b62ab3f 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -1849,13 +1849,8 @@ void ivas_param_mc_dec_render_fx( /*CLDFB*/ Word32 Cldfb_RealBuffer_fx[MAX_INTERN_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_fx[MAX_INTERN_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#else - Word32 Cldfb_RealBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif Word32 *p_output_f_fx[MAX_OUTPUT_CHANNELS]; FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { @@ -2137,7 +2132,6 @@ void ivas_param_mc_dec_render_fx( Word16 input_q = 6; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { IF( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) @@ -2154,13 +2148,10 @@ void ivas_param_mc_dec_render_fx( move16(); } } -#endif /* Implement binaural rendering */ ivas_binRenderer_fx( st_ivas->hBinRenderer, -#ifdef SPLIT_REND_WITH_HEAD_ROT ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, -#endif st_ivas->hCombinedOrientationData, hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, @@ -2179,7 +2170,6 @@ void ivas_param_mc_dec_render_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) { @@ -2192,18 +2182,7 @@ void ivas_param_mc_dec_render_fx( } } } -#else - FOR( Word16 idx1 = 0; idx1 < BINAURAL_CHANNELS; idx1++ ) - { - FOR( Word16 idx2 = 0; idx2 < hParamMC->subframe_nbslots[subframe_idx]; idx2++ ) - { - Scale_sig32( Cldfb_RealBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( Q6, input_q ) ); // Q6 - Scale_sig32( Cldfb_ImagBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( Q6, input_q ) ); // Q6 - } - } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) @@ -2218,7 +2197,6 @@ void ivas_param_mc_dec_render_fx( } } } -#endif /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, hParamMC->num_freq_bands * hParamMC->subframe_nbslots[subframe_idx] ); } @@ -2242,13 +2220,8 @@ void ivas_param_mc_dec_render_fx( { IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[0][ch][i]; // Q6 ImagBuffer_fx[i] = Cldfb_ImagBuffer_Binaural_fx[0][ch][i]; // Q6 -#else - RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[ch][i]; // Q6 - ImagBuffer_fx[i] = Cldfb_ImagBuffer_Binaural_fx[ch][i]; // Q6 -#endif } ELSE { diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index eab782f8bc9dfe47e3e307612d69e706bb453367..89a86d21a72b6892718736a8817753ae776a2f26 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -732,22 +732,15 @@ static void ivas_mc_paramupmix_dec_sf( Word32 Cldfb_RealBuffer_subfr_fx[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] = { 0 }; Word32 Cldfb_ImagBuffer_subfr_fx[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] = { 0 }; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; int16_t slot_index_start; -#else - Word32 Cldfb_RealBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif hMCParamUpmix = st_ivas->hMCParamUpmix; assert( hMCParamUpmix ); push_wmops( "ivas_mc_paramupmix_dec_sf" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT slot_index_start = st_ivas->hTcBuffer->slots_rendered; -#endif FOR( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { @@ -864,7 +857,6 @@ static void ivas_mc_paramupmix_dec_sf( Word16 input_q = 6; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT /*LFE handling for split rendering cases*/ IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -883,20 +875,16 @@ static void ivas_mc_paramupmix_dec_sf( move16(); } } -#endif /* Implement binaural rendering */ ivas_binRenderer_fx( st_ivas->hBinRenderer, -#ifdef SPLIT_REND_WITH_HEAD_ROT ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, -#endif st_ivas->hCombinedOrientationData, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_subfr_fx, Cldfb_ImagBuffer_subfr_fx, &input_q ); -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) { @@ -909,18 +897,7 @@ static void ivas_mc_paramupmix_dec_sf( } } } -#else - FOR( Word16 idx1 = 0; idx1 < BINAURAL_CHANNELS; idx1++ ) - { - FOR( Word16 idx2 = 0; idx2 < MAX_PARAM_SPATIAL_SUBFRAMES; idx2++ ) - { - Scale_sig32( Cldfb_RealBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( 6, input_q ) ); // Q6 - Scale_sig32( Cldfb_ImagBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( 6, input_q ) ); // Q6 - } - } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) @@ -935,7 +912,6 @@ static void ivas_mc_paramupmix_dec_sf( } } } -#endif /* Implement CLDFB synthesis */ FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -945,13 +921,8 @@ static void ivas_mc_paramupmix_dec_sf( FOR( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; slot_idx++ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx]; // Q6 ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx]; // Q6 -#else - RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[ch][slot_idx]; // Q6 - ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch][slot_idx]; // Q6 -#endif } #ifndef OPT_AVOID_STATE_BUF_RESCALE scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q5 - Q11 ); // Q11 -> Q5 diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 4545ab61d5029815463d2b4c1639c61cb661bf39..ed43b99916d0840ed402ad3d5e58c7041bf682b5 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1023,10 +1023,8 @@ static ivas_error ivas_mc_dec_reconfig_fx( /* 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 test(); IF( EQ_16( last_mc_mode, MC_MODE_PARAMMC ) ) { @@ -1052,9 +1050,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( move16(); Copy( 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 */ @@ -1474,11 +1470,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { /* remove unneeded binaural renderers */ test(); @@ -1493,17 +1485,9 @@ static ivas_error ivas_mc_dec_reconfig_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || NE_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) ) -#else - IF( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend != NULL ) && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || NE_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); -#endif } test(); @@ -1516,21 +1500,13 @@ static ivas_error ivas_mc_dec_reconfig_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0] != NULL ) -#else - IF( st_ivas->hDiracDecBin != NULL ) -#endif { test(); test(); IF( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) && NE_16( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#else - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); -#endif } } @@ -1555,46 +1531,25 @@ static ivas_error ivas_mc_dec_reconfig_fx( } IF( EQ_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper, 1 ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper ) ) != IVAS_ERR_OK ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT st_ivas->hCrendWrapper->hCrend[0] = NULL; st_ivas->hCrendWrapper->hHrtfCrend = NULL; IF( ( st_ivas->hCrendWrapper->hCrend[0] = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" ); } -#else - st_ivas->hCrendWrapper->hCrend = NULL; - st_ivas->hCrendWrapper->hHrtfCrend = NULL; - IF( ( st_ivas->hCrendWrapper->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" ); - } -#endif } } ELSE IF( st_ivas->hCrendWrapper == NULL && ( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) || EQ_16( 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 == NULL ) ? 1 : 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 == NULL ) ? 1 : 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_objectRenderer_internal_fx.c b/lib_dec/ivas_objectRenderer_internal_fx.c index 48cbd21c796592f205d56da4d38795e75e778446..9c603fa93b7f0d13c85847af16673c139885dfd4 100644 --- a/lib_dec/ivas_objectRenderer_internal_fx.c +++ b/lib_dec/ivas_objectRenderer_internal_fx.c @@ -237,11 +237,7 @@ ivas_error ivas_td_binaural_renderer_sf_fx( } test(); -#ifdef NONBE_FIX_978_MC_TDREND_REVERB IF( st_ivas->hRenderConfig != NULL && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else - IF( st_ivas->hRenderConfig != NULL && EQ_32( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { FOR( i = 0; i < nchan_ism_internal; ++i ) { @@ -273,11 +269,7 @@ ivas_error ivas_td_binaural_renderer_sf_fx( } test(); -#ifdef NONBE_FIX_978_MC_TDREND_REVERB IF( st_ivas->hRenderConfig != NULL && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else - IF( st_ivas->hRenderConfig != NULL && EQ_32( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { /* add reverb to rendered signals */ v_add_32( reverb_signal_fx[0], output_fx_local[0], output_fx_local[0], output_frame ); // Q11 @@ -304,7 +296,6 @@ ivas_error ivas_td_binaural_renderer_sf_fx( return IVAS_ERR_OK; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * ivas_td_binaural_renderer_sf_splitBinaural() * @@ -458,4 +449,3 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( return IVAS_ERR_OK; } -#endif diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 9d8b43515defe94715c871416a97738239ea4471..35f4f1c4b9841352f3f2aad314e047ab8b82ed71 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -419,17 +419,9 @@ ivas_error ivas_omasa_dec_config_fx( * TD Decorrelator *-----------------------------------------------------------------*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0] != NULL ) -#else - IF( st_ivas->hDiracDecBin != NULL ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -763,12 +755,10 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( Word32 *p_sepobj_fx[MAX_NUM_OBJECTS]; // Q11 Word32 data_separated_objects_fx[MAX_NUM_OBJECTS][L_FRAME48k]; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; move16(); -#endif FOR( n = 0; n < MAX_NUM_OBJECTS; n++ ) { @@ -782,7 +772,6 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( /* reset combined orientation access index before calling the td renderer */ ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { Word16 slot_idx, num_cldfb_bands, nchan_transport_orig, cldfb_slots; @@ -835,7 +824,6 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( } else { -#endif IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_sepobj_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) { return error; @@ -845,9 +833,7 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( { v_add_fx( output_fx[n], p_sepobj_fx[n], output_fx[n], *nSamplesRendered ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 87805290bef64f28954452193a37e19769b866fd..a8754d84f477b017d0d9ae20ab83c2ec6da526a6 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -137,12 +137,10 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( Word32 output_separated_objects_fx[BINAURAL_CHANNELS][L_FRAME48k]; // VE2SB: TBV Word32 *p_sepobj_fx[BINAURAL_CHANNELS]; Word16 channel_offset; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; move16(); -#endif FOR( Word16 i = 0; i < BINAURAL_CHANNELS; i++ ) { @@ -162,7 +160,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { Word16 slot_idx, num_cldfb_bands, b, nchan_transport_orig; @@ -217,7 +214,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( } else { -#endif IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_sepobj_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) { return error; @@ -232,9 +228,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( move32(); } } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index 4a3362cd25cd0e50834a98b8a8a3db4bda96c6b4..bdf7b67bc808ed5cf30f4c1811978ea2a83ccc1a 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -80,11 +80,7 @@ void ivas_renderer_select( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { test(); test(); @@ -95,11 +91,7 @@ void ivas_renderer_select( { IF( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; move16(); @@ -113,11 +105,7 @@ void ivas_renderer_select( ELSE /* ISM_MODE_DISC */ { test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; move16(); @@ -137,11 +125,7 @@ void ivas_renderer_select( { *internal_config = output_config; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; move16(); @@ -158,11 +142,7 @@ void ivas_renderer_select( move16(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; move16(); @@ -217,11 +197,7 @@ void ivas_renderer_select( *internal_config = output_config; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; move16(); @@ -237,11 +213,7 @@ void ivas_renderer_select( *internal_config = transport_config; move16(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { test(); test(); diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 121b8a7956a44b699ac4d11eafdccbd795199cea..8f8a7f486a3f8c5ed07efd9d92c835ae1d5da77d 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -183,11 +183,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) && ( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) && ( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) -#endif { RENDERER_TYPE renderer_type_new; Word16 sba_order_internal; @@ -198,11 +194,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( /* copy the logic from ivas_renderer_select(), because calling this function has too many side effects that would affect the flushing */ IF( LE_16( ivas_get_sba_num_TCs_fx( ivas_total_brate, sba_order_internal ), 2 ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { renderer_type_new = RENDERER_BINAURAL_PARAMETRIC; move16(); @@ -216,11 +208,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( ELSE { test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { renderer_type_new = RENDERER_BINAURAL_FASTCONV; move16(); @@ -639,7 +627,6 @@ ivas_error ivas_sba_dec_reconfigure_fx( * TD Decorrelator *-----------------------------------------------------------------*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0] != NULL ) { IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ), IVAS_ERR_OK ) ) @@ -647,15 +634,6 @@ ivas_error ivas_sba_dec_reconfigure_fx( return error; } } -#else - IF( st_ivas->hDiracDecBin != NULL ) - { - IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ), IVAS_ERR_OK ) ) - { - return error; - } - } -#endif /*-----------------------------------------------------------------* * CLDFB instances @@ -805,11 +783,7 @@ void ivas_sba_dec_digest_tc_fx( ivas_spar_dec_digest_tc_fx( st_ivas, st_ivas->nchan_transport, nCldfbSlots, nSamplesForRendering ); } test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) -#else - IF( st_ivas->hDiracDecBin != NULL && ( st_ivas->hDiracDecBin->useTdDecorr ) ) -#endif { Word16 nSamplesLeftForTD, default_frame; Word32 *decorr_signal[BINAURAL_CHANNELS]; @@ -832,17 +806,9 @@ void ivas_sba_dec_digest_tc_fx( { Word16 nSamplesToDecorr = s_min( nSamplesLeftForTD, default_frame ); /*Q0*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( st_ivas->hDiracDecBin[0]->hTdDecorr ) -#else - IF( st_ivas->hDiracDecBin->hTdDecorr ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_td_decorr_process_fx( st_ivas->hDiracDecBin[0]->hTdDecorr, p_tc, decorr_signal, nSamplesToDecorr ); -#else - ivas_td_decorr_process_fx( st_ivas->hDiracDecBin->hTdDecorr, p_tc, decorr_signal, nSamplesToDecorr ); -#endif } FOR( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index b13c6ab7a92b30bf250fa997d52a6eab6661de8d..7f12c592ed95f8864c686557a7c4b35679fb8ac0 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -1534,20 +1534,12 @@ void ivas_spar_dec_set_render_map_fx( 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_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -2044,13 +2036,8 @@ void ivas_spar_dec_upmixer_sf_fx( test(); test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) || !( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) && !( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) ) -#else - IF( ( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) || !( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) && - !( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) ) -#endif { FOR( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index c6f06f142721adec118d7a3223810f72083d5ba0..db23485b8693157965fe07dd21e4f3d4de9ed365 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -860,34 +860,7 @@ typedef struct renderer_struct } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; -#ifndef SPLIT_REND_WITH_HEAD_ROT -/* Fastconv binaural data structure */ -typedef struct ivas_binaural_rendering_struct -{ - /* Common variables for all modules */ - IVAS_OUTPUT_SETUP_HANDLE hInputSetup; /* pointer to input spatial format for binaural renderer*/ - EFAP_HANDLE hEFAPdata; /* EFAP structure*/ - Word32 *hoa_dec_mtx; /* pointer to HOA decoder mtx */ /*Q29*/ - Word8 rotInCldfb; /* Flag to enable rotation within bin Renderer in CLDFB*/ - Word16 max_band; /* band upto which rendering is performed */ - Word16 conv_band; /* band upto which convolution in cldfb domain is performed */ - Word16 timeSlots; /* number of time slots of binaural renderer */ - Word16 nInChannels; /* number input channels */ - Word8 render_lfe; /* Flag to render LFE in binaural rendering*/ - IVAS_FORMAT ivas_format; /* format; corresponds to st_ivas->ivas_format, unless the signal gets transormed to a different domain for rendering */ - - /* Convolution module structure */ - BINRENDERER_CONV_MODULE_HANDLE_FX hBinRenConvModule; - - /* Variables related to reverberator module */ - Word32 earlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; - REVERB_STRUCT_HANDLE hReverb; - -} BINAURAL_RENDERER, *BINAURAL_RENDERER_HANDLE; -#endif - -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------------------* * IVAS decoder specific ISAR wrapper structures *----------------------------------------------------------------------------------*/ @@ -917,7 +890,6 @@ typedef struct Word16 numTdSamplesPerChannelCached; } ISAR_DEC_SPLIT_REND_WRAPPER, *ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE; -#endif /*----------------------------------------------------------------------------------* * MASA decoder structures @@ -1062,9 +1034,7 @@ typedef struct decoder_config_structure Word16 Opt_tsm; /* indicates whether time scaling modification is activated */ IVAS_RENDER_FRAMESIZE render_framesize; Word16 Opt_delay_comp; /* flag indicating delay compensation active */ -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t Opt_Limiter; -#endif } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; @@ -1141,11 +1111,7 @@ typedef struct Decoder_Struct BINAURAL_RENDERER_HANDLE hBinRenderer; /* fastconv binaural renderer handle */ BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd; /* Time domain binaural object renderer handle */ TDREND_HRFILT_FiltSet_t *hHrtfTD; /* pointer to HRTF data for TD renderer */ -#ifdef SPLIT_REND_WITH_HEAD_ROT DIRAC_DEC_BIN_HANDLE hDiracDecBin[MAX_HEAD_ROT_POSES]; /* parametric binaural renderer handle */ -#else - DIRAC_DEC_BIN_HANDLE hDiracDecBin; /* parametric binaural renderer handle */ -#endif LSSETUP_CONVERSION_HANDLE hLsSetUpConversion; /* MC LS configuration convertion handle */ EFAP_HANDLE hEFAPdata; /* EFAP structure */ VBAP_HANDLE hVBAPdata; /* VBAP structure */ @@ -1172,10 +1138,8 @@ typedef struct Decoder_Struct Word16 flag_omasa_brate; -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; /* ISAR split binaural rendering handle */ BINAURAL_TD_OBJECT_RENDERER_HANDLE hTdRendHandles[MAX_HEAD_ROT_POSES - 1]; -#endif /* JBM module */ DECODER_TC_BUFFER_HANDLE hTcBuffer; /* JBM structure */ diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index eca2744918315ec6f1fbc39d98c906b694d7e870..28b8594fe602085389fac17b0af3d57c0fd31961 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -144,7 +144,6 @@ ivas_error IVAS_DEC_GetSamples( bool *needNewFrame /* o : indication that the decoder needs a new frame */ ); -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error IVAS_DEC_GetSplitBinauralBitstream( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ Word16 *pcmBuf_out, /* o : output synthesis signal for BINAURAL_SPLIT_PCM */ @@ -158,14 +157,10 @@ ivas_error IVAS_DEC_GetSplitRendBitstreamHeader( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 *pIsar_frame_size_ms, /* o: pointer to isar frame size setting */ -#endif Word16 *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , Word16 *pLc3plusHighRes /* o: pointer to LC3plus High-Res setting */ -#endif ); /*! r: decoder error code */ @@ -183,7 +178,6 @@ int16_t IVAS_DEC_is_split_rendering_enabled( int16_t IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ); -#endif /*! r: error code */ ivas_error IVAS_DEC_GetObjectMetadata( @@ -205,12 +199,8 @@ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ IVAS_VECTOR3 Pos, /* i : listener position */ -#ifdef SPLIT_REND_WITH_HEAD_ROT const Word16 subframe_idx, /* i : subframe index */ const ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ -#else - const Word16 subframe_idx /* i : subframe index */ -#endif ); /*! r: error code */ @@ -287,12 +277,10 @@ ivas_error IVAS_DEC_EnableVoIP( const IVAS_DEC_INPUT_FORMAT inputFormat /* i : format of the input bitstream */ ); -#ifdef SPLIT_REND_WITH_HEAD_ROT /*! r: error code */ ivas_error IVAS_DEC_EnableSplitRendering( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ); -#endif ivas_error IVAS_DEC_SetRenderFramesize( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 9213b11ce57e2577d9928c75134f2b323c5424cc..551a20c0fa51196a7e679b46ef848874fbd66cfb 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -114,11 +114,9 @@ static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, cons static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const UWord16 nSamplesForRendering, UWord16 *nSamplesRendered, UWord16 *nSamplesAvailableNext, Word16 *pcmBuf ); static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, Word16 *nSamplesBuffered ); static Word16 get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error isar_set_split_rend_setup( ISAR_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, const ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); static ivas_error ivas_create_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); -#endif /*---------------------------------------------------------------------* * IVAS_DEC_Open() @@ -276,7 +274,6 @@ ivas_error IVAS_DEC_Open( return IVAS_ERR_WRONG_PARAMS; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------------* * isar_set_split_rend_setup() * @@ -296,10 +293,8 @@ static ivas_error isar_set_split_rend_setup( splitRendBits->codec = ISAR_SPLIT_REND_CODEC_DEFAULT; splitRendBits->pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; splitRendBits->codec_frame_size_ms = 0; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS splitRendBits->isar_frame_size_ms = 0; splitRendBits->lc3plus_highres = 0; -#endif if ( ( hSplitBinRend->hMultiBinCldfbData = (ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ) ) == NULL ) { @@ -315,7 +310,6 @@ static ivas_error isar_set_split_rend_setup( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * init_decoder_config() @@ -338,10 +332,8 @@ static void init_decoder_config( hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain_fx = 0; // Q15 hDecoderConfig->Opt_tsm = 0; -#ifdef SPLIT_REND_WITH_HEAD_ROT hDecoderConfig->Opt_Limiter = 1; move16(); -#endif hDecoderConfig->Opt_delay_comp = 0; hDecoderConfig->Opt_ExternalOrientation = 0; hDecoderConfig->Opt_dpid_on = 0; @@ -388,10 +380,8 @@ void IVAS_DEC_Close( ( *phIvasDec )->hVoIP = NULL; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* destroy Split binaural renderer (ISAR) handle */ ivas_destroy_handle_isar( &( *phIvasDec )->st_ivas->hSplitBinRend ); -#endif IF( ( *phIvasDec )->st_ivas ) { @@ -578,13 +568,11 @@ ivas_error IVAS_DEC_Configure( move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { hDecoderConfig->Opt_Headrotation = TRUE; move16(); } -#endif /* Set decoder parameters to initial values */ IF( NE_32( ( error = ivas_init_decoder_front( st_ivas ) ), IVAS_ERR_OK ) ) @@ -592,7 +580,6 @@ ivas_error IVAS_DEC_Configure( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* create ISAR handle */ IF( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -601,7 +588,6 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for ISAR handle" ); } } -#endif if ( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { @@ -624,7 +610,6 @@ ivas_error IVAS_DEC_Configure( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * IVAS_DEC_EnableSplitRendering( ) * @@ -660,7 +645,6 @@ ivas_error IVAS_DEC_EnableSplitRendering( return error; } -#endif /*---------------------------------------------------------------------* * get_render_framesize_ms( ) @@ -1123,7 +1107,6 @@ ivas_error IVAS_DEC_GetSamples( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------* * Binaural split rendering setup *----------------------------------------------------------------*/ @@ -1135,7 +1118,6 @@ ivas_error IVAS_DEC_GetSamples( isar_set_split_rend_ht_setup_fx( &hIvasDec->st_ivas->hSplitBinRend->splitrend, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions, hIvasDec->st_ivas->hCombinedOrientationData->Rmat_fx ); } } -#endif hIvasDec->updateOrientation = false; move16(); @@ -1299,7 +1281,6 @@ return IVAS_ERR_OK; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * IVAS_DEC_GetSplitBinauralBitstream( ) * @@ -1520,9 +1501,7 @@ IVAS_DEC_GetSplitBinauralBitstream( Quaternion, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, st_ivas->hRenderConfig->split_rend_config.codec, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms, -#endif st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, splitRendBits, Cldfb_RealBuffer_Binaural, @@ -1559,7 +1538,6 @@ IVAS_DEC_GetSplitBinauralBitstream( return error; } -#endif /*---------------------------------------------------------------------* @@ -2227,15 +2205,11 @@ ivas_error IVAS_DEC_GetMasaMetadata( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedHeadTrackData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ - IVAS_VECTOR3 Pos, /* i : listener position */ -#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 Pos, /* i : listener position */ const Word16 subframe_idx, /* i : subframe index */ const ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ -#else - const Word16 subframe_idx /* i : subframe index */ -#endif ) { HEAD_TRACK_DATA_HANDLE hHeadTrackData; @@ -2256,19 +2230,12 @@ ivas_error IVAS_DEC_FeedHeadTrackData( /* Move head-tracking data to the decoder handle */ /* check for Euler angle signaling */ -#ifdef SPLIT_REND_WITH_HEAD_ROT /* check for Euler angle signaling */ IF( EQ_32( orientation.w_fx, L_negate( 12582912 ) ) && EQ_16( orientation.q_fact, Q22 ) ) { Euler2Quat_fx( deg2rad_fx( orientation.x_fx ), deg2rad_fx( orientation.y_fx ), deg2rad_fx( orientation.z_fx ), &orientation ); modify_Quat_q_fx( &orientation, &orientation, Q29 ); } -#else - IF( EQ_32( orientation.w_fx, -1610612736 /* -3.0f in Q29 */ ) ) - { - Euler2Quat_fx( deg2rad_fx( orientation.x_fx ), deg2rad_fx( orientation.y_fx ), deg2rad_fx( orientation.z_fx ), &orientation ); - } -#endif Word32 updateRate_fx = 1677721600; // value is 200 in Q23 move32(); @@ -2306,10 +2273,8 @@ ivas_error IVAS_DEC_FeedHeadTrackData( move32(); move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT hHeadTrackData->sr_pose_pred_axis = rot_axis; move32(); -#endif hIvasDec->updateOrientation = true; move16(); @@ -2648,23 +2613,18 @@ static ivas_error copyRendererConfigStruct( Copy32( hRCin->roomAcoustics.pAcoustic_dsr_fx, hRCout->roomAcoustics.pAcoustic_dsr_fx, CLDFB_NO_CHANNELS_MAX ); // Q30 Copy( hRCin->directivity_fx, hRCout->directivity_fx, 3 * MAX_NUM_OBJECTS ); -#ifdef SPLIT_REND_WITH_HEAD_ROT hRCout->split_rend_config.splitRendBitRate = SPLIT_REND_768k; hRCout->split_rend_config.dof = 3; hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hRCout->split_rend_config.isar_frame_size_ms = 20; move16(); -#endif hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; hRCout->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; hRCout->split_rend_config.rendererSelection = hRCin->split_rend_config.rendererSelection; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hRCout->split_rend_config.lc3plus_highres = hRCin->split_rend_config.lc3plus_highres; move16(); -#endif move32(); move16(); move16(); @@ -2673,7 +2633,6 @@ static ivas_error copyRendererConfigStruct( move32(); move32(); move32(); -#endif hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; @@ -2739,9 +2698,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error error; -#endif test(); test(); @@ -2780,7 +2737,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( Copy( renderConfig.directivity_fx, hRenderConfig->directivity_fx, 3 * MAX_NUM_OBJECTS ); -#ifdef SPLIT_REND_WITH_HEAD_ROT hRenderConfig->split_rend_config = renderConfig.split_rend_config; /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ @@ -2793,7 +2749,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( { return error; } -#endif return IVAS_ERR_OK; } @@ -2849,13 +2804,8 @@ ivas_error IVAS_DEC_GetDelay( } move32(); -#ifdef SPLIT_REND_WITH_HEAD_ROT nSamples[1] = NS2SA_FX2( hDecoderConfig->output_Fs, get_delay_fx( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], hDecoderConfig->output_config ) ); move16(); -#else - nSamples[1] = NS2SA_FX2( hDecoderConfig->output_Fs, get_delay_fx( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0] ) ); - move16(); -#endif nSamples[2] = extract_l( W_round64_L( W_mult0_32_32( L_shl( st_ivas->binaural_latency_ns, 1 ), out_fs_fx ) ) ); move16(); nSamples[0] = add( nSamples[1], nSamples[2] ); @@ -3683,11 +3633,7 @@ static ivas_error printConfigInfo_dec( test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( ( EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) -#endif { fprintf( stdout, "Render framesize: %dms\n", get_render_frame_size_ms( st_ivas->hDecoderConfig->render_framesize ) ); } @@ -4082,7 +4028,6 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * IVAS_DEC_GetSplitRendBitstreamHeader() * @@ -4094,15 +4039,10 @@ IVAS_DEC_GetSplitRendBitstreamHeader( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - Word16 *pIsar_frame_size_ms, /* o: pointer to isar frame size setting */ -#endif - Word16 *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS + Word16 *pIsar_frame_size_ms, /* o: pointer to isar frame size setting */ + Word16 *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ , - Word16 *pLc3plusHighRes -#endif -) + Word16 *pLc3plusHighRes ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -4112,10 +4052,8 @@ IVAS_DEC_GetSplitRendBitstreamHeader( *pCodec = hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec; *pCodec_frame_size_ms = hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms; *poseCorrection = hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS *pIsar_frame_size_ms = hIvasDec->st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms; *pLc3plusHighRes = hIvasDec->st_ivas->hRenderConfig->split_rend_config.lc3plus_highres; -#endif return IVAS_ERR_OK; } @@ -4293,4 +4231,3 @@ Word16 IVAS_DEC_is_split_rendering_coded_out( return isSplitCoded; } -#endif diff --git a/lib_enc/lib_enc_fx.c b/lib_enc/lib_enc_fx.c index 8b20cab7d2478c43ebf051cddd88fbdfbcadcc41..32c26be28431c5601bdc278f7e48d0c49bdf054d 100644 --- a/lib_enc/lib_enc_fx.c +++ b/lib_enc/lib_enc_fx.c @@ -1572,13 +1572,8 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef SPLIT_REND_WITH_HEAD_ROT *delay = NS2SA_FX2( hEncoderConfig->input_Fs, get_delay_fx( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, IVAS_AUDIO_CONFIG_INVALID ) ); move16(); -#else - *delay = NS2SA_FX2( hEncoderConfig->input_Fs, get_delay_fx( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL ) ); /*Q0*/ - move16(); -#endif *delay = imult1616( *delay, hEncoderConfig->nchan_inp ); /*Q0*/ move16(); diff --git a/lib_isar/isar_MSPred.c b/lib_isar/isar_MSPred.c index 1df47d695c796fd6d5ece3eb4c14ebf3677914bb..040fcc3a963c49ead1c0613be96c3a3a0ef975ff 100644 --- a/lib_isar/isar_MSPred.c +++ b/lib_isar/isar_MSPred.c @@ -32,7 +32,6 @@ #include "options.h" #include -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_lcld_rom_tables.h" #include "isar_lcld_prot.h" #include "isar_prot.h" @@ -547,4 +546,3 @@ void writeMSPred( return; } #endif -#endif diff --git a/lib_isar/isar_NoiseGen.c b/lib_isar/isar_NoiseGen.c index 7273b0e817dc4014bbd0e76cea9c127b4ec754c6..1a6881681d5b92d7df492e4a762ce2105cd1b0d3 100644 --- a/lib_isar/isar_NoiseGen.c +++ b/lib_isar/isar_NoiseGen.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "prot_fx.h" #include "isar_lcld_prot.h" @@ -55,4 +54,3 @@ void DeleteNoiseGen( NoiseGen *psNoiseGen ) extern float GetNoise( NoiseGen *psNoiseGen ); extern Word32 GetNoise_fx( NoiseGen *psNoiseGen ); -#endif diff --git a/lib_isar/isar_PerceptualModel.c b/lib_isar/isar_PerceptualModel.c index 16558dd36f2532f3dd185d39e82492448dc9157c..b9a5b1b334053d18d4ee4aff9537b8d708cd0837 100644 --- a/lib_isar/isar_PerceptualModel.c +++ b/lib_isar/isar_PerceptualModel.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_lcld_prot.h" #include "prot_fx.h" #include "isar_lcld_rom_tables.h" @@ -466,4 +465,3 @@ void PerceptualModelStereo_fx( return; } -#endif diff --git a/lib_isar/isar_PredDecoder.c b/lib_isar/isar_PredDecoder.c index b30a6e0a8c1fedd176a9cfd606d39e69357c43f3..a202aaa1c0d203c83ae8986be88c65d80d584f76 100644 --- a/lib_isar/isar_PredDecoder.c +++ b/lib_isar/isar_PredDecoder.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "prot_fx.h" #include "isar_prot.h" @@ -492,4 +491,3 @@ void ApplyInversePredictors_fx( return; } -#endif diff --git a/lib_isar/isar_PredEncoder.c b/lib_isar/isar_PredEncoder.c index 0cd32b70cb625f7d6ea0e22b8a864cebf15c5d60..8eed33ca60041619cb72d302b2576ab2a177a176 100644 --- a/lib_isar/isar_PredEncoder.c +++ b/lib_isar/isar_PredEncoder.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "isar_lcld_prot.h" #include "isar_lcld_rom_tables.h" @@ -1212,4 +1211,3 @@ Word32 WritePredictors( return iBitsWritten; } -#endif diff --git a/lib_isar/isar_RMSEnvGrouping.c b/lib_isar/isar_RMSEnvGrouping.c index 9b5de2574e70af2087769539a52211f7ceb26bdf..9a7b2ba54ed8aa6fc838b0d074e15ea1433dffab 100644 --- a/lib_isar/isar_RMSEnvGrouping.c +++ b/lib_isar/isar_RMSEnvGrouping.c @@ -34,7 +34,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "prot_fx.h" #include "isar_lcld_prot.h" @@ -961,4 +960,3 @@ void ComputeEnvelopeGrouping( return; } -#endif diff --git a/lib_isar/isar_cnst.h b/lib_isar/isar_cnst.h index 046beabdcd60ce2abf0196f51574d78e53daf74b..4aef03cf2160135ceaf7e44b4cf4903d8077cef6 100644 --- a/lib_isar/isar_cnst.h +++ b/lib_isar/isar_cnst.h @@ -38,7 +38,6 @@ /* clang-format off */ -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------------------* * Split Binaural Rendering Constants @@ -76,12 +75,8 @@ typedef enum #define MAX_SPLIT_REND_MD_BANDS 20 #define MAX_SPLIT_MD_SUBFRAMES 1 #define COMPLEX_MD_BAND_THRESH MAX_SPLIT_REND_MD_BANDS -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS #define COMPLEX_MD_BAND_THRESH_LOW 4 #define COMPLEX_MD_BAND_THRESH_HIGH 10 -#else -#define COMPLEX_MD_BAND_THRESH_LOW 5 -#endif #define SPLIT_REND_RO_MD_BAND_THRESH 4 #define ISAR_SPLIT_REND_PRED_63QUANT_PNTS_LOG2_CEIL 6 @@ -140,9 +135,7 @@ typedef enum #define ISAR_SPLIT_REND_ROT_AXIS_BITS 3 #define ISAR_SPLIT_REND_RO_FLAG_BITS 1 -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #define IVAS_LC3PLUS_MAX_NUM_DECODERS 2 -#endif /*----------------------------------------------------------------------------------* * Split rendering bitrate constants *----------------------------------------------------------------------------------*/ @@ -153,7 +146,6 @@ typedef enum #define SPLIT_REND_512k 512000 #define SPLIT_REND_768k 768000 -#endif /*SPLIT_REND_WITH_HEAD_ROT */ #endif /*ISAR_CNST_H */ /* clang-format on */ diff --git a/lib_isar/isar_lc3plus_common.c b/lib_isar/isar_lc3plus_common.c index 2e5a31cb6e9af5ea6748a1422d7c83c7781ab5a3..5c56c0b437aff18d7f88ab7711c814c466764780 100644 --- a/lib_isar/isar_lc3plus_common.c +++ b/lib_isar/isar_lc3plus_common.c @@ -35,7 +35,6 @@ #include "ivas_error.h" #include "lc3.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------------------------------* * Function ISAR_LC3PLUS_LC3plusErrToIvasErr() * @@ -57,7 +56,6 @@ ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( return IVAS_ERR_INTERNAL; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtpError ) { switch ( lc3PlusRtpError ) @@ -85,5 +83,3 @@ ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtp return IVAS_ERR_UNKNOWN; } -#endif -#endif diff --git a/lib_isar/isar_lc3plus_common.h b/lib_isar/isar_lc3plus_common.h index 57060944273cbb46aa0dbfc2ccf684414ae367f9..2638ea8a9cbb34fca0705c0b84e46692e34e9a19 100644 --- a/lib_isar/isar_lc3plus_common.h +++ b/lib_isar/isar_lc3plus_common.h @@ -37,11 +37,8 @@ #include #include "options.h" #include "ivas_error.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "lc3.h" -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #include "isar_lc3plus_payload.h" -#endif /*! common configuration parameters between encoder and decoder */ typedef struct LC3PLUS_CONFIG @@ -54,19 +51,14 @@ typedef struct LC3PLUS_CONFIG int32_t samplerate; /*! number of channels */ int16_t channels; -#if defined ISAR_BITSTREAM_UPDATE_LC3PLUS || defined ISAR_BITSTREAM_UPDATE_LC3PLUS /*! high resolution mode enabled (1) or disabled (0)*/ int16_t high_res_mode_enabled; -#endif } LC3PLUS_CONFIG; /*! utility function to convert LC3PLUS_Errors to the suitable ivas_error */ ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /*! utility function to convert LC3PLUS_Errors to the suitable ivas_error */ ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtpError ); -#endif -#endif /* SPLIT_REND_WITH_HEAD_ROT */ #endif /* ISAR_LC3PLUS_COM_H */ diff --git a/lib_isar/isar_lc3plus_dec.c b/lib_isar/isar_lc3plus_dec.c index fd1adb157297496d5ee95e28015732691cbcbd51..38371d1343b81d0c4c484f9d29f3f78f00cdff85 100644 --- a/lib_isar/isar_lc3plus_dec.c +++ b/lib_isar/isar_lc3plus_dec.c @@ -40,29 +40,6 @@ #include "ivas_error_utils.h" #include "wmc_auto.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT - -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -/*------------------------------------------------------------------------- - * isar_LC3PLUS_AllocateSubframeDecodingMatrix() - * - * - *------------------------------------------------------------------------*/ - -static void isar_LC3PLUS_DEC_FreeSubframeDecodingMatrix( - int16_t **subframeChannelMatrix ) -{ - for ( int16_t i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) - { - free( subframeChannelMatrix[i] ); - } - - free( subframeChannelMatrix ); - - return; -} -#endif - /*------------------------------------------------------------------------- * ISAR_LC3PLUS_DEC_Open() @@ -78,37 +55,22 @@ ivas_error ISAR_LC3PLUS_DEC_Open( LC3PLUS_Error err; int32_t decoder_size; Word32 scratch_size; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t i; if ( 0 == config.lc3plus_frame_duration_us ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid lc3plus_frame_duration_us (0)\n" ); } -#else - int16_t lc3plusFrameIdx; - int16_t numLC3plusFramesPerIvasFrame; - int16_t i; -#endif if ( ( *handle = malloc( sizeof( struct ISAR_LC3PLUS_DEC_HANDLE ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( config.channels > IVAS_LC3PLUS_MAX_NUM_DECODERS ) { return IVAS_ERROR( IVAS_ERR_INIT_ERROR, "Maximum number of channels exceeds IVAS_LC3PLUS_MAX_NUM_DECODERS\n" ); } -#else - - if ( 0 == config.lc3plus_frame_duration_us ) - { - return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid lc3plus_frame_duration_us (0)\n" ); - } - numLC3plusFramesPerIvasFrame = (int16_t) ( config.isar_frame_duration_us / config.lc3plus_frame_duration_us ); -#endif ( *handle )->num_decs = 0; @@ -168,11 +130,7 @@ ivas_error ISAR_LC3PLUS_DEC_Open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS err = lc3plus_dec_init( ( *handle )->handles[iCh], config.samplerate, 1, LC3PLUS_PLC_ADVANCED, config.high_res_mode_enabled ); -#else - err = lc3plus_dec_init( ( *handle )->handles[iCh], config.samplerate, 1, LC3PLUS_PLC_ADVANCED, 0 ); -#endif if ( LC3PLUS_OK != err ) { ISAR_LC3PLUS_DEC_Close( handle ); @@ -193,24 +151,10 @@ ivas_error ISAR_LC3PLUS_DEC_Open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - if ( ( ( *handle )->selective_decoding_states[iCh]->frame_actions = malloc( numLC3plusFramesPerIvasFrame * sizeof( SelectiveDecAction ) ) ) == NULL ) - { - ISAR_LC3PLUS_DEC_Close( handle ); - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); - } -#endif ( *handle )->selective_decoding_states[iCh]->has_skipped_a_frame = 0; ( *handle )->selective_decoding_states[iCh]->shall_decode_cached_frame = 0; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ( *handle )->selective_decoding_states[iCh]->frame_action = DEC_ACTION_DECODE_AND_USE; -#else - for ( lc3plusFrameIdx = 0; lc3plusFrameIdx < numLC3plusFramesPerIvasFrame; lc3plusFrameIdx++ ) - { - ( *handle )->selective_decoding_states[iCh]->frame_actions[lc3plusFrameIdx] = DEC_ACTION_DECODE_AND_USE; - } -#endif /* allocate and configure per LC3plus decoder bitstream cache */ if ( ( ( *handle )->bitstream_caches[iCh] = malloc( sizeof( ISAR_LC3PLUS_DEC_BITSTREAM_CACHE ) ) ) == NULL ) @@ -218,11 +162,7 @@ ivas_error ISAR_LC3PLUS_DEC_Open( ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity = 400 /*LC3plus max non-HR octet count*/; -#else - ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity = 400 /*LC3plus max non-HR octet count*/ * numLC3plusFramesPerIvasFrame; -#endif if ( ( ( *handle )->bitstream_caches[iCh]->bitstream_cache = malloc( ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity ) ) == NULL ) { ISAR_LC3PLUS_DEC_Close( handle ); @@ -254,156 +194,6 @@ ivas_error ISAR_LC3PLUS_DEC_Open( return IVAS_ERR_OK; } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -/*------------------------------------------------------------------------- - * ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix() - * - * - *------------------------------------------------------------------------*/ - -ivas_error ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( - int16_t ***subframeChannelMatrix, - const uint32_t num_decs ) -{ - int16_t i; - - if ( ( *subframeChannelMatrix = malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( int16_t * ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); - } - - for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) - { - ( *subframeChannelMatrix )[i] = NULL; - } - - for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) - { - if ( ( ( *subframeChannelMatrix )[i] = malloc( num_decs * sizeof( int16_t ) ) ) == NULL ) - { - isar_LC3PLUS_DEC_FreeSubframeDecodingMatrix( *subframeChannelMatrix ); - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); - } - } - - return IVAS_ERR_OK; -} - - -/*------------------------------------------------------------------------- - * ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix() - * - * - *------------------------------------------------------------------------*/ - -ivas_error ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( - ISAR_LC3PLUS_DEC_HANDLE handle, /* i : LC3plus decoder handle */ - int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] ) -{ - int16_t numIvasSubFramesPerLC3frame; - uint32_t decIdx; - int16_t ivasSubframeIdx; - int16_t effectiveIsarSubframeDuration; - int16_t actual_num_spatial_subframes; - - if ( NULL == handle ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "ISAR_LC3PLUS_DEC_HANDLE is NULL\n" ); - } - - if ( NULL == subframeChannelMatrix ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "subframeChannelMatrix is NULL\n" ); - } - - if ( handle->config.lc3plus_frame_duration_us == 0 || handle->config.isar_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) - { - return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "invalid isar_frame_duration_us/lc3plus_frame_duration_us values\n" ); - } - - effectiveIsarSubframeDuration = (int16_t) ( handle->config.isar_frame_duration_us == 20000 ? handle->config.isar_frame_duration_us / MAX_PARAM_SPATIAL_SUBFRAMES : handle->config.isar_frame_duration_us ); - numIvasSubFramesPerLC3frame = (int16_t) handle->config.lc3plus_frame_duration_us / effectiveIsarSubframeDuration; - actual_num_spatial_subframes = (int16_t) handle->config.isar_frame_duration_us / effectiveIsarSubframeDuration; - /* 0.5(0) = 10ms lc3plus, 5ms subframe */ - if ( numIvasSubFramesPerLC3frame != 1 ) - { - return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Selective decoding is only implemented for aligned IVAS-Subframes & LC3plus \n" ); - } - - /* map subframeChannelMatrix to lc3plus skip states */ - /* 1st pass: Flag the required frames */ - for ( decIdx = 0; decIdx < handle->num_decs; decIdx++ ) - { - for ( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) - { - if ( 1 == subframeChannelMatrix[ivasSubframeIdx][decIdx] ) - { - /* subframe needed by the user, definitely decode */ - handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_DECODE_AND_USE; - } - else - { - - /* subframe not needed by the user, but might be required to re-initialize a decoder after inactivity */ - if ( - ( ivasSubframeIdx != actual_num_spatial_subframes - 1 ) && 1 == subframeChannelMatrix[ivasSubframeIdx + 1][decIdx] ) - { - /* ... but if the following subframe is required, it needs to be decoded and dropped */ - handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_DECODE_AND_DROP; - } - else - { - handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_SKIP; - } - } - } - } - - /* if a decoder was paused before, it needs to either: - * - Decode the cached frame (if available) and the first required frame OR - * - Decode the previous LC3plus subframe, even if it isn't needed by the user */ - for ( decIdx = 0; decIdx < handle->num_decs; decIdx++ ) - { - if ( handle->selective_decoding_states[decIdx]->has_skipped_a_frame ) - { - /* find the first frame required by the user */ - for ( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) - { - if ( DEC_ACTION_DECODE_AND_USE == handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] ) - { - /* The first required frame is the first subframe. To flush the decoder, the cached frame must be decoded and dropped */ - if ( 0 == ivasSubframeIdx ) - { - handle->selective_decoding_states[decIdx]->shall_decode_cached_frame = 1; - break; - } - /* The first required frame is not the first frame, so the cache is useless. Instead we decode & drop the previous frame*/ - else - { - handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx - 1] = DEC_ACTION_DECODE_AND_DROP; - break; - } - } - } - } - } - - /* if a dec gets paused & caching is activated we need to flag the last useful LC3plus frame for caching */ - for ( decIdx = 0; decIdx < handle->num_decs; decIdx++ ) - { - for ( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) - { - if ( handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] == DEC_ACTION_SKIP && handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] != DEC_ACTION_DECODE_AND_USE ) - { - handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] = DEC_ACTION_CACHE; - } - } - } - - return IVAS_ERR_OK; -} -#endif - /*------------------------------------------------------------------------- * ISAR_LC3PLUS_DEC_GetDelay() @@ -472,9 +262,6 @@ void ISAR_LC3PLUS_DEC_Close( if ( NULL != ( *handle )->selective_decoding_states && NULL != ( *handle )->selective_decoding_states[iDec] ) { -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - free( ( *handle )->selective_decoding_states[iDec]->frame_actions ); -#endif free( ( *handle )->selective_decoding_states[iDec] ); } @@ -559,17 +346,10 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( ) { uint32_t iDec; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t config_num_media_times; int32_t iMediaTime; int32_t iFtd; LC3PLUS_RTP_PAYLOAD payload; -#else - int32_t iLc3plusFrame; - int32_t lc3framesPerIvasFrame; - int32_t bitstreamOffsetPerCoder; - uint8_t *bitstream_in_iter = bitstream_in; -#endif int32_t ivasSampleIndex; int16_t numSamplesPerLC3plusChannel; ivas_error err; @@ -600,7 +380,6 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "isar_frame_duration_us must be equal or multiple of lc3plus_frame_duration_us \n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS config_num_media_times = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us; if ( !badFrameIndicator ) { @@ -629,25 +408,13 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "LC3plus config change (number of media times per frame data block) in bitstream is not supported\n" ); } } -#endif -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS numSamplesPerLC3plusChannel = (int16_t) ( handle->config.samplerate / ( 1000000 / handle->config.isar_frame_duration_us ) / config_num_media_times ); for ( iDec = 0; iDec < handle->num_decs; iDec++ ) { for ( iMediaTime = 0; iMediaTime < config_num_media_times; iMediaTime++ ) { iFtd = iDec + iMediaTime * handle->num_decs; -#else - lc3framesPerIvasFrame = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us; - - numSamplesPerLC3plusChannel = (int16_t) ( handle->config.samplerate / ( 1000000 / handle->config.isar_frame_duration_us ) / lc3framesPerIvasFrame ); - bitstreamOffsetPerCoder = bitstream_in_size / handle->num_decs / lc3framesPerIvasFrame; - for ( iDec = 0; iDec < handle->num_decs; iDec++ ) - { - for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) - { -#endif if ( handle->selective_decoding_states[iDec]->shall_decode_cached_frame ) { if ( 0 == handle->bitstream_caches[iDec]->bitstream_cache_size ) @@ -670,27 +437,10 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( handle->bitstream_caches[iDec]->bitstream_cache_size = 0; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS switch ( handle->selective_decoding_states[iDec]->frame_action ) -#else - switch ( handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] ) -#endif { -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - case DEC_ACTION_DECODE_AND_DROP: - { - err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in_iter, bitstreamOffsetPerCoder, &handle->pcm_conversion_buffer, badFrameIndicator, handle->scratch ); - if ( err != IVAS_ERR_OK ) - { - return IVAS_ERROR( err, "lc3plus decoding failed\n" ); - } - handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0; - break; - } -#endif case DEC_ACTION_DECODE_AND_USE: { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( badFrameIndicator ) { err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in, bitstream_in_size, &handle->pcm_conversion_buffer, badFrameIndicator, handle->scratch ); @@ -717,33 +467,9 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( } handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0; break; -#else - err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in_iter, bitstreamOffsetPerCoder, &handle->pcm_conversion_buffer, badFrameIndicator ); - if ( err != IVAS_ERR_OK ) - { - return IVAS_ERROR( err, "lc3plus decoding failed\n" ); - } - - for ( int32_t iSampleInt16 = 0; iSampleInt16 < numSamplesPerLC3plusChannel; iSampleInt16++ ) - { - ivasSampleIndex = iSampleInt16 + iLc3plusFrame * numSamplesPerLC3plusChannel; - pcm_out[iDec][ivasSampleIndex] = handle->pcm_conversion_buffer[iSampleInt16]; - } - handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0; - break; -#endif } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - case DEC_ACTION_SKIP: - { - /* log that this instance has skipped a frame and must decode twice once reactivated */ - handle->selective_decoding_states[iDec]->has_skipped_a_frame = 1; - break; - } -#endif case DEC_ACTION_CACHE: { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( handle->bitstream_caches[iDec]->bitstream_cache_capacity < (int32_t) payload.ftds[iFtd].frame_data_length ) { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "bitstream_cache_capacity is too low for LC3plus frame size\n" ); @@ -754,41 +480,15 @@ static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( /* log that this instance has skipped a frame and must decode twice once reactivated */ handle->selective_decoding_states[iDec]->has_skipped_a_frame = 1; break; -#else - if ( handle->bitstream_caches[iDec]->bitstream_cache_capacity < bitstreamOffsetPerCoder ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "bitstream_cache_capacity is too low for LC3plus frame size\n" ); - } - /* store bit rate of cached frame */ - mvc2c( bitstream_in_iter, handle->bitstream_caches[iDec]->bitstream_cache, (int16_t) bitstreamOffsetPerCoder ); - handle->bitstream_caches[iDec]->bitstream_cache_size = bitstreamOffsetPerCoder; - /* log that this instance has skipped a frame and must decode twice once reactivated */ - handle->selective_decoding_states[iDec]->has_skipped_a_frame = 1; - break; -#endif } case DEC_ACTION_NUM_ENUMS: default: return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "invalid LC3plus decoder state\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS } /* for each media time */ /* reset skipping state, must be set by the user before each decode call*/ handle->selective_decoding_states[iDec]->frame_action = DEC_ACTION_DECODE_AND_USE; } /* for each dec/channel */ -#else - - bitstream_in_iter += bitstreamOffsetPerCoder; - } - - /* reset skipping state, must be set by the user before each decode call*/ - for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) - { - handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] = DEC_ACTION_DECODE_AND_USE; - } - } - -#endif return IVAS_ERR_OK; } @@ -855,4 +555,3 @@ ivas_error ISAR_LC3PLUS_DEC_Conceal( return isar_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, 0, badFrameIndicator, pcm_out ); } -#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_isar/isar_lc3plus_dec.h b/lib_isar/isar_lc3plus_dec.h index 5e297a40714f2e3687997889273a2f9ca23d2b00..f3e9699405844875e995738c1ed5310d4db836c7 100644 --- a/lib_isar/isar_lc3plus_dec.h +++ b/lib_isar/isar_lc3plus_dec.h @@ -35,7 +35,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "lc3.h" #include "ivas_error.h" #include "ivas_cnst.h" @@ -44,13 +43,7 @@ typedef enum { -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - DEC_ACTION_DECODE_AND_DROP = 0, -#endif DEC_ACTION_DECODE_AND_USE, -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - DEC_ACTION_SKIP, -#endif DEC_ACTION_CACHE, DEC_ACTION_NUM_ENUMS } SelectiveDecAction; @@ -60,13 +53,8 @@ typedef struct ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE { /*! indicates that the decoder has skipped one or more frames. This means it must decode two frames to flush algorithmic delay when re-activated */ int16_t has_skipped_a_frame; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /*! action to execute for the next frame */ SelectiveDecAction frame_action; -#else - /*! if set to 1, decoder will skip decoding for the next frame */ - SelectiveDecAction *frame_actions; -#endif /*! if set to 1, decoder will decode the cache before decoding any of current frames */ int16_t shall_decode_cached_frame; } ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE; @@ -104,13 +92,6 @@ void ISAR_LC3PLUS_DEC_Close( ISAR_LC3PLUS_DEC_HANDLE *handle /* i/o: pointer to decoder handle */ ); -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -/*! Sets a matrix[MAX_PARAM_SPATIAL_SUBFRAMES][numLC3plusDecoders] where all require subframes must be flagged with 1, frames that are not required with 0 */ -ivas_error ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( - ISAR_LC3PLUS_DEC_HANDLE handle, /* i : decoder handle */ - int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] /* i : */ -); -#endif ivas_error ISAR_LC3PLUS_DEC_Decode( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : decoder handle */ @@ -124,13 +105,5 @@ ivas_error ISAR_LC3PLUS_DEC_Conceal( Word32 **pcm_out /* o : decoded samples */ ); -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -ivas_error ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( - int16_t ***subframeChannelMatrix, - const uint32_t num_decs ); - -void isar_LC3PLUS_DEC_FreeSubframeDecodingMatrix( int16_t **subframeChannelMatrix ); -#endif -#endif /* SPLIT_REND_WITH_HEAD_ROT */ #endif /* ISAR_LC3PLUS_DEC_H */ diff --git a/lib_isar/isar_lc3plus_enc.c b/lib_isar/isar_lc3plus_enc.c index 08ec7c0a8b120ac8ecf95918e806ad3b2012c2cb..7b11084af7aa0c9d056a6b34c3a4212f2fcb6852 100644 --- a/lib_isar/isar_lc3plus_enc.c +++ b/lib_isar/isar_lc3plus_enc.c @@ -38,11 +38,8 @@ #include "wmc_auto.h" #include "options.h" -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS static const LC3PLUS_RTP_FDL s_fdl_request = LC3PLUS_RTP_FDL_NO_REQ_OR_NO_DATA; -#endif -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS static int32_t limit_per_channel_bitrate( LC3PLUS_CONFIG config, int32_t per_channel_bitrate ) { @@ -79,9 +76,7 @@ static int32_t limit_per_channel_bitrate( LC3PLUS_CONFIG config, assert( false && "unreachable" ); return -1; } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------* * Function ISAR_LC3PLUS_ENC_Open() * @@ -93,19 +88,9 @@ ivas_error ISAR_LC3PLUS_ENC_Open( ISAR_LC3PLUS_ENC_HANDLE *handle /* o : encoder handle */ ) { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t num_lc3plus_media_times_per_ivas_frame; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - int32_t lc3plus_num_bytes_per_frame; -#endif bool is_last_media_time, is_last_channel; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivas_error ivas_err; -#endif -#endif -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - int32_t bitsPerSecondPerChannel; -#endif Word32 scratch_size; int32_t encoder_size; LC3PLUS_Error err; @@ -118,10 +103,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Invalid number of channels\n" ); } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - bitsPerSecondPerChannel = bitsPerSecond / config.channels; -#endif -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( config.lc3plus_frame_duration_us != 2500 && config.lc3plus_frame_duration_us != 5000 && config.lc3plus_frame_duration_us != 10000 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Invalid lc3plus_frame_duration_us\n" ); @@ -130,7 +111,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Invalid isar_frame_duration_us\n" ); } -#endif encoder_size = lc3plus_enc_get_size( config.samplerate, 1 ); if ( 0 == encoder_size ) { @@ -141,10 +121,8 @@ ivas_error ISAR_LC3PLUS_ENC_Open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ( *handle )->config = config; ( *handle )->frame_type_descriptors = NULL; -#endif ( *handle )->pcm_conversion_buffer = NULL; ( *handle )->scratch = NULL; @@ -160,7 +138,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( ( *handle )->handles[i] = NULL; } ( *handle )->num_encs = config.channels; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS num_lc3plus_media_times_per_ivas_frame = config.isar_frame_duration_us / config.lc3plus_frame_duration_us; ( *handle )->fdl_request = s_fdl_request; ( *handle )->num_ftds = config.channels * num_lc3plus_media_times_per_ivas_frame; @@ -170,7 +147,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( ISAR_LC3PLUS_ENC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus frame_type_descriptors\n" ); } -#endif for ( int32_t iCh = 0; iCh < config.channels; iCh++ ) { @@ -180,11 +156,7 @@ ivas_error ISAR_LC3PLUS_ENC_Open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus encoder\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS err = lc3plus_enc_init( ( *handle )->handles[iCh], config.samplerate, 1, config.high_res_mode_enabled, lfeChans ); -#else - err = lc3plus_enc_init( ( *handle )->handles[iCh], config.samplerate, 1, 0, lfeChans ); -#endif if ( err != LC3PLUS_OK ) { ISAR_LC3PLUS_ENC_Close( handle ); @@ -197,14 +169,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( ISAR_LC3PLUS_ENC_Close( handle ); return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_frame_dms failed\n" ); } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - err = lc3plus_enc_set_bitrate( ( *handle )->handles[iCh], bitsPerSecondPerChannel ); - if ( err != LC3PLUS_OK ) - { - ISAR_LC3PLUS_ENC_Close( handle ); - return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_bitrate failed\n" ); - } -#endif } if ( config.isar_frame_duration_us < config.lc3plus_frame_duration_us || config.isar_frame_duration_us % config.lc3plus_frame_duration_us != 0 ) @@ -213,9 +177,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Current pcm_conversion_buffer sizing requires that lc3plus uses a shorter or equal frame duration than ivas\n" ); } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - ( *handle )->config = config; -#endif ( *handle )->pcm_conversion_buffer = malloc( sizeof( int16_t ) * config.samplerate * config.lc3plus_frame_duration_us / 1000000 ); if ( NULL == ( *handle )->pcm_conversion_buffer ) { @@ -223,24 +184,13 @@ ivas_error ISAR_LC3PLUS_ENC_Open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus encoder wrapper pcm_conversion_buffer\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* update FDI fields */ for ( int32_t iMediaTime = 0; iMediaTime < num_lc3plus_media_times_per_ivas_frame; ++iMediaTime ) { for ( uint32_t iEnc = 0; iEnc < ( *handle )->num_encs; ++iEnc ) { int32_t ftd_index = iEnc + iMediaTime * ( *handle )->num_encs; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ( *handle )->frame_type_descriptors[ftd_index].frame_data_length = 0; /* will be set to the correct value in IVAS_LC3PLUS_ENC_SetBitrate */ -#else - lc3plus_num_bytes_per_frame = lc3plus_enc_get_num_bytes( ( *handle )->handles[iEnc] ); - if ( lc3plus_num_bytes_per_frame <= 0 ) - { - ISAR_LC3PLUS_ENC_Close( handle ); - return IVAS_ERROR( IVAS_ERR_INTERNAL, "lc3plus_enc_get_num_bytes reported invalid result failed\n" ); - } - ( *handle )->frame_type_descriptors[ftd_index].frame_data_length = lc3plus_num_bytes_per_frame; -#endif if ( 0 != LC3PLUS_RTP_ftd_bwr_from_samplerate( &( *handle )->frame_type_descriptors[ftd_index].bwr, config.samplerate, config.high_res_mode_enabled ) ) { ISAR_LC3PLUS_ENC_Close( handle ); @@ -277,15 +227,12 @@ ivas_error ISAR_LC3PLUS_ENC_Open( } } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivas_err = IVAS_LC3PLUS_ENC_SetBitrate( *handle, bitsPerSecond ); if ( ivas_err != IVAS_ERR_OK ) { ISAR_LC3PLUS_ENC_Close( handle ); return ivas_err; } -#endif -#endif scratch_size = lc3plus_enc_get_scratch_size( ( *handle )->handles[0] ); ( *handle )->scratch = malloc( sizeof( uint8_t ) * scratch_size ); IF( NULL == ( *handle )->scratch ) @@ -297,7 +244,6 @@ ivas_error ISAR_LC3PLUS_ENC_Open( return IVAS_ERR_OK; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /*-------------------------------------------------------------------* * Function IVAS_LC3PLUS_ENC_SetBitrate() * @@ -340,12 +286,10 @@ ivas_error IVAS_LC3PLUS_ENC_SetBitrate( } minPayloadOverhead = fdrLength + ( numSubframes * LC3PLUS_RTP_FTD_MIN_SIZE ); targetLc3PlusBitratePerChannel = ( availableOctetsPerIsarFrame - minPayloadOverhead ) / handle->config.channels * 8 * lc3plusPacketRate / numLc3plusMediaTimesPerIvasFrame; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( targetLc3PlusBitratePerChannel <= 0 ) { return IVAS_ERROR( IVAS_ERR_LC3PLUS_INVALID_BITRATE, "available LC3plus bitrate <= 0\n" ); } -#endif targetLc3PlusBitratePerChannel = limit_per_channel_bitrate( handle->config, targetLc3PlusBitratePerChannel ); targetLc3PlusOctetCount = targetLc3PlusBitratePerChannel / 8 / lc3plusPacketRate; /* check resulting octet count. If it requires larger than 1-byte length fields, decrease the bitrate by enough to make room for the additional length field */ @@ -394,7 +338,6 @@ ivas_error IVAS_LC3PLUS_ENC_SetBitrate( } return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -451,15 +394,11 @@ ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( Word32 *bsSize /* o : size of each bitstream frame in bytes */ ) { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_RTP_ERR rtp_err; int32_t num_lc3plus_media_times_per_ivas_frame; int32_t iMediaTime; int32_t ftd_frame_data_length_size, lc3plus_frame_data_length; int32_t ftd_index; -#else - int32_t bitstreamSizeMultiplier; -#endif if ( NULL == handle ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Enc_Wrap_Handle is NULL\n" ); @@ -469,7 +408,6 @@ ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "bsSize is NULL\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( 0 == handle->config.lc3plus_frame_duration_us ) { return IVAS_ERROR( IVAS_ERR_INIT_ERROR, "lc3plus_frame_duration_us is 0\n" ); @@ -480,9 +418,7 @@ ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( } num_lc3plus_media_times_per_ivas_frame = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us; -#endif *bsSize = 0; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t fdl_request_length; rtp_err = LC3PLUS_RTP_frame_data_length_get_size( &fdl_request_length, handle->fdl_request ); if ( rtp_err != LC3PLUS_RTP_ERR_NO_ERROR ) @@ -490,14 +426,12 @@ ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid LC3plus frame_data_length request\n" ); } *bsSize += fdl_request_length; -#endif for ( uint32_t iEnc = 0; iEnc < handle->num_encs; iEnc++ ) { if ( NULL == handle->handles[iEnc] ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3plus encoder handle is NULL\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS lc3plus_frame_data_length = lc3plus_enc_get_num_bytes( handle->handles[iEnc] ); for ( iMediaTime = 0; iMediaTime < num_lc3plus_media_times_per_ivas_frame; ++iMediaTime ) { @@ -516,18 +450,6 @@ ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( *bsSize += ftd_frame_data_length_size; } } -#else - *bsSize += lc3plus_enc_get_num_bytes( handle->handles[iEnc] ); - } - - if ( handle->config.isar_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) - { - return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "isar_frame_duration_us must be equal or multiple of lc3plus_frame_duration_us \n" ); - } - bitstreamSizeMultiplier = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us; - - *bsSize *= bitstreamSizeMultiplier; -#endif return IVAS_ERR_OK; } @@ -547,12 +469,10 @@ void ISAR_LC3PLUS_ENC_Close( { return; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( NULL != ( *handle )->frame_type_descriptors ) { free( ( *handle )->frame_type_descriptors ); } -#endif for ( uint32_t iEnc = 0; iEnc < ( *handle )->num_encs; iEnc++ ) { if ( NULL != ( *handle )->handles[iEnc] ) @@ -585,24 +505,15 @@ void ISAR_LC3PLUS_ENC_Close( * *-------------------------------------------------------------------*/ ivas_error ISAR_LC3PLUS_ENC_Encode( - ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ - Word32 **pcm_in, /* i : pointer input samples */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS + ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ + Word32 **pcm_in, /* i : pointer input samples */ void *bitstream_out, /* o : pointer to bitstream frame */ const Word32 bitstream_out_size, /* i : size of the bitstream_out buffer in bytes. Must be equal to ISAR_LC3PLUS_ENC_GetOutputBitstreamSize. */ -#else - void *bitstream_out /* o : pointer to bitstream frame */ -#endif Word16 q_in[16] ) { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t ftdIndex; LC3PLUS_RTP_ERR rtpErr; uint32_t num_media_times; -#else - uint32_t lc3framesPerIvasFrame; - uint8_t *bitstream_out_iter = bitstream_out; -#endif uint32_t numSamplesPerLC3plusChannel; int32_t ivasSampleIndex; int32_t num_bytes = 0; @@ -627,7 +538,6 @@ ivas_error ISAR_LC3PLUS_ENC_Encode( { return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "isar_frame_duration_us must be equal or multiple of lc3plus_frame_duration_us \n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS num_media_times = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us; numSamplesPerLC3plusChannel = handle->config.samplerate / ( 1000000 / handle->config.isar_frame_duration_us ) / num_media_times; @@ -637,39 +547,20 @@ ivas_error ISAR_LC3PLUS_ENC_Encode( { return IVAS_ERROR( IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( rtpErr ), "LC3PLUS_RTP_payload_serialize failed\n" ); } -#else - lc3framesPerIvasFrame = handle->config.isar_frame_duration_us / handle->config.lc3plus_frame_duration_us; - - numSamplesPerLC3plusChannel = handle->config.samplerate / ( 1000000 / handle->config.isar_frame_duration_us ) / lc3framesPerIvasFrame; -#endif for ( uint32_t iEnc = 0; iEnc < handle->num_encs; iEnc++ ) { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS for ( uint32_t iMediaTime = 0; iMediaTime < num_media_times; iMediaTime++ ) -#else - for ( uint32_t iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) -#endif { for ( uint32_t iSampleInt16 = 0; iSampleInt16 < numSamplesPerLC3plusChannel; iSampleInt16++ ) { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivasSampleIndex = iSampleInt16 + iMediaTime * numSamplesPerLC3plusChannel; -#else - ivasSampleIndex = iSampleInt16 + iLc3plusFrame * numSamplesPerLC3plusChannel; -#endif handle->pcm_conversion_buffer[iSampleInt16] = (Word16) max( INT16_MIN, min( L_shr( pcm_in[iEnc][ivasSampleIndex], q_in[iEnc] ), INT16_MAX ) ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ftdIndex = iMediaTime * handle->num_encs + iEnc; -#endif num_bytes = 0; push_wmops( "lc3plus_enc16" ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS err = lc3plus_enc16( handle->handles[iEnc], &handle->pcm_conversion_buffer, handle->frame_type_descriptors[ftdIndex].frame_data, &num_bytes, handle->scratch ); -#else - err = lc3plus_enc16( handle->handles[iEnc], &handle->pcm_conversion_buffer, bitstream_out_iter, &num_bytes, NULL ); -#endif pop_wmops(); if ( err != LC3PLUS_OK ) { @@ -679,15 +570,10 @@ ivas_error ISAR_LC3PLUS_ENC_Encode( { return IVAS_ERROR( IVAS_ERR_INTERNAL, "lc3plus_enc16 did not produce output\n" ); } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( num_bytes != (int32_t) handle->frame_type_descriptors[ftdIndex].frame_data_length ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "payload format and lc3plus enc bitrate are not aligned\n" ); } -#else - - bitstream_out_iter += num_bytes; -#endif } } @@ -695,4 +581,3 @@ ivas_error ISAR_LC3PLUS_ENC_Encode( return IVAS_ERR_OK; } -#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_isar/isar_lc3plus_enc.h b/lib_isar/isar_lc3plus_enc.h index 6d0f47030d09b8594f25b73fea448eb725658f6a..f0c37afc8592509ff35ddc3f0e2e05dd28c1f296 100644 --- a/lib_isar/isar_lc3plus_enc.h +++ b/lib_isar/isar_lc3plus_enc.h @@ -35,13 +35,10 @@ #include #include "ivas_error.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "lc3.h" #include "isar_lc3plus_common.h" #include "typedef.h" -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #include "isar_lc3plus_payload.h" -#endif /* encoder wrapper */ typedef struct ISAR_LC3PLUS_ENC_HANDLE @@ -50,30 +47,22 @@ typedef struct ISAR_LC3PLUS_ENC_HANDLE LC3PLUS_Enc **handles; uint32_t num_encs; int16_t *pcm_conversion_buffer; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_RTP_FTD *frame_type_descriptors; int32_t num_ftds; LC3PLUS_RTP_FDL fdl_request; -#endif uint8_t *scratch; } * ISAR_LC3PLUS_ENC_HANDLE; ivas_error ISAR_LC3PLUS_ENC_Open( - const LC3PLUS_CONFIG config, /* i : encoder configuration */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS + const LC3PLUS_CONFIG config, /* i : encoder configuration */ const uint32_t initialBitsPerSecond, /* i : initial target bit rate */ -#else - const uint32_t bitsPerSecond, /* i : bit rate */ -#endif - ISAR_LC3PLUS_ENC_HANDLE *handle /* o : LC3plus encoder handle */ + ISAR_LC3PLUS_ENC_HANDLE *handle /* o : LC3plus encoder handle */ ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivas_error IVAS_LC3PLUS_ENC_SetBitrate( ISAR_LC3PLUS_ENC_HANDLE handle, /* o : LC3plus encoder handle */ const uint32_t bitsPerSecond /* i : new target bit rate */ ); -#endif ivas_error ISAR_LC3PLUS_ENC_GetDelay( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ @@ -90,15 +79,10 @@ void ISAR_LC3PLUS_ENC_Close( ); ivas_error ISAR_LC3PLUS_ENC_Encode( - ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ - Word32 **pcm_in, /* i : pointer input samples */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS + ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ + Word32 **pcm_in, /* i : pointer input samples */ void *bitstream_out, /* o : pointer to bitstream frame */ const Word32 bitstream_out_size, /* i : size of the bitstream_out buffer in bytes. Must be equal to ISAR_LC3PLUS_ENC_GetOutputBitstreamSize. */ -#else - void *bitstream_out /* o : pointer to bitstream frame */ -#endif Word16 q_in[16] ); -#endif #endif /* ISAR_LC3PLUS_ENC_H */ diff --git a/lib_isar/isar_lc3plus_payload.c b/lib_isar/isar_lc3plus_payload.c index cd053978d1ca7a5ffdc914a853e4e829e6be592f..2493aa6a30eb9ca3ab8f493dc1dad4e057666b98 100644 --- a/lib_isar/isar_lc3plus_payload.c +++ b/lib_isar/isar_lc3plus_payload.c @@ -36,8 +36,6 @@ #include "isar_lc3plus_payload.h" #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS static LC3PLUS_RTP_ERR s_frame_duration_ms_from_fdi( int32_t *frame_duration_us, const LC3PLUS_RTP_FTD_FDI fdi ) { if ( NULL == frame_duration_us ) @@ -818,6 +816,3 @@ LC3PLUS_RTP_ERR LC3PLUS_RTP_ftd_fdi_from_frame_duration_us( LC3PLUS_RTP_FTD_FDI return LC3PLUS_RTP_ERR_INVALID_PARAMETERS; } - -#endif /* ISAR_BITSTREAM_UPDATE_LC3PLUS */ -#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_isar/isar_lc3plus_payload.h b/lib_isar/isar_lc3plus_payload.h index c225c91591685f0f55f9d906d9719cb89a9fd136..e95128578493f5561fdcb2292aef37f0c202e428 100644 --- a/lib_isar/isar_lc3plus_payload.h +++ b/lib_isar/isar_lc3plus_payload.h @@ -38,8 +38,6 @@ #include "lc3.h" #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* Implementation of the "B.2.6 Table of contents" part of the RTP payload format * for LC3plus as specified in ETSI TS 103 634. */ @@ -211,6 +209,4 @@ LC3PLUS_RTP_ERR LC3PLUS_RTP_payload_deserialize( uint8_t *serialized_buffer, const size_t serialized_buffer_size ); -#endif /* ISAR_BITSTREAM_UPDATE_LC3PLUS */ -#endif /* #ifdef SPLIT_REND_WITH_HEAD_ROT */ #endif /* ISAR_LC3PLUS_PAYLOAD_H */ diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index a64a12aead2cf63dcd1e648ce57fb1e6fd6cdfbf..ce517a492ef8c296aa6eb2a9a689d82ad225c05e 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_lcld_prot.h" #include "isar_lcld_rom_tables.h" #include "prot_fx.h" @@ -1991,5 +1990,3 @@ static void ComputeAllocation( return; } - -#endif diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index 48445d08024b8b01cefa578719ab31a79441988f..327edb6ad3aed00682d86685ded5e61991568be8 100644 --- a/lib_isar/isar_lcld_encoder.c +++ b/lib_isar/isar_lcld_encoder.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include #include "isar_lcld_prot.h" @@ -2139,4 +2138,3 @@ static Word32 ComputeAllocation( } return iBitsUsed; } -#endif diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index 49e03f5ef5fc1d31a475e63bcc787beef25bf58a..3f79a2c120386746bd93f3b739750a1c17a7ee3d 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -34,7 +34,6 @@ #define ISAR_LCLD_PROT_H #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "typedef.h" #include "common_api_types.h" #include "isar_lcld_rom_tables.h" @@ -450,7 +449,6 @@ void ComputeEnvelopeGrouping( Word16 q_final ); -#endif /* clang-format on */ #endif /* _LCLD_ENCODER_H_ */ diff --git a/lib_isar/isar_lcld_rom_tables.c b/lib_isar/isar_lcld_rom_tables.c index 8ecf743363a2a4de7584df44b28eb841e83809f0..42554611f84607cf59e98b094c8a4e326d3eff1a 100644 --- a/lib_isar/isar_lcld_rom_tables.c +++ b/lib_isar/isar_lcld_rom_tables.c @@ -32,7 +32,6 @@ #include "isar_lcld_rom_tables.h" #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "wmc_auto.h" #include "prot_fx.h" #include "isar_lcld_prot.h" @@ -21204,4 +21203,3 @@ const Word32 c_pfWindowLUT[LCLD_PRED_WIN_LEN] = /* Q31 */ { 190779840, 338280192, 610825408, 966922816, 1352359680, 1708457216, 1981002240, 2128502656, 2128502528, 1981002240, 1708456960, 1352359808, 966922624, 610825152, 338280192, 190779776 }; -#endif diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index 618454f665a7c6026357381ecc54b11ad841d0da..112ee1155fc9eddb2ae34719993fea4759495d3b 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -36,7 +36,6 @@ #include "isar_stat.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "options.h" @@ -199,15 +198,8 @@ void isar_split_rend_get_quant_params_fx( Word16 bands_pitch[ISAR_SPLIT_REND_NUM_QUANT_STRATS], Word16 pred_real_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS], Word16 pred_imag_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS], -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS const Word16 ro_flag, -#endif - Word16 *num_quant_strats -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - , - Word16 *num_complex_bands -#endif -); + Word16 *num_quant_strats ); void isar_split_rend_get_quant_params( const int16_t num_md_bands, @@ -293,7 +285,6 @@ void isar_rend_CldfbSplitPreRendProcess( const Word16 low_res_pre_rend_rot, const Word16 ro_md_flag ); -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word16 isar_renderSplitGetRot_axisNumBits( const Word16 dof ); @@ -305,7 +296,6 @@ Word16 isar_renderSplitGetCodeFromRot_axis( const Word16 dof, const ISAR_SPLIT_REND_ROT_AXIS rot_axis, Word16 *num_bits ); -#endif void isar_init_split_post_rend_handles( ISAR_SPLIT_POST_REND_WRAPPER *hSplitRendWrapper ); @@ -329,13 +319,6 @@ void isar_set_split_rend_ht_setup_fx( Word32 Rmat_fx[MAX_PARAM_SPATIAL_SUBFRAMES][3][3] ); -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -Word32 isar_get_lc3plus_bitrate( - const Word32 SplitRendBitRate, - const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode, - const Word16 split_prerender_frame_size_ms ); -#endif - ivas_error isar_split_rend_validate_config( const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const Word16 is_pcm_out ); @@ -344,41 +327,29 @@ Word32 isar_get_lcld_bitrate( const Word32 SplitRendBitRate, const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -Word8 isar_get_lc3plus_bitrate_id( - const Word32 SplitRendBitRate ); -#endif ivas_error splitRendLc3plusEncodeAndWrite( SPLIT_REND_WRAPPER *hSplitBin, ISAR_SPLIT_REND_BITS_HANDLE pBits, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const int32_t available_bits, -#else - const int32_t SplitRendBitRate, -#endif Word32 *in[], Word16 Q_sig ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivas_error isar_framesize_to_ms( const IVAS_RENDER_FRAMESIZE frame_size, /* i : frame size enum */ Word16 *ms /* o : frame size in ms */ ); -#endif Word32 isar_get_split_rend_md_target_brate( const Word32 SplitRendBitRate, const Word16 pcm_out_flag ); ivas_error isar_split_rend_choose_default_codec( ISAR_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - Word16 *pIsar_frame_size_ms, /* i/o: pointer to isar frame size setting */ -#endif - Word16 *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ - const Word16 cldfb_in_flag, /* i : flag indicating rendering in TD */ - const Word16 pcm_out_flag, /* i : flag to indicate PCM output */ - const Word16 num_subframes /* i : number of subframes */ + Word16 *pIsar_frame_size_ms, /* i/o: pointer to isar frame size setting */ + Word16 *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ + const Word16 cldfb_in_flag, /* i : flag indicating rendering in TD */ + const Word16 pcm_out_flag, /* i : flag to indicate PCM output */ + const Word16 num_subframes /* i : number of subframes */ ); void ISAR_SPLIT_REND_BITStream_init( @@ -393,12 +364,6 @@ Word16 wrap_a( Word16 val, const Word16 min_val, const Word16 max_val ); -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -Word32 isar_get_lc3plus_size_from_id( - const Word8 SplitRendBitRateId, - const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode, - const Word16 split_prerender_frame_size_ms ); -#endif void isar_renderSplitUpdateNoCorrectionPoseData( const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, @@ -412,12 +377,7 @@ ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const Word32 OutSampleRate, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - const IVAS_RENDER_FRAMESIZE ivas_frame_size -#else - const int16_t num_subframes -#endif -); + const IVAS_RENDER_FRAMESIZE ivas_frame_size ); ISAR_POST_REND_AudioConfigType isar_getAudioConfigType( const IVAS_AUDIO_CONFIG config ); @@ -429,9 +389,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPosition, const Word32 SplitRendBitRate, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const Word16 isar_frame_size_ms, -#endif const Word16 codec_frame_size_ms, ISAR_SPLIT_REND_BITS_HANDLE pBits, const Word16 max_bands, @@ -447,7 +405,6 @@ void lc3plusTimeAlignCldfbPoseCorr( SPLIT_REND_WRAPPER *hSplitBin, Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], Word16 *Q_in ); -#endif void ivas_cmult_fix( Word32 in1_re_fx, Word16 exp_re1, Word32 in1_im_fx, Word16 exp_im1, Word32 in2_re_fx, Word16 exp_re2, Word32 in2_im_fx, Word16 exp_im2, Word32 *out1_re_fx, Word32 *out1_im_fx, Word16 *exp_out1_re, Word16 *exp_out1_im ); diff --git a/lib_isar/isar_rom_post_rend.c b/lib_isar/isar_rom_post_rend.c index 99742bc4f28f85d176637967b41495f82ec08f17..0af50df5c428ccb2480245c91f6cb2444b9668ea 100644 --- a/lib_isar/isar_rom_post_rend.c +++ b/lib_isar/isar_rom_post_rend.c @@ -43,7 +43,6 @@ /* clang-format off */ -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------* * Binuaral split rendering ROM tables *-----------------------------------------------------------------------*/ @@ -187,7 +186,6 @@ const int32_t ivas_split_rend_huff_roll_pred_consts[ISAR_SPLIT_REND_ROLL_PRED_QU {14,10,1022},{15,10,1023}, }; -#endif /* Tables for split renderer fixed converison */ const Word16 fade_table_fx[4] = diff --git a/lib_isar/isar_rom_post_rend.h b/lib_isar/isar_rom_post_rend.h index b9acd75e1e16af8a9cbd036d472d327033629c01..90bcae60bdc74a36a5a7c0f57e78531075466bd0 100644 --- a/lib_isar/isar_rom_post_rend.h +++ b/lib_isar/isar_rom_post_rend.h @@ -41,7 +41,6 @@ #include "cnst.h" #include "isar_cnst.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------* * Binuaral split rendering ROM tables *-----------------------------------------------------------------------*/ @@ -74,7 +73,6 @@ extern const int32_t ivas_split_rend_huff_roll_pred_consts[ISAR_SPLIT_REND_ROLL_ extern const int32_t ivas_split_rend_huff_p_d_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_p_d_diff_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; extern const int32_t split_rend_brate_tbl[]; -#endif /* Tables for fixed point conversion */ extern const Word16 fade_table_fx[4]; diff --git a/lib_isar/isar_splitRend_lcld_dec.c b/lib_isar/isar_splitRend_lcld_dec.c index ddf9515b9d59e71dc4c762e748a0cf1c9572a42c..7238887093099a97b947b90b5b1208586e37bf6c 100644 --- a/lib_isar/isar_splitRend_lcld_dec.c +++ b/lib_isar/isar_splitRend_lcld_dec.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_prot.h" #include "ivas_prot_fx.h" #include "prot_fx.h" @@ -282,4 +281,3 @@ void isar_splitBinLCLDDecProcess( return; } -#endif diff --git a/lib_isar/isar_splitRend_lcld_enc.c b/lib_isar/isar_splitRend_lcld_enc.c index 6804e97a408d1d52d0b65a80b8262c220b9a07b5..e75910e8c33aee38471a8adac3c5953799d7b3a4 100644 --- a/lib_isar/isar_splitRend_lcld_enc.c +++ b/lib_isar/isar_splitRend_lcld_enc.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_prot.h" #include "ivas_prot_fx.h" #ifdef DEBUGGING @@ -236,4 +235,3 @@ void isar_splitBinLCLDEncProcess( return; } -#endif diff --git a/lib_isar/isar_splitRendererPLC.c b/lib_isar/isar_splitRendererPLC.c index e3a0ce0e8b4bff86eafd047de36493b2893a57bb..c81d0e12f198acaba7682689fb92b7ce003ac1f9 100644 --- a/lib_isar/isar_splitRendererPLC.c +++ b/lib_isar/isar_splitRendererPLC.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "ivas_prot_fx.h" #include "prot_fx.h" @@ -1294,4 +1293,3 @@ void isar_splitBinRendPLC( return; } -#endif diff --git a/lib_isar/isar_splitRendererPost.c b/lib_isar/isar_splitRendererPost.c index 306b47d711df41e90977a2f288e069701d988dc6..b1cf6659bc467cf2cab943c3e3488f8f747f51b8 100644 --- a/lib_isar/isar_splitRendererPost.c +++ b/lib_isar/isar_splitRendererPost.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #include @@ -239,22 +238,9 @@ static void ivas_split_rend_unquant_md_fx( quantstep = pred_quant_step; move32(); -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - hMd->pred_mat_re_fx[ch1][ch2] = Mpy_32_16_1( quantstep, extract_l( L_shl( hMd->pred_mat_re_idx[ch1][ch2], Q9 ) ) ); /* Q25 */ - move32(); - hMd->pred_mat_re_fx[ch1][ch2] = L_add( hMd->pred_mat_re_fx[ch1][ch2], L_shr( fix_pos_rot_mat[ch1][ch2], Q6 ) ); /* Q25 */ - move32(); - } - } -#endif IF( real_only ) { -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) @@ -265,7 +251,6 @@ static void ivas_split_rend_unquant_md_fx( move32(); } } -#endif FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { @@ -278,7 +263,6 @@ static void ivas_split_rend_unquant_md_fx( } ELSE { -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) @@ -289,7 +273,6 @@ static void ivas_split_rend_unquant_md_fx( move32(); } } -#endif FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { @@ -385,34 +368,6 @@ static void isar_splitBinPostRendMdBase2Dec( { IF( EQ_32( hBinHrSplitPostRend->pose_type[pos_idx], ANY_YAW ) ) { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = extract_l( ISAR_SPLIT_REND_BITStream_read_int32( pBits, pred_code_len ) ); - hMd->pred_mat_re_idx[ch1][ch2] = add( code, min_pred_idx ); - move16(); - } - } - } - FOR( b = 0; b < pred_imag_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = extract_l( ISAR_SPLIT_REND_BITStream_read_int32( pBits, pred_code_len ) ); - hMd->pred_mat_im_idx[ch1][ch2] = add( code, min_pred_idx ); - move16(); - } - } - } -#else FOR( b = 0; b < pred_imag_bands_yaw; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; @@ -450,7 +405,6 @@ static void isar_splitBinPostRendMdBase2Dec( hMd->pred_mat_re_idx[1][0] = 0; move16(); } -#endif FOR( b = 0; b < d_bands_yaw; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; @@ -474,34 +428,6 @@ static void isar_splitBinPostRendMdBase2Dec( } ELSE { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_roll; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = extract_l( ISAR_SPLIT_REND_BITStream_read_int32( pBits, pred_roll_code_len ) ); - hMd->pred_mat_re_idx[ch1][ch2] = add( code, min_pred_roll_idx ); - move16(); - } - } - } - FOR( b = 0; b < pred_imag_bands_roll; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = extract_l( ISAR_SPLIT_REND_BITStream_read_int32( pBits, pred_roll_code_len ) ); - hMd->pred_mat_im_idx[ch1][ch2] = add( code, min_pred_roll_idx ); - move16(); - } - } - } -#else FOR( b = 0; b < pred_imag_bands_roll; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; @@ -539,7 +465,6 @@ static void isar_splitBinPostRendMdBase2Dec( hMd->pred_mat_re_idx[1][0] = 0; move16(); } -#endif } } } @@ -599,36 +524,6 @@ static void ivas_splitBinPostRendMdHuffDec( { IF( EQ_32( hBinHrSplitPostRend->pose_type[pos_idx], ANY_YAW ) ) { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[pred_cb_idx], pBits, pHuff_cfg->pred_idx_trav[pred_cb_idx] ); - move16(); - // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); - } - } - isar_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, 1, min_pred_idx, max_pred_idx ); - } - FOR( b = 0; b < pred_imag_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[pred_cb_idx], pBits, pHuff_cfg->pred_idx_trav[pred_cb_idx] ); - move16(); - // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); - } - } - isar_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_im_idx, -1, min_pred_idx, max_pred_idx ); - } -#else FOR( b = 0; b < pred_imag_bands_yaw; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; @@ -668,7 +563,6 @@ static void ivas_splitBinPostRendMdHuffDec( move16(); isar_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, -1, min_pred_idx, max_pred_idx ); } -#endif FOR( b = 0; b < d_bands_yaw; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; @@ -689,37 +583,6 @@ static void ivas_splitBinPostRendMdHuffDec( } ELSE { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_roll; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred_roll, pBits, pHuff_cfg->pred_roll_idx_trav ); - move16(); - // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred_roll, pBits ); - } - } - isar_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, 1, min_pred_roll_idx, max_pred_roll_idx ); - } - FOR( b = 0; b < pred_imag_bands_roll; b++ ) - { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred_roll, pBits, pHuff_cfg->pred_roll_idx_trav ); - move16(); - // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred_roll, pBits ); - } - } - isar_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_im_idx, -1, min_pred_roll_idx, max_pred_roll_idx ); - } -#else FOR( b = 0; b < pred_imag_bands_roll; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; @@ -760,7 +623,6 @@ static void ivas_splitBinPostRendMdHuffDec( move16(); isar_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, -1, min_pred_roll_idx, max_pred_roll_idx ); } -#endif } } } @@ -789,11 +651,7 @@ void isar_splitBinPostRendMdDec_fx( Word16 pred_real_bands_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS], pred_real_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; Word16 pred_imag_bands_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS], pred_imag_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; Word16 d_bands_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word16 num_quant_strats; -#else - Word16 num_complex_bands, num_quant_strats; -#endif Word32 quant_strat_bits, is_huff_coding, quant_strat; Word16 pred_quant_pnts_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; Word32 pred_1byquantstep_yaw_fx[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; // Q26 @@ -804,9 +662,7 @@ void isar_splitBinPostRendMdDec_fx( ISAR_BIN_HR_SPLIT_REND_MD_HANDLE hMd; ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; ISAR_SPLIT_REND_ROT_AXIS rot_axis; -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word16 ro_md_flag, num_bits, axis_code; -#endif hBinHrSplitPostRend->low_Res = 1; move16(); @@ -814,7 +670,6 @@ void isar_splitBinPostRendMdDec_fx( split_rend_config.dof = extract_l( ISAR_SPLIT_REND_BITStream_read_int32( pBits, ISAR_SPLIT_REND_DOF_BITS ) ); split_rend_config.hq_mode = extract_l( ISAR_SPLIT_REND_BITStream_read_int32( pBits, ISAR_SPLIT_REND_HQ_MODE_BITS ) ); -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS num_bits = isar_renderSplitGetRot_axisNumBits( split_rend_config.dof ); if ( num_bits > 0 ) { @@ -826,9 +681,6 @@ void isar_splitBinPostRendMdDec_fx( } rot_axis = isar_renderSplitGetRot_axisFromCode( split_rend_config.dof, axis_code ); ro_md_flag = (int16_t) ISAR_SPLIT_REND_BITStream_read_int32( pBits, ISAR_SPLIT_REND_RO_FLAG_BITS ); -#else - rot_axis = (ISAR_SPLIT_REND_ROT_AXIS) ISAR_SPLIT_REND_BITStream_read_int32( pBits, ISAR_SPLIT_REND_ROT_AXIS_BITS ); -#endif isar_renderSplitGetMultiBinPoseData_fx( &split_rend_config, pMultiBinPoseData, rot_axis ); set_fix_rotation_mat_fx( hBinHrSplitPostRend->fix_pos_rot_mat_fx, pMultiBinPoseData ); @@ -862,7 +714,6 @@ void isar_splitBinPostRendMdDec_fx( move32(); } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS isar_split_rend_get_quant_params_fx( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, @@ -876,21 +727,6 @@ void isar_splitBinPostRendMdDec_fx( pred_imag_bands_roll, ro_md_flag, &num_quant_strats ); -#else - isar_split_rend_get_quant_params_fx( - MAX_SPLIT_REND_MD_BANDS, - pred_real_bands_yaw, - pred_imag_bands_yaw, - pred_quant_pnts_yaw, - pred_quantstep_yaw_fx, - pred_1byquantstep_yaw_fx, - d_bands_yaw, - bands_pitch, - pred_real_bands_roll, - pred_imag_bands_roll, - &num_quant_strats, - &num_complex_bands ); -#endif quant_strat_bits = L_deposit_l( ceil_log_2( num_quant_strats ) ); is_huff_coding = ISAR_SPLIT_REND_BITStream_read_int32( pBits, 1 ); quant_strat = ISAR_SPLIT_REND_BITStream_read_int32( pBits, quant_strat_bits ); @@ -2121,5 +1957,3 @@ void isar_init_split_post_rend_handles( return; } - -#endif diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 8bdc824f87a5ed2fd3922f6ede336962c7820db2..b30f25ca7cd4d36a8b2972e9740ce5fbdaf1fbac 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #include @@ -912,11 +911,7 @@ static void isar_split_rend_quant_md_fx( { int16_t ch1, ch2; int16_t gd_idx_min; -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word32 quant_val; -#else - Word32 sign, quant_val; -#endif #ifdef DEBUG_QUANT_MD_FX float quant_val_flt; Word16 tmp; @@ -931,7 +926,6 @@ static void isar_split_rend_quant_md_fx( #endif IF( real_only == 1 ) { -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { hMd->pred_mat_re_fx[ch1][ch1] = hMd->pred_mat_re2[ch1]; @@ -948,25 +942,9 @@ static void isar_split_rend_quant_md_fx( hMd->pred_mat_re_idx[ch1][ch2] = (Word16) L_shr_r( Mpy_32_32( onebyquantstep, quant_val ), sub( Q_frame, 5 ) ); // Q25*Q26 = Q20 -> Q16 -> Q0 } } -#else - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - sign = GE_32( hMd->pred_mat_re_fx[ch1][ch2], 0 ) ? 1 : -1; - Word16 exp_out; - ivas_calculate_abs_fx( hMd->pred_mat_re_fx[ch1][ch2], Q31 - Q_frame, hMd->pred_mat_im_fx[ch1][ch2], Q31 - Q_frame, &hMd->pred_mat_re_fx[ch1][ch2], &exp_out ); - hMd->pred_mat_re_fx[ch1][ch2] = L_shr_r( hMd->pred_mat_re_fx[ch1][ch2], sub( sub( Q31, Q_frame ), exp_out ) ); // Q_frame - hMd->pred_mat_re_fx[ch1][ch2] = (Word32) W_mult0_32_32( hMd->pred_mat_re_fx[ch1][ch2], sign ); - hMd->pred_mat_im_fx[ch1][ch2] = 0; - } - } -#endif } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS else { -#endif for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) @@ -986,9 +964,7 @@ static void isar_split_rend_quant_md_fx( #endif } } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS } -#endif if ( real_only == 0 ) { @@ -1067,7 +1043,6 @@ static void isar_split_rend_quant_md_fx( } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS static void get_lr_gains( Word32 cov_ii_re_fx[][BINAURAL_CHANNELS], const Word16 exp_cov_ii_re, Word32 cov_oo_re_fx[][BINAURAL_CHANNELS], @@ -1123,7 +1098,6 @@ static void get_lr_gains( Word32 cov_ii_re_fx[][BINAURAL_CHANNELS], move16(); return; } -#endif static void ComputeCoeffs_fx( Word32 cov_ii_re_fx[][BINAURAL_CHANNELS], @@ -1216,7 +1190,6 @@ static void ComputeCoeffs_fx( { IF( real_only ) { -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word32 gd_tmp_fx[BINAURAL_CHANNELS]; get_lr_gains( cov_ii_re_fx, exp_cov_ii_re, cov_oo_re_fx, exp_cov_oo_re, @@ -1235,79 +1208,12 @@ static void ComputeCoeffs_fx( hMd->pred_mat_re2[i] = gd_tmp_fx[i]; set32_fx( hMd->pred_mat_im_fx[i], 0, BINAURAL_CHANNELS ); } - - -#else - Word32 gd_tmp_fx[BINAURAL_CHANNELS]; - Word16 exp_gd_tmp_buf[BINAURAL_CHANNELS] = { 0 }; - Word16 exp_gd_tmp = 0; - - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - gd_tmp_fx[i] = cov_ii_re_fx[i][i]; - move32(); - exp_gd_tmp_buf[i] = exp_cov_ii_re; - move16(); - - Word16 flag = BASOP_Util_Cmp_Mant32Exp( gd_tmp_fx[i], exp_gd_tmp_buf[i], EPSILON_FX, 0 ); - IF( EQ_16( flag, negate( 1 ) ) ) - { - gd_tmp_fx[i] = ONE_IN_Q25; - move32(); - exp_gd_tmp_buf[i] = 6; - move16(); - } - ELSE - { - Word16 tmp, tmp_sqrt, exp_tmp = 0; - tmp = BASOP_Util_Divide3232_Scale( cov_oo_re_fx[i][i], gd_tmp_fx[i], &exp_tmp ); - exp_tmp = exp_tmp + ( exp_cov_oo_re - exp_gd_tmp_buf[i] ); - tmp_sqrt = Sqrt16( tmp, &exp_tmp ); - gd_tmp_fx[i] = L_deposit_h( tmp_sqrt ); - move32(); - exp_gd_tmp_buf[i] = exp_tmp; - move16(); - } - hMd->pred_mat_re_fx[i][i] = gd_tmp_fx[i]; - move32(); - set32_fx( hMd->pred_mat_im_fx[i], 0, BINAURAL_CHANNELS ); - } - hMd->pred_mat_re_fx[1][0] = 0; - move32(); - hMd->pred_mat_re_fx[0][1] = 0; - move32(); - - Word16 max_gd_exp = MIN16B; - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - max_gd_exp = max( max_gd_exp, exp_gd_tmp_buf[i] ); - } - exp_gd_tmp = max_gd_exp; - - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - hMd->pred_mat_re_fx[i][i] = L_shr( hMd->pred_mat_re_fx[i][i], max_gd_exp - exp_gd_tmp_buf[i] ); - move32(); - } - - exp_pred_re = exp_gd_tmp; - move16(); - exp_pred_im = exp_gd_tmp; - move16(); - - hMd->exp_pred_mat_re = exp_pred_re; - move16(); - hMd->exp_pred_mat_im = exp_pred_im; - move16(); -#endif } ELSE { -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS get_lr_gains( cov_ii_re_fx, exp_cov_ii_re, cov_oo_re_fx, exp_cov_oo_re, hMd->pred_mat_re2, &hMd->exp_pred_mat_re2 ); -#endif Word16 exp_norm_fact = 0; cov_norm_fact_fx = GetNormFact_fx( cov_ii_re_fx, exp_cov_ii_re, cov_ii_im_fx, exp_cov_ii_im, cov_io_re_fx, exp_cov_io_re, cov_io_im_fx, exp_cov_io_im, cov_oo_re_fx, exp_cov_oo_re, &exp_norm_fact ); @@ -1580,19 +1486,12 @@ static void get_base2_bits( pose_type = hBinHrSplitPreRend->pose_type[pose_idx]; IF( EQ_32( pose_type, ANY_YAW ) ) { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_yaw_bits[q], pred_real_bands_yaw[q] ), bin_ch_2_num_sf ) ); - move32(); - base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_yaw_bits[q], pred_imag_bands_yaw[q] ), bin_ch_2_num_sf ) ); - move32(); -#else base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_yaw_bits[q], pred_real_bands_yaw[q] ), bin_ch_num_sf ) ); move32(); base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_yaw_bits[q], pred_imag_bands_yaw[q] ), bin_ch_num_sf ) ); move32(); base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_yaw_bits[q], pred_imag_bands_yaw[q] ), bin_ch_2_num_sf ) ); move32(); -#endif base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( d_gain_bits, d_bands_yaw[q] ), num_subframes ) ); @@ -1607,19 +1506,12 @@ static void get_base2_bits( } ELSE { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_roll_bits, pred_real_bands_roll[q] ), bin_ch_2_num_sf ) ); - move32(); - base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_roll_bits, pred_imag_bands_roll[q] ), bin_ch_2_num_sf ) ); - move32(); -#else base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_roll_bits, pred_real_bands_roll[q] ), bin_ch_num_sf ) ); move32(); base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_roll_bits, pred_imag_bands_roll[q] ), bin_ch_num_sf ) ); move32(); base2bits[q] = L_add( base2bits[q], L_mult0( DEPR_i_mult( pred_roll_bits, pred_imag_bands_roll[q] ), bin_ch_2_num_sf ) ); move32(); -#endif } } } @@ -1683,33 +1575,6 @@ static void isar_SplitRenderer_code_md_base2( { IF( EQ_32( hBinHrSplitPreRend->pose_type[pos_idx], ANY_YAW ) ) { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = L_sub( hMd->pred_mat_re_idx[ch1][ch2], min_pred_idx ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, pred_code_len ); - } - } - } - - FOR( b = 0; b < pred_imag_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = L_sub( hMd->pred_mat_im_idx[ch1][ch2], min_pred_idx ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, pred_code_len ); - } - } - } -#else FOR( b = 0; b < pred_imag_bands_yaw; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; @@ -1740,7 +1605,6 @@ static void isar_SplitRenderer_code_md_base2( ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, pred_code_len ); } } -#endif FOR( b = 0; b < d_bands_yaw; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; @@ -1762,33 +1626,6 @@ static void isar_SplitRenderer_code_md_base2( } ELSE { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_roll; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = L_sub( hMd->pred_mat_re_idx[ch1][ch2], min_pred_roll_idx ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, pred_roll_code_len ); - } - } - } - - FOR( b = 0; b < pred_imag_bands_roll; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - code = L_sub( hMd->pred_mat_im_idx[ch1][ch2], min_pred_roll_idx ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, pred_roll_code_len ); - } - } - } -#else FOR( b = 0; b < pred_imag_bands_roll; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; @@ -1819,7 +1656,6 @@ static void isar_SplitRenderer_code_md_base2( ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, pred_roll_code_len ); } } -#endif } } } @@ -1895,35 +1731,6 @@ static void isar_SplitRenderer_code_md_huff( { IF( EQ_32( hBinHrSplitPreRend->pose_type[pos_idx], ANY_YAW ) ) { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - isar_SplitRenderer_getdiagdiff( hMd->pred_mat_re_idx, sym_adj_idx, -1, min_pred_idx, max_pred_idx ); - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - isar_split_rend_huffman_encode( &pHuff_cfg->pred[pred_cb_idx], sym_adj_idx[ch1][ch2], &code, &len ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, len ); - } - } - } - FOR( b = 0; b < pred_imag_bands_yaw; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - isar_SplitRenderer_getdiagdiff( hMd->pred_mat_im_idx, sym_adj_idx, 1, min_pred_idx, max_pred_idx ); - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - isar_split_rend_huffman_encode( &pHuff_cfg->pred[pred_cb_idx], sym_adj_idx[ch1][ch2], &code, &len ); - - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, len ); - } - } - } -#else FOR( b = 0; b < pred_imag_bands_yaw; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; @@ -1958,7 +1765,6 @@ static void isar_SplitRenderer_code_md_huff( ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, len ); } } -#endif FOR( b = 0; b < d_bands_yaw; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; @@ -1980,34 +1786,6 @@ static void isar_SplitRenderer_code_md_huff( } ELSE { -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - FOR( b = 0; b < pred_real_bands_roll; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - isar_SplitRenderer_getdiagdiff( hMd->pred_mat_re_idx, sym_adj_idx, -1, min_pred_roll_idx, max_pred_roll_idx ); - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - isar_split_rend_huffman_encode( &pHuff_cfg->pred_roll, sym_adj_idx[ch1][ch2], &code, &len ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, len ); - } - } - } - FOR( b = 0; b < pred_imag_bands_roll; b++ ) - { - hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; - isar_SplitRenderer_getdiagdiff( hMd->pred_mat_im_idx, sym_adj_idx, 1, min_pred_roll_idx, max_pred_roll_idx ); - FOR( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - FOR( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - isar_split_rend_huffman_encode( &pHuff_cfg->pred_roll, sym_adj_idx[ch1][ch2], &code, &len ); - ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, len ); - } - } - } -#else FOR( b = 0; b < pred_imag_bands_roll; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; @@ -2041,7 +1819,6 @@ static void isar_SplitRenderer_code_md_huff( ISAR_SPLIT_REND_BITStream_write_int32( pBits, code, len ); } } -#endif } } } @@ -2073,17 +1850,11 @@ static void isar_SplitRenderer_quant_code( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, ISAR_SPLIT_REND_BITS_HANDLE pBits, const Word16 low_res_pre_rend_rot, -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS const int16_t ro_md_flag, -#endif const Word32 target_md_bits, Word16 Q_frame ) { -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word16 q, num_subframes, sf_idx, pos_idx, b, num_quant_strats; -#else - Word16 num_complex_bands, q, num_subframes, sf_idx, pos_idx, b, num_quant_strats; -#endif Word32 overhead_bits, quant_strat_bits, huff_bits, start_bit; Word16 pred_real_bands_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS], pred_real_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; Word16 pred_imag_bands_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS], pred_imag_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; @@ -2097,9 +1868,7 @@ static void isar_SplitRenderer_quant_code( float pred_quantstep_yaw[ISAR_SPLIT_REND_NUM_QUANT_STRATS]; #endif ISAR_BIN_HR_SPLIT_REND_MD_HANDLE hMd; -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word16 rot_axis_code, num_bits; -#endif IF( low_res_pre_rend_rot ) { @@ -2114,16 +1883,12 @@ static void isar_SplitRenderer_quant_code( ISAR_SPLIT_REND_BITStream_write_int32( pBits, pMultiBinPoseData->dof, ISAR_SPLIT_REND_DOF_BITS ); ISAR_SPLIT_REND_BITStream_write_int32( pBits, pMultiBinPoseData->hq_mode, ISAR_SPLIT_REND_HQ_MODE_BITS ); -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS rot_axis_code = isar_renderSplitGetCodeFromRot_axis( pMultiBinPoseData->dof, pMultiBinPoseData->rot_axis, &num_bits ); if ( num_bits > 0 ) { ISAR_SPLIT_REND_BITStream_write_int32( pBits, (int32_t) rot_axis_code, num_bits ); } ISAR_SPLIT_REND_BITStream_write_int32( pBits, (int32_t) ro_md_flag, ISAR_SPLIT_REND_RO_FLAG_BITS ); -#else - ISAR_SPLIT_REND_BITStream_write_int32( pBits, (int32_t) pMultiBinPoseData->rot_axis, ISAR_SPLIT_REND_ROT_AXIS_BITS ); -#endif /* code ref pose*/ FOR( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) @@ -2147,15 +1912,9 @@ static void isar_SplitRenderer_quant_code( ISAR_SPLIT_REND_BITStream_write_int32( pBits, angle, ISAR_SPLIT_REND_HEAD_POSE_BITS ); } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS isar_split_rend_get_quant_params_fx( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, pred_imag_bands_yaw, pred_quant_pnts_yaw, pred_quantstep_yaw_fx, pred_1byquantstep_yaw_fx, d_bands_yaw, bands_pitch, pred_real_bands_roll, pred_imag_bands_roll, ro_md_flag, &num_quant_strats ); -#else - isar_split_rend_get_quant_params_fx( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, pred_imag_bands_yaw, - pred_quant_pnts_yaw, pred_quantstep_yaw_fx, pred_1byquantstep_yaw_fx, - d_bands_yaw, bands_pitch, pred_real_bands_roll, pred_imag_bands_roll, &num_quant_strats, &num_complex_bands ); -#endif #ifdef DEBUG_QUANT_MD_FX fixedToFloat_arrL( pred_quantstep_yaw_fx, pred_quantstep_yaw, Q31, ISAR_SPLIT_REND_NUM_QUANT_STRATS ); fixedToFloat_arrL( pred_1byquantstep_yaw_fx, pred_1byquantstep_yaw, Q26, ISAR_SPLIT_REND_NUM_QUANT_STRATS ); @@ -2568,9 +2327,7 @@ void isar_rend_CldfbSplitPreRendProcess( ELSE { exp_frame = s_max( exp_frame, hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].exp_pred_mat_re ); -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS exp_frame = s_max( exp_frame, hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].exp_pred_mat_re2 ); -#endif exp_frame = s_max( exp_frame, hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].exp_pred_mat_im ); } } @@ -2600,19 +2357,13 @@ void isar_rend_CldfbSplitPreRendProcess( Scale_sig32( hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_fx[i], BINAURAL_CHANNELS, sub( hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].exp_pred_mat_re, exp_frame ) ); Scale_sig32( hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_fx[i], BINAURAL_CHANNELS, sub( hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].exp_pred_mat_im, exp_frame ) ); } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Scale_sig32( hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re2, BINAURAL_CHANNELS, sub( hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].exp_pred_mat_re2, exp_frame ) ); -#endif } } } } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS isar_SplitRenderer_quant_code( hBinHrSplitPreRend, headPosition, pMultiBinPoseData, pBits, low_res_pre_rend_rot, ro_md_flag, target_md_bits, Q_frame ); -#else - isar_SplitRenderer_quant_code( hBinHrSplitPreRend, headPosition, pMultiBinPoseData, pBits, low_res_pre_rend_rot, target_md_bits, Q_frame ); -#endif #ifdef DEBUG_QUANT_CODE_OUT for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { @@ -2925,51 +2676,31 @@ ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const Word32 OutSampleRate, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - const IVAS_RENDER_FRAMESIZE isar_frame_size -#else - const int16_t num_subframes -#endif -) + const IVAS_RENDER_FRAMESIZE isar_frame_size ) { ivas_error error; Word16 i, delayBufferLength; LC3PLUS_CONFIG config; -#if defined ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t isar_frame_size_ms; if ( ( error = isar_framesize_to_ms( isar_frame_size, &isar_frame_size_ms ) ) != IVAS_ERR_OK ) { return error; } -#endif -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* Check configuration validity */ if ( isar_frame_size_ms < pSplitRendConfig->codec_frame_size_ms ) { return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "SR codec frame doesn't fit in one output frame" ); } -#endif config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - config.ivas_frame_duration_us = ( pSplitRendConfig->dof == 0 ) ? config.lc3plus_frame_duration_us * num_subframes : 20000; -#endif config.samplerate = OutSampleRate; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS config.isar_frame_duration_us = isar_frame_size_ms * 1000; -#endif -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS config.high_res_mode_enabled = ( pSplitRendConfig->lc3plus_highres != 0 ); -#endif config.channels = BINAURAL_CHANNELS; if ( ( error = ISAR_LC3PLUS_ENC_Open( config, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode ), -#else - isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, (int16_t) ( config.isar_frame_duration_us / 1000 ) ), -#endif &hSplitRendWrapper->hLc3plusEnc ) ) != IVAS_ERR_OK ) { return error; @@ -3027,13 +2758,7 @@ ivas_error split_renderer_open_lc3plus( ivas_error splitRendLc3plusEncodeAndWrite( SPLIT_REND_WRAPPER *hSplitBin, ISAR_SPLIT_REND_BITS_HANDLE pBits, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const int32_t available_bits, -#endif -#else - const int32_t SplitRendBitRate, -#endif Word32 *in[], Word16 Q_sig ) { @@ -3055,29 +2780,20 @@ ivas_error splitRendLc3plusEncodeAndWrite( channel_ptrs[i] = in[i]; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( ( error = IVAS_LC3PLUS_ENC_SetBitrate( hSplitBin->hLc3plusEnc, available_bits * FRAMES_PER_SEC ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( ( error = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( hSplitBin->hLc3plusEnc, &lc3plusBitstreamSize ) ) != IVAS_ERR_OK ) { return error; } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - ISAR_SPLIT_REND_BITStream_write_int32( pBits, isar_get_lc3plus_bitrate_id( SplitRendBitRate ), 8 ); -#endif /* Write bitstream */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS set16_fx( Q_in, Q_sig, 16 ); move16(); if ( ( error = ISAR_LC3PLUS_ENC_Encode( hSplitBin->hLc3plusEnc, channel_ptrs, &pBits->bits_buf[pBits->bits_written / 8], lc3plusBitstreamSize, Q_in ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ISAR_LC3PLUS_ENC_Encode( hSplitBin->hLc3plusEnc, channel_ptrs, &pBits->bits_buf[pBits->bits_written / 8] ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3086,9 +2802,7 @@ ivas_error splitRendLc3plusEncodeAndWrite( pBits->codec = ISAR_SPLIT_REND_CODEC_LC3PLUS; pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; pBits->codec_frame_size_ms = (int16_t) ( hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us / 1000 ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS pBits->isar_frame_size_ms = (int16_t) ( hSplitBin->hLc3plusEnc->config.isar_frame_duration_us / 1000 ); -#endif return IVAS_ERR_OK; } @@ -3102,9 +2816,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPosition, const Word32 SplitRendBitRate, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const int16_t isar_frame_size_ms, -#endif const Word16 codec_frame_size_ms, ISAR_SPLIT_REND_BITS_HANDLE pBits, const Word16 max_bands, @@ -3116,11 +2828,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( const Word16 ro_md_flag ) { ivas_error error; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t bit_len, available_bits, target_md_bits, tmp_32; -#else - Word32 bit_len, available_bits, target_md_bits, actual_md_bits, tmp_32; -#endif Word16 num_cldfb_bands, ch, slot_idx, pos_idx, num_poses; Word16 tmp, tmp_e; Word32 Cldfb_In_BinReal_fx[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] = { 0 }; @@ -3166,10 +2874,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( } } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - actual_md_bits = pBits->bits_written; - move32(); -#endif test(); test(); @@ -3243,9 +2947,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( tmp_32 = BASOP_Util_Divide3232_Scale_cadence( target_md_bits, 48000, &tmp_e ); target_md_bits = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - actual_md_bits = pBits->bits_written; -#endif /*scaling to max Q*/ Word16 scale_factor = 31; move32(); @@ -3283,34 +2984,20 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( tmp_e = 0; tmp_32 = BASOP_Util_Divide3232_Scale_cadence( available_bits, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); available_bits = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS available_bits = L_sub( available_bits, pBits->bits_written ); -#else - actual_md_bits = L_sub( pBits->bits_written, actual_md_bits ); - available_bits = L_sub( available_bits, actual_md_bits ); -#endif pBits->codec_frame_size_ms = codec_frame_size_ms; move16(); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS pBits->isar_frame_size_ms = isar_frame_size_ms; move16(); -#endif isar_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal_fx, Cldfb_In_BinImag_fx, available_bits, pBits, &q_final ); } ELSE { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; IF( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, in_fx, Q_in ) ) != IVAS_ERR_OK ) { return error; } -#else - IF( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, SplitRendBitRate, in_flt ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } } ELSE @@ -3445,5 +3132,3 @@ void lc3plusTimeAlignCldfbPoseCorr( return; } - -#endif diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index 7f21a40c7cdafc2f51b4c7cf8e7f4d0f1305d57c..62f3870d3d3d3a46a3e9979009668414e64c12f6 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -32,7 +32,6 @@ #include #include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "ivas_prot_fx.h" #include "prot_fx.h" @@ -738,135 +737,6 @@ Word32 isar_get_lcld_bitrate( return -1; } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS -/*------------------------------------------------------------------------- - * Function isar_get_lc3plus_bitrate() - * - * - *------------------------------------------------------------------------*/ - -Word32 isar_get_lc3plus_bitrate( - const Word32 SplitRendBitRate, - ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode, - const Word16 split_prerender_frame_size_ms ) -{ - IF( EQ_32( poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) ) - { - Word32 inBandMdBps = (Word32) ( 8 * 1000 / split_prerender_frame_size_ms ); - return L_sub( isar_get_lcld_bitrate( SplitRendBitRate, poseCorrectionMode ), inBandMdBps ); - } - - IF( EQ_32( poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) - { - return SplitRendBitRate; - } - - /* Should not be reached */ - assert( 0 ); - return -1; -} - - -/*------------------------------------------------------------------------- - * Function isar_get_lc3plus_bitrate_id() - * - * - *------------------------------------------------------------------------*/ - -Word8 isar_get_lc3plus_bitrate_id( - const Word32 SplitRendBitRate ) -{ - SWITCH( SplitRendBitRate ) - { - case SPLIT_REND_768k: - { - return 4; - } - case SPLIT_REND_512k: - { - return 3; - } - case SPLIT_REND_384k: - { - return 2; - } - case SPLIT_REND_320k: - { - return 1; - } - case SPLIT_REND_256k: - { - return 0; - } - default: - { - BREAK; - } - } - - return -1; -} - - -/*------------------------------------------------------------------------- - * Function ivas_mat_mult_2by2_complex() - * - * - *------------------------------------------------------------------------*/ - -Word32 isar_get_lc3plus_size_from_id( - const Word8 SplitRendBitRateId, - const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode, - const Word16 split_prerender_frame_size_ms ) -{ - Word32 bitrate; - - SWITCH( SplitRendBitRateId ) - { - case 4: - { - bitrate = SPLIT_REND_768k; - move32(); - BREAK; - } - case 3: - { - bitrate = SPLIT_REND_512k; - move32(); - BREAK; - } - case 2: - { - bitrate = SPLIT_REND_384k; - move32(); - BREAK; - } - case 1: - { - bitrate = SPLIT_REND_320k; - move32(); - BREAK; - } - case 0: - { - bitrate = SPLIT_REND_256k; - move32(); - BREAK; - } - default: - { - bitrate = -1; - move32(); - BREAK; - } - } - - bitrate = isar_get_lc3plus_bitrate( bitrate, poseCorrectionMode, split_prerender_frame_size_ms ); - - /* Return size in bytes */ - return (Word32) ( bitrate * split_prerender_frame_size_ms / 1000 / 8 ); -} -#endif /*------------------------------------------------------------------------- * Function isar_split_rend_validate_config() @@ -940,65 +810,39 @@ ivas_error isar_split_rend_validate_config( BREAK; case SPLIT_REND_384k: case SPLIT_REND_512k: -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS case SPLIT_REND_768k: -#endif /* Always valid */ BREAK; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - case SPLIT_REND_768k: - test(); - IF( EQ_16( pSplitRendConfig->dof, 0 ) && EQ_32( pSplitRendConfig->codec, ISAR_SPLIT_REND_CODEC_LC3PLUS ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Bitrate is too high for LC3plus with 0 DOF" ); - } - BREAK; -#endif default: return IVAS_ERR_LC3PLUS_INVALID_BITRATE; } } ELSE { - IF( EQ_16( pSplitRendConfig->dof, 1 ) ){ -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - IF( LT_32( pSplitRendConfig->splitRendBitRate, 34000 ) ){ + IF( EQ_16( pSplitRendConfig->dof, 1 ) ) + { + IF( LT_32( pSplitRendConfig->splitRendBitRate, 34000 ) ) + { return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "1DOF metadata needs atleast 34 kbps" ); + } + } + ELSE IF( EQ_16( pSplitRendConfig->dof, 2 ) ) + { + IF( LT_32( pSplitRendConfig->splitRendBitRate, 50000 ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "2DOF metadata needs atleast 50 kbps" ); + } + } + ELSE IF( EQ_16( pSplitRendConfig->dof, 3 ) ) + { + IF( LT_32( pSplitRendConfig->splitRendBitRate, 82000 ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "3DOF metadata needs atleast 128 kbps" ); + } + } } -#else - IF( LT_32( pSplitRendConfig->splitRendBitRate, 50000 ) ){ - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "1DOF metadata needs atleast 50 kbps" ); - } -#endif -} -ELSE IF( EQ_16( pSplitRendConfig->dof, 2 ) ){ -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - IF( LT_32( pSplitRendConfig->splitRendBitRate, 50000 ) ){ - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "2DOF metadata needs atleast 50 kbps" ); -} -#else - IF( LT_32( pSplitRendConfig->splitRendBitRate, 66000 ) ){ - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "2DOF metadata needs atleast 66 kbps" ); -} -#endif -} -ELSE IF( EQ_16( pSplitRendConfig->dof, 3 ) ) -{ -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - IF( LT_32( pSplitRendConfig->splitRendBitRate, 82000 ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "3DOF metadata needs atleast 128 kbps" ); - } -#else - IF( LT_32( pSplitRendConfig->splitRendBitRate, 128000 ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "3DOF metadata needs atleast 128 kbps" ); - } -#endif -} -} -return IVAS_ERR_OK; + return IVAS_ERR_OK; } @@ -1019,25 +863,13 @@ void isar_split_rend_get_quant_params_fx( Word16 bands_pitch[ISAR_SPLIT_REND_NUM_QUANT_STRATS], Word16 pred_real_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS], Word16 pred_imag_bands_roll[ISAR_SPLIT_REND_NUM_QUANT_STRATS], -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS const Word16 ro_flag, -#endif - Word16 *num_quant_strats -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - , - Word16 *num_complex_bands -#endif -) + Word16 *num_quant_strats ) { Word16 q; *num_quant_strats = ISAR_SPLIT_REND_NUM_QUANT_STRATS; move16(); -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - *num_complex_bands = COMPLEX_MD_BAND_THRESH_LOW; - move16(); - assert( *num_complex_bands <= num_md_bands ); -#endif pred_quant_pnts_yaw[0] = ISAR_SPLIT_REND_PRED_63QUANT_PNTS; move16(); @@ -1063,24 +895,6 @@ void isar_split_rend_get_quant_params_fx( move16(); } -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - pred_imag_bands_yaw[0] = num_md_bands; - move16(); - pred_imag_bands_roll[0] = num_md_bands; - move16(); - pred_imag_bands_yaw[1] = num_md_bands; - move16(); - pred_imag_bands_roll[1] = num_md_bands; - move16(); - - FOR( q = 2; q < *num_quant_strats; q++ ) - { - pred_imag_bands_yaw[q] = LT_16( q, sub( *num_quant_strats, 1 ) ) ? num_md_bands : *num_complex_bands; - move16(); - pred_imag_bands_roll[q] = *num_complex_bands; - move16(); - } -#else IF( ro_flag ) { FOR( q = 0; q < *num_quant_strats; q++ ) @@ -1107,7 +921,6 @@ void isar_split_rend_get_quant_params_fx( pred_imag_bands_roll[q] = SPLIT_REND_RO_MD_BAND_THRESH; move16(); } -#endif FOR( q = 0; q < *num_quant_strats; q++ ) { @@ -1120,7 +933,6 @@ void isar_split_rend_get_quant_params_fx( return; } -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS /*------------------------------------------------------------------------- * Function isar_renderSplitGetRot_axisNumBits() * @@ -1212,7 +1024,6 @@ Word16 isar_renderSplitGetCodeFromRot_axis( return code; } -#endif /*------------------------------------------------------------------------- * Function isar_renderSplitGetMultiBinPoseData() @@ -1287,10 +1098,6 @@ void isar_renderSplitGetMultiBinPoseData_fx( SWITCH( rot_axis ) { case DEFAULT_AXIS: -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - case YAW: - case PITCH: -#endif case YAW_PITCH: { num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; @@ -1299,9 +1106,6 @@ void isar_renderSplitGetMultiBinPoseData_fx( move16(); BREAK; } -#ifndef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS - case ROLL: -#endif case YAW_ROLL: { num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; @@ -1466,7 +1270,6 @@ void isar_init_multi_bin_pose_data_fx_enc( return; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ivas_error isar_framesize_to_ms( const IVAS_RENDER_FRAMESIZE frame_size, /* i : frame size enum */ int16_t *ms /* o : frame size in ms */ @@ -1489,7 +1292,6 @@ ivas_error isar_framesize_to_ms( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- * Function isar_split_rend_choose_default_codec() @@ -1499,13 +1301,11 @@ ivas_error isar_framesize_to_ms( ivas_error isar_split_rend_choose_default_codec( ISAR_SPLIT_REND_CODEC *pCodec, /* i/o: pointer to codec setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - int16_t *pIsar_frame_size_ms, /* i/o: pointer to isar frame size setting */ -#endif - Word16 *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ - const Word16 cldfb_in_flag, /* i : flag indicating rendering in TD */ - const Word16 pcm_out_flag, /* i : flag to indicate PCM output */ - const Word16 num_subframes /* i : number of subframes */ + int16_t *pIsar_frame_size_ms, /* i/o: pointer to isar frame size setting */ + Word16 *pCodec_frame_size_ms, /* i/o: pointer to codec frame size setting */ + const Word16 cldfb_in_flag, /* i : flag indicating rendering in TD */ + const Word16 pcm_out_flag, /* i : flag to indicate PCM output */ + const Word16 num_subframes /* i : number of subframes */ ) { IF( EQ_16( pcm_out_flag, 0 ) ) @@ -1538,12 +1338,10 @@ ivas_error isar_split_rend_choose_default_codec( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Unknown split codec value" ); } } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS IF( *pIsar_frame_size_ms == 0 ) /* isar frame size hasn't been set yet - use default for current configuration */ { *pIsar_frame_size_ms = 20; } -#endif return IVAS_ERR_OK; } @@ -1560,6 +1358,3 @@ Word32 get_bit( { return L_and( state, ( L_shl( 1, (Word16) bit_id ) ) ); } - - -#endif diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index fec4a5d807680260fd15bec8d3c859960b12c84a..3fc1580e25d6b864a58e2d400ce9dfaaac5428f3 100644 --- a/lib_isar/isar_stat.h +++ b/lib_isar/isar_stat.h @@ -38,7 +38,6 @@ #include "options.h" #include "stat_com.h" #include "ivas_stat_com.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_lcld_prot.h" #include "isar_lc3plus_enc.h" #include "isar_lc3plus_dec.h" @@ -115,10 +114,8 @@ typedef struct isar_binaural_head_rot_split_rendering_md_struct Word16 exp_pred_mat_re; Word32 pred_mat_im_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; /* Q25 */ Word16 exp_pred_mat_im; -#ifdef SPLIT_REND_POSE_CORRECTION_UNUSED_BITS Word32 pred_mat_re2[BINAURAL_CHANNELS]; Word16 exp_pred_mat_re2; -#endif Word32 gd_fx; /* Q25 */ Word32 gd2_fx; /* Q25 */ Word16 exp_gd; @@ -255,6 +252,5 @@ typedef struct Word32 lc3plusDelaySamples; } SPLIT_REND_WRAPPER; -#endif #endif /* ISAR_STAT_H */ diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index 82c01004e7a93cfd5679e0ca51a8d51931db873e..c784ed1a9aa5d47a4b2e4e07872e558ebe706792 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -38,14 +38,6 @@ #include "prot_fx.h" #include "ivas_prot_fx.h" #include "prot_fx.h" -#ifndef SPLIT_REND_WITH_HEAD_ROT - -int32_t ISAR_POST_REND_void_func( void ) -{ - return 0; -} - -#else #include "ivas_prot_rend_fx.h" #include @@ -81,18 +73,9 @@ typedef struct { const int32_t *pOutSampleRate; const AUDIO_CONFIG *pOutConfig; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - const LSSETUP_CUSTOM_STRUCT *pCustomLsOut; - const EFAP_WRAPPER *pEfapOutWrapper; -#endif const ISAR_POST_REND_HeadRotData *pHeadRotData; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - const RENDER_CONFIG_HANDLE *hhRendererConfig; -#endif const int16_t *pSplitRendBFI; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRenderConfig; -#endif } rendering_context; /* Common base for input structs */ @@ -215,10 +198,8 @@ static void convertBitsBufferToInternalBitsBuff( hBits->codec = outBits.config.codec; hBits->pose_correction = outBits.config.poseCorrection; hBits->codec_frame_size_ms = outBits.config.codec_frame_size_ms; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hBits->isar_frame_size_ms = outBits.config.isar_frame_size_ms; hBits->lc3plus_highres = outBits.config.lc3plusHighRes; -#endif return; } @@ -234,10 +215,8 @@ static void convertInternalBitsBuffToBitsBuffer( hOutBits->config.codec = bits.codec; hOutBits->config.poseCorrection = bits.pose_correction; hOutBits->config.codec_frame_size_ms = bits.codec_frame_size_ms; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hOutBits->config.isar_frame_size_ms = bits.isar_frame_size_ms; hOutBits->config.lc3plusHighRes = bits.lc3plus_highres; -#endif return; } @@ -463,9 +442,7 @@ static rendering_context getRendCtx( ctx.pOutSampleRate = &hIvasRend->sampleRateOut; ctx.pHeadRotData = &hIvasRend->headRotData; ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ctx.pSplitRenderConfig = &hIvasRend->splitRenderConfig; -#endif return ctx; } @@ -487,12 +464,7 @@ static ivas_error getRendInputNumChannels( static ivas_error updateSplitPostRendPanGains( input_split_post_rend *inputSplitPostRend, const AUDIO_CONFIG outConfig, - ISAR_SPLIT_REND_CONFIG_DATA *hRendCfg -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - int16_t num_subframes -#endif -) + ISAR_SPLIT_REND_CONFIG_DATA *hRendCfg ) { ivas_error error; rendering_context rendCtx; @@ -504,30 +476,9 @@ static ivas_error updateSplitPostRendPanGains( rendCtx = inputSplitPostRend->base.ctx; isar_renderSplitGetMultiBinPoseData_fx( hRendCfg, &inputSplitPostRend->splitPostRendWrapper.multiBinPoseData, rendCtx.pHeadRotData->sr_pose_pred_axis ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS config.high_res_mode_enabled = ( hRendCfg->lc3plus_highres != 0 ); -#endif config.lc3plus_frame_duration_us = hRendCfg->codec_frame_size_ms * 1000; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS config.isar_frame_duration_us = hRendCfg->isar_frame_size_ms * 1000; -#else - IF( NE_16( num_subframes, MAX_PARAM_SPATIAL_SUBFRAMES ) ) - { - IF( hRendCfg->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) - { - config.ivas_frame_duration_us = ( hRendCfg->poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ? config.lc3plus_frame_duration_us * num_subframes : 20000; - } - ELSE - { - config.ivas_frame_duration_us = ( hRendCfg->poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ? config.lc3plus_frame_duration_us : 20000; - } - iNumLCLDIterationsPerFrame = 1; - } - ELSE - { - config.ivas_frame_duration_us = 20000; - } -#endif IF( GT_16( hRendCfg->codec_frame_size_ms, 0 ) ) { @@ -572,12 +523,7 @@ static ivas_error setRendInputActiveSplitPostRend( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - ISAR_SPLIT_REND_CONFIG_DATA *hRendCfg -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - const int16_t num_subframes -#endif -) + ISAR_SPLIT_REND_CONFIG_DATA *hRendCfg ) { ivas_error error; rendering_context rendCtx; @@ -597,12 +543,7 @@ static ivas_error setRendInputActiveSplitPostRend( inputSplitPostRend->numCachedSamples = 0; - if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - num_subframes -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) { return error; } @@ -928,12 +869,7 @@ ivas_error ISAR_POST_REND_AddInput( Word32 maxNumInputsOfType; void *inputsArray; Word32 inputStructSize; - ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, ISAR_SPLIT_REND_CONFIG_DATA * -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - int16_t -#endif - ); + ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, ISAR_SPLIT_REND_CONFIG_DATA * ); Word32 inputIndex; /* Validate function arguments */ @@ -961,12 +897,7 @@ ivas_error ISAR_POST_REND_AddInput( } *inputId = makeInputId( inConfig, inputIndex ); - if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, &hIvasRend->splitRenderConfig -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - , - hIvasRend->num_subframes -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, &hIvasRend->splitRenderConfig ) ) != IVAS_ERR_OK ) { return error; } @@ -1159,9 +1090,7 @@ ivas_error ISAR_POST_REND_InitConfig( hIvasRend->splitRenderConfig.hq_mode = 0; hIvasRend->splitRenderConfig.codec_delay_ms = 0; hIvasRend->splitRenderConfig.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hIvasRend->splitRenderConfig.isar_frame_size_ms = 0; /* 0 means "use default for selected codec" */ -#endif hIvasRend->splitRenderConfig.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; hIvasRend->splitRenderConfig.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; hIvasRend->splitRenderConfig.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT; @@ -1194,9 +1123,7 @@ Word16 ISAR_POST_REND_GetRenderConfig( splitRenderConfig->hq_mode = 0; splitRenderConfig->codec_delay_ms = 0; splitRenderConfig->codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS splitRenderConfig->isar_frame_size_ms = 0; /* 0 means "use default for selected codec" */ -#endif splitRenderConfig->codec = ISAR_SPLIT_REND_CODEC_DEFAULT; splitRenderConfig->poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; splitRenderConfig->rendererSelection = hRCin.rendererSelection; @@ -1310,18 +1237,11 @@ static ivas_error splitBinLc3plusDecode( ISAR_SPLIT_POST_REND_WRAPPER *hSplitBin, ISAR_SPLIT_REND_BITS_HANDLE bits, Word32 outputBuffer[BINAURAL_CHANNELS][L_FRAME48k], -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction, -#endif const int16_t SplitRendBFI ) { ivas_error error; Word32 *channel_ptrs[MAX_HEAD_ROT_POSES * 2]; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word32 lc3plusBitstreamSize; -#else - Word32 lc3plusBitrateId, lc3plusBitstreamSize; -#endif push_wmops( "splitBinLc3plusDecode" ); assert( hSplitBin->hLc3plusDec != NULL ); @@ -1338,15 +1258,9 @@ static ivas_error splitBinLc3plusDecode( { ++bits->bits_read; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* Size is in bytes */ assert( ( bits->bits_written - bits->bits_read ) % 8 == 0 ); lc3plusBitstreamSize = ( bits->bits_written - bits->bits_read ) / 8; -#else - /* Read LC3plus bitstream size info */ - lc3plusBitrateId = ISAR_SPLIT_REND_BITStream_read_int32( bits, 8 ); - lc3plusBitstreamSize = isar_get_lc3plus_size_from_id( (Word8) lc3plusBitrateId, pose_correction, (Word16) ( hSplitBin->hLc3plusDec->config.ivas_frame_duration_us / 1000 ) ); -#endif if ( ( error = ISAR_LC3PLUS_DEC_Decode( hSplitBin->hLc3plusDec, &bits->bits_buf[bits->bits_read / 8], lc3plusBitstreamSize, channel_ptrs ) ) != IVAS_ERR_OK ) { @@ -1394,9 +1308,6 @@ static ivas_error renderSplitBinauralWithPostRot( Word16 Q_cldfb_final[MAX_PARAM_SPATIAL_SUBFRAMES] = { 0 }; Word16 Q_out[MAX_PARAM_SPATIAL_SUBFRAMES][BINAURAL_CHANNELS] = { 0 }; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - uint32_t ivas_frame_duration_us; -#endif Word16 iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; const ISAR_POST_REND_HeadRotData *pHeadRotData; @@ -1404,24 +1315,15 @@ static ivas_error renderSplitBinauralWithPostRot( push_wmops( "renderSplitBinauralWithPostRot" ); error = IVAS_ERR_OK; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( outAudio.config.numSamplesPerChannel / *splitBinInput->base.ctx.pOutSampleRate > splitBinInput->hBits->config.isar_frame_size_ms ) { return IVAS_ERR_INTERNAL_FATAL; } -#endif pHeadRotData = splitBinInput->base.ctx.pHeadRotData; hSplitBin = &splitBinInput->splitPostRendWrapper; convertBitsBufferToInternalBitsBuff( *splitBinInput->hBits, &bits ); -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - ivas_frame_duration_us = 20000; - if ( splitBinInput->splitPostRendWrapper.hLc3plusDec != NULL ) - { - ivas_frame_duration_us = splitBinInput->splitPostRendWrapper.hLc3plusDec->config.isar_frame_duration_us; - } -#endif iNumLCLDIterationsPerFrame = 1; iNumBlocksPerFrame = CLDFB_NO_COL_MAX; @@ -1466,13 +1368,7 @@ static ivas_error renderSplitBinauralWithPostRot( { isPostRendInputCldfb = 1; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * bits.isar_frame_size_ms / 1000 ) - outBufNumSamplesPerChannel; -#else - preRendFrameSize_ms = (int16_t) ( ivas_frame_duration_us ) / 1000; - - numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * ( preRendFrameSize_ms - bits.codec_frame_size_ms ) / 1000 ); -#endif outBufNumColPerChannel = MAX_PARAM_SPATIAL_SUBFRAMES; numColPerChannelCacheSize = sub( DEPR_i_mult( iNumBlocksPerFrame, iNumLCLDIterationsPerFrame ), outBufNumColPerChannel ); @@ -1519,9 +1415,6 @@ static ivas_error renderSplitBinauralWithPostRot( Q_out[sf_idx][0] = 0; Q_out[sf_idx][1] = 0; if ( ( error = splitBinLc3plusDecode( hSplitBin, &bits, tmpCrendBuffer_fx, -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - bits.pose_correction, -#endif SplitRendBFI ) ) != IVAS_ERR_OK ) // Q0 { return error; @@ -1579,11 +1472,7 @@ static ivas_error renderSplitBinauralWithPostRot( copyBufferTo2dArray_fx( splitBinInput->base.inputBuffer, tmpCrendBuffer_fx ); IF( splitBinInput->numCachedSamples == 0 ) { -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS preRendFrameSize_ms = splitBinInput->base.ctx.pSplitRenderConfig->isar_frame_size_ms; -#else - preRendFrameSize_ms = (int16_t) ( ivas_frame_duration_us ) / 1000; -#endif numSamplesPerChannelCacheSize = (Word16) ( *splitBinInput->base.ctx.pOutSampleRate * preRendFrameSize_ms / 1000 ); numSamplesPerChannelCacheSize -= outAudio.config.numSamplesPerChannel; splitBinInput->numCachedSamples = numSamplesPerChannelCacheSize; @@ -1877,11 +1766,9 @@ ivas_error ISAR_REND_SetSplitRendBitstreamHeader( const ISAR_SPLIT_REND_CODEC codec, /* o: codec setting */ const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection, /* o: pose correction mode */ const int16_t codec_frame_size_ms /* i: codec frame size setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , const int16_t isar_frame_size_ms, /* i: isar codec frame size setting */ const int16_t lc3plus_highres /* i: LC3plus Hig-Res setting. Ignored if codec is not LC3plus */ -#endif ) { IF( hIvasRend == NULL ) @@ -1889,14 +1776,10 @@ ivas_error ISAR_REND_SetSplitRendBitstreamHeader( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } hIvasRend->splitRenderConfig.codec = codec; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hIvasRend->splitRenderConfig.isar_frame_size_ms = isar_frame_size_ms; -#endif hIvasRend->splitRenderConfig.codec_frame_size_ms = codec_frame_size_ms; hIvasRend->splitRenderConfig.poseCorrectionMode = poseCorrection; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hIvasRend->splitRenderConfig.lc3plus_highres = lc3plus_highres; -#endif return IVAS_ERR_OK; } @@ -1924,6 +1807,3 @@ int32_t ISAR_POST_REND_GetCntFramesLimited( return hIvasRend->hLimiter->cnt_frames_limited; } #endif - - -#endif diff --git a/lib_isar/lib_isar_post_rend.h b/lib_isar/lib_isar_post_rend.h index ef437eaa3a314b6808545e3260c9207cdf5c8466..70b46f57cc08d3f674b9b3c199e2bfa7733856de 100644 --- a/lib_isar/lib_isar_post_rend.h +++ b/lib_isar/lib_isar_post_rend.h @@ -36,11 +36,6 @@ #include "common_api_types.h" #include -#ifndef SPLIT_REND_WITH_HEAD_ROT - -int32_t ISAR_POST_REND_void_func( void ); - -#else /*---------------------------------------------------------------------* * Renderer constants @@ -61,10 +56,8 @@ typedef struct ISAR_SPLIT_REND_CODEC codec; ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection; int16_t codec_frame_size_ms; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t isar_frame_size_ms; int16_t lc3plusHighRes; -#endif } ISAR_POST_REND_BitstreamBufferConfig; typedef struct @@ -200,11 +193,9 @@ ivas_error ISAR_REND_SetSplitRendBitstreamHeader( const ISAR_SPLIT_REND_CODEC codec, /* o: codec setting */ const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection, /* o: pose correction mode */ const int16_t codec_frame_size_ms /* i: codec frame size setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , const int16_t isar_frame_size_ms, /* i: isar frame size setting */ const int16_t lc3plus_highres /* i: LC3plus Hig-Res setting. Ignored if codec is not LC3plus */ -#endif ); @@ -218,7 +209,6 @@ int32_t ISAR_POST_REND_GetCntFramesLimited( ); #endif -#endif /* SPLIT_REND_WITH_HEAD_ROT */ /* clang-format on */ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index fa3462fdc7a0f2ac8cb5003383f5938b244603ea..13ae12ac60eeb49a38c2b855acda80f49ed532c5 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -47,14 +47,6 @@ #include "wmc_auto.h" -#ifndef SPLIT_REND_WITH_HEAD_ROT -int32_t ISAR_PRE_REND_void_func( void ) -{ - return 0; -} - -#else - /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ @@ -83,11 +75,7 @@ ivas_error ISAR_PRE_REND_open( const Word32 OutSampleRate, const Word16 cldfb_in_flag, const Word16 pcm_out_flag, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const IVAS_RENDER_FRAMESIZE ivas_frame_size, /* i: IVAS frame size */ -#else - const int16_t num_subframes, /* i: number of subframes */ -#endif const int16_t mixed_td_cldfb_flag ) { ivas_error error, ch, num_ch; @@ -95,18 +83,10 @@ ivas_error ISAR_PRE_REND_open( Word16 cldfb_in_flag_local = cldfb_in_flag; if ( ( error = isar_split_rend_choose_default_codec( &( pSplitRendConfig->codec ), -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS &pSplitRendConfig->isar_frame_size_ms, -#endif &pSplitRendConfig->codec_frame_size_ms, cldfb_in_flag_local, - pcm_out_flag, (int16_t) -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - ivas_frame_size -#else - num_subframes -#endif - ) ) != IVAS_ERR_OK ) + pcm_out_flag, (int16_t) ivas_frame_size ) ) != IVAS_ERR_OK ) { return error; } @@ -192,12 +172,7 @@ ivas_error ISAR_PRE_REND_open( IF( EQ_16( pSplitRendConfig->codec, ISAR_SPLIT_REND_CODEC_LC3PLUS ) ) { if ( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - ivas_frame_size -#else - num_subframes -#endif - ) ) != IVAS_ERR_OK ) + ivas_frame_size ) ) != IVAS_ERR_OK ) { return error; } @@ -252,7 +227,6 @@ void ISAR_PRE_REND_close( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { IF( hSplitBinRend->hCldfbHandles->cldfbSyn[ch] != NULL ) @@ -261,7 +235,6 @@ void ISAR_PRE_REND_close( hSplitBinRend->hCldfbHandles->cldfbSyn[ch] = NULL; } } -#endif free( hSplitBinRend->hCldfbHandles ); hSplitBinRend->hCldfbHandles = NULL; @@ -323,9 +296,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const IVAS_QUATERNION headPosition, const Word32 SplitRendBitRate, ISAR_SPLIT_REND_CODEC splitCodec, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const Word16 isar_frame_size_ms, /* i: ISAR framesize */ -#endif Word16 codec_frame_size_ms, ISAR_SPLIT_REND_BITS_HANDLE pBits, Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -340,11 +311,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( Word16 *Q_out ) { ivas_error error; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t bit_len, target_md_bits, available_bits, tmp_32; -#else - Word32 bit_len, target_md_bits, actual_md_bits, available_bits, tmp_32; -#endif Word16 q1 = 31, q2 = 31, q_final, Q_cldfb, tmp, tmp_e; Word16 i, j; error = IVAS_ERR_OK; @@ -369,9 +336,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( IF( EQ_16( cldfb_in_flag, 0 ) ) { error = isar_renderMultiTDBinToSplitBinaural( hSplitBin, headPosition, SplitRendBitRate, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS isar_frame_size_ms, -#endif codec_frame_size_ms, pBits, max_bands, pOutput_fx, Q_out[0], low_res_pre_rend_rot, pcm_out_flag, ro_md_flag ); Q_out[1] = Q_out[0]; @@ -390,16 +355,10 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( move16(); } -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - actual_md_bits = pBits->bits_written; -#endif IF( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) { target_md_bits = isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ) * L_FRAME48k / 48000; -#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS - actual_md_bits = pBits->bits_written; -#endif /*float2fix, to be removed*/ Word16 Q_Cldfb_re = 31, Q_Cldfb_im = 31; move16(); @@ -439,12 +398,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( tmp_e = 0; tmp_32 = BASOP_Util_Divide3232_Scale_cadence( available_bits, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); available_bits = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS available_bits = L_sub( available_bits, pBits->bits_written ); -#else - actual_md_bits = L_sub( pBits->bits_written, actual_md_bits ); - available_bits = L_sub( available_bits, actual_md_bits ); -#endif pBits->codec_frame_size_ms = codec_frame_size_ms; q_final = sub( s_min( Q_buff_re, Q_buff_im ), 2 ); FOR( i = 0; i < hSplitBin->hSplitBinLCLDEnc->iChannels; i++ ) @@ -523,7 +477,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( #ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( Cldfb_In_BinReal_p_fx, Cldfb_In_BinImag_p_fx, pOutput_fx[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, 0, 0, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); // Q_cldfb - 1 #else - cldfbSynthesis_ivas_fx( Cldfb_In_BinReal_p_fx, Cldfb_In_BinImag_p_fx, pOutput_fx[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, 0, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); // Q_cldfb - 1 + cldfbSynthesis_ivas_fx( Cldfb_In_BinReal_p_fx, Cldfb_In_BinImag_p_fx, pOutput_fx[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, 0, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); // Q_cldfb - 1 #endif Q_out[ch] = sub( Q_cldfb, 1 ); move16(); @@ -532,12 +486,8 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( } assert( Q_out[0] == Q_out[1] ); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; IF( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, pOutput_fx, Q_out[0] ) ) != IVAS_ERR_OK ) -#else - IF( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, SplitRendBitRate, pOutput_fx ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -638,5 +588,3 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( fclose(fp1);*/ return error; } - -#endif diff --git a/lib_isar/lib_isar_pre_rend.h b/lib_isar/lib_isar_pre_rend.h index a4d03e8a59af26e0be87ce0659006e5ea438e6bb..dd0ad575579a2359d68ca2b974dd203c5e6c20ae 100644 --- a/lib_isar/lib_isar_pre_rend.h +++ b/lib_isar/lib_isar_pre_rend.h @@ -36,22 +36,13 @@ #include "isar_stat.h" #include "isar_prot.h" -#ifndef SPLIT_REND_WITH_HEAD_ROT - -int32_t ISAR_PRE_REND_void_func( void ); - -#else ivas_error ISAR_PRE_REND_open( SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renerer handle */ ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i/o: Split renderer pre-renerer config */ const int32_t output_Fs, /* i: output sampling rate */ const int16_t cldfb_in_flag, /* i: Flag to indicate CLDFB or time doamin input */ const int16_t pcm_out_flag, /* i: Flag to indicate PCM output */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const IVAS_RENDER_FRAMESIZE ivas_frame_size, /* i: IVAS frame size */ -#else - const int16_t num_subframes, /* i: number of subframes */ -#endif const int16_t mixed_td_cldfb_flag /* i: Flag to indicate combined TD and CLDFB input */ ); @@ -71,9 +62,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const IVAS_QUATERNION headPosition, /* i: head rotation QUATERNION */ const Word32 SplitRendBitRate, /* i: Split renderer bitrate */ ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS const Word16 isar_frame_size_ms, /* i: ISAR framesize */ -#endif Word16 codec_frame_size_ms, /* i/o: Split renderer codec framesize */ ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: Split renderer bitstream handle */ Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB real buffer */ @@ -87,5 +76,4 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( Word16 Q_buff, Word16 *Q_out ); -#endif #endif /* LIB_ISAR_PRE_REND_H */ diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 392d8ea998705612d4dff7702e66df05c187e09b..369a1d2b4302ba0b542c95696e61c2441e42641b 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -206,11 +206,7 @@ static ivas_error ivas_rend_initCrend_fx( test(); test(); - if ( NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#ifdef SPLIT_REND_WITH_HEAD_ROT - && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif - ) + if ( NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Encountered unsupported output type in Crend" ); } @@ -1565,19 +1561,12 @@ static ivas_error ivas_er_init_handle( *------------------------------------------------------------------------*/ ivas_error ivas_rend_initCrendWrapper( -#ifdef SPLIT_REND_WITH_HEAD_ROT CREND_WRAPPER_HANDLE *pCrend, - const int16_t num_poses -#else - CREND_WRAPPER_HANDLE *pCrend -#endif -) + const int16_t num_poses ) { Word16 i; CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif IF( pCrend == NULL ) { @@ -1596,9 +1585,7 @@ ivas_error ivas_rend_initCrendWrapper( move16(); ( *pCrend )->p_io_qfactor = &( *pCrend )->io_qfactor; -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) -#endif { hCrend = NULL; IF( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) @@ -1642,17 +1629,12 @@ ivas_error ivas_rend_initCrendWrapper( move32(); move32(); -#ifdef SPLIT_REND_WITH_HEAD_ROT ( *pCrend )->hCrend[pos_idx] = hCrend; -#else - ( *pCrend )->hCrend = hCrend; -#endif } return IVAS_ERR_OK; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * ivas_rend_openMultiBinCrend() * @@ -1668,14 +1650,10 @@ 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 { return error; @@ -1683,7 +1661,6 @@ ivas_error ivas_rend_openMultiBinCrend( return error; } -#endif /*------------------------------------------------------------------------- * ivas_rend_openCrend() @@ -1700,31 +1677,20 @@ ivas_error ivas_rend_openCrend( #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT const Word32 output_Fs, - const Word16 num_poses -#else - const Word32 output_Fs -#endif -) + const Word16 num_poses ) { Word16 i, subframe_length; Word32 max_total_ir_len; HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif error = IVAS_ERR_OK; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( error = ivas_rend_initCrendWrapper( pCrend, num_poses ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_rend_initCrendWrapper( pCrend ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1739,15 +1705,9 @@ ivas_error ivas_rend_openCrend( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = ( *pCrend )->hCrend[pos_idx]; -#else - hCrend = ( *pCrend )->hCrend; -#endif hHrtf = ( *pCrend )->hHrtfCrend; IF( hHrtf != NULL ) @@ -1933,11 +1893,7 @@ ivas_error ivas_rend_openCrend( move32(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ( *pCrend )->hCrend[pos_idx] = hCrend; -#else - ( *pCrend )->hCrend = hCrend; -#endif } return IVAS_ERR_OK; } @@ -1949,18 +1905,11 @@ ivas_error ivas_rend_openCrend( *------------------------------------------------------------------------*/ void ivas_rend_closeCrend( -#ifdef SPLIT_REND_WITH_HEAD_ROT CREND_WRAPPER_HANDLE *pCrend, - const Word16 num_poses -#else - CREND_WRAPPER_HANDLE *pCrend -#endif -) + const Word16 num_poses ) { Word16 i; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif CREND_HANDLE hCrend; test(); @@ -1974,15 +1923,9 @@ void ivas_rend_closeCrend( ivas_hrtf_close( &( *pCrend )->hHrtfCrend ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = ( *pCrend )->hCrend[pos_idx]; -#else - hCrend = ( *pCrend )->hCrend; -#endif IF( hCrend != NULL ) { FOR( i = 0; i < MAX_INTERN_CHANNELS; i++ ) @@ -2074,11 +2017,7 @@ void ivas_rend_closeCrend( } free( hCrend ); hCrend = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT ( *pCrend )->hCrend[pos_idx] = hCrend; -#else - ( *pCrend )->hCrend = hCrend; -#endif } } @@ -2089,7 +2028,6 @@ void ivas_rend_closeCrend( } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * ivas_rend_closeCldfbRend() * @@ -2111,7 +2049,6 @@ void ivas_rend_closeCldfbRend( return; } -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_rend_crendConvolver() @@ -2126,13 +2063,8 @@ static ivas_error ivas_rend_crendConvolver( Word32 *pcm_in[], // Qx Word32 *pcm_out[], // Qx const Word32 output_Fs, -#ifdef SPLIT_REND_WITH_HEAD_ROT const Word16 i_ts, - const Word16 pos_idx -#else - const Word16 i_ts -#endif -) + const Word16 pos_idx ) { Word16 i, j, k, m; Word16 subframe_length, idx_in; @@ -2152,11 +2084,7 @@ static ivas_error ivas_rend_crendConvolver( CREND_HANDLE hCrend; ivas_error error; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = pCrend->hCrend[pos_idx]; -#else - hCrend = pCrend->hCrend; -#endif IF( NE_32( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ), IVAS_ERR_OK ) ) { @@ -2397,11 +2325,8 @@ ivas_error ivas_rend_crendProcessSubframe( Word32 *output[], /* i/o: input/output audio channels Qx */ const Word16 n_samples_to_render, /* i : output frame length per channel */ const Word32 output_Fs /* i : output sampling rate */ -#ifdef SPLIT_REND_WITH_HEAD_ROT , - const Word16 pos_idx -#endif -) + const Word16 pos_idx ) { Word16 subframe_idx, subframe_len; Word16 nchan_out, nchan_in, ch, first_sf, last_sf, slot_size, slots_to_render; @@ -2412,11 +2337,7 @@ ivas_error ivas_rend_crendProcessSubframe( ivas_error error; Word8 combinedOrientationEnabled; CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = pCrend->hCrend[pos_idx]; -#else - hCrend = pCrend->hCrend; -#endif combinedOrientationEnabled = 0; move16(); @@ -2547,16 +2468,11 @@ ivas_error ivas_rend_crendProcessSubframe( test(); IF( EQ_32( inConfigType, IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || EQ_32( inConfigType, IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local_fx, p_pcm_tmp_fx, output_Fs, 0, pos_idx ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local_fx, p_pcm_tmp_fx, output_Fs, 0 ) ), IVAS_ERR_OK ) ) -#endif { return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( pCrend->hCrend[0]->hReverb != NULL ) { IF( NE_32( ( error = ivas_reverb_process_fx( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, tc_local_fx, p_pcm_tmp_fx, 0 ) ), IVAS_ERR_OK ) ) @@ -2564,15 +2480,6 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } } -#else - IF( pCrend->hCrend->hReverb != NULL ) - { - IF( NE_32( ( error = ivas_reverb_process_fx( pCrend->hCrend->hReverb, inConfig, 1, tc_local_fx, p_pcm_tmp_fx, 0 ) ), IVAS_ERR_OK ) ) - { - return error; - } - } -#endif FOR( ch = 0; ch < nchan_in; ch++ ) { @@ -2598,11 +2505,7 @@ ivas_error ivas_rend_crendProcessSubframe( ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_len ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( pCrend->hCrend[0]->hReverb != NULL ) -#else - IF( pCrend->hCrend->hReverb != NULL ) -#endif { *pCrend->p_io_qfactor = sub( *pCrend->p_io_qfactor, 2 ); move16(); @@ -2633,7 +2536,6 @@ ivas_error ivas_rend_crendProcessSubframe( return IVAS_ERR_OK; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------------------------------* * Function ivas_rend_crend_ProcessSplitBin() * @@ -2972,4 +2874,3 @@ ivas_error ivas_rend_crendProcessSubframesSplitBin( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index d0a5e47d1d38c12951866954aa5584bbb4ccdd18..a1d3a4908446ee80905c39b4f287499fb711dc1d 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -108,21 +108,13 @@ static void ivas_dirac_dec_binaural_internal_fx( Decoder_Struct *st_ivas, COMBIN static void ivas_dirac_dec_decorrelate_slot_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const Word16 num_freq_bands, const Word16 slot, Word32 inRe[][CLDFB_SLOTS_PER_SUBFRAME] /*q_inp*/[CLDFB_NO_CHANNELS_MAX], Word32 inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, Word16 q_inp, Word32 decRe[][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, Word32 decIm[] /*q_inp*/[CLDFB_NO_CHANNELS_MAX] ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, Word32 inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const Word16 subframe, Word32 *subFrameTotalEne, Word16 *subFrameTotalEne_e, Word32 *IIReneLimiter, Word16 q ); static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, const PARAMBIN_REND_CONFIG_HANDLE hConfig, Word32 Rmat[3][3], const Word16 subframe, const Word16 isHeadtracked, const Word32 *subFrameTotalEne, Word16 *subFrameTotalEne_e, const Word32 *IIReneLimiter, const MASA_ISM_DATA_HANDLE hMasaIsmData ); -#else -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, Word32 inRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q*/, Word32 inIm_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q*/, Word32 Rmat_fx[3][3] /*Q30*/, const Word16 subframe, const Word16 isHeadtracked, const MASA_ISM_DATA_HANDLE hMasaIsmData, Word16 q ); -#endif static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, const Word16 max_band_decorr, Word32 Rmat[3][3] /*Q30*/, const Word16 subframe, const Word16 isHeadtracked, const Word16 nchanSeparateChannels, const MASA_ISM_DATA_HANDLE hMasaIsmData ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static void ivas_dirac_dec_binaural_process_output_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, HANDLE_CLDFB_FILTER_BANK cldfbSynDec[MAX_OUTPUT_CHANNELS], Word32 *output_fx[] /*q_out*/, Word16 *q_out, Word32 inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, Word32 inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, const Word16 q_inp, const Word16 max_band_decorr, const Word16 numInChannels, const Word16 processReverb, const Word16 subframe, const Word16 q_mat, Word32 outRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 outIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 reverbRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 reverbIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 decorrRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 decorrIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word16 *Q_inp_mix, const Word8 recompute ); -#else -static void ivas_dirac_dec_binaural_process_output_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, HANDLE_CLDFB_FILTER_BANK cldfbSynDec[MAX_OUTPUT_CHANNELS], Word32 *output_fx[] /*q_out*/, Word16 *q_out, Word32 inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, Word32 inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, const Word16 q_inp, const Word16 max_band_decorr, const Word16 numInChannels, const Word16 processReverb, const Word16 subframe, const Word16 q_mat ); -#endif static void adaptTransportSignalsHeadtracked_fx( COMBINED_ORIENTATION_HANDLE hHeadTrackData, Word32 inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, Word32 inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /*q_inp*/, Word16 q_inp, const Word16 nBins, const Word16 nSlots, Word32 Rmat[3][3] /*Q30*/ ); @@ -140,11 +132,7 @@ static void getDirectPartGains_fx( const Word16 bin, Word16 aziDeg, Word16 eleDe static void getDirectPartGains_fx( const Word16 bin, Word16 aziDeg, Word16 eleDeg, Word32 *lRealp, Word32 *lImagp, Word32 *rRealp, Word32 *rImagp, const UWord8 renderStereoOutputInsteadOfBinaural, Word32 Rmat[3][3] /*Q30*/, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const Word16 isHeadtracked ); #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT static void ivas_masa_ext_rend_parambin_internal_fx( MASA_EXT_REND_HANDLE hMasaExtRend, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, Word32 *output_fx[] /*Q11*/, const Word16 subframe, const SPLIT_REND_WRAPPER *hSplitRendWrapper, Word32 Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], Word32 Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ); -#else -static void ivas_masa_ext_rend_parambin_internal_fx( MASA_EXT_REND_HANDLE hMasaExtRend, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, Word32 *output_fx[] /*Q11*/, const Word16 subframe ); -#endif static void formulate2x2MixingMatrix_fx( Word32 Ein1_fx /*q_Ein*/, Word32 Ein2_fx /*q_Ein*/, Word16 q_Ein, Word32 CinRe_fx /*q_Cin*/, Word32 CinIm_fx /*q_Cin*/, Word16 q_Cin, Word32 Eout1_fx /*q_Eout*/, Word32 Eout2_fx /*q_Eout*/, Word16 q_Eout, Word32 CoutRe_fx /*q_Cout*/, Word32 CoutIm_fx /*q_Cout*/, Word16 q_Cout, Word32 Q_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*Q31*/, Word32 Mre_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_M*/, Word32 Mim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_M*/, Word16 *q_M, const Word16 regularizationFactor_fx /*Q14*/ ); @@ -189,7 +177,6 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( Word16 tmp2; ivas_error error; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 num_poses, pos_idx; num_poses = 1; @@ -203,9 +190,6 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( { hDiracDecBin = st_ivas->hDiracDecBin[pos_idx]; move32(); -#else - hDiracDecBin = st_ivas->hDiracDecBin; -#endif IF( hDiracDecBin == NULL ) { @@ -315,7 +299,7 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF Copy32( ( *phHrtfParambin )->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); #else - Copy32( hHrtfParambin->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); + Copy32( hHrtfParambin->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); #endif hDiracDecBin->q_earlyPartEneCorrection = Q28; move16(); @@ -328,11 +312,7 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( ivas_binaural_reverb_close_fx( &( hDiracDecBin->hReverb ) ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( hDiracDecBin->hReverb == NULL && EQ_16( pos_idx, 0 ) ) /* open reverb only for the main direction */ -#else - IF( hDiracDecBin->hReverb == NULL ) -#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES @@ -342,8 +322,8 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( 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_fx, st_ivas->hHrtfParambin->parametricReverberationEneCorrections_fx ) ) != IVAS_ERR_OK ) #endif #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 ) + /* 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; @@ -377,10 +357,8 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( ivas_dirac_dec_decorr_close_fx( &hDiracDecBin->h_freq_domain_decorr_ap_params, &hDiracDecBin->h_freq_domain_decorr_ap_state ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( pos_idx == 0 ) /* open decorrelator only for the main direction */ { -#endif IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( hDiracDecBin->hTdDecorr ), &( hDiracDecBin->useTdDecorr ) ) ), IVAS_ERR_OK ) ) { return error; @@ -407,13 +385,11 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( return error; } } -#ifdef SPLIT_REND_WITH_HEAD_ROT } else { hDiracDecBin->useTdDecorr = st_ivas->hDiracDecBin[0]->useTdDecorr; /* copy the flag, but the implementation re-uses the decorrelated signal */ } -#endif hDiracDecBin->reqularizationFactor_fx = configure_reqularization_factor_fx( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); /* Q14 */ move16(); @@ -422,12 +398,8 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( hDiracDecBin->phHrtfParambin = phHrtfParambin; #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT st_ivas->hDiracDecBin[pos_idx] = hDiracDecBin; } -#else - st_ivas->hDiracDecBin = hDiracDecBin; -#endif /* allocate transport channels */ IF( st_ivas->hTcBuffer == NULL ) @@ -468,16 +440,13 @@ void ivas_dirac_dec_close_binaural_data( DIRAC_DEC_BIN_HANDLE *hBinaural /* i/o: decoder DirAC binaural data handle */ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; -#endif test(); IF( hBinaural == NULL || *hBinaural == NULL ) { return; } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { IF( hBinaural[pos_idx] != NULL ) @@ -498,21 +467,6 @@ void ivas_dirac_dec_close_binaural_data( hBinaural[pos_idx] = NULL; } } -#else - IF( ( *hBinaural )->hReverb != NULL ) - { - ivas_binaural_reverb_close_fx( &( ( *hBinaural )->hReverb ) ); - } - - ivas_td_decorr_dec_close( &( ( *hBinaural )->hTdDecorr ) ); - IF( ( *hBinaural )->h_freq_domain_decorr_ap_params != NULL ) - { - ivas_dirac_dec_decorr_close_fx( &( *hBinaural )->h_freq_domain_decorr_ap_params, &( *hBinaural )->h_freq_domain_decorr_ap_state ); - } - - free( *hBinaural ); - *hBinaural = NULL; -#endif return; } @@ -720,7 +674,6 @@ static void ivas_dirac_dec_binaural_internal_fx( Word16 nBins, offsetSamples; Word16 i, j; Word16 q_mat, q_out; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; Word32 tmp_Cldfb_out_re[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; @@ -736,9 +689,6 @@ static void ivas_dirac_dec_binaural_internal_fx( Word16 Q_inp_mix; hDiracDecBin = st_ivas->hDiracDecBin[0]; -#else - hDiracDecBin = st_ivas->hDiracDecBin; -#endif assert( hDiracDecBin ); hSpatParamRendCom = st_ivas->hSpatParamRendCom; nBins = hSpatParamRendCom->num_freq_bands; @@ -1026,18 +976,13 @@ static void ivas_dirac_dec_binaural_internal_fx( IF( EQ_16( nchan_transport, 2 ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT /* in case of split rendering, determine the prototype rotation based on the main direction and use the same prototypes for the offset directions */ -#endif adaptTransportSignalsHeadtracked_fx( hCombinedOrientationData, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, nBins, hSpatParamRendCom->subframe_nbslots[subframe], Rmat_fx ); ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_fx( hCombinedOrientationData, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, nBins, hSpatParamRendCom->subframe_nbslots[subframe], Rmat_fx ); } } test(); -#ifndef SPLIT_REND_WITH_HEAD_ROT - ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, st_ivas->hMasaIsmData, q_inp ); -#endif IF( EQ_32( config_data.ivas_format, ISM_FORMAT ) ) { @@ -1055,13 +1000,11 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_binaural_formulate_input_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, subframe, subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, q_inp ); ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, st_ivas->hMasaIsmData ); -#endif nchanSeparateChannels = 0; move16(); @@ -1128,7 +1071,6 @@ static void ivas_dirac_dec_binaural_internal_fx( hDiracDecBin->q_processMtxDecPrev = q_mat; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT pMultiBinPoseData = NULL; IF( st_ivas->hSplitBinRend != NULL ) { @@ -1136,11 +1078,7 @@ static void ivas_dirac_dec_binaural_internal_fx( move32(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - if ( pMultiBinPoseData != NULL && pMultiBinPoseData->num_poses > 1 ) -#endif { ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat, tmp_Cldfb_out_re, tmp_Cldfb_out_im, reverbRe_fx, reverbIm_fx, decorrRe_fx, decorrIm_fx, &Q_inp_mix, 1 ); @@ -1159,13 +1097,9 @@ static void ivas_dirac_dec_binaural_internal_fx( ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat, NULL, NULL, reverbRe_fx, reverbIm_fx, decorrRe_fx, decorrIm_fx, &Q_inp_mix, 1 ); } -#else - ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat ); -#endif hDiracDecBin->hDiffuseDist = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( pMultiBinPoseData != NULL && pMultiBinPoseData->num_poses > 1 ) { /* quaternion-based rotation from ivas_binRenderer_internal.c:ivas_binRenderer(), but using absolute rotation instead of delta rotations */ @@ -1277,7 +1211,6 @@ static void ivas_dirac_dec_binaural_internal_fx( } /* update this counter only after the last rendering of split directions */ -#endif hSpatParamRendCom->slots_rendered = add( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->subframe_nbslots[subframe] ); hSpatParamRendCom->subframes_rendered = add( hSpatParamRendCom->subframes_rendered, 1 ); @@ -1361,7 +1294,6 @@ static void ivas_dirac_dec_decorrelate_slot_fx( } -#ifdef SPLIT_REND_WITH_HEAD_ROT static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, @@ -1638,531 +1570,14 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( Word16 separateCenterChannelRendering; Word16 nBins, idx, shift; Word32 frameMeanDiffusenessEneWeight_fx[CLDFB_NO_CHANNELS_MAX]; - Word32 qualityBasedSmFactor_fx; - Word16 dirac_read_idx; - PARAMBIN_HRTF_GAIN_CACHE gainCache[MAX_GAIN_CACHE_SIZE]; - IVAS_FORMAT ivas_format; - MC_MODE mc_mode; - Word16 gainCacheBaseIndex; - Word16 q_earlyPartEneCorrection; - Word16 exp, exp1; - Word32 temp; - - separateCenterChannelRendering = hConfig->separateCenterChannelRendering; - move16(); - ivas_format = hConfig->ivas_format; - move32(); - mc_mode = hConfig->mc_mode; - move32(); - qualityBasedSmFactor_fx = hConfig->qualityBasedSmFactor_fx; /*Q31*/ - move32(); - qualityBasedSmFactor_fx = Mpy_32_32( qualityBasedSmFactor_fx, qualityBasedSmFactor_fx ); /*Q31*/ - - nBins = hSpatParamRendCom->num_freq_bands; /* Actually bins */ - move16(); - - q_earlyPartEneCorrection = s_min( Q31, add( getScaleFactor32( hDiracDecBin->earlyPartEneCorrection_fx, nBins ), hDiracDecBin->q_earlyPartEneCorrection ) ); - scale_sig32( hDiracDecBin->earlyPartEneCorrection_fx, nBins, sub( q_earlyPartEneCorrection, hDiracDecBin->q_earlyPartEneCorrection ) ); - hDiracDecBin->q_earlyPartEneCorrection = q_earlyPartEneCorrection; - move16(); - - set32_fx( hDiracDecBin->ChCrossReOut_fx, 0, nBins ); - set32_fx( hDiracDecBin->ChCrossImOut_fx, 0, nBins ); - set16_fx( hDiracDecBin->ChCrossReOut_e, 0, nBins ); - set16_fx( hDiracDecBin->ChCrossImOut_e, 0, nBins ); - - FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - set32_fx( hDiracDecBin->ChEneOut_fx[ch], 0, nBins ); - set16_fx( hDiracDecBin->ChEneOut_e[ch], 0, nBins ); - } - set32_fx( hDiracDecBin->frameMeanDiffuseness_fx, 0, nBins ); - - set32_fx( frameMeanDiffusenessEneWeight_fx, 0, CLDFB_NO_CHANNELS_MAX ); - - FOR( idx = 0; idx < MAX_GAIN_CACHE_SIZE; idx++ ) - { - gainCache[idx].azi = -1000; /* Use -1000 as value for uninitialized cache. */ - move16(); - } - - dirac_read_idx = hSpatParamRendCom->render_to_md_map[subframe]; - - /* Determine target covariance matrix containing target binaural properties */ - FOR( bin = 0; bin < nBins; bin++ ) - { - Word32 diffuseness_fx = ONE_IN_Q30; /* ratio1 and ratio2 are subtracted from diffuseness further below */ - Word32 diffusenessValForDecorrelationReduction_fx = ONE_IN_Q30; - Word32 diffEneValForDecorrelationReduction_fx; - Word16 q_diffEneValForDecorrelationReduction; - Word16 surCoh_fx = 0, spreadCoh_fx = 0; /* Default values if spreadSurroundCoherenceApplied == false */ - Word32 diffEne_fx, dirEne_fx, meanEnePerCh_fx; - Word16 q_meanEnePerCh; - Word16 q_diffEne, q_dirEne; - Word16 dirIndex; - move16(); - move16(); - move32(); - move32(); - - /* When BINAURAL_ROOM is not indicated, hBinaural->earlyPartEneCorrection[bin] values are all 1.0f. - * When BINAURAL_ROOM is indicated, the binaural audio output is based on combined use of the - * HRTF data set and a BRIR-based data set. The HRTF data set is spectrally corrected to match - * the early spectrum of the BRIR data, using the spectral correction data in - * hBinaural->earlyPartEneCorrection[bin], based on the BRIR set. */ - meanEnePerCh_fx = Mpy_32_32( hDiracDecBin->earlyPartEneCorrection_fx[bin], subFrameTotalEne_fx[bin] ); // Q( q_meanEnePerCh ) - q_meanEnePerCh = add( sub( q_earlyPartEneCorrection, subFrameTotalEne_e[bin] ), 1 ); // q_earlyPartEneCorrection + 31 - subFrameTotalEne_e[bin] - 31 + Q1(0.5f) - /* Determine direct part target covariance matrix (for 1 or 2 directions) */ - FOR( dirIndex = 0; dirIndex < hSpatParamRendCom->numSimultaneousDirections; dirIndex++ ) - { - Word16 aziDeg, eleDeg; - Word32 lRealp_fx, lImagp_fx, rRealp_fx, rImagp_fx; - Word32 lRealpTmp_fx, lImagpTmp_fx, rRealpTmp_fx, rImagpTmp_fx; - Word32 hrtfEne_fx[BINAURAL_CHANNELS], hrtfCrossRe_fx, hrtfCrossIm_fx, ratio_fx; - UWord8 isIsmDirection = 0; - move16(); - - test(); - test(); - IF( dirIndex == 0 ) /* For first of the two simultaneous directions */ - { - aziDeg = hSpatParamRendCom->azimuth[dirac_read_idx][bin]; - move16(); - eleDeg = hSpatParamRendCom->elevation[dirac_read_idx][bin]; - move16(); - ratio_fx = hSpatParamRendCom->energy_ratio1_fx[dirac_read_idx][bin]; - move32(); - spreadCoh_fx = hSpatParamRendCom->spreadCoherence_fx[dirac_read_idx][bin]; - move16(); - gainCacheBaseIndex = 0; - move16(); - } - ELSE IF( NE_32( ivas_format, MASA_ISM_FORMAT ) || ( EQ_32( ivas_format, MASA_ISM_FORMAT ) && LT_16( dirIndex, hSpatParamRendCom->numParametricDirections ) ) ) /* For second of the two simultaneous directions */ - { - IF( LT_32( ( ratio_fx = hSpatParamRendCom->energy_ratio2_fx[dirac_read_idx][bin] ), 10737418 /* 0.01 in Q30 */ ) ) - { - /* This touches only MASA path where second direction always has smaller ratio and - * for non-2dir it is zero. As the whole direction contribution is multiplied with - * the ratio, a very small ratio does not contribute any energy to output. Thus, - * it is better to save complexity. */ - CONTINUE; - } - aziDeg = hSpatParamRendCom->azimuth2[dirac_read_idx][bin]; - move16(); - eleDeg = hSpatParamRendCom->elevation2[dirac_read_idx][bin]; - move16(); - spreadCoh_fx = hSpatParamRendCom->spreadCoherence2_fx[dirac_read_idx][bin]; - move16(); - gainCacheBaseIndex = 3; - move16(); - } - ELSE /* For object directions of MASA_ISM_FORMAT */ - { - isIsmDirection = 1; - move16(); - UWord16 ismDirIndex; - ismDirIndex = sub( dirIndex, hSpatParamRendCom->numParametricDirections ); - assert( hMasaIsmData != NULL && "hMasaIsmData should not be NULL if we use it" ); - IF( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - aziDeg = hMasaIsmData->azimuth_ism_edited[ismDirIndex]; - move16(); - eleDeg = hMasaIsmData->elevation_ism_edited[ismDirIndex]; - move16(); - } - ELSE - { - aziDeg = hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx]; - move16(); - eleDeg = hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx]; - move16(); - } - ratio_fx = hMasaIsmData->energy_ratio_ism_fx[ismDirIndex][dirac_read_idx][bin]; - move32(); - spreadCoh_fx = 0; - move16(); - gainCacheBaseIndex = add( 6, ismDirIndex ); - } - - diffuseness_fx = L_sub( diffuseness_fx, ratio_fx ); /* diffuseness = 1 - ratio1 - ratio2 */ - - if ( diffuseness_fx < 0 ) - { - diffuseness_fx = 0; - move32(); - } - IF( isIsmDirection ) - { - /* Objects cause lesser decorrelation reduction, to avoid removing all decorrelation when only objects are present */ - diffusenessValForDecorrelationReduction_fx = L_sub( diffusenessValForDecorrelationReduction_fx, L_shr( ratio_fx, 1 ) ); /*Q30*/ - } - ELSE - { - diffusenessValForDecorrelationReduction_fx = L_sub( diffusenessValForDecorrelationReduction_fx, ratio_fx ); /*Q30*/ - } - - IF( separateCenterChannelRendering ) - { - /* In masa + mono rendering mode, the center directions originate from phantom sources, so the - * spread coherence is increased */ - Word16 azi_scaled, ele_scaled; - Word32 doaVectorX_fx, num, den; - Word16 e = 0, spatialAngleDeg_fx, altSpreadCoh_fx; - move16(); - - azi_scaled = i_mult( aziDeg, 91 ); - ele_scaled = i_mult( eleDeg, 91 ); - doaVectorX_fx = L_mult( getCosWord16R2( azi_scaled ), getCosWord16R2( ele_scaled ) ); /*Q31*/ - num = Sqrt32( L_sub( ONE_IN_Q31, Mpy_32_32( doaVectorX_fx, doaVectorX_fx ) ), &e ); - den = doaVectorX_fx; - move32(); - spatialAngleDeg_fx = BASOP_util_atan2( num, den, e ); // Q13 - Word16 numr, num_e = 0, denr, den_e; - move16(); - num_e = sub( norm_s( spatialAngleDeg_fx ), 1 ); - numr = shl( spatialAngleDeg_fx, num_e ); - denr = 17157; - move16(); - den_e = 4; - move16(); - altSpreadCoh_fx = sub( 32767, shl_sat( div_s( numr, denr ), sub( den_e, num_e ) ) ); // 4289 = pi/6 in Q13 - spreadCoh_fx = s_max( spreadCoh_fx, altSpreadCoh_fx ); - } - -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - getDirectPartGains_fx( bin, aziDeg, eleDeg, &lRealp_fx, &lImagp_fx, &rRealp_fx, &rImagp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains_fx( bin, aziDeg, eleDeg, &lRealp_fx, &lImagp_fx, &rRealp_fx, &rImagp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif - - Word16 q_lr = Q28; - move16(); - if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) - { - /* Synthesizing spread coherence is not needed for stereo loudspeaker output, - * as directional sound is reproduced with two loudspeakers in any case */ - spreadCoh_fx = 0; - move32(); - } - - IF( spreadCoh_fx > 0 ) - { - Word32 centerMul_fx, sidesMul_fx; - Word32 hrtfEneCenter_fx, hrtfEneSides_fx, hrtfEneRealized_fx; - Word16 eneCorrectionFactor_fx, eneCorrectionFactor_e; - Word16 w1_fx, w2_fx, w3_fx, eq_fx; - - hrtfEneCenter_fx = L_add( Mpy_32_32( lRealp_fx, lRealp_fx ), // Q25 - L_add( Mpy_32_32( lImagp_fx, lImagp_fx ), // Q25 - L_add( Mpy_32_32( rRealp_fx, rRealp_fx ), // Q25 - Mpy_32_32( rImagp_fx, rImagp_fx ) ) ) ); // Q25 - - /* Spread coherence is synthesized as coherent sources at 30 degree horizontal spacing. - * The following formulas determine the gains for these sources. - * spreadCoh = 0: Only panning - * spreadCoh = 0.5: Three sources coherent panning (e.g. 30 0 -30 deg azi) - * spreadCoh = 1.0: Two sources coherent panning with gap (as above, but center is silent) */ - IF( LT_16( spreadCoh_fx, 16384 ) ) - { - /* 0.0f < spreadCoh < 0.5f */ - sidesMul_fx = L_mult0( spreadCoh_fx, 9459 ); /* 2*sqrt(1/3) in Q13 = 9459 */ // Q28 - centerMul_fx = L_add( L_sub( ONE_IN_Q28, L_shl( spreadCoh_fx, 14 ) ), sidesMul_fx ); // Q28 - } - ELSE - { - /* 0.5f <= spreadCoh < 1.0f */ - // centerMul = 2.0f - ( 2.0f * spreadCoh ); - centerMul_fx = L_shl( sub( 32767, spreadCoh_fx ), 14 ); // Q28 - sidesMul_fx = Isqrt( L_add( L_shr( centerMul_fx, 22 ), L_shl( 2, Q6 ) ) ); // Q28 - centerMul_fx = L_shl( Mpy_32_32( centerMul_fx, sidesMul_fx ), 3 ); // Q28 - } - - /* Apply the gain for the center source of the three coherent sources */ - lRealp_fx = Mpy_32_32( lRealp_fx, centerMul_fx ); // Q25 - lImagp_fx = Mpy_32_32( lImagp_fx, centerMul_fx ); // Q25 - rRealp_fx = Mpy_32_32( rRealp_fx, centerMul_fx ); // Q25 - rImagp_fx = Mpy_32_32( rImagp_fx, centerMul_fx ); // Q25 - - /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF - getDirectPartGains_fx( bin, add( aziDeg, 30 ), eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains_fx( bin, add( aziDeg, 30 ), eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif - - hrtfEneSides_fx = L_add( Mpy_32_32( lRealpTmp_fx, lRealpTmp_fx ), // Q25 - L_add( Mpy_32_32( lImagpTmp_fx, lImagpTmp_fx ), // Q25 - L_add( Mpy_32_32( rRealpTmp_fx, rRealpTmp_fx ), // Q25 - Mpy_32_32( rImagpTmp_fx, rImagpTmp_fx ) ) ) ); // Q25 - lRealp_fx = L_add( lRealp_fx, Mpy_32_32( sidesMul_fx, lRealpTmp_fx ) ); // Q25 - lImagp_fx = L_add( lImagp_fx, Mpy_32_32( sidesMul_fx, lImagpTmp_fx ) ); // Q25 - rRealp_fx = L_add( rRealp_fx, Mpy_32_32( sidesMul_fx, rRealpTmp_fx ) ); // Q25 - rImagp_fx = L_add( rImagp_fx, Mpy_32_32( sidesMul_fx, rImagpTmp_fx ) ); // Q25 - - /* 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_fx( bin, aziDeg + 330, eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains_fx( bin, aziDeg + 330, eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif - - hrtfEneSides_fx = L_add( hrtfEneSides_fx, - L_add( Mpy_32_32( lRealpTmp_fx, lRealpTmp_fx ), // Q25 - L_add( Mpy_32_32( lImagpTmp_fx, lImagpTmp_fx ), // Q25 - L_add( Mpy_32_32( rRealpTmp_fx, rRealpTmp_fx ), // Q25 - Mpy_32_32( rImagpTmp_fx, rImagpTmp_fx ) ) ) ) ); // Q25 - lRealp_fx = L_add( lRealp_fx, Mpy_32_32( sidesMul_fx, lRealpTmp_fx ) ); // Q25 - lImagp_fx = L_add( lImagp_fx, Mpy_32_32( sidesMul_fx, lImagpTmp_fx ) ); // Q25 - rRealp_fx = L_add( rRealp_fx, Mpy_32_32( sidesMul_fx, rRealpTmp_fx ) ); // Q25 - rImagp_fx = L_add( rImagp_fx, Mpy_32_32( sidesMul_fx, rImagpTmp_fx ) ); // Q25 - - /* Formulate an eneCorrectionFactor that compensates for the coherent summation of the HRTFs */ - hrtfEneRealized_fx = L_add( Mpy_32_32( lRealp_fx, lRealp_fx ), // Q19 - L_add( Mpy_32_32( lImagp_fx, lImagp_fx ), // Q19 - L_add( Mpy_32_32( rRealp_fx, rRealp_fx ), // Q19 - Mpy_32_32( rImagp_fx, rImagp_fx ) ) ) ); // Q19 - - eneCorrectionFactor_fx = BASOP_Util_Divide3232_Scale( L_add( Mpy_32_32( hrtfEneSides_fx, Mpy_32_32( sidesMul_fx, sidesMul_fx ) ), - Mpy_32_32( hrtfEneCenter_fx, Mpy_32_32( centerMul_fx, centerMul_fx ) ) ), - L_max( 1, hrtfEneRealized_fx ), &eneCorrectionFactor_e ); - - /* Weighting factors to determine appropriate target spectrum for spread coherent sound */ - IF( LT_16( spreadCoh_fx, 16384 ) ) - { - w1_fx = sub( 32767, shl( spreadCoh_fx, 1 ) ); /*Q15*/ - w2_fx = shl( spreadCoh_fx, 1 ); /*Q15*/ - w3_fx = 0; - move16(); - } - ELSE - { - w1_fx = 0; - move16(); - w2_fx = shl( sub( 32767, spreadCoh_fx ), 1 ); /*Q15*/ - w3_fx = shl( sub( spreadCoh_fx, 16384 ), 1 ); /*Q15*/ - } - - test(); - IF( ( EQ_32( ivas_format, MC_FORMAT ) && EQ_32( mc_mode, MC_MODE_MCMASA ) ) ) - { - idx = s_min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); - - /* Apply the target spectrum to the eneCorrectionFactor */ - IF( separateCenterChannelRendering ) /* spreadCoh mostly originates from phantom sources in separate channel rendering mode */ - { - eneCorrectionFactor_fx = mult_r( eneCorrectionFactor_fx, add( mult_r( w1_fx, 8192 ), shr( mult_r( add( w2_fx, w3_fx ), spreadCohEne1_fx[idx] ), 1 ) ) ); - eneCorrectionFactor_e = add( eneCorrectionFactor_e, 2 ); - } - ELSE - { - eneCorrectionFactor_fx = mult_r( eneCorrectionFactor_fx, add( mult_r( w1_fx, 4096 ), add( shr( mult_r( w2_fx, spreadCohEne05_fx[idx] ), 1 ), shr( mult_r( w3_fx, spreadCohEne1_fx[idx] ), 2 ) ) ) ); - eneCorrectionFactor_e = add( eneCorrectionFactor_e, 3 ); - } - } - - /* Equalize the spread coherent combined HRTFs */ - Word16 tmp, tmp_e; - tmp_e = eneCorrectionFactor_e; - move16(); - tmp = Sqrt16( eneCorrectionFactor_fx, &tmp_e ); - IF( GE_16( shr( tmp, sub( 15, tmp_e ) ), 4 ) ) - { - eq_fx = 32767; // Q13 - move16(); - } - ELSE - { - eq_fx = shl( tmp, sub( tmp_e, 2 ) ); // Q13 - } - - lRealp_fx = Mpy_32_16_1( lRealp_fx, eq_fx ); // Q23 - lImagp_fx = Mpy_32_16_1( lImagp_fx, eq_fx ); // Q23 - rRealp_fx = Mpy_32_16_1( rRealp_fx, eq_fx ); // Q23 - rImagp_fx = Mpy_32_16_1( rImagp_fx, eq_fx ); // Q23 - q_lr = Q23; - move16(); - } - - hrtfEne_fx[0] = L_add( Mpy_32_32( lRealp_fx, lRealp_fx ), Mpy_32_32( lImagp_fx, lImagp_fx ) ); // Q( 2*q_lr - 31 ) - hrtfEne_fx[1] = L_add( Mpy_32_32( rRealp_fx, rRealp_fx ), Mpy_32_32( rImagp_fx, rImagp_fx ) ); // Q( 2*q_lr - 31 ) - move32(); - move32(); - hrtfCrossRe_fx = L_add( Mpy_32_32( lRealp_fx, rRealp_fx ), Mpy_32_32( lImagp_fx, rImagp_fx ) ); // Q( 2*q_lr - 31 ) - hrtfCrossIm_fx = L_add( Mpy_32_32( -lImagp_fx, rRealp_fx ), Mpy_32_32( lRealp_fx, rImagp_fx ) ); // Q( 2*q_lr - 31 ) - - /* Add direct part (1 or 2) covariance matrix */ - dirEne_fx = Mpy_32_32( ratio_fx, meanEnePerCh_fx ); // Q(q_meanEnePerCh - 1) - shift = norm_l( dirEne_fx ); - dirEne_fx = L_shl( dirEne_fx, shift ); - q_dirEne = add( sub( q_meanEnePerCh, 1 ), shift ); - - hDiracDecBin->ChEneOut_fx[0][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[0][bin], hDiracDecBin->ChEneOut_e[0][bin], Mpy_32_32( dirEne_fx, hrtfEne_fx[0] ), sub( 31, sub( add( q_dirEne, shl( q_lr, 1 ) ), 62 ) ), &hDiracDecBin->ChEneOut_e[0][bin] ); /* Dir ene part*/ - hDiracDecBin->ChEneOut_fx[1][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[1][bin], hDiracDecBin->ChEneOut_e[1][bin], Mpy_32_32( dirEne_fx, hrtfEne_fx[1] ), sub( 31, sub( add( q_dirEne, shl( q_lr, 1 ) ), 62 ) ), &hDiracDecBin->ChEneOut_e[1][bin] ); - hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_32( dirEne_fx, hrtfCrossRe_fx ), sub( 31, sub( add( q_dirEne, shl( q_lr, 1 ) ), 62 ) ), &hDiracDecBin->ChCrossReOut_e[bin] ); /* Dir cross re */ - hDiracDecBin->ChCrossImOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossImOut_fx[bin], hDiracDecBin->ChCrossImOut_e[bin], Mpy_32_32( dirEne_fx, hrtfCrossIm_fx ), sub( 31, sub( add( q_dirEne, shl( q_lr, 1 ) ), 62 ) ), &hDiracDecBin->ChCrossImOut_e[bin] ); /* Dir cross im */ - move32(); - move32(); - move32(); - move32(); - } - - /* Add diffuse / ambient part covariance matrix */ - diffuseness_fx = L_max( 0, diffuseness_fx ); // Q30 - diffEne_fx = Mpy_32_32( diffuseness_fx, meanEnePerCh_fx ); // Q(2q - 32) - shift = norm_l( diffEne_fx ); - diffEne_fx = L_shl( diffEne_fx, shift ); - q_diffEne = add( shift, sub( q_meanEnePerCh, 1 ) ); - - surCoh_fx = hSpatParamRendCom->surroundingCoherence_fx[dirac_read_idx][bin]; // Q15 - move16(); - - diffusenessValForDecorrelationReduction_fx = L_max( 0, diffusenessValForDecorrelationReduction_fx ); // Q30 - diffEneValForDecorrelationReduction_fx = Mpy_32_32( diffusenessValForDecorrelationReduction_fx, meanEnePerCh_fx ); // resulting Q = q_meanEnePerCh - 1 - q_diffEneValForDecorrelationReduction = sub( q_meanEnePerCh, 1 ); - - test(); - IF( ( EQ_32( ivas_format, MC_FORMAT ) && EQ_32( mc_mode, MC_MODE_MCMASA ) ) ) - { - IF( !hDiracDecBin->renderStereoOutputInsteadOfBinaural ) - { - Word32 spectrumModVal; - - idx = s_min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); - /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ - spectrumModVal = L_add( L_sub( ONE_IN_Q29, L_shl( surCoh_fx, 14 ) ), L_mult( surCoh_fx, surCohEne_fx[idx] ) ); // Q29 - diffEne_fx = Mpy_32_32( diffEne_fx, spectrumModVal ); // Q-2 - q_diffEne = sub( q_diffEne, 2 ); - /* Modify also the value for decorrelation reduction */ - diffEneValForDecorrelationReduction_fx = Mpy_32_32( diffEneValForDecorrelationReduction_fx, spectrumModVal ); // Q-2 - q_diffEneValForDecorrelationReduction = sub( q_diffEneValForDecorrelationReduction, 2 ); - } - } - hDiracDecBin->ChEneOut_fx[0][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[0][bin], hDiracDecBin->ChEneOut_e[0][bin], diffEne_fx, sub( 31, q_diffEne ), &hDiracDecBin->ChEneOut_e[0][bin] ); /* Diff ene part*/ - hDiracDecBin->ChEneOut_fx[1][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[1][bin], hDiracDecBin->ChEneOut_e[1][bin], diffEne_fx, sub( 31, q_diffEne ), &hDiracDecBin->ChEneOut_e[1][bin] ); - - move32(); - move32(); - IF( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) - { - /* When rendering stereo, ambience (except for surround coherent sound) has zero ICC. */ - hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_16_1( diffEne_fx, surCoh_fx ), sub( 31, q_diffEne ), &hDiracDecBin->ChCrossReOut_e[bin] ); - move32(); - } - ELSE /* When rendering binaural, ambience has frequency dependent ICC. */ - { - test(); - test(); - IF( ( EQ_32( ivas_format, SBA_FORMAT ) || EQ_32( ivas_format, SBA_ISM_FORMAT ) ) && LT_16( bin, BINAURAL_COHERENCE_DIFFERENCE_BINS ) ) - { - Word32 diffuseFieldCoherence_fx; - Word16 tmp_exp; - temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( hDiracDecBin->hDiffuseDist->diffuseRatioX_fx[bin], hDiracDecBin->diffuseFieldCoherenceX_fx[bin] ), 0, Mpy_32_32( hDiracDecBin->hDiffuseDist->diffuseRatioY_fx[bin], hDiracDecBin->diffuseFieldCoherenceY_fx[bin] ), 0, &tmp_exp ); - diffuseFieldCoherence_fx = BASOP_Util_Add_Mant32Exp( temp, tmp_exp, Mpy_32_32( hDiracDecBin->hDiffuseDist->diffuseRatioZ_fx[bin], hDiracDecBin->diffuseFieldCoherenceZ_fx[bin] ), 0, &tmp_exp ); - temp = BASOP_Util_Add_Mant32Exp( Mpy_32_16_1( diffuseFieldCoherence_fx, sub( 32767, surCoh_fx ) ), tmp_exp, L_shl( surCoh_fx, 16 ), 0, &tmp_exp ); - hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_32( temp, diffEne_fx ), add( tmp_exp, sub( 31, q_diffEne ) ), &hDiracDecBin->ChCrossReOut_e[bin] ); - } - ELSE - { - hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_32( L_add( Mpy_32_16_1( hDiracDecBin->diffuseFieldCoherence_fx[bin], sub( 32767, surCoh_fx ) ), L_shl( surCoh_fx, 16 ) ), diffEne_fx ), sub( 31, q_diffEne ), &hDiracDecBin->ChCrossReOut_e[bin] ); - } - move32(); - } - - /* Store parameters for formulating average diffuseness over frame */ - Word32 frameMeanDiffuseness = BASOP_Util_Add_Mant32Exp( hDiracDecBin->frameMeanDiffuseness_fx[bin], 2 /*Q29*/, diffEneValForDecorrelationReduction_fx, sub( 31, q_diffEneValForDecorrelationReduction ), &exp1 ); // exp = exp1 - frameMeanDiffusenessEneWeight_fx[bin] = L_add( frameMeanDiffusenessEneWeight_fx[bin], meanEnePerCh_fx ); - move32(); - - /* Formulate average diffuseness over frame */ - frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_cadence( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 - exp = sub( exp, sub( sub( 31, q_meanEnePerCh ), exp1 ) ); - hDiracDecBin->frameMeanDiffuseness_fx[bin] = L_shl( frameMeanDiffuseness, sub( exp, 2 ) ); // Q29 - move32(); - } - - FOR( bin = 0; bin < nBins; bin++ ) - { - hDiracDecBin->ChCrossReOut_fx[bin] = Mpy_32_32( hDiracDecBin->ChCrossReOut_fx[bin], qualityBasedSmFactor_fx ); - hDiracDecBin->ChCrossImOut_fx[bin] = Mpy_32_32( hDiracDecBin->ChCrossImOut_fx[bin], qualityBasedSmFactor_fx ); - - FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - hDiracDecBin->ChEneOut_fx[ch][bin] = Mpy_32_32( hDiracDecBin->ChEneOut_fx[ch][bin], qualityBasedSmFactor_fx ); - move32(); - } - hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_32( hDiracDecBin->ChCrossReOutPrev_fx[bin], IIReneLimiter_fx[bin] ), hDiracDecBin->ChCrossReOutPrev_e[bin], &hDiracDecBin->ChCrossReOut_e[bin] ); - hDiracDecBin->ChCrossImOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossImOut_fx[bin], hDiracDecBin->ChCrossImOut_e[bin], Mpy_32_32( hDiracDecBin->ChCrossImOutPrev_fx[bin], IIReneLimiter_fx[bin] ), hDiracDecBin->ChCrossImOutPrev_e[bin], &hDiracDecBin->ChCrossImOut_e[bin] ); - move32(); - move32(); - - FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - hDiracDecBin->ChEneOut_fx[ch][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[ch][bin], hDiracDecBin->ChEneOut_e[ch][bin], Mpy_32_32( hDiracDecBin->ChEneOutPrev_fx[ch][bin], IIReneLimiter_fx[bin] ), hDiracDecBin->ChEneOutPrev_e[ch][bin], &hDiracDecBin->ChEneOut_e[ch][bin] ); - move32(); - } - - - hDiracDecBin->ChCrossReOutPrev_fx[bin] = hDiracDecBin->ChCrossReOut_fx[bin]; - move32(); - hDiracDecBin->ChCrossImOutPrev_fx[bin] = hDiracDecBin->ChCrossImOut_fx[bin]; - move32(); - hDiracDecBin->ChCrossReOutPrev_e[bin] = hDiracDecBin->ChCrossReOut_e[bin]; - move16(); - hDiracDecBin->ChCrossImOutPrev_e[bin] = hDiracDecBin->ChCrossImOut_e[bin]; - move16(); - - FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - hDiracDecBin->ChEnePrev_fx[ch][bin] = hDiracDecBin->ChEne_fx[ch][bin]; - move32(); - hDiracDecBin->ChEnePrev_e[ch][bin] = hDiracDecBin->ChEne_e[ch][bin]; - move16(); - hDiracDecBin->ChEneOutPrev_fx[ch][bin] = hDiracDecBin->ChEneOut_fx[ch][bin]; - move32(); - hDiracDecBin->ChEneOutPrev_e[ch][bin] = hDiracDecBin->ChEneOut_e[ch][bin]; - move16(); - } - } - - return; -} - - -#else -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx( - DIRAC_DEC_BIN_HANDLE hDiracDecBin, - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, - PARAMBIN_REND_CONFIG_HANDLE hConfig, - Word32 inRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*q*/ - Word32 inIm_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*q*/ - Word32 Rmat_fx[3][3], /*Q30*/ - const Word16 subframe, - const Word16 isHeadtracked, - const MASA_ISM_DATA_HANDLE hMasaIsmData, - Word16 q ) -{ - Word16 ch, slot, bin; - Word16 separateCenterChannelRendering; - Word16 nBins, idx, shift; - Word32 frameMeanDiffusenessEneWeight_fx[CLDFB_NO_CHANNELS_MAX]; - Word32 IIReneLimiterFactor_fx; // Q26 - Word32 qualityBasedSmFactor_fx; - Word32 lowBitRateEQ_fx[CLDFB_NO_CHANNELS_MAX]; - UWord8 applyLowBitRateEQ; + Word32 qualityBasedSmFactor_fx; Word16 dirac_read_idx; - Word32 subFrameTotalEne_fx[CLDFB_NO_CHANNELS_MAX]; - Word16 subFrameTotalEne_e[CLDFB_NO_CHANNELS_MAX]; PARAMBIN_HRTF_GAIN_CACHE gainCache[MAX_GAIN_CACHE_SIZE]; IVAS_FORMAT ivas_format; MC_MODE mc_mode; - Word32 ivas_total_brate; - Word16 nchan_transport; Word16 gainCacheBaseIndex; Word16 q_earlyPartEneCorrection; Word16 exp, exp1; - Word64 temp64; Word32 temp; separateCenterChannelRendering = hConfig->separateCenterChannelRendering; @@ -2171,10 +1586,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric move32(); mc_mode = hConfig->mc_mode; move32(); - ivas_total_brate = hConfig->ivas_total_brate; - move32(); - nchan_transport = hConfig->nchan_transport; - move16(); qualityBasedSmFactor_fx = hConfig->qualityBasedSmFactor_fx; /*Q31*/ move32(); qualityBasedSmFactor_fx = Mpy_32_32( qualityBasedSmFactor_fx, qualityBasedSmFactor_fx ); /*Q31*/ @@ -2187,158 +1598,27 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric hDiracDecBin->q_earlyPartEneCorrection = q_earlyPartEneCorrection; move16(); - set32_fx( hDiracDecBin->ChCrossRe_fx, 0, nBins ); - set32_fx( hDiracDecBin->ChCrossIm_fx, 0, nBins ); set32_fx( hDiracDecBin->ChCrossReOut_fx, 0, nBins ); set32_fx( hDiracDecBin->ChCrossImOut_fx, 0, nBins ); - - set16_fx( hDiracDecBin->ChCrossRe_e, 0, nBins ); - set16_fx( hDiracDecBin->ChCrossIm_e, 0, nBins ); set16_fx( hDiracDecBin->ChCrossReOut_e, 0, nBins ); set16_fx( hDiracDecBin->ChCrossImOut_e, 0, nBins ); + FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - set32_fx( hDiracDecBin->ChEne_fx[ch], 0, nBins ); set32_fx( hDiracDecBin->ChEneOut_fx[ch], 0, nBins ); - - set16_fx( hDiracDecBin->ChEne_e[ch], 0, nBins ); set16_fx( hDiracDecBin->ChEneOut_e[ch], 0, nBins ); } set32_fx( hDiracDecBin->frameMeanDiffuseness_fx, 0, nBins ); set32_fx( frameMeanDiffusenessEneWeight_fx, 0, CLDFB_NO_CHANNELS_MAX ); - set16_fx( subFrameTotalEne_e, 0, CLDFB_NO_CHANNELS_MAX ); - FOR( idx = 0; idx < MAX_GAIN_CACHE_SIZE; idx++ ) { gainCache[idx].azi = -1000; /* Use -1000 as value for uninitialized cache. */ move16(); } - /* Determine EQ for low bit rates (13.2 and 16.4 kbps) */ - applyLowBitRateEQ = 0; - move16(); - test(); - test(); - IF( ( EQ_32( ivas_format, MASA_FORMAT ) || EQ_32( ivas_format, MC_FORMAT ) ) && LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) ) - { - applyLowBitRateEQ = 1; - move16(); - IF( EQ_32( ivas_total_brate, IVAS_16k4 ) ) - { - FOR( bin = 0; bin < LOW_BIT_RATE_BINAURAL_EQ_BINS; bin++ ) - { - lowBitRateEQ_fx[bin + LOW_BIT_RATE_BINAURAL_EQ_OFFSET] = L_add( L_shr( lowBitRateBinauralEQ_fx[bin], 1 ), ONE_IN_Q30 ); // Q31 - move32(); - } - } - ELSE - { - FOR( bin = 0; bin < LOW_BIT_RATE_BINAURAL_EQ_BINS; bin++ ) - { - lowBitRateEQ_fx[bin + LOW_BIT_RATE_BINAURAL_EQ_OFFSET] = lowBitRateBinauralEQ_fx[bin]; // Q31 - move32(); - } - } - } - - /* Formulate input and target covariance matrices for this subframe */ - set32_fx( subFrameTotalEne_fx, 0, CLDFB_NO_CHANNELS_MAX ); dirac_read_idx = hSpatParamRendCom->render_to_md_map[subframe]; - move16(); - - exp = sub( 63, shl( q, 1 ) ); // exp for the energy (inRe_fx * inRe_fx + inIm_fx * inIm_fx) computed below - - /* Calculate input covariance matrix */ - FOR( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) - { - FOR( bin = 0; bin < nBins; bin++ ) - { - FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - Word32 instEne_fx; - temp64 = W_mult0_32_32( inRe_fx[ch][slot][bin], inRe_fx[ch][slot][bin] ); // 2q - temp64 = W_add( temp64, W_mult0_32_32( inIm_fx[ch][slot][bin], inIm_fx[ch][slot][bin] ) ); // 2q - exp1 = W_norm( temp64 ); - instEne_fx = W_extract_h( W_shl( temp64, exp1 ) ); // 2q - 32 + exp1 - /* exp of instEne_fx = 31 - (2q -32 + exp1) = 63 - 2q - exp1 = exp - exp1*/ - - hDiracDecBin->ChEne_fx[ch][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEne_fx[ch][bin], hDiracDecBin->ChEne_e[ch][bin], instEne_fx, sub( exp, exp1 ), &hDiracDecBin->ChEne_e[ch][bin] ); - subFrameTotalEne_fx[bin] = BASOP_Util_Add_Mant32Exp( subFrameTotalEne_fx[bin], subFrameTotalEne_e[bin], instEne_fx, sub( exp, exp1 ), &subFrameTotalEne_e[bin] ); - move32(); - move32(); - } - temp64 = W_mult0_32_32( inRe_fx[0][slot][bin], inRe_fx[1][slot][bin] ); // 2q - temp64 = W_add( temp64, W_mult0_32_32( inIm_fx[0][slot][bin], inIm_fx[1][slot][bin] ) ); // 2q - exp1 = W_norm( temp64 ); - temp = W_extract_h( W_shl( temp64, exp1 ) ); // // 2q - 32 + exp1 - hDiracDecBin->ChCrossRe_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossRe_fx[bin], hDiracDecBin->ChCrossRe_e[bin], temp, sub( exp, exp1 ), &hDiracDecBin->ChCrossRe_e[bin] ); - move32(); - - temp64 = W_mult0_32_32( inRe_fx[0][slot][bin], inIm_fx[1][slot][bin] ); // 2q - temp64 = W_sub( temp64, W_mult0_32_32( inIm_fx[0][slot][bin], inRe_fx[1][slot][bin] ) ); // 2q - exp1 = W_norm( temp64 ); - temp = W_extract_h( W_shl( temp64, exp1 ) ); // // 2q - 32 + exp1 - hDiracDecBin->ChCrossIm_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossIm_fx[bin], hDiracDecBin->ChCrossIm_e[bin], temp, sub( exp, exp1 ), &hDiracDecBin->ChCrossIm_e[bin] ); - move32(); - } - } - - /* Apply EQ at low bit rates */ - IF( applyLowBitRateEQ != 0 ) - { - Word16 lastEqBin = LOW_BIT_RATE_BINAURAL_EQ_OFFSET + LOW_BIT_RATE_BINAURAL_EQ_BINS - 1; - - FOR( bin = LOW_BIT_RATE_BINAURAL_EQ_OFFSET; bin < lastEqBin; bin++ ) - { - subFrameTotalEne_fx[bin] = Mpy_32_32( subFrameTotalEne_fx[bin], lowBitRateEQ_fx[bin] ); // exp = subFrameTotalEne_e[bin] - move32(); - } - FOR( ; bin < nBins; bin++ ) - { - subFrameTotalEne_fx[bin] = Mpy_32_32( subFrameTotalEne_fx[bin], lowBitRateEQ_fx[lastEqBin] ); // exp = subFrameTotalEne_e[bin] - move32(); - } - } - - test(); - test(); - IF( ( EQ_32( ivas_format, SBA_FORMAT ) || EQ_32( ivas_format, SBA_ISM_FORMAT ) ) && EQ_16( nchan_transport, 2 ) ) - { - Word32 tempRe, tempIm; - Word32 subFrameSumEne_fx[CLDFB_NO_CHANNELS_MAX]; - Word16 subFrameSumEne_e[CLDFB_NO_CHANNELS_MAX]; - - set32_fx( subFrameSumEne_fx, 0, CLDFB_NO_CHANNELS_MAX ); - set16_fx( subFrameSumEne_e, 0, CLDFB_NO_CHANNELS_MAX ); - FOR( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ ) - { - FOR( bin = 0; bin < nBins; bin++ ) - { - tempRe = L_add( inRe_fx[0][slot][bin], inRe_fx[1][slot][bin] ); // q - tempIm = L_add( inIm_fx[0][slot][bin], inIm_fx[1][slot][bin] ); // q - temp64 = W_add( W_mult0_32_32( tempRe, tempRe ), W_mult0_32_32( tempIm, tempIm ) ); // 2q - exp1 = W_norm( temp64 ); - temp64 = W_shl( temp64, exp1 ); // 2q + exp1 - subFrameSumEne_fx[bin] = BASOP_Util_Add_Mant32Exp( subFrameSumEne_fx[bin], subFrameSumEne_e[bin], W_extract_h( temp64 ), sub( exp /* 63 - 2q */, exp1 ) /*31 - (2q + exp1 - 32)*/, &subFrameSumEne_e[bin] ); - move32(); - } - } - FOR( bin = 0; bin < nBins; bin++ ) - { - subFrameTotalEne_e[bin] = sub( subFrameTotalEne_e[bin], 1 ); - move16(); - temp = L_shl_sat( subFrameTotalEne_fx[bin], sub( subFrameTotalEne_e[bin], subFrameSumEne_e[bin] ) ); // subFrameSumEne_e[bin] - IF( GT_32( subFrameSumEne_fx[bin], temp ) ) - { - subFrameTotalEne_fx[bin] = subFrameSumEne_fx[bin]; - move32(); - subFrameTotalEne_e[bin] = subFrameSumEne_e[bin]; - move16(); - } - } - } /* Determine target covariance matrix containing target binaural properties */ FOR( bin = 0; bin < nBins; bin++ ) @@ -2481,7 +1761,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh_fx = s_max( spreadCoh_fx, altSpreadCoh_fx ); } +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains_fx( bin, aziDeg, eleDeg, &lRealp_fx, &lImagp_fx, &rRealp_fx, &rImagp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains_fx( bin, aziDeg, eleDeg, &lRealp_fx, &lImagp_fx, &rRealp_fx, &rImagp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex], isHeadtracked ); +#endif Word16 q_lr = Q28; move16(); @@ -2532,7 +1816,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric rImagp_fx = Mpy_32_32( rImagp_fx, centerMul_fx ); // Q25 /* Apply the gain for the left source of the three coherent sources */ +#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + getDirectPartGains_fx( bin, add( aziDeg, 30 ), eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains_fx( bin, add( aziDeg, 30 ), eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); +#endif hrtfEneSides_fx = L_add( Mpy_32_32( lRealpTmp_fx, lRealpTmp_fx ), // Q25 L_add( Mpy_32_32( lImagpTmp_fx, lImagpTmp_fx ), // Q25 @@ -2546,7 +1834,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_fx( bin, aziDeg + 330, eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); +#else getDirectPartGains_fx( bin, aziDeg + 330, eleDeg, &lRealpTmp_fx, &lImagpTmp_fx, &rRealpTmp_fx, &rImagpTmp_fx, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat_fx, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); +#endif hrtfEneSides_fx = L_add( hrtfEneSides_fx, L_add( Mpy_32_32( lRealpTmp_fx, lRealpTmp_fx ), // Q25 @@ -2716,97 +2008,38 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric move32(); /* Formulate average diffuseness over frame */ - frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_newton( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 + frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_cadence( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 exp = sub( exp, sub( sub( 31, q_meanEnePerCh ), exp1 ) ); hDiracDecBin->frameMeanDiffuseness_fx[bin] = L_shl( frameMeanDiffuseness, sub( exp, 2 ) ); // Q29 move32(); } - test(); - /* Temporal IIR-type smoothing of covariance matrices. Also apply encoding quality based smoothing factor. */ - IF( EQ_32( ivas_format, MASA_FORMAT ) && LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) ) - { - IIReneLimiterFactor_fx = L_add( L_shl( 16, Q26 ), L_sub( L_shl( 1, Q26 ), L_shr( qualityBasedSmFactor_fx, 5 ) ) ); // Q26 - } - ELSE - { - IIReneLimiterFactor_fx = L_add( L_shl( 8, Q26 ), L_sub( L_shl( 1, Q26 ), L_shr( qualityBasedSmFactor_fx, 5 ) ) ); // Q26 - } - FOR( bin = 0; bin < nBins; bin++ ) { - Word32 IIReneLimiter_fx; - - /* Temporally smooth cov mtx estimates for resulting mixing matrix stability. The design principle is that - * the energy history (IIR) must not be more than double of the current frame energy. This provides more - * robust performance at energy offsets when compared to typical IIR averaging. */ - Word16 num_e, den_e; - Word32 num, den; - num = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEne_fx[0][bin], hDiracDecBin->ChEne_e[0][bin], hDiracDecBin->ChEne_fx[1][bin], hDiracDecBin->ChEne_e[1][bin], &num_e ); - num = Mpy_32_32( num, IIReneLimiterFactor_fx ); /*Q = (31 - num_e + 26 - 31) = (26 - num_e)*/ - den_e = 0; - move16(); - den = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEnePrev_fx[0][bin], hDiracDecBin->ChEnePrev_e[0][bin], hDiracDecBin->ChEnePrev_fx[1][bin], hDiracDecBin->ChEnePrev_e[1][bin], &den_e ); - den = L_max( 1, den ); - IIReneLimiter_fx = BASOP_Util_Divide3232_Scale_newton( num, den, &exp ); - exp = add( sub( num_e, den_e ), add( 5, exp ) ); - IF( L_shr_sat( IIReneLimiter_fx, sub( 31, exp ) ) > 0 ) - { - IIReneLimiter_fx = ONE_IN_Q31; /*Q31*/ - move32(); - } - ELSE - { - IIReneLimiter_fx = L_shl( IIReneLimiter_fx, exp ); /*Q31*/ - } - - hDiracDecBin->ChCrossRe_fx[bin] = Mpy_32_32( hDiracDecBin->ChCrossRe_fx[bin], qualityBasedSmFactor_fx ); - hDiracDecBin->ChCrossIm_fx[bin] = Mpy_32_32( hDiracDecBin->ChCrossIm_fx[bin], qualityBasedSmFactor_fx ); hDiracDecBin->ChCrossReOut_fx[bin] = Mpy_32_32( hDiracDecBin->ChCrossReOut_fx[bin], qualityBasedSmFactor_fx ); hDiracDecBin->ChCrossImOut_fx[bin] = Mpy_32_32( hDiracDecBin->ChCrossImOut_fx[bin], qualityBasedSmFactor_fx ); - move32(); - move32(); - move32(); - move32(); FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - hDiracDecBin->ChEne_fx[ch][bin] = Mpy_32_32( hDiracDecBin->ChEne_fx[ch][bin], qualityBasedSmFactor_fx ); hDiracDecBin->ChEneOut_fx[ch][bin] = Mpy_32_32( hDiracDecBin->ChEneOut_fx[ch][bin], qualityBasedSmFactor_fx ); move32(); - move32(); } - - hDiracDecBin->ChCrossRe_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossRe_fx[bin], hDiracDecBin->ChCrossRe_e[bin], Mpy_32_32( hDiracDecBin->ChCrossRePrev_fx[bin], IIReneLimiter_fx ), hDiracDecBin->ChCrossRePrev_e[bin], &hDiracDecBin->ChCrossRe_e[bin] ); - hDiracDecBin->ChCrossIm_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossIm_fx[bin], hDiracDecBin->ChCrossIm_e[bin], Mpy_32_32( hDiracDecBin->ChCrossImPrev_fx[bin], IIReneLimiter_fx ), hDiracDecBin->ChCrossImPrev_e[bin], &hDiracDecBin->ChCrossIm_e[bin] ); - hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_32( hDiracDecBin->ChCrossReOutPrev_fx[bin], IIReneLimiter_fx ), hDiracDecBin->ChCrossReOutPrev_e[bin], &hDiracDecBin->ChCrossReOut_e[bin] ); - hDiracDecBin->ChCrossImOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossImOut_fx[bin], hDiracDecBin->ChCrossImOut_e[bin], Mpy_32_32( hDiracDecBin->ChCrossImOutPrev_fx[bin], IIReneLimiter_fx ), hDiracDecBin->ChCrossImOutPrev_e[bin], &hDiracDecBin->ChCrossImOut_e[bin] ); - move32(); - move32(); + hDiracDecBin->ChCrossReOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossReOut_fx[bin], hDiracDecBin->ChCrossReOut_e[bin], Mpy_32_32( hDiracDecBin->ChCrossReOutPrev_fx[bin], IIReneLimiter_fx[bin] ), hDiracDecBin->ChCrossReOutPrev_e[bin], &hDiracDecBin->ChCrossReOut_e[bin] ); + hDiracDecBin->ChCrossImOut_fx[bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChCrossImOut_fx[bin], hDiracDecBin->ChCrossImOut_e[bin], Mpy_32_32( hDiracDecBin->ChCrossImOutPrev_fx[bin], IIReneLimiter_fx[bin] ), hDiracDecBin->ChCrossImOutPrev_e[bin], &hDiracDecBin->ChCrossImOut_e[bin] ); move32(); move32(); FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - hDiracDecBin->ChEne_fx[ch][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEne_fx[ch][bin], hDiracDecBin->ChEne_e[ch][bin], Mpy_32_32( hDiracDecBin->ChEnePrev_fx[ch][bin], IIReneLimiter_fx ), hDiracDecBin->ChEnePrev_e[ch][bin], &hDiracDecBin->ChEne_e[ch][bin] ); - hDiracDecBin->ChEneOut_fx[ch][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[ch][bin], hDiracDecBin->ChEneOut_e[ch][bin], Mpy_32_32( hDiracDecBin->ChEneOutPrev_fx[ch][bin], IIReneLimiter_fx ), hDiracDecBin->ChEneOutPrev_e[ch][bin], &hDiracDecBin->ChEneOut_e[ch][bin] ); - move32(); + hDiracDecBin->ChEneOut_fx[ch][bin] = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEneOut_fx[ch][bin], hDiracDecBin->ChEneOut_e[ch][bin], Mpy_32_32( hDiracDecBin->ChEneOutPrev_fx[ch][bin], IIReneLimiter_fx[bin] ), hDiracDecBin->ChEneOutPrev_e[ch][bin], &hDiracDecBin->ChEneOut_e[ch][bin] ); move32(); } - /* Store energy values and coefficients for next round */ - hDiracDecBin->ChCrossRePrev_fx[bin] = hDiracDecBin->ChCrossRe_fx[bin]; - move32(); - hDiracDecBin->ChCrossImPrev_fx[bin] = hDiracDecBin->ChCrossIm_fx[bin]; - move32(); + hDiracDecBin->ChCrossReOutPrev_fx[bin] = hDiracDecBin->ChCrossReOut_fx[bin]; move32(); hDiracDecBin->ChCrossImOutPrev_fx[bin] = hDiracDecBin->ChCrossImOut_fx[bin]; move32(); - hDiracDecBin->ChCrossRePrev_e[bin] = hDiracDecBin->ChCrossRe_e[bin]; - move16(); - hDiracDecBin->ChCrossImPrev_e[bin] = hDiracDecBin->ChCrossIm_e[bin]; - move16(); hDiracDecBin->ChCrossReOutPrev_e[bin] = hDiracDecBin->ChCrossReOut_e[bin]; move16(); hDiracDecBin->ChCrossImOutPrev_e[bin] = hDiracDecBin->ChCrossImOut_e[bin]; @@ -2816,10 +2049,10 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric { hDiracDecBin->ChEnePrev_fx[ch][bin] = hDiracDecBin->ChEne_fx[ch][bin]; move32(); - hDiracDecBin->ChEneOutPrev_fx[ch][bin] = hDiracDecBin->ChEneOut_fx[ch][bin]; - move32(); hDiracDecBin->ChEnePrev_e[ch][bin] = hDiracDecBin->ChEne_e[ch][bin]; move16(); + hDiracDecBin->ChEneOutPrev_fx[ch][bin] = hDiracDecBin->ChEneOut_fx[ch][bin]; + move32(); hDiracDecBin->ChEneOutPrev_e[ch][bin] = hDiracDecBin->ChEneOut_e[ch][bin]; move16(); } @@ -2827,7 +2060,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric return; } -#endif + static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( DIRAC_DEC_BIN_HANDLE hDiracDecBin, @@ -3459,9 +2692,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( const Word16 numInChannels, const Word16 processReverb, const Word16 subframe, - const Word16 q_mat -#ifdef SPLIT_REND_WITH_HEAD_ROT - , + const Word16 q_mat, Word32 outRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 outIm_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 reverbRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], @@ -3469,9 +2700,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( Word32 decorrRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word32 decorrIm_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], Word16 *Q_inp_mix, - const Word8 recompute -#endif -) + const Word8 recompute ) { Word16 slot, bin, chA, chB; Word16 nBins; @@ -3487,10 +2716,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( Word32 decSlotRe_fx[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], decSlotIm_fx[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; Word32 outSlotRe_fx[CLDFB_NO_CHANNELS_MAX], outSlotIm_fx[CLDFB_NO_CHANNELS_MAX]; -#ifndef SPLIT_REND_WITH_HEAD_ROT - Word32 reverbRe_fx[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - Word32 reverbIm_fx[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#endif Word16 q_inp[6][CLDFB_SLOTS_PER_SUBFRAME]; Word16 interpVal_fx; Word32 *decSlotRePointer_fx; @@ -3501,21 +2726,15 @@ static void ivas_dirac_dec_binaural_process_output_fx( IF( processReverb ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( recompute == 1 ) { -#endif /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe_fx( hDiracDecBin->hReverb, numInChannels, nSlots, inRe_fx, inIm_fx, reverbRe_fx, reverbIm_fx ); -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( recompute, 1 ) ) { -#endif // scaling input and reverb to same q// // input scaling is to maintain precision in ivas_dirac_dec_decorrelate_slot fn// Word16 shift = s_min( L_norm_arr( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length ), L_norm_arr( cldfbSynDec[1]->cldfb_state_fx, cldfbSynDec[1]->p_filter_length ) ); @@ -3528,11 +2747,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( q_inp[i][j] = s_min( L_norm_arr( inRe_fx[i][j], nBins ), L_norm_arr( inIm_fx[i][j], nBins ) ); move16(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( processReverb && EQ_16( recompute, 1 ) ) && LT_16( i, 2 ) ) -#else - IF( ( processReverb ) && LT_16( i, 2 ) ) -#endif { q_reverb = s_min( L_norm_arr( reverbRe_fx[i][j], CLDFB_NO_CHANNELS_MAX ), L_norm_arr( reverbIm_fx[i][j], CLDFB_NO_CHANNELS_MAX ) ); q_inp[i][j] = s_min( q_reverb, q_inp[i][j] ); @@ -3560,11 +2775,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( scale_sig32( inRe_fx[i][j], nBins, q_inp_mix ); /*q_input + q_inp_mix*/ scale_sig32( inIm_fx[i][j], nBins, q_inp_mix ); /*q_input + q_inp_mix*/ test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( processReverb && EQ_16( recompute, 1 ) ) && LT_16( i, 2 ) ) -#else - IF( ( processReverb ) && LT_16( i, 2 ) ) -#endif { scale_sig32( reverbRe_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( add( q_inp_mix, q_mat ), 15 ) ); /*q_inp_mix+q_mat-15*/ scale_sig32( reverbIm_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( add( q_inp_mix, q_mat ), 15 ) ); /*q_inp_mix+q_mat-15*/ @@ -3579,7 +2790,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( cldfbSynDec[1]->Q_cldfb_state = add( cldfbSynDec[1]->Q_cldfb_state, cldfb_state_shift ); move16(); move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT *Q_inp_mix = q_inp_mix; move16(); } @@ -3587,7 +2797,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( { q_inp_mix = *Q_inp_mix; } -#endif q_inp_mix = add( q_inp_mix, q_input ); @@ -3613,12 +2822,9 @@ static void ivas_dirac_dec_binaural_process_output_fx( test(); IF( !hDiracDecBin->useTdDecorr && ( max_band_decorr > 0 ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( recompute == 1 ) { -#endif ivas_dirac_dec_decorrelate_slot_fx( hDiracDecBin, nBins, slot, inRe_fx, inIm_fx, q_inp_mix, decSlotRe_fx, decSlotIm_fx ); -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { Copy32( decSlotRe_fx[chA], decorrRe_fx[chA][slot], CLDFB_NO_CHANNELS_MAX ); @@ -3633,7 +2839,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( Copy32( decorrIm_fx[chA][slot], decSlotIm_fx[chA], CLDFB_NO_CHANNELS_MAX ); } } -#endif } FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) @@ -3723,7 +2928,6 @@ static void ivas_dirac_dec_binaural_process_output_fx( outSlotRePr_fx = &( outSlotRe_fx[0] ); outSlotImPr_fx = &( outSlotIm_fx[0] ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( outRe_fx != NULL && outIm_fx != NULL ) { /* provide the data outside in CLDFB domain => mainly for split rendering */ @@ -3743,27 +2947,13 @@ static void ivas_dirac_dec_binaural_process_output_fx( cldfbSynDec[chA]->Q_cldfb_state = sub( q_result, 1 ); move16(); } -#else -#ifdef OPT_AVOID_STATE_BUF_RESCALE - cldfbSynthesis_ivas_fx( &outSlotRePr_fx, &outSlotImPr_fx, &( output_fx[chA][nBins * slot + offsetSamples] ), nBins, 0, 0, cldfbSynDec[chA] ); -#else - cldfbSynthesis_ivas_fx( &outSlotRePr_fx, &outSlotImPr_fx, &( output_fx[chA][nBins * slot + offsetSamples] ), nBins, 0, cldfbSynDec[chA] ); -#endif - cldfbSynDec[chA]->Q_cldfb_state = sub( q_result, 1 ); - move16(); -#endif /* SPLIT_REND_WITH_HEAD_ROT */ } } -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( recompute == 1 ) { *q_out = sub( q_result, 1 ); move16(); } -#else - *q_out = sub( q_result, 1 ); - move16(); -#endif return; } @@ -6330,15 +5520,10 @@ static void ivas_masa_ext_rend_parambin_internal_fx( MASA_EXT_REND_HANDLE hMasaExtRend, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, Word32 *output_fx[], /* Q11*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT const Word16 subframe, const SPLIT_REND_WRAPPER *hSplitRendWrapper, Word32 Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word32 Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] -#else - const Word16 subframe -#endif -) + Word32 Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; @@ -6349,7 +5534,6 @@ static void ivas_masa_ext_rend_parambin_internal_fx( Word16 i, j; Word16 nchan_transport; Word16 q_mat; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; Word32 tmp_Cldfb_out_re[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; @@ -6366,9 +5550,6 @@ static void ivas_masa_ext_rend_parambin_internal_fx( Word16 Q_inp_mix; hDiracDecBin = hMasaExtRend->hDiracDecBin[0]; -#else - hDiracDecBin = hMasaExtRend->hDiracDecBin; -#endif hSpatParamRendCom = hMasaExtRend->hSpatParamRendCom; Word32 Cldfb_RealBuffer_in_fx[6][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; @@ -6383,11 +5564,7 @@ static void ivas_masa_ext_rend_parambin_internal_fx( } } Word32 Rmat_fx[3][3]; -#ifdef SPLIT_REND_WITH_HEAD_ROT hDiracDecBin = hMasaExtRend->hDiracDecBin[0]; -#else - hDiracDecBin = hMasaExtRend->hDiracDecBin; -#endif assert( hDiracDecBin ); hSpatParamRendCom = hMasaExtRend->hSpatParamRendCom; nBins = hSpatParamRendCom->num_freq_bands; @@ -6491,29 +5668,21 @@ static void ivas_masa_ext_rend_parambin_internal_fx( IF( EQ_16( nchan_transport, 2 ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT /* in case of split rendering, determine the prototype rotation based on the main direction and use the same prototypes for the offset directions */ -#endif adaptTransportSignalsHeadtracked_fx( hCombinedOrientationData, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, nBins, hSpatParamRendCom->subframe_nbslots[subframe], Rmat_fx ); ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_fx( hCombinedOrientationData, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, nBins, hSpatParamRendCom->subframe_nbslots[subframe], Rmat_fx ); } } test(); -#ifndef SPLIT_REND_WITH_HEAD_ROT - ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, Rmat_fx, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, NULL, q_inp ); -#endif /* Always using CLDFB decorrelation in MASA EXT renderer */ max_band_decorr = hDiracDecBin->h_freq_domain_decorr_ap_params->max_band_decorr; -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_dirac_dec_binaural_formulate_input_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, subframe, subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, q_inp ); ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, NULL ); -#endif ivas_dirac_dec_binaural_determine_processing_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_fx, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, @@ -6564,7 +5733,6 @@ static void ivas_masa_ext_rend_parambin_internal_fx( move16(); move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT pMultiBinPoseData = NULL; if ( hSplitRendWrapper != NULL ) { @@ -6587,13 +5755,9 @@ static void ivas_masa_ext_rend_parambin_internal_fx( ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, hMasaExtRend->cldfbSynRend, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat, NULL, NULL, reverbRe_fx, reverbIm_fx, decorrRe_fx, decorrIm_fx, &Q_inp_mix, 1 ); } -#else - ivas_dirac_dec_binaural_process_output_fx( hDiracDecBin, hSpatParamRendCom, hMasaExtRend->cldfbSynRend, output_fx, &q_out, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_inp, max_band_decorr, numInChannels, config_data.processReverb, subframe, q_mat ); -#endif hDiracDecBin->hDiffuseDist = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( pMultiBinPoseData != NULL && pMultiBinPoseData->num_poses > 1 ) { /* quaternion-based rotation from ivas_binRenderer_internal.c:ivas_binRenderer(), but using absolute rotation instead of delta rotations */ @@ -6700,7 +5864,6 @@ static void ivas_masa_ext_rend_parambin_internal_fx( } /* update this counter only after the last rendering of split directions */ -#endif hSpatParamRendCom->slots_rendered = add( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->subframe_nbslots[subframe] ); hSpatParamRendCom->subframes_rendered = add( hSpatParamRendCom->subframes_rendered, 1 ); @@ -6718,17 +5881,13 @@ static void ivas_masa_ext_rend_parambin_internal_fx( } void ivas_masa_ext_rend_parambin_render_fx( - MASA_EXT_REND_HANDLE hMasaExtRend, /* i/o: MASA ext rend structure */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ - Word32 *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output Q11*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT + MASA_EXT_REND_HANDLE hMasaExtRend, /* i/o: MASA ext rend structure */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ + Word32 *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output Q11*/ const Word16 num_subframes, /* i : number of subframes to render */ const SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i : split rendering orientation data */ Word32 Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : rendered orientations for split rend. real part of cldfb */ Word32 Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] /* o : rendered orientations for split rend. imag part of cldfb */ -#else - const Word16 num_subframes /* i : number of subframes to render */ -#endif ) { Word16 subframe; @@ -6751,11 +5910,7 @@ void ivas_masa_ext_rend_parambin_render_fx( hSpatParamRendCom->slots_rendered = 0; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_masa_ext_rend_parambin_internal_fx( hMasaExtRend, hCombinedOrientationData, p_output, hSpatParamRendCom->dirac_read_idx, hSplitRendWrapper, Cldfb_Out_Real, Cldfb_Out_Imag ); -#else - ivas_masa_ext_rend_parambin_internal_fx( hMasaExtRend, hCombinedOrientationData, p_output, hSpatParamRendCom->dirac_read_idx ); -#endif FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { p_output[ch] += n_samples_sf; diff --git a/lib_rend/ivas_orient_trk_fx.c b/lib_rend/ivas_orient_trk_fx.c index 5ea170a783751ecdc78eec6b0defab050e79b056..ee91e7060e252c6d06e9827ba3f2e5d353710038 100644 --- a/lib_rend/ivas_orient_trk_fx.c +++ b/lib_rend/ivas_orient_trk_fx.c @@ -696,20 +696,12 @@ ivas_error ivas_orient_trk_SetReferenceRotation_fx( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* check for Euler angle signaling */ IF( EQ_32( refRot.w_fx, L_negate( 12582912 ) ) && EQ_16( refRot.q_fact, Q22 ) ) { Euler2Quat_fx( deg2rad_fx( refRot.x_fx ), deg2rad_fx( refRot.y_fx ), deg2rad_fx( refRot.z_fx ), &pOTR->refRot ); modify_Quat_q_fx( &pOTR->refRot, &pOTR->refRot, Q29 ); } -#else - /* check for Euler angle signaling */ - IF( EQ_32( refRot.w_fx, -1610612736 /* -3.0f in Q29 */ ) ) - { - Euler2Quat_fx( deg2rad_fx( refRot.x_fx ), deg2rad_fx( refRot.y_fx ), deg2rad_fx( refRot.z_fx ), &pOTR->refRot ); - } -#endif pOTR->refRot = refRot; return IVAS_ERR_OK; diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 7bcf6e37dc2987b9edc600935d18e46dc76643a0..5c19acb5fc00de4a18d30664cf1c7bfdc8a9734d 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -100,10 +100,8 @@ Word16 audioCfg2channels( move16(); BREAK; case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: nchan_out = 2; @@ -270,10 +268,8 @@ void ivas_output_init( move16(); BREAK; case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: case IVAS_AUDIO_CONFIG_ISM1: @@ -378,12 +374,8 @@ Word16 ivas_get_nchan_buffers_dec( { nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); } - ELSE if ( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#ifdef SPLIT_REND_WITH_HEAD_ROT - || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif - ) + ELSE if ( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { nchan_out_buff = shl( CPE_CHANNELS, 1 ); } @@ -464,12 +456,10 @@ Word16 ivas_get_nchan_buffers_dec( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS ); } -#endif return nchan_out_buff; } diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 90771862ef41d2ebc1539410da0224c25e7fbd16..fec80824367ad78dbd450a6203ef8f1a115c8eec 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -220,14 +220,10 @@ void ivas_masa_ext_rend_parambin_render_fx( MASA_EXT_REND_HANDLE hMasaExtRend, /* i/o: MASA ext rend structure */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ Word32 *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output Q11*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT const Word16 num_subframes, /* i : number of subframes to render */ const SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i : split rendering orientation data */ Word32 Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : rendered orientations for split rend. real part of cldfb */ Word32 Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] /* o : rendered orientations for split rend. imag part of cldfb */ -#else - const Word16 num_subframes /* i : number of subframes to render */ -#endif ); ivas_error ivas_dirac_dec_init_binaural_data_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -887,21 +883,13 @@ ivas_error ivas_rend_openCrend( #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT const Word32 output_Fs, const Word16 num_poses -#else - const Word32 output_Fs -#endif ); void ivas_rend_closeCrend( -#ifdef SPLIT_REND_WITH_HEAD_ROT CREND_WRAPPER_HANDLE *pCrend , const Word16 num_poses -#else - CREND_WRAPPER_HANDLE *pCrend -#endif ); ivas_error ivas_hrtf_init( @@ -909,12 +897,8 @@ ivas_error ivas_hrtf_init( ); ivas_error ivas_rend_initCrendWrapper( -#ifdef SPLIT_REND_WITH_HEAD_ROT CREND_WRAPPER_HANDLE *pCrend, const Word16 num_poses -#else - CREND_WRAPPER_HANDLE *pCrend -#endif ); ivas_error ivas_rend_crendProcessSubframe( @@ -930,10 +914,8 @@ ivas_error ivas_rend_crendProcessSubframe( Word32 *output[], /* i/o: input/output audio channels */ const Word16 n_samples_to_render, /* i : output frame length per channel */ const Word32 output_Fs /* i : output sampling rate */ -#ifdef SPLIT_REND_WITH_HEAD_ROT , const Word16 pos_idx -#endif ); @@ -1569,7 +1551,6 @@ void masaPrerendClose_fx( MASA_PREREND_HANDLE *hMasaPrerendPtr /* i/o: prerenderer handle to be closed */ ); -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------------------* * Split rendering *----------------------------------------------------------------------------------*/ @@ -1648,7 +1629,6 @@ void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ); -#endif /* clang-format on */ diff --git a/lib_rend/ivas_reflections_fx.c b/lib_rend/ivas_reflections_fx.c index fb3e865857df6d46e95cd85799b72096cbf4c2c1..6bd0ed87c14b7a2cbbd9a3f6f89856361688c014 100644 --- a/lib_rend/ivas_reflections_fx.c +++ b/lib_rend/ivas_reflections_fx.c @@ -338,17 +338,13 @@ ivas_error ivas_er_encoder_init( p_y_fx = reflections->shoebox_data.az_angle.data_fx[i]; // Q23 move32(); move32(); -#ifdef SPLIT_REND_WITH_HEAD_ROT - p_x_fx = L_shr( p_x_fx, 1 ); // Q22 - p_y_fx = L_shr( p_y_fx, 1 ); // Q22 -#endif + p_x_fx = L_shr( p_x_fx, 1 ); // Q22 + p_y_fx = L_shr( p_y_fx, 1 ); // Q22 rad_el_angle = deg2rad_fx( p_x_fx ); // Q22 rad_az_angle = deg2rad_fx( p_y_fx ); // Q22 -#ifdef SPLIT_REND_WITH_HEAD_ROT rad_el_angle = L_shl( rad_el_angle, 1 ); // Q23 rad_az_angle = L_shl( rad_az_angle, 1 ); // Q23 -#endif rad_el_angle = L_shr( rad_el_angle, 10 ); // Q13 rad_az_angle = L_shr( rad_az_angle, 10 ); // Q13 diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index 0ce576cb3416b17527a80e46d2df14a1b18ffe39..fc5c263510d659daf4507178a7402fc36b1a1e0d 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -137,7 +137,6 @@ ivas_error ivas_render_config_init_from_rom_fx( move16(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ( *hRenderConfig )->split_rend_config.splitRendBitRate = SPLIT_REND_768k; move32(); ( *hRenderConfig )->split_rend_config.dof = 3; @@ -146,10 +145,8 @@ ivas_error ivas_render_config_init_from_rom_fx( move16(); ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; move16(); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ( *hRenderConfig )->split_rend_config.isar_frame_size_ms = 20; move16(); -#endif ( *hRenderConfig )->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ move16(); ( *hRenderConfig )->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; @@ -158,11 +155,8 @@ ivas_error ivas_render_config_init_from_rom_fx( move32(); ( *hRenderConfig )->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT; move32(); -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ( *hRenderConfig )->split_rend_config.lc3plus_highres = 0; move16(); -#endif -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_rotation_fx.c b/lib_rend/ivas_rotation_fx.c index 154dab32191fcc00f24e6d3f526dbb1cfc0438a0..2fe95f151c0f9723633bd07ff935ceecdb2f19f6 100644 --- a/lib_rend/ivas_rotation_fx.c +++ b/lib_rend/ivas_rotation_fx.c @@ -87,9 +87,7 @@ Word16 square_root30_q12[31] = { static ivas_error combine_external_and_head_orientations( IVAS_QUATERNION *headRotQuaternions, IVAS_VECTOR3 *listenerPos, -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis, /* i : split rend pose prediction axis*/ -#endif EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData ); static void external_target_interpolation_fx( @@ -143,10 +141,8 @@ ivas_error ivas_headTrack_open_fx( move32(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ( *hHeadTrackData )->sr_pose_pred_axis = DEFAULT_AXIS; move32(); -#endif set32_fx( ( *hHeadTrackData )->chEneIIR_fx[0], 0, MASA_FREQUENCY_BANDS ); set32_fx( ( *hHeadTrackData )->chEneIIR_fx[1], 0, MASA_FREQUENCY_BANDS ); @@ -196,7 +192,6 @@ void QuatToRotMat_fx( ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( quat.w_fx, L_negate( 12582912 ) ) ) { assert( 0 ); @@ -206,7 +201,6 @@ void QuatToRotMat_fx( } else { -#endif Word32 w = quat.w_fx; // Qx move32(); Word32 x = quat.x_fx; @@ -252,9 +246,7 @@ void QuatToRotMat_fx( move32(); Rmat[2][2] = L_add( L_sub( L_sub( ww, xx ), yy ), zz ); move32(); -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif return; } @@ -731,11 +723,7 @@ void rotateFrame_shd( } /* calculate ambisonics rotation matrices for the previous and current frames */ -#ifdef SPLIT_REND_WITH_HEAD_ROT SHrotmatgen_fx( SHrotmat_prev, hCombinedOrientationData->Rmat_prev_fx[0], shd_rot_max_order ); -#else - SHrotmatgen_fx( SHrotmat_prev, hCombinedOrientationData->Rmat_prev_fx, shd_rot_max_order ); -#endif SHrotmatgen_fx( SHrotmat /*Q14*/, hCombinedOrientationData->Rmat_fx[hCombinedOrientationData->subframe_idx], shd_rot_max_order ); FOR( i = 0; i < subframe_len; i++ ) @@ -796,11 +784,7 @@ void rotateFrame_shd( { Copy32( hCombinedOrientationData->Rmat_fx[subframe_idx][i], -#ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->Rmat_prev_fx[0][i], -#else - hCombinedOrientationData->Rmat_prev_fx[i], -#endif 3 ); // Q14 } @@ -899,11 +883,7 @@ void rotateFrame_sd( } /* gains for previous subframe rotation */ -#ifdef SPLIT_REND_WITH_HEAD_ROT rotateAziEle_fx( extract_l( L_shr( hTransSetup.ls_azimuth_fx[ch_in_woLFE], Q22 ) ), extract_l( L_shr( hTransSetup.ls_elevation_fx[ch_in_woLFE], Q22 ) ), &azimuth, &elevation, hCombinedOrientationData->Rmat_prev_fx[0], hTransSetup.is_planar_setup ); -#else - rotateAziEle_fx( extract_l( L_shr( hTransSetup.ls_azimuth_fx[ch_in_woLFE], Q22 ) ), extract_l( L_shr( hTransSetup.ls_elevation_fx[ch_in_woLFE], Q22 ) ), &azimuth, &elevation, hCombinedOrientationData->Rmat_prev_fx, hTransSetup.is_planar_setup ); -#endif test(); test(); IF( hEFAPdata != NULL && ( NE_16( extract_l( L_shr( hTransSetup.ls_azimuth_fx[ch_in_woLFE], Q22 ) ), azimuth ) || NE_16( extract_l( L_shr( hTransSetup.ls_elevation_fx[ch_in_woLFE], Q22 ) ), elevation ) ) ) @@ -997,11 +977,7 @@ void rotateFrame_sd( { Copy32( hCombinedOrientationData->Rmat_fx[hCombinedOrientationData->subframe_idx][i], // Q30 -#ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->Rmat_prev_fx[0][i], -#else - hCombinedOrientationData->Rmat_prev_fx[i], -#endif 3 ); } /* copy to output */ @@ -1345,9 +1321,7 @@ ivas_error ivas_combined_orientation_open( Word16 j; IVAS_QUATERNION identity; IVAS_VECTOR3 origo; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif identity.w_fx = ONE_IN_Q31; move32(); identity.x_fx = 0; @@ -1379,20 +1353,8 @@ ivas_error ivas_combined_orientation_open( move32(); ( *hCombinedOrientationData )->interpolationIncrement_fx = ONE_IN_Q30; // Q30 move32(); -#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION - IF( EQ_16( num_subframes, 1 ) ) - { - ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 2000; - move16(); - } - ELSE - { -#endif - ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; - move16(); -#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION - } -#endif + ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; + move16(); ( *hCombinedOrientationData )->lrSwitchedNext = 0; move16(); ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; @@ -1421,7 +1383,6 @@ ivas_error ivas_combined_orientation_open( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { FOR( j = 0; j < 3; j++ ) @@ -1435,14 +1396,6 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->sr_low_res_flag = 0; move32(); move16(); -#else - FOR( j = 0; j < 3; j++ ) - { - set32_fx( ( *hCombinedOrientationData )->Rmat_prev_fx[j], 0, 3 ); - ( *hCombinedOrientationData )->Rmat_prev_fx[j][j] = ONE_IN_Q30; - move32(); - } -#endif ( *hCombinedOrientationData ) ->Quaternion_prev_extOrientation = identity; @@ -1506,9 +1459,7 @@ ivas_error combine_external_and_head_orientations_dec( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; -#endif IVAS_QUATERNION *pHeadRotQuaternion = NULL; IVAS_VECTOR3 *listenerPos = NULL; @@ -1516,20 +1467,14 @@ ivas_error combine_external_and_head_orientations_dec( { pHeadRotQuaternion = hHeadTrackData->Quaternions; listenerPos = hHeadTrackData->Pos; -#ifdef SPLIT_REND_WITH_HEAD_ROT sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; -#endif } -#ifdef SPLIT_REND_WITH_HEAD_ROT ELSE { sr_pose_pred_axis = DEFAULT_AXIS; } -#endif return combine_external_and_head_orientations( pHeadRotQuaternion, listenerPos, -#ifdef SPLIT_REND_WITH_HEAD_ROT sr_pose_pred_axis, -#endif hExtOrientationData, hCombinedOrientationData ); } @@ -1546,16 +1491,12 @@ ivas_error combine_external_and_head_orientations_rend( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; -#endif IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; Word16 i; -#ifdef SPLIT_REND_WITH_HEAD_ROT sr_pose_pred_axis = DEFAULT_AXIS; -#endif IF( hHeadTrackData != NULL ) { @@ -1564,9 +1505,7 @@ ivas_error combine_external_and_head_orientations_rend( headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; } -#ifdef SPLIT_REND_WITH_HEAD_ROT sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; -#endif } ELSE IF( hExtOrientationData != NULL ) { @@ -1582,9 +1521,7 @@ ivas_error combine_external_and_head_orientations_rend( } return combine_external_and_head_orientations( headRotQuaternions, listenerPos, -#ifdef SPLIT_REND_WITH_HEAD_ROT sr_pose_pred_axis, -#endif hExtOrientationData, hCombinedOrientationData ); } @@ -1596,11 +1533,9 @@ ivas_error combine_external_and_head_orientations_rend( * NOTE that the external orientations are inversed. *------------------------------------------------------------------------*/ ivas_error combine_external_and_head_orientations( - IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ - IVAS_VECTOR3 *listenerPos, /* i : listener position */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis, /* i : split rend pose prediction axis */ -#endif + IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ + IVAS_VECTOR3 *listenerPos, /* i : listener position */ + ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis, /* i : split rend pose prediction axis */ EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) @@ -1949,9 +1884,7 @@ ivas_error combine_external_and_head_orientations( move16(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->sr_pose_pred_axis = sr_pose_pred_axis; -#endif return IVAS_ERR_OK; } @@ -2260,11 +2193,7 @@ static Word32 SHrot_w_fx( IF( m == 0 ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT assert( 0 && "ERROR should not be called\n" ); -#else - printf( "ERROR should not be called\n" ); -#endif return 0; } ELSE @@ -2462,11 +2391,7 @@ void ivas_combined_orientation_update_index( Word16 exp, div_result; IF( hCombinedOrientationData != NULL ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( hCombinedOrientationData->num_subframes, 1 ) || hCombinedOrientationData->sr_low_res_flag ) -#else - IF( EQ_16( hCombinedOrientationData->num_subframes, 1 ) ) -#endif { /* only one orientation available anyway or split rendering with low resolution*/ hCombinedOrientationData->subframe_idx = 0; @@ -2523,11 +2448,7 @@ void ivas_combined_orientation_update_start_index( { IF( hCombinedOrientationData != NULL ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( hCombinedOrientationData->num_subframes, 1 ) || hCombinedOrientationData->sr_low_res_flag ) -#else - IF( EQ_16( hCombinedOrientationData->num_subframes, 1 ) ) -#endif { /* only one orientation available anyway or split rendering with low resolution*/ hCombinedOrientationData->subframe_idx = 0; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c93f62396b5ca9abcdc9e9563b83fd7d9e700c25..fd1945a3f1d28bbb28320d52609d860cd230dc5d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -699,15 +699,9 @@ typedef struct ivas_binaural_rendering_conv_module_struct_fx Word32 ***filterTapsRightReal_fx; Word32 ***filterTapsRightImag_fx; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 ****filterStatesLeftReal_fx; Word32 ****filterStatesLeftImag_fx; Word16 *Q_filterStates; -#else - Word32 ***filterStatesLeftReal_fx; - Word32 ***filterStatesLeftImag_fx; - Word16 Q_filterStatesLeft; -#endif Word16 numTapsArray[BINAURAL_CONVBANDS]; Word16 numTaps; @@ -802,9 +796,7 @@ typedef struct IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_VECTOR3 Pos[MAX_PARAM_SPATIAL_SUBFRAMES]; Word32 crossfade_fx[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; /* Q31 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; -#endif ivas_orient_trk_state_t *hOrientationTracker; } IVAS_REND_HeadRotData; @@ -826,9 +818,7 @@ typedef struct ivas_binaural_head_track_struct Word16 shd_rot_max_order; ivas_orient_trk_state_t *OrientationTracker; -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; -#endif } HEAD_TRACK_DATA, *HEAD_TRACK_DATA_HANDLE; /*----------------------------------------------------------------------------------* @@ -862,21 +852,15 @@ typedef struct ivas_combined_orientation_struct IVAS_QUATERNION Quaternions_ext_interpolation_start; IVAS_QUATERNION Quaternions_ext_interpolation_target; Word32 Rmat_fx[MAX_PARAM_SPATIAL_SUBFRAMES][3][3]; /* Q30 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT Word32 Rmat_prev_fx[MAX_HEAD_ROT_POSES][3][3]; -#else - Word32 Rmat_prev_fx[3][3]; /* Q30 */ -#endif Word32 chEneIIR_fx[2][MASA_FREQUENCY_BANDS]; /* independent of the format. MASA bands are suitable for the task and readily available in ROM. */ /* Q(q_chEneIIR) */ Word16 q_chEneIIR; Word32 procChEneIIR_fx[2][MASA_FREQUENCY_BANDS]; /* Q(q_procChEneIIR) */ Word16 q_procChEneIIR; Word16 shd_rot_max_order; IVAS_VECTOR3 listenerPos[MAX_PARAM_SPATIAL_SUBFRAMES]; -#ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; Word16 sr_low_res_flag; -#endif IVAS_QUATERNION Quaternion_frozen_ext; IVAS_QUATERNION Quaternion_frozen_head; Word8 isExtOrientationFrozen; @@ -1387,18 +1371,13 @@ typedef struct ivas_crend_state_t typedef struct ivas_binaural_crend_wrapper_struct { Word32 binaural_latency_ns; -#ifdef SPLIT_REND_WITH_HEAD_ROT CREND_HANDLE hCrend[MAX_HEAD_ROT_POSES]; -#else - CREND_HANDLE hCrend; -#endif HRTFS_HANDLE hHrtfCrend; Word16 *p_io_qfactor; Word16 io_qfactor; } CREND_WRAPPER, *CREND_WRAPPER_HANDLE; -#ifdef SPLIT_REND_WITH_HEAD_ROT /* Fastconv binaural data structure */ typedef struct ivas_binaural_rendering_struct { @@ -1424,7 +1403,6 @@ typedef struct ivas_binaural_rendering_struct Word16 numPoses; } BINAURAL_RENDERER, *BINAURAL_RENDERER_HANDLE; -#endif /*------------------------------------------------------------------------------------------* * HRTF structures - hrtfs from binary files @@ -1510,7 +1488,6 @@ typedef struct ivas_hrtfs_statistics_struct } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------------------* * CLDFB renderer wrapper @@ -1524,7 +1501,6 @@ typedef struct } CLDFB_REND_WRAPPER; -#endif /*----------------------------------------------------------------------------------* * Limiter structure @@ -1622,11 +1598,7 @@ typedef struct ivas_masa_external_rendering_struct RENDERER_TYPE renderer_type; DIRAC_REND_HANDLE hDirACRend; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; -#ifdef SPLIT_REND_WITH_HEAD_ROT DIRAC_DEC_BIN_HANDLE hDiracDecBin[MAX_HEAD_ROT_POSES]; -#else - DIRAC_DEC_BIN_HANDLE hDiracDecBin; -#endif REVERB_STRUCT_HANDLE hReverb; HRTFS_PARAMBIN_HANDLE *hHrtfParambin; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 9615a170d4a084bdfc4c61ed820f9bf1118a8848..1300d634036878bed59981c0161a7650ffe18dad 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -56,7 +56,6 @@ typedef float IVAS_REND_LfePanMtx[RENDERER_MAX_INPUT_LFE_CHANNELS][IVAS_MAX_OUTPUT_CHANNELS]; typedef Word32 IVAS_REND_LfePanMtx_fx[RENDERER_MAX_INPUT_LFE_CHANNELS][IVAS_MAX_OUTPUT_CHANNELS]; -#ifdef SPLIT_REND_WITH_HEAD_ROT typedef struct { Word32 bufLenInBytes; @@ -65,17 +64,14 @@ typedef struct ISAR_SPLIT_REND_CODEC codec; ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection; Word16 codec_frame_size_ms; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 isar_frame_size_ms; Word16 lc3plus_highres; -#endif } IVAS_REND_BitstreamBufferConfig; typedef struct { IVAS_REND_BitstreamBufferConfig config; UWord8 *bits; } IVAS_REND_BitstreamBuffer; -#endif typedef struct { @@ -268,7 +264,6 @@ Word16 IVAS_REND_FeedRenderConfig( const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ); -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error IVAS_REND_FeedSplitBinauralBitstream( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_REND_InputId inputId, /* i : ID of the input */ @@ -292,20 +287,15 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ Word16 *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , Word16 *pIsar_frame_size_ms /* o: pointer to isar frame size setting */ -#endif ); -#endif ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos, /* i : listener positions for next rendering call */ -#ifdef SPLIT_REND_WITH_HEAD_ROT const ISAR_SPLIT_REND_ROT_AXIS rot_axis, /* i : external control for rotation axis for split rendering*/ -#endif const Word16 sf_idx /* i : subframe index */ ); @@ -340,11 +330,9 @@ ivas_error IVAS_REND_SetReferenceVector( const IVAS_VECTOR3 refPos /* i : Reference position */ ); -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error IVAS_REND_SetSplitRendBFI( IVAS_REND_HANDLE hIvasRend, const Word16 bfi); -#endif ivas_error IVAS_REND_SetExternalOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ @@ -404,7 +392,6 @@ void IVAS_REND_Close( IVAS_REND_HANDLE* phIvasRend /* i/o: Pointer to renderer handle */ ); -#ifdef SPLIT_REND_WITH_HEAD_ROT /* Split binaural rendering functions */ ivas_error IVAS_REND_openCldfb( @@ -437,7 +424,6 @@ void IVAS_REND_cldfbSynthesis_wrapper( IVAS_CLDFB_FILTER_BANK_HANDLE h_cldfb, /* i : filter bank state */ Word16 Q_cldfb, Word16 *Q_out ); -#endif /* Disclaimer and info printing */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 562b35a6abb0b7de45d72271507108cb8a6d8633..2b0f1bdea6b296eacd1b763e0b1f85f3fd02653a 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -95,11 +95,9 @@ typedef struct const LSSETUP_CUSTOM_STRUCT *pCustomLsOut; const EFAP_WRAPPER *pEfapOutWrapper; IVAS_REND_HeadRotData *pHeadRotData; // for now removing the const qualifier TODO: will modify later -#ifdef SPLIT_REND_WITH_HEAD_ROT const RENDER_CONFIG_HANDLE *hhRendererConfig; const Word16 *pSplitRendBFI; const SPLIT_REND_WRAPPER *pSplitRendWrapper; -#endif const COMBINED_ORIENTATION_HANDLE *pCombinedOrientationData; } rendering_context; /* Common base for input structs */ @@ -125,9 +123,7 @@ typedef struct rotation_matrix_fx rot_mat_prev_fx; pan_vector prev_pan_gains; Word8 firstFrameRendered; -#ifdef SPLIT_REND_WITH_HEAD_ROT TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ -#endif Word32 *bufferData_fx; Word16 nonDiegeticPan; Word32 nonDiegeticPanGain_fx; /* Q31 */ @@ -160,15 +156,9 @@ typedef struct EFAP_WRAPPER efapInWrapper; TDREND_WRAPPER tdRendWrapper; CREND_WRAPPER_HANDLE crendWrapper; -#ifdef SPLIT_REND_WITH_HEAD_ROT TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ -#endif REVERB_HANDLE hReverb; -#ifdef SPLIT_REND_WITH_HEAD_ROT rotation_gains_Word32 rot_gains_prev_fx[MAX_HEAD_ROT_POSES]; -#else - rotation_gains_Word32 rot_gains_prev_fx; -#endif Word16 nonDiegeticPan; Word32 nonDiegeticPanGain_fx; lfe_routing lfeRouting; @@ -182,15 +172,9 @@ typedef struct input_base base; // pan_matrix hoaDecMtx; pan_matrix_fx hoaDecMtx_fx; -#ifdef SPLIT_REND_WITH_HEAD_ROT CLDFB_REND_WRAPPER cldfbRendWrapper; -#endif CREND_WRAPPER_HANDLE crendWrapper; -#ifdef SPLIT_REND_WITH_HEAD_ROT rotation_gains_fx rot_gains_prev_fx[MAX_HEAD_ROT_POSES]; -#else - rotation_gains_fx rot_gains_prev_fx; -#endif Word32 *bufferData_fx; DIRAC_ANA_HANDLE hDirAC; } input_sba; @@ -232,14 +216,10 @@ struct IVAS_REND EFAP_WRAPPER efapOutWrapper; IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; -#ifdef SPLIT_REND_WITH_HEAD_ROT SPLIT_REND_WRAPPER splitRendWrapper; IVAS_REND_AudioBuffer splitRendEncBuffer; -#endif IVAS_REND_HeadRotData headRotData; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 splitRendBFI; -#endif EXTERNAL_ORIENTATION_HANDLE hExternalOrientationData; COMBINED_ORIENTATION_HANDLE hCombinedOrientationData; @@ -265,7 +245,6 @@ static void intermidiate_ext_dirac_render( MASA_EXT_REND_HANDLE hMasaExtRend, /* i/o: MASA renderer structure */ Word16 to_fix ); -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput, Word32 Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -278,7 +257,6 @@ static ivas_error renderSbaToMultiBinaural( input_sba *sbaInput, const AUDIO_CONFIG outConfig, Word32 out[][L_FRAME48k] ); -#endif /*-------------------------------------------------------------------* * Local functions @@ -359,7 +337,6 @@ static Word32 *getSmplPtr_fx( return buffer.data_fx + chnlIdx * buffer.config.numSamplesPerChannel + smplIdx; } -#ifdef SPLIT_REND_WITH_HEAD_ROT static void convertBitsBufferToInternalBitsBuff( const IVAS_REND_BitstreamBuffer outBits, ISAR_SPLIT_REND_BITS_HANDLE hBits ) @@ -461,7 +438,6 @@ static void accumulateCLDFBArrayToBuffer_fx( return; } -#endif static void copyBufferTo2dArray_fx( const IVAS_REND_AudioBuffer buffer, @@ -471,9 +447,7 @@ static void copyBufferTo2dArray_fx( UWord32 chnlIdx; const Word32 *readPtr; -#ifdef SPLIT_REND_WITH_HEAD_ROT assert( ( buffer.config.is_cldfb == 0 ) && "for CLDFB input call copyBufferToCLDFBarray()" ); -#endif readPtr = buffer.data_fx; @@ -583,10 +557,8 @@ static ivas_error validateOutputAudioConfig( case IVAS_AUDIO_CONFIG_HOA2: case IVAS_AUDIO_CONFIG_HOA3: case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: case IVAS_AUDIO_CONFIG_MASA1: @@ -663,35 +635,33 @@ IVAS_REND_AudioConfigType getAudioConfigType( static ivas_error validateOutputSampleRate( const Word32 sampleRate, - const AUDIO_CONFIG outConfig ){ + const AUDIO_CONFIG outConfig ) +{ - IF( NE_32( getAudioConfigType( outConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ){ + IF( NE_32( getAudioConfigType( outConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) + { /* If no binaural rendering, any sampling rate is supported */ return IVAS_ERR_OK; -} -#ifdef SPLIT_REND_WITH_HEAD_ROT -ELSE IF( ( EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && NE_32( sampleRate, 48000 ) ) -{ - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); -} -ELSE -{ -#endif - - /* Otherwise rendering to binaural, support the same set as IVAS decoder */ - SWITCH( sampleRate ) + } + ELSE IF( ( EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && NE_32( sampleRate, 48000 ) ) { - case 8000: - case 16000: - case 32000: - case 48000: - return IVAS_ERR_OK; + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); } + ELSE + { - return IVAS_ERR_INVALID_SAMPLING_RATE; -#ifdef SPLIT_REND_WITH_HEAD_ROT -} -#endif + /* Otherwise rendering to binaural, support the same set as IVAS decoder */ + SWITCH( sampleRate ) + { + case 8000: + case 16000: + case 32000: + case 48000: + return IVAS_ERR_OK; + } + + return IVAS_ERR_INVALID_SAMPLING_RATE; + } } /*-------------------------------------------------------------------* * getAudioConfigNumChannels() @@ -713,10 +683,8 @@ ivas_error getAudioConfigNumChannels( BREAK; case IVAS_AUDIO_CONFIG_STEREO: case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: case IVAS_AUDIO_CONFIG_MASA2: @@ -1226,10 +1194,8 @@ static ivas_error initHeadRotation_fx( hIvasRend->headRotData.headPositions[i] = quaternionInit_fx(); } -#ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->headRotData.sr_pose_pred_axis = DEFAULT_AXIS; move32(); -#endif IF( ( hIvasRend->headRotData.hOrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) { @@ -1381,11 +1347,9 @@ static rendering_context getRendCtx( ctx.pCustomLsOut = &hIvasRend->customLsOut; ctx.pEfapOutWrapper = &hIvasRend->efapOutWrapper; ctx.pHeadRotData = &hIvasRend->headRotData; -#ifdef SPLIT_REND_WITH_HEAD_ROT ctx.hhRendererConfig = &hIvasRend->hRendererConfig; ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; ctx.pSplitRendWrapper = &hIvasRend->splitRendWrapper; -#endif ctx.pCombinedOrientationData = &hIvasRend->hCombinedOrientationData; return ctx; @@ -1433,11 +1397,7 @@ static ivas_error initIsmMasaRendering( ivas_td_binaural_close_fx( &inputIsm->tdRendWrapper.hBinRendererTd ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &inputIsm->crendWrapper ); -#endif ivas_reverb_close( &inputIsm->hReverb ); IF( NE_32( ( error = ivas_omasa_ana_open( &inputIsm->hOMasa, inSampleRate, inputIsm->total_num_objects ) ), IVAS_ERR_OK ) ) @@ -1460,9 +1420,7 @@ static ivas_error setRendInputActiveIsm( rendering_context rendCtx; AUDIO_CONFIG outConfig; input_ism *inputIsm; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 i; -#endif Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; Word16 num_src; Word16 ivas_format; @@ -1504,12 +1462,10 @@ static ivas_error setRendInputActiveIsm( set_zero_fx( inputIsm->prev_pan_gains_fx, MAX_OUTPUT_CHANNELS ); -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { inputIsm->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; } -#endif inputIsm->hOMasa = NULL; @@ -1519,24 +1475,10 @@ static ivas_error setRendInputActiveIsm( inputIsm->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT test(); test(); IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) -#endif { -#ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - IF( NE_32( ( 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( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif - { - return error; - } -#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) { return error; @@ -1594,7 +1536,6 @@ static ivas_error setRendInputActiveIsm( } } } -#endif } ELSE IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_MASA1 ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_MASA2 ) ) { @@ -1605,48 +1546,6 @@ static ivas_error setRendInputActiveIsm( } ELSE { -#ifndef SPLIT_REND_WITH_HEAD_ROT - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) - { - return error; - } - Word16 nchan_rend = num_src; - move16(); - - test(); - IF( EQ_16( ivas_format, MC_FORMAT ) && NE_32( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_rend = sub( nchan_rend, 1 ); /* Skip LFE channel -- added to the others */ - } - - FOR( Word16 nS = 0; nS < nchan_rend; nS++ ) - { - TDREND_SRC_t *Src_p = inputIsm->tdRendWrapper.hBinRendererTd->Sources[SrcInd[nS]]; - IF( Src_p != NULL ) - { - IF( Src_p->SrcSpatial_p != NULL ) - { - Src_p->SrcSpatial_p->q_Pos_p = Q31; - move16(); - } - TDREND_SRC_SPATIAL_t *SrcSpatial_p = inputIsm->tdRendWrapper.hBinRendererTd->Sources[nS]->SrcSpatial_p; - SrcSpatial_p->q_Pos_p = Q31; - move16(); - } - } - - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) - { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - IF( NE_32( ( error = ivas_reverb_open_fx( &( inputIsm->hReverb ), hrtfs->hHrtfStatistics, hRendCfg, *rendCtx.pOutSampleRate ) ) IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_reverb_open_fx( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, hRendCfg, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif - { - return error; - } - } -#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) { return error; @@ -1699,7 +1598,6 @@ static ivas_error setRendInputActiveIsm( return error; } } -#endif } return IVAS_ERR_OK; @@ -1709,9 +1607,7 @@ static void clearInputIsm( input_ism *inputIsm ) { rendering_context rendCtx; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t i; -#endif rendCtx = inputIsm->base.ctx; @@ -1720,11 +1616,7 @@ static void clearInputIsm( initRendInputBase_fx( &inputIsm->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &inputIsm->crendWrapper ); -#endif ivas_reverb_close( &inputIsm->hReverb ); @@ -1733,12 +1625,10 @@ static void clearInputIsm( ivas_td_binaural_close_fx( &inputIsm->tdRendWrapper.hBinRendererTd ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { ivas_td_binaural_close_fx( &inputIsm->splitTdRendWrappers[i].hBinRendererTd ); } -#endif ivas_omasa_ana_close( &( inputIsm->hOMasa ) ); @@ -2468,10 +2358,8 @@ static ivas_error updateMcPanGains( SWITCH( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif BREAK; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: @@ -2525,9 +2413,7 @@ static ivas_error initMcBinauralRendering( Word32 binauralDelayNs; Word32 outSampleRate; Word8 useTDRend; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t i; -#endif /* Allocate TD binaural renderer for custom loudspeaker layouts (regardless of headrotation) or planar MC layouts with headrotation, CREND for the rest */ @@ -2558,7 +2444,6 @@ static ivas_error initMcBinauralRendering( ivas_td_binaural_close_fx( &inputMc->tdRendWrapper.hBinRendererTd ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( !reconfigureFlag || !useTDRend ) { FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) @@ -2569,16 +2454,11 @@ static ivas_error initMcBinauralRendering( } } } -#endif /* if we need to use TD renderer and CREND was open, close it */ IF( useTDRend ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &inputMc->crendWrapper ); -#endif } test(); @@ -2638,7 +2518,6 @@ static ivas_error initMcBinauralRendering( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { /* Open TD renderer wrappers */ @@ -2673,7 +2552,6 @@ static ivas_error initMcBinauralRendering( } } -#endif test(); IF( EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && inputMc->hReverb == NULL ) @@ -2691,7 +2569,6 @@ static ivas_error initMcBinauralRendering( ELSE IF( !useTDRend && inputMc->crendWrapper == NULL ) { /* open CREND */ -#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( 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 ) ), @@ -2701,16 +2578,6 @@ static ivas_error initMcBinauralRendering( 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( NE_32( ( 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( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( EQ_16( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - hMixconv, - outSampleRate ) ), - IVAS_ERR_OK ) ) -#endif #endif { return error; @@ -2769,11 +2636,7 @@ static ivas_error initMcMasaRendering( ivas_td_binaural_close_fx( &inputMc->tdRendWrapper.hBinRendererTd ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &inputMc->crendWrapper ); -#endif ivas_reverb_close( &inputMc->hReverb ); @@ -2860,16 +2723,12 @@ static ivas_error setRendInputActiveMc( RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 i; -#endif ivas_error error; rendering_context rendCtx; AUDIO_CONFIG outConfig; input_mc *inputMc; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pos_idx; -#endif inputMc = (input_mc *) input; rendCtx = inputMc->base.ctx; @@ -2902,14 +2761,10 @@ static ivas_error setRendInputActiveMc( inputMc->hReverb = NULL; inputMc->hMcMasa = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { initRotGainsWord32_fx( inputMc->rot_gains_prev_fx[pos_idx] ); } -#else - initRotGainsWord32_fx( inputMc->rot_gains_prev_fx ); -#endif inputMc->lfeRouting = defaultLfeRouting( inConfig, inputMc->customLsInput, outConfig, *inputMc->base.ctx.pCustomLsOut ); set32_fx( inputMc->lfeDelayBuffer_fx, 0, MAX_BIN_DELAY_SAMPLES ); inputMc->binauralDelaySmp = 0; @@ -2917,7 +2772,6 @@ static ivas_error setRendInputActiveMc( test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { if ( hrtfs->hHrtfTD ) @@ -2928,9 +2782,6 @@ static ivas_error setRendInputActiveMc( } IF( EQ_32( getAudioConfigType( outConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) -#else - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES @@ -2963,9 +2814,7 @@ static void clearInputMc( input_mc *inputMc ) { rendering_context rendCtx; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 i; -#endif rendCtx = inputMc->base.ctx; freeMcLfeDelayBuffer_fx( &inputMc->lfeDelayBuffer_fx ); @@ -2978,11 +2827,7 @@ static void clearInputMc( efap_free_data_fx( &inputMc->efapInWrapper.hEfap ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &inputMc->crendWrapper ); -#endif ivas_reverb_close( &inputMc->hReverb ); @@ -2991,7 +2836,6 @@ static void clearInputMc( ivas_td_binaural_close_fx( &inputMc->tdRendWrapper.hBinRendererTd ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { IF( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) @@ -3000,7 +2844,6 @@ static void clearInputMc( inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; } } -#endif ivas_mcmasa_ana_close( &( inputMc->hMcMasa ) ); @@ -3129,7 +2972,6 @@ static ivas_error updateSbaPanGains( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: SWITCH( outConfig ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: { @@ -3153,10 +2995,8 @@ static ivas_error updateSbaPanGains( } break; } -#endif case IVAS_AUDIO_CONFIG_BINAURAL: { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( hRendCfg->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, @@ -3166,20 +3006,11 @@ static ivas_error updateSbaPanGains( } } else -#endif { -#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( 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( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif #endif { return error; @@ -3193,18 +3024,10 @@ static ivas_error updateSbaPanGains( { return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( 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( NE_32( ( 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( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif #endif { return error; @@ -3237,11 +3060,7 @@ static ivas_error initSbaMasaRendering( { ivas_error error; -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); -#else - ivas_rend_closeCrend( &inputSba->crendWrapper ); -#endif IF( NE_32( ( error = ivas_dirac_ana_open_fx( &inputSba->hDirAC, inSampleRate ) ), IVAS_ERR_OK ) ) { @@ -3264,9 +3083,7 @@ static ivas_error setRendInputActiveSba( rendering_context rendCtx; AUDIO_CONFIG outConfig; input_sba *inputSba; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; -#endif inputSba = (input_sba *) input; rendCtx = inputSba->base.ctx; @@ -3278,37 +3095,22 @@ static ivas_error setRendInputActiveSba( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = allocateInputBaseBufferData_fx( &inputSba->bufferData_fx, MAX_CLDFB_BUFFER_LENGTH ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = allocateInputBaseBufferData_fx( &inputSba->bufferData_fx, MAX_BUFFER_LENGTH ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT initRendInputBase_fx( &inputSba->base, inConfig, id, rendCtx, inputSba->bufferData_fx, MAX_CLDFB_BUFFER_LENGTH ); -#else - initRendInputBase_fx( &inputSba->base, inConfig, id, rendCtx, inputSba->bufferData_fx, MAX_BUFFER_LENGTH ); -#endif setZeroPanMatrix_fx( inputSba->hoaDecMtx_fx ); inputSba->crendWrapper = NULL; inputSba->hDirAC = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { initRotGains_fx( inputSba->rot_gains_prev_fx[pos_idx] ); } inputSba->cldfbRendWrapper.hHrtfFastConv = hrtfs->hHrtfFastConv; -#else - initRotGains_fx( inputSba->rot_gains_prev_fx ); -#endif test(); IF( EQ_32( outConfig, IVAS_AUDIO_CONFIG_MASA1 ) || EQ_32( outConfig, IVAS_AUDIO_CONFIG_MASA2 ) ) @@ -3340,17 +3142,12 @@ static void clearInputSba( initRendInputBase_fx( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ); IF( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) { ivas_rend_closeCldfbRend( &inputSba->cldfbRendWrapper ); } -#else - /* Free input's internal handles */ - ivas_rend_closeCrend( &inputSba->crendWrapper ); -#endif ivas_dirac_ana_close_fx( &( inputSba->hDirAC ) ); @@ -3470,9 +3267,7 @@ ivas_error IVAS_REND_Open( const Word16 num_subframes ) { Word16 i; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 j; -#endif IVAS_REND_HANDLE hIvasRend; ivas_error error; Word16 numOutChannels; @@ -3542,10 +3337,8 @@ ivas_error IVAS_REND_Open( } /* Initialize inputs */ -#ifdef SPLIT_REND_WITH_HEAD_ROT isar_init_split_rend_handles( &hIvasRend->splitRendWrapper ); hIvasRend->splitRendEncBuffer.data_fx = NULL; -#endif FOR( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { @@ -3553,13 +3346,11 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( j = 0; j < MAX_HEAD_ROT_POSES - 1; ++j ) { hIvasRend->inputsIsm[i].splitTdRendWrappers[j].hBinRendererTd = NULL; hIvasRend->inputsIsm[i].splitTdRendWrappers[j].hHrtfTD = NULL; } -#endif hIvasRend->inputsIsm[i].nonDiegeticPan = nonDiegeticPan; move16(); hIvasRend->inputsIsm[i].nonDiegeticPanGain_fx = nonDiegeticPanGain; @@ -3583,13 +3374,11 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsMc[i].nonDiegeticPanGain_fx = nonDiegeticPanGain; move32(); hIvasRend->inputsMc[i].hMcMasa = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT FOR( j = 0; j < MAX_HEAD_ROT_POSES - 1; ++j ) { hIvasRend->inputsMc[i].splitTdRendWrappers[j].hBinRendererTd = NULL; hIvasRend->inputsMc[i].splitTdRendWrappers[j].hHrtfTD = NULL; } -#endif } FOR( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) @@ -3597,10 +3386,8 @@ ivas_error IVAS_REND_Open( initRendInputBase_fx( &hIvasRend->inputsSba[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsSba[i].crendWrapper = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL; hIvasRend->inputsSba[i].cldfbRendWrapper.hHrtfFastConv = NULL; -#endif hIvasRend->inputsSba[i].bufferData_fx = NULL; hIvasRend->inputsSba[i].hDirAC = NULL; } @@ -4039,7 +3826,6 @@ static ivas_error findFreeInputSlot_fx( } -#ifdef SPLIT_REND_WITH_HEAD_ROT static Word16 getCldfbRendFlag( IVAS_REND_HANDLE hIvasRend, /* i : Renderer handle */ const IVAS_REND_AudioConfigType new_configType ) @@ -4168,8 +3954,6 @@ static ivas_error ivas_pre_rend_init( return IVAS_ERR_OK; } -#endif - /*-------------------------------------------------------------------* * IVAS_REND_AddInput() @@ -4196,7 +3980,6 @@ ivas_error IVAS_REND_AddInput_fx( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( ( EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && hIvasRend->splitRendEncBuffer.data_fx == NULL && hIvasRend->hRendererConfig != NULL ) { Word16 cldfb_in_flag; @@ -4207,7 +3990,6 @@ ivas_error IVAS_REND_AddInput_fx( return error; } } -#endif SWITCH( getAudioConfigType( inConfig ) ) @@ -4317,11 +4099,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( test(); test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) -#else - IF( EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) @@ -4667,7 +4445,6 @@ ivas_error IVAS_REND_GetDelay_fx( { IF( NE_32( hIvasRend->inputsSba[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL ) { if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) @@ -4687,7 +4464,6 @@ ivas_error IVAS_REND_GetDelay_fx( max_latency_ns = max( max_latency_ns, latency_ns ); } else -#endif { IF( hIvasRend->inputsSba[i].crendWrapper != NULL ) { @@ -4738,9 +4514,7 @@ ivas_error IVAS_REND_FeedInputAudio_fx( ivas_error error; input_base *inputBase; Word16 numInputChannels; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 cldfb2tdShift; -#endif /* Validate function arguments */ test(); @@ -4750,14 +4524,10 @@ ivas_error IVAS_REND_FeedInputAudio_fx( } test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT cldfb2tdShift = ( inputAudio.config.is_cldfb ) ? 1 : 0; IF( inputAudio.config.numSamplesPerChannel <= 0 || ( MAX_BUFFER_LENGTH_PER_CHANNEL < inputAudio.config.numSamplesPerChannel && inputAudio.config.is_cldfb == 0 ) || ( ( shl( MAX_BUFFER_LENGTH_PER_CHANNEL, cldfb2tdShift ) ) < inputAudio.config.numSamplesPerChannel && inputAudio.config.is_cldfb == 1 ) ) -#else - IF( inputAudio.config.numSamplesPerChannel <= 0 || LT_16( MAX_BUFFER_LENGTH_PER_CHANNEL, inputAudio.config.numSamplesPerChannel ) ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Buffer size outside of supported range" ); } @@ -4770,15 +4540,10 @@ ivas_error IVAS_REND_FeedInputAudio_fx( test(); move32(); // move added for typecasting -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && NE_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && NE_32( L_shr( L_mult0( inputAudio.config.numSamplesPerChannel, 1000 ), cldfb2tdShift ), (Word32) W_mult0_32_32( L_mult0( BINAURAL_RENDERING_FRAME_SIZE_MS, hIvasRend->num_subframes ), hIvasRend->sampleRateOut ) ) ) -#else - IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && - NE_32( L_mult0( inputAudio.config.numSamplesPerChannel, 1000 ), (Word32) W_mult0_32_32( L_mult0( BINAURAL_RENDERING_FRAME_SIZE_MS, hIvasRend->num_subframes ), hIvasRend->sampleRateOut ) ) ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Binaural rendering requires specific frame size" ); } @@ -4809,11 +4574,7 @@ ivas_error IVAS_REND_FeedInputAudio_fx( MVR2R_WORD32( inputAudio.data_fx, inputBase->inputBuffer.data_fx, inputAudio.config.numSamplesPerChannel * inputAudio.config.numChannels ); -#ifdef SPLIT_REND_WITH_HEAD_ROT inputBase->numNewSamplesPerChannel = shr( inputAudio.config.numSamplesPerChannel, cldfb2tdShift ); -#else - inputBase->numNewSamplesPerChannel = inputAudio.config.numSamplesPerChannel; -#endif move32(); return IVAS_ERR_OK; @@ -5009,22 +4770,16 @@ Word16 IVAS_REND_GetRenderConfig( Copy32( hRCin->roomAcoustics.pAcoustic_rt60_fx, hRCout->roomAcoustics.pAcoustic_rt60_fx, CLDFB_NO_CHANNELS_MAX ); Copy32( hRCin->roomAcoustics.pAcoustic_dsr_fx, hRCout->roomAcoustics.pAcoustic_dsr_fx, CLDFB_NO_CHANNELS_MAX ); -#ifdef SPLIT_REND_WITH_HEAD_ROT hRCout->split_rend_config.splitRendBitRate = SPLIT_REND_768k; hRCout->split_rend_config.dof = 3; hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hRCout->split_rend_config.isar_frame_size_ms = 20; -#endif hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; hRCout->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; hRCout->split_rend_config.rendererSelection = hRCin->split_rend_config.rendererSelection; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hRCout->split_rend_config.lc3plus_highres = 0; -#endif -#endif hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; @@ -5048,9 +4803,7 @@ Word16 IVAS_REND_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error error; -#endif test(); IF( hIvasRend == NULL || hIvasRend->hRendererConfig == NULL ) @@ -5086,7 +4839,6 @@ Word16 IVAS_REND_FeedRenderConfig( Copy32( renderConfig.roomAcoustics.AbsCoeff_fx, hRenderConfig->roomAcoustics.AbsCoeff_fx, IVAS_ROOM_ABS_COEFF ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT hRenderConfig->split_rend_config = renderConfig.split_rend_config; /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ IF( EQ_16( hRenderConfig->split_rend_config.dof, 0 ) ) @@ -5114,7 +4866,6 @@ Word16 IVAS_REND_FeedRenderConfig( return error; } } -#endif return IVAS_ERR_OK; } @@ -5125,13 +4876,11 @@ Word16 IVAS_REND_FeedRenderConfig( * *-------------------------------------------------------------------*/ ivas_error IVAS_REND_SetHeadRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ - const IVAS_VECTOR3 Pos, /* i : listener positions for next rendering call */ -#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ + const IVAS_VECTOR3 Pos, /* i : listener positions for next rendering call */ const ISAR_SPLIT_REND_ROT_AXIS rot_axis, /* i : external control for rotation axis for split rendering */ -#endif - const Word16 sf_idx /* i : subframe index */ + const Word16 sf_idx /* i : subframe index */ ) { Word16 i; @@ -5169,20 +4918,12 @@ ivas_error IVAS_REND_SetHeadRotation( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* check for Euler angle signaling */ IF( EQ_32( headRot.w_fx, L_negate( 12582912 ) ) && EQ_16( headRot.q_fact, Q22 ) ) { Euler2Quat_fx( deg2rad_fx( headRot.x_fx ), deg2rad_fx( headRot.y_fx ), deg2rad_fx( headRot.z_fx ), &rotQuat ); modify_Quat_q_fx( &rotQuat, &rotQuat, Q29 ); } -#else - /* check for Euler angle signaling */ - IF( EQ_32( headRot.w_fx, -1610612736 /* -3.0f in Q29 */ ) ) - { - Euler2Quat_fx( deg2rad_fx( headRot.x_fx ), deg2rad_fx( headRot.y_fx ), deg2rad_fx( headRot.z_fx ), &rotQuat ); - } -#endif ELSE { rotQuat = headRot; @@ -5229,9 +4970,7 @@ ivas_error IVAS_REND_SetHeadRotation( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->headRotData.sr_pose_pred_axis = rot_axis; -#endif hIvasRend->headRotData.Pos[sf_idx] = Pos; @@ -5282,7 +5021,6 @@ ivas_error IVAS_REND_DisableHeadRotation( return IVAS_ERR_OK; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------* * IVAS_REND_SetSplitRendBFI() * @@ -5298,7 +5036,6 @@ IVAS_REND_SetSplitRendBFI( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -6004,7 +5741,6 @@ static Word16 getNumSubframesInBuffer( const IVAS_REND_AudioBuffer *buffer, const Word32 sampleRate ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 cldfb2tdShift; cldfb2tdShift = buffer->config.is_cldfb ? 1 : 0; @@ -6013,11 +5749,6 @@ static Word16 getNumSubframesInBuffer( temp = BASOP_Util_Divide1616_Scale( buffer->config.numSamplesPerChannel, temp, &scale ); temp = shr( temp, sub( 15, scale ) ); /* Q0 */ temp = shr( temp, cldfb2tdShift ); -#else - Word16 scale, temp = extract_l( Mpy_32_32( sampleRate, 10737418 /* 1 / FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES in Q31 */ ) ); - temp = BASOP_Util_Divide1616_Scale( buffer->config.numSamplesPerChannel, temp, &scale ); - temp = shr( temp, sub( 15, scale ) ); /* Q0 */ -#endif return temp; } @@ -6194,11 +5925,7 @@ static ivas_error renderIsmToBinauralRoom( } // Crend_process porting CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = ismInput->crendWrapper->hCrend[0]; -#else - hCrend = ismInput->crendWrapper->hCrend; -#endif IF( hCrend->reflections != NULL ) { test(); @@ -6214,13 +5941,8 @@ static ivas_error renderIsmToBinauralRoom( move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT /* render 7_1_4 with BRIRs */ IF( NE_32( ( error = ivas_rend_crendProcessSubframe( ismInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, ismInput->base.inputBuffer.config.numSamplesPerChannel, *ismInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) -#else - /* render 7_1_4 with BRIRs */ - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( ismInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, ismInput->base.inputBuffer.config.numSamplesPerChannel, *ismInput->base.ctx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -6508,7 +6230,6 @@ static ivas_error renderIsmToSba( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error renderIsmToSplitBinaural( input_ism *ismInput, const IVAS_REND_AudioBuffer outAudio ) @@ -6631,7 +6352,6 @@ static ivas_error renderIsmToSplitBinaural( /* Encoding to split rendering bitstream done at a higher level */ return IVAS_ERR_OK; } -#endif static void renderIsmToMasa( @@ -6745,12 +6465,10 @@ static ivas_error renderInputIsm( case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio, &exp ); BREAK; -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderIsmToSplitBinaural( ismInput, outAudio ); break; -#endif case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderIsmToBinauralReverb( ismInput, outAudio ); BREAK; @@ -6821,17 +6539,13 @@ static ivas_error renderActiveInputsIsm( static ivas_error renderLfeToBinaural_fx( const input_mc *mcInput, -#ifdef SPLIT_REND_WITH_HEAD_ROT const AUDIO_CONFIG outConfig, -#endif IVAS_REND_AudioBuffer outAudio, Word16 in_q, Word16 out_q ) { Word16 lfe_idx; -#ifdef SPLIT_REND_WITH_HEAD_ROT Word16 pose_idx, num_poses; -#endif Word32 gain_fx; Word16 ear_idx, i, r_shift; Word32 tmpLfeBuffer[MAX_BUFFER_LENGTH_PER_CHANNEL]; @@ -6839,11 +6553,7 @@ static ivas_error renderLfeToBinaural_fx( const Word32 *lfeInput; Word32 *writePtr; -#ifdef SPLIT_REND_WITH_HEAD_ROT assert( ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && "Must be binaural output" ); -#else - assert( ( outAudio.config.numChannels == 2 ) && "Must be binaural output" ); -#endif push_wmops( "renderLfeToBinaural" ); gain_fx = GAIN_LFE_WORD32; /* 1.88364911f in Q30 */ @@ -6895,7 +6605,6 @@ static ivas_error renderLfeToBinaural_fx( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT /* Copy LFE to left and right binaural channels for all poses */ IF( mcInput->base.ctx.pSplitRendWrapper != NULL ) { @@ -6916,19 +6625,6 @@ static ivas_error renderLfeToBinaural_fx( v_add_fixed( writePtr, tmpLfeBuffer, writePtr, frame_size, 0 ); /* Q(out_q) */ } } -#else /* SPLIT_REND_WITH_HEAD_ROT */ - /* Copy LFE to left and right ears */ - FOR( ear_idx = 0; ear_idx < BINAURAL_CHANNELS; ++ear_idx ) - { - writePtr = getSmplPtr_fx( outAudio, ear_idx, 0 ); - move32(); -#ifdef VEC_ARITH_OPT_v1 - v_add_fixed_no_hdrm( writePtr, tmpLfeBuffer, writePtr, frame_size ); /* Q(out_q) */ -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( writePtr, tmpLfeBuffer, writePtr, frame_size, 0 ); /* Q(out_q) */ -#endif /* VEC_ARITH_OPT_v1 */ - } -#endif pop_wmops(); @@ -7005,11 +6701,7 @@ static ivas_error renderMcToBinaural( tmpRotBuffer.data_fx = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( Word32 ) ); set32_fx( tmpRotBuffer.data_fx, 0, imult1616( tmpRotBuffer.config.numSamplesPerChannel, tmpRotBuffer.config.numChannels ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = rotateFrameMc_fx( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev_fx[0], mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = rotateFrameMc_fx( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev_fx, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -7026,18 +6718,10 @@ static ivas_error renderMcToBinaural( } // Porting Crend_process function CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = mcInput->crendWrapper->hCrend[0]; -#else - hCrend = mcInput->crendWrapper->hCrend; -#endif /* call CREND */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer_fx, p_tmpRendBuffer_fx, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer_fx, p_tmpRendBuffer_fx, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -7050,19 +6734,11 @@ static ivas_error renderMcToBinaural( accumulate2dArrayToBuffer_fx( tmpRendBuffer_fx, &outAudio ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = renderLfeToBinaural_fx( mcInput, outConfig, outAudio, *outAudio.pq_fact, exp ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_32( ( error = renderLfeToBinaural_fx( mcInput, outAudio, *outAudio.pq_fact, exp ) ), IVAS_ERR_OK ) ) - - { - return error; - } -#endif *outAudio.pq_fact = exp; move16(); pop_wmops(); @@ -7143,17 +6819,10 @@ static ivas_error renderMcToBinauralRoom( tmpRotBuffer.data_fx = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( Word32 ) ); set32_fx( tmpRotBuffer.data_fx, 0, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = rotateFrameMc_fx( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev_fx[0], mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = rotateFrameMc_fx( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, - mcInput->rot_gains_prev_fx, - mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -7169,18 +6838,10 @@ static ivas_error renderMcToBinauralRoom( } // Porting Crend_process function CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = mcInput->crendWrapper->hCrend[0]; -#else - hCrend = mcInput->crendWrapper->hCrend; -#endif /* call CREND */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpRendBuffer, p_tmpRendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -7193,11 +6854,7 @@ static ivas_error renderMcToBinauralRoom( accumulate2dArrayToBuffer_fx( tmpRendBuffer, &outAudio ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = renderLfeToBinaural_fx( mcInput, outConfig, outAudio, *outAudio.pq_fact, exp ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = renderLfeToBinaural_fx( mcInput, outAudio, *outAudio.pq_fact, exp ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -7255,17 +6912,10 @@ static ivas_error renderMcCustomLsToBinauralRoom( tmpRotBuffer.data_fx = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( Word32 ) ); set32_fx( tmpRotBuffer.data_fx, 0, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = rotateFrameMc_fx( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev_fx[0], mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = rotateFrameMc_fx( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, - mcInput->rot_gains_prev_fx, - mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -7300,18 +6950,10 @@ static ivas_error renderMcCustomLsToBinauralRoom( copyBufferTo2dArray_fx( tmpMcBuffer, tmpCrendBuffer ); CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = mcInput->crendWrapper->hCrend[0]; -#else - hCrend = mcInput->crendWrapper->hCrend; -#endif /* call CREND */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( mcInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, mcInput->base.inputBuffer.config.numSamplesPerChannel, *mcInput->base.ctx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -7323,11 +6965,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( accumulate2dArrayToBuffer_fx( tmpCrendBuffer, &outAudio ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = renderLfeToBinaural_fx( mcInput, outConfig, outAudio, *outAudio.pq_fact, exp ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = renderLfeToBinaural_fx( mcInput, outAudio, *outAudio.pq_fact, exp ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -7392,7 +7030,6 @@ static void renderMcToMasa( return; } -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error renderMcToSplitBinaural( input_mc *mcInput, const AUDIO_CONFIG outConfig, @@ -7532,11 +7169,7 @@ static ivas_error renderMcToSplitBinaural( } ELSE { -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = mcInput->crendWrapper->hCrend[0]; -#else - hCrend = mcInput->crendWrapper->hCrend; -#endif /* crend processing overview: * 1. rotateFrameMc: inputBuffer to tmpRotBuffer * 2. crend_process: tmpRotBuffer to tmpRendBuffer @@ -7605,7 +7238,6 @@ static ivas_error renderMcToSplitBinaural( pop_wmops(); return IVAS_ERR_OK; } -#endif static ivas_error renderInputMc( @@ -7657,12 +7289,10 @@ static ivas_error renderInputMc( error = renderMcToBinauralRoom( mcInput, outConfig, outAudio ); } BREAK; -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderMcToSplitBinaural( mcInput, outConfig, outAudio ); break; -#endif default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; } @@ -7740,8 +7370,6 @@ static void renderSbaToSba( } -#ifdef SPLIT_REND_WITH_HEAD_ROT - static ivas_error renderSbaToMultiBinaural( input_sba *sbaInput, const AUDIO_CONFIG outConfig, @@ -7925,7 +7553,6 @@ static ivas_error renderSbaToSplitBinaural( pop_wmops(); return error; } -#endif static ivas_error renderSbaToBinaural( input_sba *sbaInput, @@ -7943,7 +7570,6 @@ static ivas_error renderSbaToBinaural( push_wmops( "renderSbaToBinaural" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection, ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) ) { Word32 Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -7958,7 +7584,6 @@ static ivas_error renderSbaToBinaural( accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, &outAudio ); } ELSE -#endif { FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) @@ -7993,21 +7618,12 @@ static ivas_error renderSbaToBinaural( Copy32( sbaInput->base.inputBuffer.data_fx, tmpRotBuffer.data_fx, i_mult( tmpRotBuffer.config.numChannels, tmpRotBuffer.config.numSamplesPerChannel ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_16( ( error = rotateFrameSba_fx( sbaInput->base.inputBuffer, sbaInput->base.inConfig, sbaInput->base.ctx.pHeadRotData, sbaInput->base.ctx.pCombinedOrientationData, sbaInput->rot_gains_prev_fx[0], tmpRotBuffer ) ), IVAS_ERR_OK ) ) { return error; } -#else - IF( NE_16( ( error = rotateFrameSba_fx( sbaInput->base.inputBuffer, sbaInput->base.inConfig, sbaInput->base.ctx.pHeadRotData, - sbaInput->base.ctx.pCombinedOrientationData, sbaInput->rot_gains_prev_fx, tmpRotBuffer ) ), - IVAS_ERR_OK ) ) - { - return error; - } -#endif copyBufferTo2dArray_fx( tmpRotBuffer, output_buffer_fx ); free( tmpRotBuffer.data_fx ); @@ -8018,18 +7634,10 @@ static ivas_error renderSbaToBinaural( } // Porting Crend_process function CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = sbaInput->crendWrapper->hCrend[0]; -#else - hCrend = sbaInput->crendWrapper->hCrend; -#endif /* call CREND */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, output_fx, output_fx, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, NULL, output_fx, output_fx, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -8066,11 +7674,7 @@ static ivas_error renderSbaToBinauralRoom( push_wmops( "renderSbaToBinauralRoom" ); Word16 nchan_out; CREND_HANDLE hCrend; -#ifdef SPLIT_REND_WITH_HEAD_ROT hCrend = sbaInput->crendWrapper->hCrend[0]; -#else - hCrend = sbaInput->crendWrapper->hCrend; -#endif IF( NE_32( ( error = getAudioConfigNumChannels( outConfig, &nchan_out ) ), IVAS_ERR_OK ) ) { @@ -8107,19 +7711,11 @@ static ivas_error renderSbaToBinauralRoom( /* copy input for in-place rotation */ Copy32( sbaInput->base.inputBuffer.data_fx, tmpRotBuffer.data_fx, i_mult( tmpRotBuffer.config.numChannels, tmpRotBuffer.config.numSamplesPerChannel ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = rotateFrameSba_fx( sbaInput->base.inputBuffer, sbaInput->base.inConfig, sbaInput->base.ctx.pHeadRotData, sbaInput->base.ctx.pCombinedOrientationData, sbaInput->rot_gains_prev_fx[0], tmpRotBuffer ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = rotateFrameSba_fx( sbaInput->base.inputBuffer, sbaInput->base.inConfig, sbaInput->base.ctx.pHeadRotData, - sbaInput->base.ctx.pCombinedOrientationData, - sbaInput->rot_gains_prev_fx, - tmpRotBuffer ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -8154,11 +7750,7 @@ static ivas_error renderSbaToBinauralRoom( // Porting Crend_process function /* call CREND */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe( sbaInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, p_tmpCrendBuffer, sbaInput->base.inputBuffer.config.numSamplesPerChannel, *sbaInput->base.ctx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -8201,20 +7793,14 @@ static ivas_error renderInputSba( { ivas_error error; IVAS_REND_AudioBuffer inAudio; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t cldfb2tdShift; -#endif error = IVAS_ERR_OK; move32(); inAudio = sbaInput->base.inputBuffer; -#ifdef SPLIT_REND_WITH_HEAD_ROT cldfb2tdShift = outAudio.config.is_cldfb ? 1 : 0; IF( NE_32( L_shl( sbaInput->base.numNewSamplesPerChannel, cldfb2tdShift ), outAudio.config.numSamplesPerChannel ) && NE_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( NE_32( sbaInput->base.numNewSamplesPerChannel, outAudio.config.numSamplesPerChannel ) ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Mismatch between the number of input samples vs number of requested output samples - currently not allowed" ); } @@ -8241,12 +7827,10 @@ static ivas_error renderInputSba( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: SWITCH( outConfig ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, outConfig, outAudio ); break; -#endif case IVAS_AUDIO_CONFIG_BINAURAL: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); BREAK; @@ -8580,11 +8164,9 @@ static ivas_error renderInputMasa( Word16 maxBin; Word32 *tmpBuffer_fx[MAX_OUTPUT_CHANNELS]; Word32 tmpBuffer_buff_fx[MAX_OUTPUT_CHANNELS][L_FRAME48k]; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t cldfb2tdShift; Word32 Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#endif IF( !masaInput->metadataHasBeenFed ) { @@ -8593,13 +8175,9 @@ static ivas_error renderInputMasa( inAudio = masaInput->base.inputBuffer; -#ifdef SPLIT_REND_WITH_HEAD_ROT cldfb2tdShift = outAudio.config.is_cldfb ? 1 : 0; IF( ( NE_32( L_shl( masaInput->base.numNewSamplesPerChannel, cldfb2tdShift ), outAudio.config.numSamplesPerChannel ) ) && NE_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( NE_32( masaInput->base.numNewSamplesPerChannel, outAudio.config.numSamplesPerChannel ) ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Mismatch between the number of input samples vs number of requested output samples - currently not allowed" ); } @@ -8636,7 +8214,6 @@ static ivas_error renderInputMasa( num_subframes = BASOP_Util_Divide3232_Scale( L_mult0( masaInput->base.inputBuffer.config.numSamplesPerChannel, IVAS_NUM_FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ), *masaInput->base.ctx.pOutSampleRate, &exp ); num_subframes = shr( num_subframes, sub( 15, exp ) ); /* Q0 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) { /* split rendering. use the combined of the first subframe in all subframes */ @@ -8674,7 +8251,6 @@ static ivas_error renderInputMasa( ELSE { /* non-split path */ -#endif SWITCH( masaInput->hMasaExtRend->renderer_type ) { case RENDERER_DIRAC: @@ -8718,11 +8294,7 @@ static ivas_error renderInputMasa( scale_sig32( outAudio.data_fx, i_mult( outAudio.config.numChannels, outAudio.config.numSamplesPerChannel ), sub( Q11, *outAudio.pq_fact ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT ivas_masa_ext_rend_parambin_render_fx( masaInput->hMasaExtRend, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer_fx, num_subframes, NULL, NULL, NULL ); -#else - ivas_masa_ext_rend_parambin_render_fx( masaInput->hMasaExtRend, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer_fx, num_subframes ); -#endif *outAudio.pq_fact = Q11; move16(); BREAK; @@ -8732,9 +8304,7 @@ static ivas_error renderInputMasa( return ( IVAS_ERROR( IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, "Wrong output config for MASA input in external renderer\n" ) ); } accumulate2dArrayToBuffer_fx( tmpBuffer_buff_fx, &outAudio ); -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif } return IVAS_ERR_OK; @@ -8965,20 +8535,14 @@ ivas_error IVAS_REND_SetIsmMetadataDelay( static ivas_error getSamplesInternal( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */, IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/ -#else - IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ -#endif ) { ivas_error error; Word16 numOutChannels; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t cldfb2tdSampleShift; IVAS_REND_AudioBuffer outAudioOrig; -#endif /* Validate function arguments */ test(); IF( hIvasRend == NULL || outAudio.data_fx == NULL ) @@ -8987,14 +8551,10 @@ static ivas_error getSamplesInternal( } test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT cldfb2tdSampleShift = ( outAudio.config.is_cldfb ) ? 1 : 0; IF( outAudio.config.numSamplesPerChannel <= 0 || ( MAX_BUFFER_LENGTH_PER_CHANNEL < outAudio.config.numSamplesPerChannel && outAudio.config.is_cldfb == 0 ) || ( ( shl( MAX_BUFFER_LENGTH_PER_CHANNEL, cldfb2tdSampleShift ) ) < outAudio.config.numSamplesPerChannel && outAudio.config.is_cldfb == 1 ) ) -#else - IF( outAudio.config.numSamplesPerChannel <= 0 || LT_16( MAX_BUFFER_LENGTH_PER_CHANNEL, outAudio.config.numSamplesPerChannel ) ) -#endif { return IVAS_ERR_INVALID_BUFFER_SIZE; } @@ -9006,16 +8566,11 @@ static ivas_error getSamplesInternal( } test(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && NE_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && NE_32( L_shr( L_mult0( outAudio.config.numSamplesPerChannel, 1000 ), cldfb2tdSampleShift ), imult3216( hIvasRend->sampleRateOut, i_mult( hIvasRend->num_subframes, BINAURAL_RENDERING_FRAME_SIZE_MS ) ) ) ) -#else - IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && - NE_32( L_mult0( outAudio.config.numSamplesPerChannel, 1000 ), imult3216( hIvasRend->sampleRateOut, i_mult( hIvasRend->num_subframes, BINAURAL_RENDERING_FRAME_SIZE_MS ) ) ) ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Binaural rendering requires specific frame size" ); } @@ -9094,11 +8649,7 @@ static ivas_error getSamplesInternal( return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_16( numOutChannels, outAudio.config.numChannels ) && NE_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( NE_16( numOutChannels, outAudio.config.numChannels ) ) -#endif { return IVAS_ERR_WRONG_NUM_CHANNELS; } @@ -9106,7 +8657,6 @@ static ivas_error getSamplesInternal( /* Clear original output buffer */ set32_fx( outAudio.data_fx, 0, imult1616( outAudio.config.numChannels, outAudio.config.numSamplesPerChannel ) ); -#ifdef SPLIT_REND_WITH_HEAD_ROT outAudioOrig = outAudio; /* Use internal buffer if outputting split rendering bitstream */ IF( EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || @@ -9125,7 +8675,6 @@ static ivas_error getSamplesInternal( /* Clear output buffer for split rendering bitstream */ set32_fx( outAudio.data_fx, 0, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); } -#endif IF( NE_32( ( error = renderActiveInputsIsm( hIvasRend, outAudio ) ), IVAS_ERR_OK ) ) { @@ -9147,13 +8696,7 @@ static ivas_error getSamplesInternal( test(); test(); -#ifndef SPLIT_REND_WITH_HEAD_ROT - - Word32 limiter_thresold = L_lshl( IVAS_LIMITER_THRESHOLD, *outAudio.pq_fact ); - limitRendererOutput_fx( hIvasRend->hLimiter, outAudio.data_fx, outAudio.config.numSamplesPerChannel, limiter_thresold, *outAudio.pq_fact ); -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ISAR_SPLIT_REND_BITS_DATA bits; @@ -9253,9 +8796,7 @@ static ivas_error getSamplesInternal( } if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms, -#endif hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) { @@ -9282,15 +8823,12 @@ static ivas_error getSamplesInternal( accumulate2dArrayToBuffer_fx( tmpBinaural_buff, &outAudio ); } } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( outAudio.config.is_cldfb == 0 ) { Word32 limiter_thresold = L_lshl( IVAS_LIMITER_THRESHOLD, *outAudio.pq_fact ); limitRendererOutput_fx( hIvasRend->hLimiter, outAudio.data_fx, outAudio.config.numSamplesPerChannel, limiter_thresold, *outAudio.pq_fact ); } -#endif /* update global cominbed orientation start index */ ivas_combined_orientation_update_start_index( hIvasRend->hCombinedOrientationData, outAudio.config.numSamplesPerChannel ); @@ -9310,14 +8848,9 @@ ivas_error IVAS_REND_GetSamples( ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT return getSamplesInternal( hIvasRend, outAudio, NULL ); -#else - return getSamplesInternal( hIvasRend, outAudio ); -#endif } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------* * IVAS_REND_GetSplitBinauralBitstream() * @@ -9355,10 +8888,8 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ int16_t *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , int16_t *pIsar_frame_size_ms /* o: pointer to isar frame size setting */ -#endif ) { if ( hIvasRend == NULL || hIvasRend->hRendererConfig == NULL ) @@ -9367,14 +8898,11 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( } *pCodec = hIvasRend->hRendererConfig->split_rend_config.codec; *pCodec_frame_size_ms = hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms; -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS *pIsar_frame_size_ms = hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms; -#endif *poseCorrection = hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode; return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * IVAS_REND_Close() @@ -9426,10 +8954,8 @@ void IVAS_REND_Close( ivas_limiter_close_fx( &hIvasRend->hLimiter ); -#ifdef SPLIT_REND_WITH_HEAD_ROT /* Split binaural rendering */ ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); -#endif closeHeadRotation( hIvasRend ); @@ -9453,7 +8979,6 @@ void IVAS_REND_Close( return; } -#ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------* * IVAS_REND_openCldfb() * @@ -9588,7 +9113,6 @@ void IVAS_REND_cldfbSynthesis_wrapper( return; } -#endif /*---------------------------------------------------------------------* @@ -10136,7 +9660,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( 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 */ + input_masa *inputMasa /* i/o: MASA external renderer structure */ #endif ) { @@ -10154,9 +9678,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( Word16 tmpFloat_fx; ivas_error error; Word16 frequency_axis_fx[CLDFB_NO_CHANNELS_MAX]; -#ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; -#endif Word16 tmp; Word16 tmp_e; @@ -10178,13 +9700,9 @@ static ivas_error ivas_masa_ext_rend_parambin_init( renderer_type = inputMasa->hMasaExtRend->renderer_type; move32(); -#ifdef SPLIT_REND_WITH_HEAD_ROT for ( pos_idx = 0; pos_idx < inputMasa->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; pos_idx++ ) { hDiracDecBin = inputMasa->hMasaExtRend->hDiracDecBin[pos_idx]; -#else - hDiracDecBin = inputMasa->hMasaExtRend->hDiracDecBin; -#endif /* Init assumes that no reconfiguration is required in external renderer. Instead, free and rebuild whole rendering. */ IF( ( hDiracDecBin = (DIRAC_DEC_BIN_HANDLE) malloc( sizeof( DIRAC_DEC_BIN_DATA ) ) ) == NULL ) @@ -10277,16 +9795,12 @@ static ivas_error ivas_masa_ext_rend_parambin_init( #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF Copy32( ( *phHrtfParambin )->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); #else - Copy32( hHrtfParambin->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); + Copy32( hHrtfParambin->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); #endif hDiracDecBin->q_earlyPartEneCorrection = Q28; move16(); -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ -#else - IF( hDiracDecBin->hReverb == NULL ) -#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF @@ -10295,8 +9809,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( IF( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes_fx, hHrtfParambin->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) #endif #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( NE_32( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, hHrtfParambin ) ), IVAS_ERR_OK ) ) + /* 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( NE_32( ( 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; @@ -10317,10 +9831,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( assert( false ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT IF( pos_idx == 0 ) /* open decorrelator only for the main direction */ { -#endif /* Always open frequency domain decorrelator */ ivas_dirac_dec_get_frequency_axis_fx( frequency_axis_fx, output_Fs, nBins ); @@ -10337,9 +9849,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( { return error; } -#ifdef SPLIT_REND_WITH_HEAD_ROT } -#endif /* External renderer uses constant regularization factor */ hDiracDecBin->reqularizationFactor_fx = 6554; /* 0.4f in Q14 */ move16(); @@ -10348,12 +9858,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( hDiracDecBin->phHrtfParambin = phHrtfParambin; #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT inputMasa->hMasaExtRend->hDiracDecBin[pos_idx] = hDiracDecBin; } -#else - inputMasa->hMasaExtRend->hDiracDecBin = hDiracDecBin; -#endif return error; } @@ -10385,14 +9891,10 @@ static ivas_error initMasaExtRenderer( move32(); hMasaExtRend->hDirACRend = NULL; hMasaExtRend->hSpatParamRendCom = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { hMasaExtRend->hDiracDecBin[i] = NULL; } -#else - hMasaExtRend->hDiracDecBin = NULL; -#endif hMasaExtRend->hReverb = NULL; hMasaExtRend->hHrtfParambin = &hrtfs->hHrtfParambin; hMasaExtRend->hVBAPdata = NULL; @@ -10443,10 +9945,8 @@ static ivas_error initMasaExtRenderer( BREAK; case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: -#endif hMasaExtRend->renderer_type = RENDERER_BINAURAL_PARAMETRIC; move32(); BREAK; @@ -10567,7 +10067,6 @@ static void freeMasaExtRenderer( ivas_spat_hSpatParamRendCom_close_fx( &hMasaExtRend->hSpatParamRendCom ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { if ( hMasaExtRend->hDiracDecBin[i] != NULL ) @@ -10576,12 +10075,6 @@ static void freeMasaExtRenderer( } } -#else - IF( hMasaExtRend->hDiracDecBin != NULL ) - { - ivas_dirac_dec_close_binaural_data( &hMasaExtRend->hDiracDecBin ); - } -#endif IF( hMasaExtRend->hReverb != NULL ) { diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index dae55f18c5c83a160a5c8d074e4a1c0fc81ef181..84de1e7b79381c92d6f24d95251221cddeb2ecfd 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -1073,11 +1073,7 @@ static void strip_spaces( while ( pStr[read_idx] ) { -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( !isspace( (int32_t) pStr[read_idx] ) && !iscntrl( (int32_t) pStr[read_idx] ) ) -#else - if ( !isspace( pStr[read_idx] ) && !iscntrl( pStr[read_idx] ) ) -#endif { pStr[write_idx++] = pStr[read_idx]; } @@ -1841,10 +1837,8 @@ ivas_error RenderConfigReader_read( uint32_t fgHasMethod, fgHasNBands, fgHasFreqs, fgHasDefaultGrid, fgHasStartFreq, fgHasFreqHop; uint32_t aeHasFgIdx, aeHasPredelay, aeHasRt60, aeHasDsr; uint32_t aeHasERsize, aeHasERabs; -#ifdef SPLIT_REND_WITH_HEAD_ROT bool dofProvided = false; bool poseCorrProvided = false; -#endif uint32_t nDP; uint32_t accDPIdx; @@ -2369,7 +2363,6 @@ ivas_error RenderConfigReader_read( free( pValue ); acIdx++; } -#ifdef SPLIT_REND_WITH_HEAD_ROT else if ( strcmp( chapter, "SPLITREND" ) == 0 && strlen( pParams ) != 0 ) { params_idx = 0; @@ -2486,7 +2479,6 @@ ivas_error RenderConfigReader_read( errorHandler( pValue, ERROR_VALUE_INVALID ); } } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS else if ( strcmp( item, "LC3PLUS_HIGHRES" ) == 0 ) { if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.lc3plus_highres ) ) @@ -2494,7 +2486,6 @@ ivas_error RenderConfigReader_read( errorHandler( item, ERROR_VALUE_INVALID ); } } -#endif #ifdef DEBUGGING else { @@ -2504,7 +2495,6 @@ ivas_error RenderConfigReader_read( } free( pValue ); } -#endif else if ( strcmp( chapter, "DIRECTIVITYSETTING" ) == 0 && strlen( pParams ) != 0 ) { params_idx = 0; diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index a3f9544c8bec21ef677923ed1c382baf58308d81..3cd2e798b4ee2f01df24aae37293703a7a327891 100644 --- a/lib_util/rotation_file_reader.c +++ b/lib_util/rotation_file_reader.c @@ -121,7 +121,6 @@ ivas_error HeadRotationFileReading( ( headRotReader->frameCounter )++; -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( w == -3.0f ) { pQuaternion->w_fx = floatToFixed_32( w, Q22 ); @@ -138,13 +137,6 @@ ivas_error HeadRotationFileReading( pQuaternion->z_fx = floatToFixed_32( z, Q31 ); pQuaternion->q_fact = Q31; } -#else - pQuaternion->w_fx = floatToFixed_32( w, Q31 ); - pQuaternion->x_fx = floatToFixed_32( x, Q31 ); - pQuaternion->y_fx = floatToFixed_32( y, Q31 ); - pQuaternion->z_fx = floatToFixed_32( z, Q31 ); - pQuaternion->q_fact = Q31; -#endif if ( pPos != NULL ) { diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 4c5770f45930b668c5a6f83ebe20bc3801b130fd..6b7e1acd34b19cb9cd30b3b93b2ab4938041ffa8 100644 --- a/lib_util/split_rend_bfi_file_reader.c +++ b/lib_util/split_rend_bfi_file_reader.c @@ -33,7 +33,6 @@ #include #include "options.h" #include "split_rend_bfi_file_reader.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "prot_fx.h" @@ -159,4 +158,3 @@ const char *SplitRendBFIFileReader_getFilePath( return SplitRendBFIReader->file_path; } -#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_util/split_rend_bfi_file_reader.h b/lib_util/split_rend_bfi_file_reader.h index 679c424a1563cc4fd8de76651ef439565a03269c..0956b6b3ddcecc0b8fd58f0f13a26b15b8e4c5a0 100644 --- a/lib_util/split_rend_bfi_file_reader.h +++ b/lib_util/split_rend_bfi_file_reader.h @@ -34,7 +34,6 @@ #define IVAS_SR_BFI_FILE_READER_H #include "common_api_types.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT typedef struct SplitRendBFIFileReader SplitRendBFIFileReader; @@ -56,5 +55,4 @@ const char *SplitRendBFIFileReader_getFilePath( ); -#endif /* SPLIT_REND_WITH_HEAD_ROT */ #endif /* IVAS_SR_BFI_FILE_READER_H */ diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 065300c10ea94056103cc35668a7098a9ab7a9bc..43c68cba577df42a514c7245019576aacd924dec 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -33,7 +33,6 @@ #include #include "options.h" #include "split_render_file_read_write.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "prot_fx.h" @@ -66,14 +65,10 @@ ivas_error split_rend_reader_open( char *filename, ISAR_SPLIT_REND_CODEC *codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, - int16_t *codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + int16_t *codec_frame_size_ms, int16_t *isar_frame_size_ms, int32_t *sampling_rate, - int16_t *lc3plus_highres -#endif -) + int16_t *lc3plus_highres ) { SplitFileReadWrite *hSplitRendFileReadWrite; size_t header_len, h; @@ -125,7 +120,6 @@ ivas_error split_rend_reader_open( { return IVAS_ERR_FAILED_FILE_READ; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* read isar bitstream frame size signalling */ if ( fread( isar_frame_size_ms, sizeof( *isar_frame_size_ms ), 1, hSplitRendFileReadWrite->file ) != 1 ) { @@ -141,7 +135,6 @@ ivas_error split_rend_reader_open( { return IVAS_ERR_FAILED_FILE_READ; } -#endif *hhSplitRendFileReadWrite = hSplitRendFileReadWrite; @@ -162,14 +155,10 @@ ivas_error split_rend_writer_open( const int32_t delayTimeScale, ISAR_SPLIT_REND_CODEC codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection, - int16_t codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + int16_t codec_frame_size_ms, const int16_t isar_frame_size_ms, const int32_t sampling_rate, - const int16_t lc3plus_highres -#endif -) + const int16_t lc3plus_highres ) { SplitFileReadWrite *hSplitRendFileReadWrite; size_t header_len, h; @@ -220,7 +209,6 @@ ivas_error split_rend_writer_open( { return IVAS_ERR_FAILED_FILE_WRITE; } -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* Write isar bit stream frame size signalling */ if ( fwrite( &isar_frame_size_ms, sizeof( isar_frame_size_ms ), 1, hSplitRendFileReadWrite->file ) != 1 ) { @@ -236,7 +224,6 @@ ivas_error split_rend_writer_open( { return IVAS_ERR_FAILED_FILE_WRITE; } -#endif *hhSplitRendFileReadWrite = hSplitRendFileReadWrite; @@ -428,4 +415,3 @@ ivas_error split_rend_read_pre_rend_delay_ns( return IVAS_ERR_OK; } -#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_util/split_render_file_read_write.h b/lib_util/split_render_file_read_write.h index bdda7e59893446ef9501f87464f1463474c119a9..2895dd42687f37c421d3c97734bea2a0c32c8d7e 100644 --- a/lib_util/split_render_file_read_write.h +++ b/lib_util/split_render_file_read_write.h @@ -34,7 +34,6 @@ #define SPLIT_RENDER_FILE_READ_WRITE_H #include "common_api_types.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT typedef struct SplitFileReadWrite SplitFileReadWrite; @@ -44,14 +43,10 @@ ivas_error split_rend_reader_open( char *filename, ISAR_SPLIT_REND_CODEC *codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, - int16_t *codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + int16_t *codec_frame_size_ms, int16_t *isar_frame_size_ms, int32_t *sampling_rate, - int16_t *lc3plus_highres -#endif -); + int16_t *lc3plus_highres ); /* Allocates and initializes a a split renderer writer instance */ @@ -62,14 +57,10 @@ ivas_error split_rend_writer_open( const int32_t delayTimeScale, ISAR_SPLIT_REND_CODEC codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection, - int16_t codec_frame_size_ms -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS - , + int16_t codec_frame_size_ms, const int16_t isar_frame_size_ms, const int32_t sampling_rate, - const int16_t lc3plus_highres -#endif -); + const int16_t lc3plus_highres ); /* Closes the split renderer reader/writer and deallocates memory */ @@ -95,5 +86,4 @@ ivas_error split_rend_read_pre_rend_delay_ns( SplitFileReadWrite *hSplitRendFileReadWrite, uint32_t *delay_ns ); -#endif /* SPLIT_REND_WITH_HEAD_ROT */ #endif /* SPLIT_RENDER_FILE_READ_WRITE_H */