diff --git a/apps/decoder.c b/apps/decoder.c index 4545ab3d05138144b84e1a390d765f7967c1a6b1..8212552a59498d60588557ad18d09e24077fdbdc 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -129,11 +129,7 @@ typedef struct #endif IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; bool tsmEnabled; -#ifndef NONBE_UNIFIED_DECODING_PATHS - bool enable5ms; -#else IVAS_RENDER_FRAMESIZE renderFramesize; -#endif #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC @@ -163,11 +159,7 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF #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 -#ifndef NONBE_UNIFIED_DECODING_PATHS -static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); -#else static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); @@ -203,9 +195,7 @@ int main( Vector3PairFileReader *referenceVectorReader = NULL; RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; -#ifdef NONBE_UNIFIED_DECODING_PATHS IVAS_RENDER_FRAMESIZE asked_frame_size; -#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -438,20 +428,14 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, - arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else asked_frame_size = arg.renderFramesize; if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -462,7 +446,6 @@ int main( { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" ); } -#endif /*------------------------------------------------------------------------------------------* * Configure Split rendering @@ -471,16 +454,13 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS asked_frame_size = arg.renderFramesize; -#endif if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -491,7 +471,6 @@ int main( { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for split rendering!\n" ); } -#endif arg.enableHeadRotation = true; } @@ -646,35 +625,18 @@ int main( } #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( arg.renderFramesize == IVAS_RENDER_FRAMESIZE_5MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || renderConfig.split_rend_config.dof == 0 ) ) -#else - if ( arg.enable5ms && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || - renderConfig.split_rend_config.dof == 0 ) ) -#endif { -/*TODO : needs to be refined as this wont work with LCLD codec*/ -#ifdef NONBE_UNIFIED_DECODING_PATHS + /*TODO : needs to be refined as this wont work with LCLD codec*/ arg.renderFramesize = IVAS_RENDER_FRAMESIZE_5MS; -#else - arg.enable5ms = true; -#endif } else { -#ifdef NONBE_UNIFIED_DECODING_PATHS arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; -#else - arg.enable5ms = true; -#endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Set5msFlag( hIvasDec, arg.enable5ms ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -819,11 +781,7 @@ int main( if ( arg.voipMode ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); -#else - error = decodeVoIP( arg, hBsReader, hIvasDec ); -#endif } else { @@ -1077,11 +1035,7 @@ static bool parseCmdlIVAS_dec( arg->Opt_non_diegetic_pan = 0; arg->non_diegetic_pan_gain = 0.f; arg->tsmEnabled = false; -#ifndef NONBE_UNIFIED_DECODING_PATHS - arg->enable5ms = false; -#else arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; -#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING arg->tsmScale = 100; @@ -1225,9 +1179,6 @@ static bool parseCmdlIVAS_dec( i++; int32_t tmp = 100; arg->tsmEnabled = true; -#ifndef NONBE_UNIFIED_DECODING_PATHS - arg->enable5ms = true; -#endif if ( i < argc - 3 ) { if ( !is_digits_only( argv[i] ) ) @@ -1276,13 +1227,6 @@ static bool parseCmdlIVAS_dec( arg->headrotTrajFileName = argv[i]; i++; } -#ifndef NONBE_UNIFIED_DECODING_PATHS - else if ( strcmp( argv_to_upper, "-FR5" ) == 0 ) - { - arg->enable5ms = true; - i++; - } -#else else if ( strcmp( argv_to_upper, "-FR" ) == 0 ) { int32_t tmp; @@ -1316,7 +1260,6 @@ static bool parseCmdlIVAS_dec( } } } -#endif else if ( strcmp( argv_to_upper, "-OTR" ) == 0 ) { @@ -1623,13 +1566,6 @@ static bool parseCmdlIVAS_dec( return false; } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) && ( !arg->tsmEnabled ) ) - { - arg->enable5ms = false; - } - -#endif return true; } @@ -1679,11 +1615,7 @@ static void usage_dec( void ) fprintf( stdout, " 50 <= fac <= 150; fac<100 faster, fac>100 slower\n" ); #endif #endif -#ifndef NONBE_UNIFIED_DECODING_PATHS - fprintf( stdout, "-fr5 : option to perform rendering + head-tracking with 5ms frame size\n" ); -#else fprintf( stdout, "-fr L : render frame size in ms L=(5,10,20), default is 20)\n" ); -#endif fprintf( stdout, "-fec_cfg_file : Optimal channel aware configuration computed by the JBM \n" ); fprintf( stdout, " as described in Section 6.3.1 of TS26.448. The output is \n" ); fprintf( stdout, " written into a .txt file. Each line contains the FER indicator \n" ); @@ -1764,12 +1696,8 @@ static ivas_error initOnFirstGoodFrame( const DecArguments arg, /* i : */ const int16_t numInitialBadFrames, /* i : */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_UNIFIED_DECODING_PATHS int16_t *numOutSamples, /* i/o: */ -#else - uint16_t *numOutSamples, /* i/o: */ -#endif - int16_t *vec_pos_len, /* i/o: */ + int16_t *vec_pos_len, /* i/o: */ #else const uint16_t numOutSamples, /* i : */ #endif @@ -2011,15 +1939,11 @@ static ivas_error initOnFirstGoodFrame( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( *splitRendWriter != NULL ) { -#ifndef NONBE_UNIFIED_DECODING_PATHS - int16_t enable5ms; -#endif if ( numOutSamples == NULL || vec_pos_len == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* real setting of the 5ms mode for split rendering is only known after the decoded first good frame, reset the variables needed in the main decoding loop accordingly here*/ if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, numOutSamples ) ) != IVAS_ERR_OK ) { @@ -2031,24 +1955,6 @@ static ivas_error initOnFirstGoodFrame( fprintf( stderr, "\nError getting render frame size in samples\n" ); return error; } -#else - if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* real setting of the 5ms mode for split rendering is only known after the decoded first good frame, reset the variables needed in the main decoding loop accordingly here*/ - if ( enable5ms ) - { - *numOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS ); - *vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; - } - else - { - *numOutSamples = (int16_t) ( arg.output_Fs / 1000 * DEFAULT_FETCH_FRAMESIZE_MS ); - *vec_pos_len = 1; - } -#endif } #endif @@ -2090,11 +1996,7 @@ static ivas_error decodeG192( int16_t nOutChannels = 0; int16_t delayNumSamples = -1; int16_t delayNumSamples_orig[3]; -#if defined( SPLIT_REND_WITH_HEAD_ROT ) && !defined( NONBE_UNIFIED_DECODING_PATHS ) - uint16_t nOutSamples = 0; -#else int16_t nOutSamples = 0; -#endif int32_t delayTimeScale = 0; ivas_error error = IVAS_ERR_UNKNOWN; uint16_t numObj = 0; @@ -2143,7 +2045,6 @@ static ivas_error decodeG192( nSamplesAvailableNext = 0; vec_pos_update = 0; -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nOutSamples ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError getting render frame size in samples\n" ); @@ -2154,18 +2055,6 @@ static ivas_error decodeG192( fprintf( stderr, "\nError getting render frame size in samples\n" ); return error; } -#else - if ( arg.enableHeadRotation && arg.enable5ms ) - { - nOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS ); - vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; - } - else - { - nOutSamples = (int16_t) ( arg.output_Fs / 1000 * DEFAULT_FETCH_FRAMESIZE_MS ); - vec_pos_len = 1; - } -#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING @@ -2249,22 +2138,12 @@ static ivas_error decodeG192( } } -#ifndef NONBE_UNIFIED_DECODING_PATHS - int16_t enable5ms, num_subframes; - if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK ) - { - return error; - } - arg.enable5ms = enable5ms; - num_subframes = ( arg.enable5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; -#else int16_t num_subframes; if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetNumOrientationSubframes failed: \n" ); goto cleanup; } -#endif /* Head-tracking input simulation */ /* Head-tracking input simulation */ if ( arg.enableHeadRotation ) @@ -2922,12 +2801,10 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, -#ifdef NONBE_UNIFIED_DECODING_PATHS RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, -#endif IVAS_DEC_HANDLE hIvasDec ) { bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */ @@ -2970,13 +2847,10 @@ static ivas_error decodeVoIP( IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; -#ifdef NONBE_UNIFIED_DECODING_PATHS IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; int16_t vec_pos_update, vec_pos_len; int16_t nOutSamples = 0; -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) { @@ -2993,7 +2867,6 @@ static ivas_error decodeVoIP( fprintf( stderr, "\nError getting render frame size in samples\n" ); return error; } -#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { @@ -3094,16 +2967,7 @@ static ivas_error decodeVoIP( while ( 1 ) { -#ifndef NONBE_UNIFIED_DECODING_PATHS -#if defined( SPLIT_REND_WITH_HEAD_ROT ) - uint16_t nOutSamples = 0; -#else - int16_t nOutSamples = 0; -#endif - nOutSamples = (int16_t) ( arg.output_Fs / 1000 * JBM_FRONTEND_FETCH_FRAMESIZE_MS ); -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS /* reference vector */ if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) { @@ -3222,7 +3086,6 @@ static ivas_error decodeVoIP( } } } -#endif /* read all packets with a receive time smaller than the system time */ while ( nextPacketRcvTime_ms <= systemTime_ms ) @@ -3411,9 +3274,7 @@ static ivas_error decodeVoIP( { fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); } -#ifdef NONBE_UNIFIED_DECODING_PATHS vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; -#endif frame++; systemTime_ms += systemTimeInc_ms; diff --git a/apps/renderer.c b/apps/renderer.c index 139c473e1c29405ecdf3791a455fc2e998d5ed85..4c9dcf516d00c607b208ae8c05cc20f770491dfe 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -187,11 +187,7 @@ typedef struct bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; float syncMdDelay; -#ifdef NONBE_UNIFIED_DECODING_PATHS IVAS_RENDER_FRAMESIZE render_framesize; -#else - bool framing_5ms; -#endif uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; uint16_t acousticEnvironmentId; } CmdlnArgs; @@ -223,11 +219,7 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, -#ifdef NONBE_UNIFIED_DECODING_PATHS CmdLnOptionId_framing, -#else - CmdLnOptionId_framing5ms, -#endif CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, CmdLnOptionId_acousticEnvironmentId @@ -380,21 +372,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, -#ifdef NONBE_UNIFIED_DECODING_PATHS { .id = CmdLnOptionId_framing, .match = "framing", .matchShort = "fr", .description = "Set Render audio framing.", }, -#else - { - .id = CmdLnOptionId_framing5ms, - .match = "framing_5ms", - .matchShort = "fr5", - .description = "Render audio with 5 ms framing.", - }, -#endif { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", @@ -1020,17 +1003,9 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); -#else - const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 ); -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1525,11 +1500,7 @@ int main( { int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; -#ifdef NONBE_UNIFIED_DECODING_PATHS const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0; -#else - const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT numSamplesRead = 0; @@ -1581,11 +1552,7 @@ int main( #endif int16_t num_subframes, sf_idx; -#ifdef NONBE_UNIFIED_DECODING_PATHS num_subframes = (int16_t) args.render_framesize; -#else - num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; -#endif if ( isCurrentFrameMultipleOf20ms ) { @@ -2381,7 +2348,6 @@ static bool parseDiegeticPan( } -#ifdef NONBE_UNIFIED_DECODING_PATHS static bool parseRenderFramesize( char *value, IVAS_RENDER_FRAMESIZE *render_framesize ) @@ -2411,7 +2377,6 @@ static bool parseRenderFramesize( return true; } -#endif static bool parseOrientationTracking( char *value, @@ -2708,11 +2673,7 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); -#ifdef NONBE_UNIFIED_DECODING_PATHS args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS; -#else - args.framing_5ms = false; -#endif args.syncMdDelay = 0; for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) @@ -2874,7 +2835,6 @@ static void parseOption( exit( -1 ); } break; -#ifdef NONBE_UNIFIED_DECODING_PATHS case CmdLnOptionId_framing: assert( numOptionValues == 1 ); if ( !parseRenderFramesize( optionValues[0], &args->render_framesize ) ) @@ -2884,13 +2844,6 @@ static void parseOption( } break; -#else - case CmdLnOptionId_framing5ms: - assert( numOptionValues == 0 ); - args->framing_5ms = true; - fprintf( stderr, "Warning: this is a placeholder for 5ms framing.\n" ); - break; -#endif case CmdLnOptionId_directivityPatternId: assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS ); for ( int16_t i = 0; i < numOptionValues; ++i ) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 4f1a452c611c84279c0ba33b7bc7c91422f233cf..132e829ed3712b3cb2105beaaac5e8483e84604a 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -147,7 +147,6 @@ typedef enum } IVAS_HEAD_ORIENT_TRK_T; -#ifdef NONBE_UNIFIED_DECODING_PATHS typedef enum { IVAS_RENDER_FRAMESIZE_UNKNOWN = 0, @@ -156,7 +155,6 @@ typedef enum IVAS_RENDER_FRAMESIZE_20MS = 4 } IVAS_RENDER_FRAMESIZE; -#endif typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 95008d17f591a37b883dc49b8a38ac08039c380c..3c6a93dd596fa05bf8d2080ed8137a5f92f874d0 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1335,49 +1335,27 @@ typedef struct { unsigned short length[81]; } HUFF_ELEMENTS; -#ifdef FIX_891_PARAMUPMIX_CLEANUP typedef struct { HUFF_ELEMENTS df0; HUFF_ELEMENTS df; } HUFF_TABLE; -#else -typedef struct { - HUFF_ELEMENTS df0; - HUFF_ELEMENTS df; - HUFF_ELEMENTS dt; -} HUFF_TABLE; -#endif typedef enum { ALPHA, BETA } PAR_TYPE; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -typedef enum { - FINE, - COARSE -} QUANT_TYPE; - -#endif typedef struct { int16_t nquant; int16_t offset; float data[35]; } ACPL_QUANT_TABLE; -#ifdef FIX_891_PARAMUPMIX_CLEANUP + typedef struct { const int16_t (*alpha)[2]; const int16_t (*beta)[2]; } HUFF_NODE_TABLE; -#else -typedef struct -{ - const int16_t (*alpha[2])[2]; - const int16_t (*beta[2])[2]; -} HUFF_NODE_TABLE; -#endif /*----------------------------------------------------------------------------------* * Parametric MC Constants diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index bcf502033a6ddb0af293c17a8272f62acb5a5b8c..c47a1a6098b1a0cf1bef93196b82ea5f0c556174 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -162,12 +162,7 @@ ivas_error ivas_dirac_config( hConfig->dec_param_estim = FALSE; if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) /* skip for MASA decoder */ { - if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - ivas_format -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band, ivas_format ) ) != IVAS_ERR_OK ) { return error; } @@ -324,12 +319,8 @@ void ivas_get_dirac_sba_max_md_bits( int16_t *bits_frame_nominal, int16_t *metadata_max_bits, int16_t *qmetadata_max_bit_req, - const int16_t nbands -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - IVAS_FORMAT ivas_format -#endif -) + const int16_t nbands, + IVAS_FORMAT ivas_format ) { if ( sba_total_brate <= IVAS_13k2 ) { @@ -345,13 +336,11 @@ void ivas_get_dirac_sba_max_md_bits( { *bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC; *metadata_max_bits = 103; -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA /* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */ if ( ivas_format == SBA_ISM_FORMAT ) { ( *metadata_max_bits ) -= 3; } -#endif } else if ( sba_total_brate <= IVAS_32k ) { @@ -406,12 +395,8 @@ ivas_error ivas_dirac_sba_config( int16_t *element_mode, /* i/o: element mode of the core coder */ int32_t sba_total_brate, /* i : SBA total bitrate */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int16_t nbands /* i : number of frequency bands */ -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - IVAS_FORMAT ivas_format -#endif -) + const int16_t nbands, /* i : number of frequency bands */ + IVAS_FORMAT ivas_format ) { int16_t nbands_coded; int16_t hodirac_flag; @@ -473,12 +458,7 @@ ivas_error ivas_dirac_sba_config( } } - ivas_get_dirac_sba_max_md_bits( sba_total_brate, &hQMetaData->bits_frame_nominal, &hQMetaData->metadata_max_bits, &hQMetaData->qmetadata_max_bit_req, hQMetaData->q_direction[0].cfg.nbands -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - ivas_format -#endif - ); + ivas_get_dirac_sba_max_md_bits( sba_total_brate, &hQMetaData->bits_frame_nominal, &hQMetaData->metadata_max_bits, &hQMetaData->qmetadata_max_bit_req, hQMetaData->q_direction[0].cfg.nbands, ivas_format ); return error; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index cdd5a6bfd0c2bb4b043902e299b98c5e18eeefc9..fcb0011f8a049205b25c7c5c887b4b1e638ad9a7 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -312,12 +312,7 @@ void stereo_dmx_evs_close_encoder( ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ -#if( defined SPLIT_REND_WITH_HEAD_ROT && !defined NONBE_UNIFIED_DECODING_PATHS_FIX ) - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#else int16_t *data /* o : output synthesis signal */ -#endif ); ivas_error ivas_dec_setup( @@ -1155,11 +1150,7 @@ int16_t ivas_ism_dtx_enc( int16_t *sid_flag /* o : indication of SID frame */ ); -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH void ivas_ism_dtx_dec( -#else -ivas_error ivas_ism_dtx_dec( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *nb_bits_metadata /* o : number of metadata bits */ ); @@ -1455,11 +1446,7 @@ int16_t stereo_dft_sg_recovery( void stereo_dft_dec_res( CPE_DEC_HANDLE hCPE, /* i/o: decoder CPE handle */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO float res_buf[STEREO_DFT_N_8k], /* i : residual buffer */ -#else - float res_buf[STEREO_DFT_BUF_MAX], /* i : residual buffer */ -#endif float *output /* o : output frame */ ); @@ -1467,11 +1454,7 @@ void stereo_dft_dec_res( int16_t res_bpf_adapt( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: DFT stereo decoder handle */ const float *bpf_error_signal_8k, /* i : BPF modification signal */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO float res_buf[STEREO_DFT_N_8k] /* i : residual buffer */ -#else - float res_buf[STEREO_DFT_BUF_MAX] /* i : residual buffer */ -#endif ); void bpf_pitch_coherence( @@ -1487,11 +1470,7 @@ void stereo_dft_dec_read_BS( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder DFT stereo handle */ const int16_t bwidth, /* i : bandwidth */ const int16_t output_frame, /* i : output frame length */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO float res_buf[STEREO_DFT_N_8k], /* o : residual buffer */ -#else - float res_buf[STEREO_DFT_BUF_MAX], /* o : residual buffer */ -#endif int16_t *nb_bits, /* o : number of bits read */ float *coh, /* i/o: Coherence */ const int16_t ivas_format /* i : ivas format */ @@ -2263,19 +2242,10 @@ void EstimateStereoTCXNoiseLevel( void TNSAnalysisStereo( Encoder_State **sts, /* i : state handle */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO float *mdst_spectrum[CPE_CHANNELS][NB_DIV], /* o : MDST spectrum */ -#else - float *mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* o : MDST spectrum */ -#endif const int16_t bWhitenedDomain, /* i : whitened domain flag */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO int16_t tnsSize[CPE_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ int16_t tnsBits[CPE_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ -#else - int16_t tnsSize[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ - int16_t tnsBits[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ -#endif int16_t param_core[][NB_DIV * NPRM_DIV], /* o : quantized noise filling level */ const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ ); @@ -2558,13 +2528,8 @@ void stereo_decoder_tcx( STEREO_MDCT_DEC_DATA *hStereoMdct, /* i/o: MDCT stereo decoder structure */ int16_t ms_mask[NB_DIV][MAX_SFB], /* i : bandwise MS mask */ float *spec_r_0[NB_DIV], /* i/o: spectrum right channel */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO float *spec_l[], /* i/o: spectrum left channel [NB_DIV][N] */ float *spec_r[], /* i/o: spectrum right channel [NB_DIV][N] */ -#else - float *spec_l[NB_DIV], /* i/o: spectrum left channel */ - float *spec_r[NB_DIV], /* i/o: spectrum right channel */ -#endif const int16_t mdct_stereo_mode[], /* i : stereo mode (FB/band wise MS, dual mono */ const int16_t core_l, /* i : core for left channel (TCX20/TCX10) */ const int16_t core_r, /* i : core for right channel (TCX20/TCX10) */ @@ -3096,11 +3061,7 @@ void mctStereoIGF_enc( void ivas_mdct_dec_side_bits_frame_channel( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ -#else - int16_t param_lpc[MCT_MAX_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ -#endif int16_t p_param[CPE_CHANNELS][NB_DIV], /* o : pointer to param buffer */ Decoder_State *st0, /* i : pointer to bitstream handle */ int16_t nTnsBitsTCX10[CPE_CHANNELS][NB_DIV], /* o : number of bits for TNS */ @@ -3678,11 +3639,8 @@ void ivas_get_dirac_sba_max_md_bits( int16_t *bits_frame_nominal, int16_t *metadata_max_bits, int16_t *qmetadata_max_bit_req, - const int16_t nbands -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - IVAS_FORMAT ivas_format -#endif + const int16_t nbands, + IVAS_FORMAT ivas_format ); ivas_error ivas_dirac_sba_config( @@ -3690,11 +3648,8 @@ ivas_error ivas_dirac_sba_config( int16_t *element_mode, /* o : element mode of the core coder */ int32_t sba_total_brate, /* i : SBA total bitrate */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int16_t nbands /* i : number of frequency bands */ -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - IVAS_FORMAT ivas_format -#endif + const int16_t nbands, /* i : number of frequency bands */ + IVAS_FORMAT ivas_format ); ivas_error ivas_dirac_dec_config( @@ -3730,14 +3685,6 @@ void ivas_dirac_dec_set_md_map( const int16_t nCldfbTs /* i : number of CLDFB time slots */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -void ivas_dirac_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t num_subframes /* i : number of subframes to render */ -); -#endif void ivas_dirac_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const int16_t nchan_transport, /* i : number of transport channels */ @@ -3819,12 +3766,6 @@ void ivas_mc_paramupmix_enc_close( const int32_t input_Fs /* i : input sampling rate */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -void ivas_mc_paramupmix_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -); -#endif ivas_error ivas_mc_paramupmix_dec_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -4184,13 +4125,6 @@ void ivas_spar_config( const int16_t sid_format /* i : IVAS format indicator from SID frame */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -ivas_error ivas_sba_upmixer_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - float *output[], /* i/o: transport/output audio channels */ - const int16_t output_frame /* i : output frame length */ -); -#endif ivas_error ivas_sba_linear_renderer( float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t output_frame, /* i : output frame length per channel */ @@ -5265,9 +5199,6 @@ void ivas_binRenderer( const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, #endif COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ -#ifndef NONBE_UNIFIED_DECODING_PATHS - int16_t subframe_idx, /* i : subframe index */ -#endif const int16_t numTimeSlots, /* i : number of time slots to process */ #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, @@ -5303,13 +5234,6 @@ void ivas_ism_renderer_close( ISM_RENDERER_HANDLE *hIsmRendererData /* i/o: ISM renderer handle */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS -void ivas_ism_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[], /* i/o: core-coder transport channels/object output */ - const int16_t output_frame /* i : output frame length per channel */ -); -#endif void ivas_ism_render_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: core-coder transport channels/object output */ @@ -5342,17 +5266,6 @@ void ivas_param_mc_mc2sba_cldfb( const float gain_lfe /* i : gain applied to LFE */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -void ivas_ism2sba( - float *buffer_td[], /* i/o: TD signal buffers */ - ISM_RENDERER_HANDLE hIsmRendererData, /* i/o: renderer data */ - const ISM_METADATA_HANDLE hIsmMetaData[], /* i : object metadata */ - const int16_t nchan_ism, /* i : number of objects */ - const int16_t output_frame, /* i : output frame length per channel */ - const int16_t sba_order /* i : SBA order */ -); - -#endif void ivas_ism2sba_sf( float *buffer_in[], /* i : TC buffer */ float *buffer_out[], /* o : TD signal buffers */ @@ -5701,13 +5614,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( float *output_f[] /* o : rendered time signal */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -ivas_error ivas_osba_dirac_td_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* o : output synthesis signal */ - const int16_t output_frame /* i : output frame length per channel */ -); -#endif ivas_error ivas_osba_ism_metadata_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -5716,7 +5622,6 @@ ivas_error ivas_osba_ism_metadata_dec( int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ ); -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX ivas_error ivas_osba_render_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ @@ -5724,13 +5629,6 @@ ivas_error ivas_osba_render_sf( uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ float *output_f[] /* o : rendered time signal */ ); -#else -ivas_error ivas_osba_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[], /* i/o: core-coder transport channels/object output */ - const int16_t output_frame /* i : output frame length per channel */ -); -#endif void ivas_osba_data_close( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ @@ -5869,13 +5767,6 @@ ivas_error ivas_omasa_ism_metadata_dec( int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS -ivas_error ivas_omasa_dirac_td_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* o : output synthesis signal */ - const int16_t output_frame /* i : output frame length per channel */ -); -#endif ivas_error ivas_omasa_dirac_td_binaural_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ @@ -5885,14 +5776,6 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( float *output_f[] /* o : rendered time signal */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -void ivas_omasa_dirac_rend( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* o : output synthesis signal */ - const int16_t output_frame /* i : output frame length per channel */ -); - -#endif void ivas_omasa_rearrange_channels( float *output[], /* o : output synthesis signal */ const int16_t nchan_transport_ism, /* i : number of ISM TCs */ @@ -5924,21 +5807,10 @@ void ivas_omasa_separate_object_renderer_close( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -void ivas_omasa_separate_object_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float input_f[][L_FRAME48k], /* i : separated object signal */ - float *output_f[], /* i/o: output signals */ - const int16_t output_frame /* i : output frame length per channel */ -); - -#endif void ivas_omasa_separate_object_render_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const uint16_t nSamplesRendered, /* i : number of samples rendered */ -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float input_f[][L_FRAME48k], /* i : separated object signal */ -#endif float *output_f[], /* o : rendered time signal */ const int16_t subframes_rendered, /* i : number of subframes rendered */ const int16_t slots_rendered /* i : number of CLDFB slots rendered */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 9727f39fddda2738e82ccd2d3099383b3d6a83a8..a054221f9376b79aa66f8a80ef787d10627520f2 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2518,17 +2518,6 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_ 1, 1, 1, 2, 24, 69, 122, 194, 285, 487, 690, 1173, 2255, 4709, 10599, 24635, 10862, 4709, 2204, 1059, 566, 330, 221, 150, 95, 59, 28, 2, 1, 1, 1 }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/*----------------------------------------------------------------------------------* - * Parametric Upmix MC ROM tables - *----------------------------------------------------------------------------------*/ - -const int16_t ivas_param_upmx_mx_qmap[2][33] = -{ - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, - { 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0 } -}; -#endif /*----------------------------------------------------------------------------------* * MASA ROM tables @@ -6439,7 +6428,6 @@ const int16_t sns_1st_means_32k[2][16] = * MC ParamUpmix ROM tables *-----------------------------------------------------------------------*/ -#ifdef FIX_891_PARAMUPMIX_CLEANUP const int16_t ivas_param_upmx_mx_qmap[33] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0 @@ -6503,105 +6491,5 @@ const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[9] = { +0.000000e+000f, +5.937500e-002f, +1.375000e-001f, +2.343750e-001f, +3.500000e-001f, +4.843750e-001f, +6.375000e-001f, +8.093750e-001f, +1.000000e+000f } /* data */ } }; -#else -const ACPL_QUANT_TABLE ivas_mc_paramupmix_alpha_quant_table[] = -{ - /* Alfa Fine */ - { - 33, /* nquant */ - 16, /* offset */ - { -2.000000e+000f, -1.809375e+000f, -1.637500e+000f, -1.484375e+000f, -1.350000e+000f, -1.234375e+000f, -1.137500e+000f, -1.059375e+000f, -1.000000e+000f, -9.406250e-001f, - -8.625000e-001f, -7.656250e-001f, -6.500000e-001f, -5.156250e-001f, -3.625000e-001f, -1.906250e-001f, +0.000000e+000f, +1.906250e-001f, +3.625000e-001f, +5.156250e-001f, - +6.500000e-001f, +7.656250e-001f, +8.625000e-001f, +9.406250e-001f, +1.000000e+000f, +1.059375e+000f, +1.137500e+000f, +1.234375e+000f, +1.350000e+000f, +1.484375e+000f, - +1.637500e+000f, +1.809375e+000f, +2.000000e+000f } /* data */ - }, - { /* Alfa Coarse */ - 17, /* nquant */ - 8, /* offset */ - { -2.000000e+000f, -1.637500e+000f, -1.350000e+000f, -1.137500e+000f, -1.000000e+000f, -8.625000e-001f, -6.500000e-001f, -3.625000e-001f, +0.000000e+000f, +3.625000e-001f, - +6.500000e-001f, +8.625000e-001f, +1.000000e+000f, +1.137500e+000f, +1.350000e+000f, +1.637500e+000f, +2.000000e+000f } /* data */ - } -}; - -const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[2][9] = -{ - { - /* Beta Fine #1 */ - { - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +2.375000e-001f, +5.500000e-001f, +9.375000e-001f, +1.400000e+000f, +1.937500e+000f, +2.550000e+000f, +3.237500e+000f, +4.000000e+000f } /* data */ - }, - { /* Beta Fine #2 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +2.035449e-001f, +4.713672e-001f, +8.034668e-001f, +1.199844e+000f, +1.660498e+000f, +2.185430e+000f, +2.774639e+000f, +3.428125e+000f } /* data */ - }, - { /* Beta Fine #3 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +1.729297e-001f, +4.004688e-001f, +6.826172e-001f, +1.019375e+000f, +1.410742e+000f, +1.856719e+000f, +2.357305e+000f, +2.912500e+000f } /* data */ - }, - { /* Beta Fine #4 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +1.456543e-001f, +3.373047e-001f, +5.749512e-001f, +8.585938e-001f, +1.188232e+000f, +1.563867e+000f, +1.985498e+000f, +2.453125e+000f } /* data */ - }, - { /* Beta Fine #5 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +1.217188e-001f, +2.818750e-001f, +4.804688e-001f, +7.175000e-001f, +9.929688e-001f, +1.306875e+000f, +1.659219e+000f, +2.050000e+000f } /* data */ - }, - { /* Beta Fine #6 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +1.011230e-001f, +2.341797e-001f, +3.991699e-001f, +5.960938e-001f, +8.249512e-001f, +1.085742e+000f, +1.378467e+000f, +1.703125e+000f } /* data */ - }, - { /* Beta Fine #7 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +8.386719e-002f, +1.942188e-001f, +3.310547e-001f, +4.943750e-001f, +6.841797e-001f, +9.004688e-001f, +1.143242e+000f, +1.412500e+000f } /* data */ - }, - { /* Beta Fine #8 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +6.995117e-002f, +1.619922e-001f, +2.761230e-001f, +4.123438e-001f, +5.706543e-001f, +7.510547e-001f, +9.535449e-001f, +1.178125e+000f } /* data */ - }, - { /* Beta Fine #9 */ - 9, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +5.937500e-002f, +1.375000e-001f, +2.343750e-001f, +3.500000e-001f, +4.843750e-001f, +6.375000e-001f, +8.093750e-001f, +1.000000e+000f } /* data */ - } - }, - { - /* Beta Coarse #1 */ - { - 5, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +5.500000e-001f, +1.400000e+000f, +2.550000e+000f, +4.000000e+000f } /* data */ - }, - { /* Beta Coarse #2 */ - 5, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +4.004688e-001f, +1.019375e+000f, +1.856719e+000f, +2.912500e+000f } /* data */ - }, - { /* Beta Coarse #3 */ - 5, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +2.818750e-001f, +7.175000e-001f, +1.306875e+000f, +2.050000e+000f } /* data */ - }, - { /* Beta Coarse #4 */ - 5, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +1.942188e-001f, +4.943750e-001f, +9.004688e-001f, +1.412500e+000f } /* data */ - }, - { /* Beta Coarse #5 */ - 5, /* nquant */ - 0, /* offset */ - { +0.000000e+000f, +1.375000e-001f, +3.500000e-001f, +6.375000e-001f, +1.000000e+000f } /* data */ - } - } -}; -#endif /* clang-format on */ diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 89086987ebdc3f2b1742879deed47cfd519e5185..9a6f9ddf3270e5f253682be16cc9e5b30d29fd19 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -259,12 +259,6 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_combined_48_16bits[PARAM_MC_SZ_ extern const uint16_t ivas_param_mc_cum_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER]; extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1]; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/*----------------------------------------------------------------------------------* - * Parametric Upmix MC ROM tables - *----------------------------------------------------------------------------------*/ -extern const int16_t ivas_param_upmx_mx_qmap[2][33]; -#endif /*----------------------------------------------------------------------------------* * MASA ROM tables @@ -453,15 +447,10 @@ extern const int16_t sns_1st_means_32k[2][16]; /*----------------------------------------------------------------------* * MC ParamUpmix ROM tables *-----------------------------------------------------------------------*/ -#ifdef FIX_891_PARAMUPMIX_CLEANUP extern const int16_t ivas_param_upmx_mx_qmap[33]; extern const ACPL_QUANT_TABLE ivas_mc_paramupmix_alpha_quant_table; extern const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[9]; -#else -extern const ACPL_QUANT_TABLE ivas_mc_paramupmix_alpha_quant_table[]; -extern const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[2][9]; -#endif /* IVAS_ROM_COM_H */ #endif diff --git a/lib_com/options.h b/lib_com/options.h index d825f0ddd5cf0fdf4e63e2d6d44b6c578809b979..974e32fc89d426b5789eff4b90c79119dbde730d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,12 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_902_HACK_IN_CORECODER /* VA: issue 902: remove a hack in ivas_core_dec() */ -#define FIX_881_REMOVE_LFE_ADDITION_IN_ISM /* VA: issue 881: remove LFE addition in ISM format */ -#define FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO /* VA: Fix the definition of buffers/arrays in DFT and MDCT stereo to satisfy gcc v 11.4.0 */ -#define FIX_891_PARAMUPMIX_CLEANUP /* Dlb: issue 891: remove unneeded code from ParamUpmix */ -#define FIX_917_LCLD_WARNINGS /* Dlb: issue 917 and 918: fix LCLD codec warnings*/ -#define FIX_920_IGF_INIT_ERROR /* FhG: issue 920: fix bitrate mismatch in initial IGF config to avoid error message in same cases */ #define FIX_SPLITREND_WARNINGS /* FhG: fix warnings related to split rendering observed in build jobs */ #define FIX_923_EXTERNAL_REND_COMMAND_LINE /* VA: issue 923: enable external renderer command-line options in UPPER case letters */ #define FIX_921_OMASA_DELAY_PRINTOUT /* VA: issue 921: correct OMASA decoder delay printout */ @@ -169,20 +163,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ -#define NONBE_UNIFIED_DECODING_PATHS /* FhG: unify decoding paths */ -#ifdef NONBE_UNIFIED_DECODING_PATHS -#define NONBE_UNIFIED_DECODING_PATHS_FIX /* VA: issue 876: fixes within NONBE_UNIFIED_DECODING_PATHS */ -#endif -#define NONBE_FIX_874_OMASA_BRSW_2TD /* Nokia: issue 874: Fixes the crashes with the long test vectors that prompted switching to TD*/ -#define NONBE_FIX_871_ACELP_CRASH_IN_OSBA /* FhG: isse 871: crash in ACELP core encoder with OSBA */ -#define NONBE_FIX_906_SBA_LBR_SMOOTHING /* FhG: issue #906: fix SBA low bit rate smoothing for HOA2/HOA3 output */ -#define NONBE_FIX_878_RS_FEC_STEREO_CNG /* Eri: Frame loss and Unified Stereo CNG may cause false BER detection which results in corrupt bitstream decoding */ -#define NONBE_FIX_904_JBM_SBA_RS_FOA /* FhG: issue #904: fix JBM SBA RS to FOA decoding */ -#define NONBE_FIX_898_ISM_BRATE_CRASH /* VA: issue 898: fix decoder crash in ISM bitrate switching with DTX and binaural output */ -#define NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC /* DLB: issue 862 : UBSAN: out-of-bound error in SPAR for OSBA bitrate switching with PLC*/ -#define NONBE_FIX_DISCRETE_ISM_NOISE_SEED_HANDLING /* FhG: fix handling of common and differing noise seeds in SCEs for ISM DTX */ -#define NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION /* VA/Nok: issue 913: Resolve "Crash in OMASA encoder - DFT-Stereo bit-budget violated" */ -#define NONBE_FIX_855_JBM_FLUSH_OFFSET /* FhG: issue #855: add missing switch here for the code in JBM flushing */ #define NONBE_FIX_926_OSBA_DECODER_CRASH_PLANAR_SBA /* FhG: issue 926: crash in OSBA decoding with planar FOA */ #define NONBE_FIX_908_OSBA_BR_SWITCHING_CRASH /* FhG: issue 908: fix crash in OSBA BR switching with long test vectors */ #define NONBE_FIX_BINAURAL_ROOM_IR_REVERBERATOR /* FhG: re-enable acidentially disabled reverberator for BINAURAL_ROOM_IR */ diff --git a/lib_com/prot.h b/lib_com/prot.h index a0a1d8b4a321a6eae3c5899875a9492bc8740b5b..527d80318794ee6493b2b7451f8e80b2f46669f4 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2271,9 +2271,8 @@ ivas_error init_encoder( const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ - const ISM_MODE ism_mode /* i : ISM mode */ - , - const int32_t element_brate /* element bitrate */ + const ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t element_brate /* element bitrate */ ); void LPDmem_enc_init( @@ -6760,10 +6759,8 @@ float correlation_shift( void init_coder_ace_plus( Encoder_State *st, /* i : Encoder state handle */ const int32_t last_total_brate, /* i : last total bitrate */ -#ifdef FIX_920_IGF_INIT_ERROR - const int32_t igf_brate, /* i : IGF configuration bitrate */ -#endif - const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0)*/ + const int32_t igf_brate, /* i : IGF configuration bitrate */ + const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0)*/ ); void core_coder_reconfig( diff --git a/lib_dec/bass_psfilter.c b/lib_dec/bass_psfilter.c index d1fc86e0ed2f100011d04748ec3b033f06abea4f..cd63806c647002cf9fc289bdb0fa21c30a1e11a1 100644 --- a/lib_dec/bass_psfilter.c +++ b/lib_dec/bass_psfilter.c @@ -522,11 +522,7 @@ void addBassPostFilter( int16_t res_bpf_adapt( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: DFT stereo decoder handle */ const float *bpf_error_signal_8k, /* i : BPF modification signal */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO - float res_buf[STEREO_DFT_N_8k] /* i : residual buffer */ -#else - float res_buf[STEREO_DFT_BUF_MAX] /* i : residual buffer */ -#endif + float res_buf[STEREO_DFT_N_8k] /* i : residual buffer */ ) { float error_nrg; diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 348cfd1227746158a630aebf6f3f9669431d7eab..69d007825caed9dd17a7b9194eecbe406f4032ce 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1104,17 +1104,10 @@ void generate_comfort_noise_dec( c2 = (float) sqrt( 1 - hFdCngCom->coherence ); seed2 = &( hFdCngCom->seed2 ); -#ifdef NONBE_FIX_DISCRETE_ISM_NOISE_SEED_HANDLING if ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) { seed2 = &( hFdCngCom->seed3 ); } -#else - if ( ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) - { - seed2 = &( hFdCngCom->seed3 ); - } -#endif /* Generate Gaussian random noise in real and imaginary parts of the FFT bins Amplitudes are adjusted to the estimated noise level cngNoiseLevel in each bin */ @@ -1366,11 +1359,7 @@ void generate_comfort_noise_dec_hf( if ( cng_coh_flag ) { -#ifdef NONBE_FIX_DISCRETE_ISM_NOISE_SEED_HANDLING seed2 = &( hFdCngCom->seed2 ); -#else - seed2 = &( hFdCngCom->seed3 ); -#endif c1 = (float) sqrt( hFdCngCom->coherence ); c2 = (float) sqrt( 1 - hFdCngCom->coherence ); diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 6d1d83b5b61c1f01ce382754b9d3771b84a907a7..6ece78587daeb7da3639eae929661d54251575ab 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1655,9 +1655,6 @@ void ivas_binaural_cldfb( &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, #endif st_ivas->hCombinedOrientationData, -#ifndef NONBE_UNIFIED_DECODING_PATHS - subframeIdx, -#endif JBM_CLDFB_SLOTS_IN_SUBFRAME, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, @@ -1705,10 +1702,8 @@ void ivas_binaural_cldfb( } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, maxBand * MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -1839,9 +1834,6 @@ void ivas_binaural_cldfb_sf( &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, #endif st_ivas->hCombinedOrientationData, -#ifndef NONBE_UNIFIED_DECODING_PATHS - subframeIdx, -#endif st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, @@ -1869,10 +1861,8 @@ void ivas_binaural_cldfb_sf( } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, maxBand * st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ); -#endif /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -1916,10 +1906,7 @@ void ivas_binRenderer( const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, #endif COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - int16_t subframe_idx, /* i : subframe index */ -#endif - const int16_t numTimeSlots, /* i : number of time slots to render */ + const int16_t numTimeSlots, /* i : number of time slots to render */ #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, #endif @@ -1970,40 +1957,24 @@ void ivas_binRenderer( #endif /* Head rotation in HOA3 or CICPx */ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] && hBinRenderer->rotInCldfb ) -#else - if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb ) -#endif { if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) { /* Rotation in SHD (HOA3) */ if ( hCombinedOrientationData->shd_rot_max_order == -1 ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); -#else - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); -#endif } else if ( hCombinedOrientationData->shd_rot_max_order > 0 ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order ); -#else - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order ); -#endif } } else { /* Rotation in SD (CICPx) */ -#ifdef NONBE_UNIFIED_DECODING_PATHS rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx], RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); -#else - rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat[subframe_idx], RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); -#endif } } @@ -2196,17 +2167,9 @@ void ivas_rend_CldfbMultiBinRendProcess( #endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, MAX_PARAM_SPATIAL_SUBFRAMES, &head_track_post, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); #else - ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, sf_idx, MAX_PARAM_SPATIAL_SUBFRAMES, &head_track_post, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); -#endif -#else -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, MAX_PARAM_SPATIAL_SUBFRAMES, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); -#else - ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, sf_idx, MAX_PARAM_SPATIAL_SUBFRAMES, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); -#endif #endif for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) { diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 423a673e8da9404d07d5db4e5f39380596f906b0..1e803dc03a0515d22a864e8b7b4e8bd027a4deeb 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -112,11 +112,7 @@ ivas_error ivas_core_dec( sts = hSCE->hCoreCoder; hStereoICBWE = NULL; element_brate = hSCE->element_brate; -#ifdef FIX_902_HACK_IN_CORECODER last_element_brate = hSCE->last_element_brate; /* note: this parameter is unused */ -#else - last_element_brate = hSCE->element_brate; /* hack - the past parameter is not really needed */ -#endif last_element_mode = IVAS_SCE; hStereoTD = NULL; p_output_mem = NULL; diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index 14d7ce1dd5bcfc7a5225002c4cc5ed83cacc2fec..aaff963d5fadfd15a0c4954b192003d056ebd8ba 100644 --- a/lib_dec/ivas_corecoder_dec_reconfig.c +++ b/lib_dec/ivas_corecoder_dec_reconfig.c @@ -64,10 +64,8 @@ ivas_error ivas_corecoder_dec_reconfig( MC_MODE last_mc_mode; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t prev_bfi; Decoder_State *st0; -#endif /*-----------------------------------------------------------------* * Initialization @@ -145,10 +143,8 @@ ivas_error ivas_corecoder_dec_reconfig( } else { -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st0 = ( nSCE_old > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; prev_bfi = st0->prev_bfi; -#endif nSCE_existing = min( nSCE_old, st_ivas->nSCE ); nCPE_existing = min( nCPE_old, st_ivas->nCPE ); @@ -221,9 +217,7 @@ ivas_error ivas_corecoder_dec_reconfig( { return error; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st_ivas->hSCE[sce_id]->hCoreCoder[0]->prev_bfi = prev_bfi; -#endif } if ( st_ivas->sba_dirac_stereo_flag && sba_dirac_stereo_flag_old && st_ivas->nchan_transport == 1 && nSCE_old == 0 ) { @@ -252,10 +246,8 @@ ivas_error ivas_corecoder_dec_reconfig( { return error; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st_ivas->hCPE[cpe_id]->hCoreCoder[0]->prev_bfi = prev_bfi; st_ivas->hCPE[cpe_id]->hCoreCoder[1]->prev_bfi = prev_bfi; -#endif } if ( st_ivas->nCPE > 1 && nCPE_old <= 1 ) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 140b33622cb312fd0aa19f475651efc52823115e..1972c326273cd52de743a8ea9f8adafa21775ef7 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -248,10 +248,8 @@ ivas_error ivas_cpe_dec( { nb_bits -= SID_FORMAT_NBITS; sts[1]->bit_stream -= SID_FORMAT_NBITS; -#ifdef NONBE_FIX_878_RS_FEC_STEREO_CNG /* set total bitrate of Stereo CNG parameters for BER detection */ sts[1]->total_brate = IVAS_SID_5k2 - SID_2k40; -#endif } if ( ( ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || ( st_ivas->ivas_format == MASA_ISM_FORMAT && cpe_brate < MASA_STEREO_MIN_BITRATE ) ) && ivas_total_brate > IVAS_SID_5k2 ) @@ -260,7 +258,6 @@ ivas_error ivas_cpe_dec( } else { -#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) { nb_bits -= nb_bits_metadata; @@ -270,7 +267,6 @@ ivas_error ivas_cpe_dec( } } -#endif stereo_dft_dec_read_BS( ivas_total_brate, hCPE->element_brate, &sts[0]->total_brate, sts[1], hCPE->hStereoDft, sts[0]->bwidth, output_frame, res_buf, &nb_bits, hCPE->hStereoCng->coh, st_ivas->ivas_format ); } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 7ed71d5d6cd8987721f5b476a512e3e7d61890f8..aeb2b1d06c6c995b54b67c48fe80b4e0b7936707 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -51,7 +51,6 @@ * Principal IVAS decoder routine *--------------------------------------------------------------------------*/ -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ @@ -63,1121 +62,3 @@ ivas_error ivas_dec( return IVAS_ERR_OK; } -#else -ivas_error ivas_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#else - int16_t *data /* o : output synthesis signal */ -#endif -) -{ - int16_t n, output_frame, nchan_out; - Decoder_State *st; /* used for bitstream handling */ - float *p_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* 'float' buffer for output synthesis */ - int16_t nchan_remapped; - int16_t nb_bits_metadata[MAX_SCE + 1]; - int32_t output_Fs, ivas_total_brate; - AUDIO_CONFIG output_config; - ivas_error error; - int16_t num_md_sub_frames; - int32_t ism_total_brate; -#ifdef SPLIT_REND_WITH_HEAD_ROT - int16_t nchan_out_syn_output; -#endif - - push_wmops( "ivas_dec" ); - - /*----------------------------------------------------------------* - * Initialization of local vars after struct has been set - *----------------------------------------------------------------*/ - - output_Fs = st_ivas->hDecoderConfig->output_Fs; - nchan_out = st_ivas->hDecoderConfig->nchan_out; - output_config = st_ivas->hDecoderConfig->output_config; - ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - - output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); - - for ( n = 0; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) - { - p_output[n] = st_ivas->p_output_f[n]; - } - - /*----------------------------------------------------------------* - * Update combined orientation access index - *----------------------------------------------------------------*/ - -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( ( error = combine_external_and_head_orientations_dec( st_ivas->hHeadTrackData, st_ivas->hExtOrientationData, st_ivas->hCombinedOrientationData ) ) != IVAS_ERR_OK ) - { - return error; - } -#else - ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#endif - -#ifdef SPLIT_REND_WITH_HEAD_ROT - /*----------------------------------------------------------------* - * Binaural split rendering setup - *----------------------------------------------------------------*/ - - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - ivas_set_split_rend_ht_setup( &st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData ); - } - -#endif - /*----------------------------------------------------------------* - * Decoding + Rendering - *----------------------------------------------------------------*/ - - if ( st_ivas->bfi && st_ivas->ini_frame == 0 ) - { - for ( n = 0; n < nchan_out; n++ ) - { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - p_output[n] = st_ivas->p_output_f[n]; - } - - /* zero output when first frame(s) is lost */ - for ( n = 0; n < nchan_out; n++ ) - { - set_f( p_output[n], 0.0f, output_frame ); - } - -#ifdef DEBUG_MODE_INFO - create_sce_dec( st_ivas, 0, ivas_total_brate ); - output_debug_mode_info_dec( st_ivas->hSCE[0]->hCoreCoder, 1, output_frame, NULL ); - destroy_sce_dec( st_ivas->hSCE[0] ); - st_ivas->hSCE[0] = NULL; -#endif - } - else if ( st_ivas->ivas_format == STEREO_FORMAT ) - { - st_ivas->hCPE[0]->element_brate = ivas_total_brate; - - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* HP filtering */ - for ( n = 0; n < min( nchan_out, st_ivas->nchan_transport ); n++ ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_MC ) - { - ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); - } - } - else if ( st_ivas->ivas_format == ISM_FORMAT ) - { - /* Metadata decoding and configuration */ - if ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) - { -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH - ivas_ism_dtx_dec( st_ivas, nb_bits_metadata ); -#else - if ( ( error = ivas_ism_dtx_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif - - /* decode dominant object first so the noise energy of the other objects can be limited */ - if ( ( error = ivas_sce_dec( st_ivas, st_ivas->hISMDTX.sce_id_dtx, &p_output[st_ivas->hISMDTX.sce_id_dtx], output_frame, nb_bits_metadata[st_ivas->hISMDTX.sce_id_dtx] ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_ism_dtx_limit_noise_energy_for_near_silence( st_ivas->hSCE, st_ivas->hISMDTX.sce_id_dtx, st_ivas->nchan_transport ); - } - else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) - { - if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hParamIsmDec->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else /* ISM_MODE_DISC */ - { - if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - for ( n = 0; n < st_ivas->nchan_transport; n++ ) - { - /* for DTX frames, dominant object has already been decoded before */ - if ( !( ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) && n == st_ivas->hISMDTX.sce_id_dtx ) ) - { - if ( ( error = ivas_sce_dec( st_ivas, n, &p_output[n], output_frame, nb_bits_metadata[n] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - /* HP filtering */ - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - /* Rendering */ - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) - { - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - /* loudness correction */ - ivas_dirac_dec_binaural_sba_gain( p_output, st_ivas->nchan_transport, output_frame ); - - ivas_param_ism_params_to_masa_param_mapping( st_ivas ); - - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, p_output, st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) - { - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); - } - else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { - ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, output_frame ); - } - else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_param_ism_dec( st_ivas, p_output ); - - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - /* Convert CICP19 -> Ambisonics */ - ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - } - } - else /* ISM_MODE_DISC */ - { - /* Loudspeaker or Ambisonics rendering */ - if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) - { - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); - } - else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { - ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, output_frame ); - } - else if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ - ivas_ism_render( st_ivas, p_output, output_frame ); - } -#ifdef DEBUGGING - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) -#else - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) -#endif - { - /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ - ivas_ism2sba( p_output, st_ivas->hIsmRendererData, st_ivas->hIsmMetaData, st_ivas->nchan_ism, output_frame, st_ivas->hIntSetup.ambisonics_order ); - } - - /* Binaural rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { -#endif - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } -#ifndef FIX_881_REMOVE_LFE_ADDITION_IN_ISM - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); -#endif - } -#ifdef DEBUGGING - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - ivas_binaural_cldfb( st_ivas, p_output ); - } -#endif - } - } - else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) - { - set_s( nb_bits_metadata, 0, MAX_SCE ); - - /* read parameters from the bitstream */ - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hQMetaData != NULL ) - { - st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; - - if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->ivas_format == SBA_FORMAT ) - { - if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( st_ivas->nchan_transport == CPE_CHANNELS && st_ivas->nCPE >= 1 ) - { - st_ivas->hCPE[0]->element_brate = ivas_total_brate; - } - - /* core-decoding of transport channels */ - if ( st_ivas->nSCE == 1 ) - { - if ( ( error = ivas_sce_dec( st_ivas, 0, &p_output[0], output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->nCPE == 1 ) - { - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->nCPE > 1 ) - { - if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#ifdef DEBUG_LBR_SBA - /* SCE Decoder Output */ - for ( int16_t t = 0; t < 960; t++ ) - { - for ( int16_t c = 0; c < st_ivas->nchan_transport; c++ ) - { - float val = output[c][t] / MAX16B_FLT; - dbgwrite( &val, sizeof( float ), 1, 1, "int_dec_core_out.raw" ); - } - } -#endif -#ifdef DEBUG_SBA_AUDIO_DUMP - /* Dump audio signal after core-decoding */ - ivas_spar_dump_signal_wav( output_frame, NULL, output, st_ivas->nchan_transport, spar_foa_dec_wav[0], "core-decoding" ); -#endif - - /* TCs remapping */ - nchan_remapped = st_ivas->nchan_transport; - if ( st_ivas->sba_dirac_stereo_flag ) - { - nchan_remapped = nchan_out; - - if ( st_ivas->ivas_format == SBA_FORMAT ) - { - ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, p_output, p_output, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame ); - - if ( st_ivas->hSpar->hPCA != NULL ) - { - ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, p_output ); - } - - ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ) ); - } - - ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame, st_ivas->ivas_format == MC_FORMAT ); - } - else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ( ivas_total_brate > IVAS_SID_5k2 || ( ivas_total_brate <= IVAS_SID_5k2 && st_ivas->nCPE > 0 && st_ivas->hCPE[0]->nchan_out == 1 ) ) ) - { - nchan_remapped = 1; /* Only one channel transported */ - } - - /* HP filtering */ -#ifndef DEBUG_SPAR_BYPASS_EVS_CODEC - for ( n = 0; n < nchan_remapped; n++ ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } -#endif - if ( st_ivas->ivas_format == SBA_FORMAT ) - { - nchan_remapped = ivas_sba_remapTCs( p_output, st_ivas, output_frame ); - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ); - ivas_sba_mix_matrix_determiner( st_ivas->hSpar, p_output, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames ); - } - else if ( st_ivas->renderer_type != RENDERER_DISABLE ) - { - ivas_spar_dec_agc_pca( st_ivas, p_output, output_frame ); - } - } - - if ( st_ivas->ivas_format == MASA_FORMAT ) - { - ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped ); - } - else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) - { - /* loudness correction */ - ivas_dirac_dec_binaural_sba_gain( p_output, nchan_remapped, output_frame ); - } - - /* Loudspeakers, Ambisonics or Binaural rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, p_output, nchan_remapped, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - else if ( st_ivas->ivas_format == MASA_FORMAT ) - { - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) - { - if ( ( error = ivas_sba_linear_renderer( p_output, output_frame, nchan_remapped, 0, output_config, st_ivas->hOutSetup ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) - { - ivas_dirac_dec( st_ivas, p_output, nchan_remapped, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - } - else if ( !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 ) - { - if ( ( error = ivas_sba_upmixer_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */ - { - return error; - } - } - } - else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - int16_t nchan_ism, nchan_transport_ism; - int16_t dirac_bs_md_write_idx; - - set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); - - /* Set the number of objects for the parametric rendering */ - dirac_bs_md_write_idx = 0; - if ( st_ivas->hSpatParamRendCom != NULL ) - { - st_ivas->hSpatParamRendCom->numIsmDirections = 0; - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) - { - st_ivas->hSpatParamRendCom->numIsmDirections = st_ivas->nchan_ism; - } - - dirac_bs_md_write_idx = st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx; /* Store the write-index for this frame */ - } - - /* MASA metadata decoding */ - if ( ( error = ivas_masa_decode( st_ivas, st_ivas->hCPE[0]->hCoreCoder[0], &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Configuration of combined-format bit-budget distribution */ - ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); - - st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); - - /* set ISM parameters and decode ISM metadata in OMASA format */ - if ( ( error = ivas_omasa_ism_metadata_dec( st_ivas, ism_total_brate, &nchan_ism, &nchan_transport_ism, dirac_bs_md_write_idx, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* decode ISM channels */ - for ( n = 0; n < nchan_transport_ism; n++ ) - { - if ( ( error = ivas_sce_dec( st_ivas, n, &p_output[st_ivas->nchan_transport + n], output_frame, nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - /* decode MASA channels */ - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( st_ivas->hCPE[0]->nchan_out == 1 ) - { - mvr2r( p_output[0], p_output[1], output_frame ); /* Copy mono signal to stereo output channels */ - } - - /* HP filtering */ - for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) - { - if ( ( error = ivas_omasa_dirac_td_binaural( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, p_output, st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - } - else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) - { - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) - { - ivas_omasa_dirac_rend( st_ivas, p_output, output_frame ); - } - - /* external output */ - if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - /* sanity check in case of bitrate switching */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - - ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); - } - } - else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - int16_t nchan_ism, sba_ch_idx; - - set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); - nchan_ism = st_ivas->nchan_ism; - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - /* set ISM parameters and decode ISM metadata in OSBA format */ - if ( ( error = ivas_osba_ism_metadata_dec( st_ivas, ivas_total_brate, &nchan_ism, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - sba_ch_idx = st_ivas->nchan_ism; - } - else - { - nb_bits_metadata[1] += NO_BITS_MASA_ISM_NO_OBJ; - sba_ch_idx = 0; - } - - /* SBA metadata decoding */ - if ( ( error = ivas_spar_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( st_ivas->nchan_transport == CPE_CHANNELS && st_ivas->nCPE >= 1 ) - { - st_ivas->hCPE[0]->element_brate = ivas_total_brate; - } - - /* core-decoding of transport channels */ - if ( st_ivas->nSCE == 1 ) - { - if ( ( error = ivas_sce_dec( st_ivas, 0, &p_output[0], output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->nCPE == 1 ) - { - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->nCPE > 1 ) - { - if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( st_ivas->sba_dirac_stereo_flag ) - { - ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &p_output[sba_ch_idx], &p_output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame ); - - if ( st_ivas->hSpar->hPCA != NULL ) - { - ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &p_output[sba_ch_idx] ); - } - - ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ) ); - - ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame, 0 ); - } - - /* HP filtering */ - for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - nchan_remapped = ivas_sba_remapTCs( &p_output[sba_ch_idx], st_ivas, output_frame ); - -#ifdef DEBUG_OSBA - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - int16_t nchan = st_ivas->nchan_transport + st_ivas->nchan_ism; - for ( int16_t t = 0; t < output_frame; t++ ) - { - for ( int16_t c = 0; c < nchan; c++ ) - { - int16_t val = (int16_t) ( output[c][t] + 0.5f ); - dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/TC_dec_core_out.raw" ); - } - } - } -#endif - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ); - ivas_sba_mix_matrix_determiner( st_ivas->hSpar, &p_output[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames ); - } - else if ( st_ivas->renderer_type != RENDERER_DISABLE ) - { - ivas_spar_dec_agc_pca( st_ivas, &p_output[sba_ch_idx], output_frame ); - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - /* loudness correction */ - ivas_dirac_dec_binaural_sba_gain( &p_output[sba_ch_idx], nchan_remapped, output_frame ); - } - - /* Loudspeakers, Ambisonics or Binaural rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || - st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || - st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, &p_output[sba_ch_idx], nchan_remapped, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - if ( ( error = ivas_osba_dirac_td_binaural( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - ivas_sba_upmixer_renderer( st_ivas, &p_output[sba_ch_idx], output_frame ); - } - } - else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_OSBA_STEREO || st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) ) - { - if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) - { - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); - } - else /* stereo output */ - { - /* shift SBA channels to avoid overwrite by ISM upmix in 1 object case */ - if ( nchan_ism == 1 ) - { - mvr2r( p_output[2], p_output[3], output_frame ); - mvr2r( p_output[1], p_output[2], output_frame ); - } - - ivas_ism_render( st_ivas, p_output, output_frame ); - } - - for ( n = 0; n < nchan_out; n++ ) - { - v_add( p_output[n], p_output[n + max( nchan_out, nchan_ism )], p_output[n], output_frame ); - } - } - else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS ) - { - if ( ( error = ivas_osba_render( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL && !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 ) - { - if ( ( error = ivas_sba_upmixer_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/ - { - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - for ( n = 0; n < nchan_ism; n++ ) - { - delay_signal( p_output[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); - } - } - - if ( ( error = ivas_sba_upmixer_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( st_ivas->ism_mode == ISM_MODE_NONE ) - { - for ( n = st_ivas->hIntSetup.nchan_out_woLFE - 1; n >= 0; n-- ) - { - mvr2r( p_output[n], p_output[n + nchan_ism], output_frame ); - } - - for ( n = 0; n < nchan_ism; n++ ) - { - set_zero( p_output[n], output_frame ); - } - } - } - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; - - if ( st_ivas->mc_mode == MC_MODE_MCT ) - { - /* LFE channel decoder */ - ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, p_output[LFE_CHANNEL] ); - - if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* HP filtering */ - for ( n = 0; n < st_ivas->nchan_transport; n++ ) - { - if ( n != LFE_CHANNEL ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - } - - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) - { - ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); - } - - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = ivas_rend_crendProcessSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hDecoderConfig, - st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, - st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, - st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } - - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - } - else if ( st_ivas->renderer_type == RENDERER_MC ) - { - ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); - } - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { -#endif - if ( ( ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - } - } - else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) - { - ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, p_output[LFE_CHANNEL] ); - - ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] ); - - if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* HP filtering */ - for ( n = 0; n < st_ivas->nchan_transport; n++ ) - { - if ( n != LFE_CHANNEL ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - } - - ivas_mc_paramupmix_dec( st_ivas, p_output ); - - if ( st_ivas->transport_config != st_ivas->intern_config && - ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) && - ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) - { - ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); - } - - /* Rendering */ - if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && !st_ivas->hDecoderConfig->Opt_Headrotation ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif - { - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); - } - } - else if ( st_ivas->renderer_type == RENDERER_MC ) - { - if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) - { - ivas_ls_setup_conversion( st_ivas, audioCfg2channels( IVAS_AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); - } - else - { - ivas_ls_setup_conversion( st_ivas, MC_PARAMUPMIX_MAX_INPUT_CHANS, output_frame, p_output, p_output ); - } - } - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { -#endif - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - } - } - else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) - { - /* read Parametric MC parameters from the bitstream */ - ivas_param_mc_dec_read_BS( ivas_total_brate, st, st_ivas->hParamMC, &nb_bits_metadata[0] ); - - if ( st_ivas->nCPE == 1 ) - { - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->nCPE > 1 ) - { - if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - /* HP filtering */ - for ( n = 0; n < st_ivas->nchan_transport; n++ ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - /* Rendering */ - if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) - { - ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); - } - else - { - ivas_param_mc_dec( st_ivas, p_output ); - } - } - else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) - { - if ( st_ivas->hOutSetup.separateChannelEnabled ) - { - st = st_ivas->hCPE[0]->hCoreCoder[0]; /* Metadata is always with CPE in the case of separated channel */ - } - - /* read McMASA parameters from the bitstream */ - if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( st_ivas->hOutSetup.separateChannelEnabled ) - { - /* Decode the transport audio signals */ - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Identify the index of the separated channel */ - n = st_ivas->hOutSetup.separateChannelIndex; - - /* Decode the separated channel to output[n] to be combined with the synthesized channels */ - if ( ( error = ivas_sce_dec( st_ivas, 0, &p_output[n], output_frame, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ - if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || - output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || - output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) - { - ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, p_output, output_frame, n, LFE_CHANNEL ); - } - else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) - { - /* Delay the separated channel to sync with the DirAC rendering */ - delay_signal( p_output[n], output_frame, st_ivas->hMasa->hMasaLfeSynth->delayBuffer_syncDirAC, st_ivas->hMasa->hMasaLfeSynth->delayBuffer_syncDirAC_size ); - } - } - else - { - if ( st_ivas->nSCE == 1 ) - { - if ( ( error = ivas_sce_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->nCPE == 1 ) - { - if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - - if ( st_ivas->sba_dirac_stereo_flag ) /* use the flag to trigger the DFT upmix */ - { - ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame, 1 ); - } - - /* HP filtering */ - for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) - { - hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, p_output, st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */ - { - ivas_dirac_dec( st_ivas, p_output, st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - else if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_5_1 && ( output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 ) ) - { - for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ ) - { - set_zero( p_output[n], output_frame ); - } - } - } - else if ( st_ivas->renderer_type == RENDERER_MCMASA_MONO_STEREO ) - { - ivas_mono_stereo_downmix_mcmasa( st_ivas, p_output, output_frame ); - } - } - } - - /*----------------------------------------------------------------* - * Write IVAS output channels - * - compensation for saturation - * - float to integer conversion - *----------------------------------------------------------------*/ - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; - } - else - { - nchan_out_syn_output = nchan_out; - } - - if ( st_ivas->hDecoderConfig->Opt_Limiter ) -#endif - { -#ifndef DISABLE_LIMITER -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out_syn_output, output_frame, st_ivas->BER_detect ); -#else - ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, output_frame, st_ivas->BER_detect ); -#endif -#endif - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - switch ( pcm_resolution ) - { - case PCM_INT16: -#endif -#ifdef DEBUGGING - st_ivas->noClipping += -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_syn_output( p_output, output_frame, nchan_out_syn_output, (int16_t *) data ); -#else - ivas_syn_output( p_output, output_frame, nchan_out, data ); -#endif - -#ifdef SPLIT_REND_WITH_HEAD_ROT - break; - case PCM_FLOAT32: - ivas_syn_output_f( p_output, output_frame, nchan_out_syn_output, (float *) data ); - break; - default: - error = IVAS_ERR_UNKNOWN; - break; - } -#endif - - /*----------------------------------------------------------------* - * Common updates - *----------------------------------------------------------------*/ - - if ( !st_ivas->bfi ) /* do not update if first frame(s) are lost or NO_DATA */ - { - st_ivas->hDecoderConfig->last_ivas_total_brate = ivas_total_brate; - st_ivas->last_active_ivas_total_brate = ( ivas_total_brate <= IVAS_SID_5k2 ) ? st_ivas->last_active_ivas_total_brate : ivas_total_brate; - } - - if ( st_ivas->ini_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) ) /* keep "st_ivas->ini_frame = 0" until first good received frame */ - { - st_ivas->ini_frame++; - } - - if ( st_ivas->ini_active_frame < MAX_FRAME_COUNTER && !( st_ivas->bfi && st_ivas->ini_frame == 0 ) && ivas_total_brate > IVAS_SID_5k2 ) /* needed in MASA decoder in case the first active frame is BFI, and there were SID-frames decoded before */ - { - st_ivas->ini_active_frame++; - } - - st_ivas->last_ivas_format = st_ivas->ivas_format; - -#ifdef NONBE_UNIFIED_DECODING_PATHS - /* update global combined orientation start index */ - ivas_combined_orientation_update_start_index( st_ivas->hCombinedOrientationData, output_frame ); -#endif - - /* in case first frame(s) was/were lost, deallocate output buffers */ - if ( st_ivas->bfi && st_ivas->ini_frame == 0 ) - { - for ( n = 0; n < nchan_out; n++ ) - { - free( st_ivas->p_output_f[n] ); - st_ivas->p_output_f[n] = NULL; - } - } - -#ifdef DEBUG_MODE_INFO - dbgwrite( &st_ivas->bfi, sizeof( int16_t ), 1, output_frame, "res/bfi" ); - dbgwrite( &st_ivas->BER_detect, sizeof( int16_t ), 1, output_frame, "res/BER_detect" ); - { - float tmpF = ivas_total_brate / 1000.0f; - dbgwrite( &tmpF, sizeof( float ), 1, output_frame, "res/ivas_total_brate.dec" ); - } -#endif - - pop_wmops(); - return IVAS_ERR_OK; -} -#endif diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 25fc8d99fef5ee2e36f8034a71d45c1ebf2a3119..bdc5e1827a78d4813f27f465616491b6b3089af2 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -949,40 +949,6 @@ ivas_error ivas_dirac_dec_config( } } -#ifndef NONBE_UNIFIED_DECODING_PATHS - /* Allocate transport channel buffers for SBA format when in JBM */ - if ( dec_config_flag == DIRAC_OPEN ) - { -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL ) -#else - if ( st_ivas->hTcBuffer == NULL ) -#endif - { - if ( st_ivas->ivas_format == SBA_FORMAT ) - { - int16_t nchan_to_allocate; - int16_t nchan_transport; - - nchan_transport = st_ivas->nchan_transport; - - nchan_to_allocate = nchan_transport; - if ( st_ivas->nchan_transport == 1 && ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) ) - { - nchan_to_allocate++; /* we need a channel for the CNG in this case*/ - } - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - nchan_to_allocate = 2 * BINAURAL_CHANNELS; - } - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_to_allocate, nchan_to_allocate, st_ivas->hSpatParamRendCom->slot_size ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - } -#endif return error; } @@ -1590,86 +1556,6 @@ void ivas_dirac_dec_set_md_map( return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*------------------------------------------------------------------------- - * ivas_dirac_dec() - * - * DirAC decoding process - *------------------------------------------------------------------------*/ - -void ivas_dirac_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t num_subframes /* i : number of subframes to render */ -) -{ - int16_t subframe_idx; - float *output_f_local[MAX_OUTPUT_CHANNELS]; - float cng_td_buffer[L_FRAME16k]; - int16_t nchan_out, n, n_samples_sf; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; - - n_samples_sf = JBM_CLDFB_SLOTS_IN_SUBFRAME * hSpatParamRendCom->slot_size; - - for ( n = 0; n < nchan_out; n++ ) - { - output_f_local[n] = output_f[n]; - } - - for ( n = 0; n < nchan_transport; n++ ) - { - st_ivas->hTcBuffer->tc[n] = output_f[n]; - } - - if ( st_ivas->nchan_transport == 1 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->ivas_format != SBA_FORMAT ) - { - Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; - st_ivas->hTcBuffer->tc[nchan_transport] = &cng_td_buffer[0]; - generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], DEFAULT_JBM_CLDFB_TIMESLOTS, st->cna_dirac_flag && st->flag_cna ); - } - - ivas_dirac_dec_set_md_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - - for ( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ ) - { - ivas_dirac_dec_render_sf( st_ivas, output_f_local, nchan_transport, NULL, NULL ); - for ( n = 0; n < nchan_out; n++ ) - { - output_f_local[n] += n_samples_sf; - } - -#ifdef NONBE_UNIFIED_DECODING_PATHS - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); -#endif - } - - if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) - { - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_CLDFB_TIMESLOTS ) % hSpatParamRendCom->dirac_md_buffer_length; - } - else - { - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; - } - - for ( n = 0; n < nchan_transport; n++ ) - { - st_ivas->hTcBuffer->tc[n] = NULL; - } - - if ( st_ivas->nchan_transport == 1 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->ivas_format != SBA_FORMAT ) - { - st_ivas->hTcBuffer->tc[nchan_transport] = NULL; - } - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_dirac_dec_render() @@ -1690,9 +1576,7 @@ void ivas_dirac_dec_render( uint16_t slot_size, n_samples_sf, ch, nchan_intern; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // VE2SB: TBV -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; @@ -1702,12 +1586,8 @@ void ivas_dirac_dec_render( #endif for ( ch = 0; ch < nchan_intern; ch++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX output_f_local[ch] = output_f_local_buff[ch]; set_zero( output_f_local_buff[ch], nSamplesAsked ); -#else - output_f_local[ch] = output_f[ch]; -#endif } slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -1735,13 +1615,10 @@ void ivas_dirac_dec_render( output_f_local[ch] += n_samples_sf; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); -#endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX for ( ch = 0; ch < nchan_intern; ch++ ) { if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) @@ -1750,7 +1627,6 @@ void ivas_dirac_dec_render( } } -#endif if ( hSpatParamRendCom->slots_rendered == hSpatParamRendCom->num_slots ) { if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) @@ -1896,17 +1772,9 @@ void ivas_dirac_dec_render_sf( set_zero( onset_filter_subframe, hSpatParamRendCom->num_freq_bands ); } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] ) -#else - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] ) -#endif { -#ifdef NONBE_UNIFIED_DECODING_PATHS p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx][0][0]; -#else - p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[subframe_idx][0][0]; -#endif if ( st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) { num_freq_bands = hDirAC->band_grouping[hDirAC->hConfig->enc_param_start_band]; @@ -1970,11 +1838,7 @@ void ivas_dirac_dec_render_sf( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) -#else - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) -#endif { ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, hDirACRend, @@ -2101,11 +1965,7 @@ void ivas_dirac_dec_render_sf( if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) -#else - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) -#endif { protoSignalComputation_shd( Cldfb_RealBuffer, Cldfb_ImagBuffer, hDirACRend->h_output_synthesis_psd_state.proto_direct_buffer_f, @@ -2337,11 +2197,7 @@ void ivas_dirac_dec_render_sf( } /*Compute PSDs*/ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) -#else - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) -#endif { ivas_dirac_dec_output_synthesis_process_slot( reference_power, p_onset_filter, @@ -2544,9 +2400,6 @@ void ivas_dirac_dec_render_sf( #endif st_ivas->hCombinedOrientationData, -#ifndef NONBE_UNIFIED_DECODING_PATHS - subframe_idx, -#endif hSpatParamRendCom->subframe_nbslots[subframe_idx], #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index a2e53ceb064b6750940bfe0b318fcd72f12db637..420a25da1dd3fa198d903b34d95d33beed26ecc9 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -259,11 +259,7 @@ static ivas_error ivas_dec_init_split_rend( } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ); -#else - error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->Opt_5ms ); -#endif return error; } @@ -357,11 +353,6 @@ ivas_error ivas_dec_setup( st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; -#ifndef NONBE_UNIFIED_DECODING_PATHS - /* set Ambisonic (SBA) order used for analysis and coding */ - st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); - -#endif num_bits_read += SBA_ORDER_BITS; if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 ) { @@ -376,10 +367,8 @@ ivas_error ivas_dec_setup( } else { -#ifdef NONBE_UNIFIED_DECODING_PATHS /* set Ambisonic (SBA) order used for analysis and coding */ st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); -#endif ivas_sba_config( ivas_total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init ); } @@ -636,15 +625,9 @@ ivas_error ivas_dec_setup( } } -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH if ( st_ivas->ivas_format == ISM_FORMAT ) -#else - if ( st_ivas->ini_frame == 0 && st_ivas->ivas_format == ISM_FORMAT ) -#endif { -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH ISM_MODE last_ism_mode = st_ivas->ism_mode; -#endif /* read the number of objects */ st_ivas->nchan_transport = 1; @@ -657,12 +640,10 @@ ivas_error ivas_dec_setup( } k--; -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); } -#endif st_ivas->nchan_ism = nchan_ism; @@ -675,25 +656,15 @@ ivas_error ivas_dec_setup( st_ivas->ism_mode = (ISM_MODE) ( idx + 1 ); } -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH if ( st_ivas->ini_frame == 0 ) { last_ism_mode = st_ivas->ism_mode; } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -1053,11 +1024,7 @@ ivas_error ivas_init_decoder_front( if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ), st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ), ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1069,11 +1036,7 @@ ivas_error ivas_init_decoder_front( if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData ), ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1361,7 +1324,6 @@ ivas_error ivas_init_decoder( st_ivas->hISMDTX.sce_id_dtx = 0; -#ifdef NONBE_FIX_DISCRETE_ISM_NOISE_SEED_HANDLING if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed2 = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed3; @@ -1373,12 +1335,6 @@ ivas_error ivas_init_decoder( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed2 = 2 + sce_id; } } -#else - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) - { - st_ivas->hSCE[1]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed3 = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed2; - } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT ) { @@ -1400,12 +1356,9 @@ ivas_error ivas_init_decoder( } } - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - st_ivas->ivas_format -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, + ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), + st_ivas->ivas_format ) ) != IVAS_ERR_OK ) { return error; } @@ -1558,12 +1511,9 @@ ivas_error ivas_init_decoder( } } - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - st_ivas->ivas_format -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, + ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), + st_ivas->ivas_format ) ) != IVAS_ERR_OK ) { return error; } @@ -2028,20 +1978,13 @@ ivas_error ivas_init_decoder( } } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms ) - { -#endif - granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); - n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); + n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef NONBE_UNIFIED_DECODING_PATHS + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) + { + return error; } -#endif } else if ( st_ivas->renderer_type == RENDERER_MC ) { @@ -2080,35 +2023,28 @@ ivas_error ivas_init_decoder( st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms ) + if ( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) { -#endif - if ( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) - { - granularity = NS2SA( output_Fs, CLDFB_SLOT_NS ); + granularity = NS2SA( output_Fs, CLDFB_SLOT_NS ); - n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, MC_PARAMUPMIX_MAX_INPUT_CHANS, MC_PARAMUPMIX_MAX_INPUT_CHANS, granularity ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, MC_PARAMUPMIX_MAX_INPUT_CHANS, MC_PARAMUPMIX_MAX_INPUT_CHANS, granularity ) ) != IVAS_ERR_OK ) { - granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); + return error; + } + } + else + { + granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); - n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) + { + return error; } -#ifndef NONBE_UNIFIED_DECODING_PATHS } -#endif } if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) @@ -2251,11 +2187,7 @@ ivas_error ivas_init_decoder( * Allocate and initialize JBM struct + buffer *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL ) -#else if ( st_ivas->hTcBuffer == NULL ) -#endif { /* no module has yet open the TC buffer, open a default one */ @@ -2291,25 +2223,14 @@ ivas_error ivas_init_decoder( * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !st_ivas->hDecoderConfig->Opt_5ms ) + for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { -#endif - for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + /* note: these are intra-frame heap memories */ + if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); } -#ifndef NONBE_UNIFIED_DECODING_PATHS } - else - { - n = 0; - } -#endif for ( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 7d22eb50ba182052bd1709003d9d67bf83d4dc37..52349b9e69a431700970c46c550b8cfd7c5a58d7 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -128,9 +128,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms ) -#endif { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) ) @@ -324,9 +321,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( * floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !st_ivas->hDecoderConfig->Opt_5ms ) -#endif { nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); @@ -339,9 +333,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms ) -#endif { int16_t tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index 1c53749d7bc3c893bb9cee027ba57f1717e8c9ab..523002e746f43aab898a16c3c72b44b258e68739 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -47,29 +47,15 @@ * ISM DTX Metadata decoding routine *-------------------------------------------------------------------*/ -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH void ivas_ism_dtx_dec( -#else -ivas_error ivas_ism_dtx_dec( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *nb_bits_metadata /* o : number of metadata bits */ ) { -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH int16_t ch, nchan_ism, nchan_ism_prev; -#else - int16_t ch, pos, nchan_ism, nchan_ism_prev; -#endif int32_t ivas_total_brate; int16_t md_diff_flag[MAX_NUM_OBJECTS]; -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH int16_t flag_noisy_speech, sce_id_dtx; -#else - int16_t idx, flag_noisy_speech, sce_id_dtx; - ISM_MODE last_ism_mode, ism_mode_bstr; - ivas_error error; -#endif Decoder_State *st; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -79,50 +65,10 @@ ivas_error ivas_ism_dtx_dec( if ( !st_ivas->bfi && ivas_total_brate == IVAS_SID_5k2 ) { -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH /* 'nchan_ism' was read in ivas_dec_setup() */ nchan_ism = st_ivas->nchan_ism; /* ism_mode was read in ivas_dec_setup() as well as reconfiguration ivas_ism_dec_config() */ -#else - /* read number of objects */ - nchan_ism = 1; - pos = (int16_t) ( ( ivas_total_brate / FRAMES_PER_SEC ) - 1 - SID_FORMAT_NBITS ); - - while ( get_indice( st_ivas->hSCE[0]->hCoreCoder[0], pos, 1 ) == 1 && nchan_ism < MAX_NUM_OBJECTS ) - { - ( nchan_ism )++; - pos--; - } - st_ivas->nchan_ism = nchan_ism; - pos--; - - if ( nchan_ism != nchan_ism_prev ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); - } - - last_ism_mode = st_ivas->ism_mode; - - /* read ism_mode */ - if ( nchan_ism > 2 ) - { - pos -= nchan_ism; /* SID metadata flags */ - - idx = get_indice( st_ivas->hSCE[0]->hCoreCoder[0], pos, 1 ); - ism_mode_bstr = (ISM_MODE) ( idx + 1 ); - st_ivas->ism_mode = ism_mode_bstr; - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, PCM_NOT_KNOW, NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, NULL ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } -#endif } else { @@ -154,7 +100,6 @@ ivas_error ivas_ism_dtx_dec( } } -#ifdef NONBE_FIX_DISCRETE_ISM_NOISE_SEED_HANDLING /* synch common seed between SCEs */ if ( st_ivas->ism_mode == ISM_MODE_DISC ) { @@ -163,7 +108,6 @@ ivas_error ivas_ism_dtx_dec( st_ivas->hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed = st_ivas->hSCE[st_ivas->hISMDTX.sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed; } } -#endif update_last_metadata( nchan_ism, st_ivas->hIsmMetaData, md_diff_flag ); @@ -189,11 +133,7 @@ ivas_error ivas_ism_dtx_dec( } } -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH return; -#else - return IVAS_ERR_OK; -#endif } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index d355798f6da6d20ea4ef2a775091899a55bf2b4f..da12741551cfbaf5e0a9f1547b6e71b1a49bc627 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -591,75 +591,63 @@ ivas_error ivas_param_ism_dec_open( st_ivas->hSpatParamRendCom = hSpatParamRendCom; -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms ) + if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) { -#endif - if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) - { - int16_t nchan_transport = st_ivas->nchan_transport; - int16_t nchan_full = 0; + int16_t nchan_transport = st_ivas->nchan_transport; + int16_t nchan_full = 0; - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) + { + nchan_full = nchan_transport; + hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL; + hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc = NULL; + } + else + { + int16_t n_slots_to_alloc; + if ( st_ivas->hDecoderConfig->Opt_tsm == 1 ) { - nchan_full = nchan_transport; - hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL; - hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc = NULL; + n_slots_to_alloc = MAX_JBM_CLDFB_TIMESLOTS; } else { - int16_t n_slots_to_alloc; - if ( st_ivas->hDecoderConfig->Opt_tsm == 1 ) - { - n_slots_to_alloc = MAX_JBM_CLDFB_TIMESLOTS; - } - else - { - n_slots_to_alloc = CLDFB_SLOTS_PER_SUBFRAME * MAX_PARAM_SPATIAL_SUBFRAMES; - } - if ( ( hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands * sizeof( float ) ) ) == NULL ) - - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); - } - set_zero( hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc, n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands ); + n_slots_to_alloc = CLDFB_SLOTS_PER_SUBFRAME * MAX_PARAM_SPATIAL_SUBFRAMES; + } + if ( ( hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands * sizeof( float ) ) ) == NULL ) - if ( ( hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); - } - set_zero( hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc, n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands ); + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); } + set_zero( hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc, n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands ); - if ( st_ivas->hTcBuffer == NULL ) + if ( ( hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands * sizeof( float ) ) ) == NULL ) { - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, nchan_full, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) - { - return error; - } + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); } + set_zero( hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc, n_slots_to_alloc * nchan_transport * hSpatParamRendCom->num_freq_bands ); } - else + + if ( st_ivas->hTcBuffer == NULL ) { - hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL; - hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc = NULL; - if ( st_ivas->hTcBuffer == NULL ) + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, nchan_full, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) { - int16_t nchan_to_allocate = st_ivas->hDecoderConfig->nchan_out; - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_BUFFER, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } } -#ifndef NONBE_UNIFIED_DECODING_PATHS } else { hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL; hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc = NULL; + if ( st_ivas->hTcBuffer == NULL ) + { + int16_t nchan_to_allocate = st_ivas->hDecoderConfig->nchan_out; + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_BUFFER, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) + { + return error; + } + } } -#endif pop_wmops(); return error; @@ -1211,11 +1199,7 @@ void ivas_param_ism_dec_digest_tc( } } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_tsm || !st_ivas->hDecoderConfig->Opt_5ms ) -#else if ( st_ivas->hDecoderConfig->Opt_tsm ) -#endif { /*TODO : FhG to check*/ ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, fade_len, transport_channels_f ); @@ -1226,11 +1210,7 @@ void ivas_param_ism_dec_digest_tc( /* CLDFB Analysis */ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_tsm || !st_ivas->hDecoderConfig->Opt_5ms ) -#else if ( st_ivas->hDecoderConfig->Opt_tsm ) -#endif { float RealBuffer[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 63c8f47d2ce2c995156e57e4dc1aebfc18b30faa..018727ba250bb720fa5ed5eb7f808e8cd3db151e 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -132,108 +132,6 @@ void ivas_ism_renderer_close( return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS -/*-------------------------------------------------------------------------* - * ivas_ism_render() - * - * Object rendering process. - *-------------------------------------------------------------------------*/ - -void ivas_ism_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[], /* i/o: core-coder transport channels/object output */ - const int16_t output_frame /* i : output frame length per channel */ -) -{ - int16_t i, j, k, j2; - float input_f[MAX_NUM_OBJECTS][L_FRAME48k]; - float tmp_output_f[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; - float g1, g2; - int16_t nchan_ism, nchan_out_woLFE, lfe_index; - int16_t azimuth, elevation; - - nchan_ism = st_ivas->nchan_ism; - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - - lfe_index = 0; - - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - set_f( tmp_output_f[j], 0.0f, output_frame ); - } - - for ( i = 0; i < nchan_ism; i++ ) - { - mvr2r( output_f[i], input_f[i], output_frame ); - } - - for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) - { - set_f( output_f[i], 0.0f, output_frame ); - } - - for ( i = 0; i < nchan_ism; i++ ) - { - if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) - { - ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &gains[i][0], &gains[i][1] ); - } - else - { - /* Combined rotation: rotate the object positions depending the head and external orientations */ - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) - { - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); - } - else - { - // TODO tmu review when #215 is resolved - azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->azimuth + 0.5f ); - elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->elevation + 0.5f ); - - if ( st_ivas->hIntSetup.is_planar_setup ) - { - /* If no elevation support in output format, then rendering should be done with zero elevation */ - elevation = 0; - } - } - - if ( st_ivas->hEFAPdata != NULL ) - { - efap_determine_gains( st_ivas->hEFAPdata, gains[i], azimuth, elevation, EFAP_MODE_EFAP ); - } - } - - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( fabsf( gains[i][j] ) > 0.0f || fabsf( st_ivas->hIsmRendererData->prev_gains[i][j] ) > 0.0f ) - { - for ( k = 0; k < output_frame; k++ ) - { - g1 = st_ivas->hIsmRendererData->interpolator[k]; - g2 = 1.0f - g1; - tmp_output_f[j][k] += ( g1 * gains[i][j] + g2 * st_ivas->hIsmRendererData->prev_gains[i][j] ) * input_f[i][k]; - } - } - - st_ivas->hIsmRendererData->prev_gains[i][j] = gains[i][j]; - } - } - - /* Move to output skipping LFE */ - for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) - { - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) - { - ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; - } - mvr2r( tmp_output_f[j], output_f[j2], output_frame ); - } - - return; -} -#endif /*-------------------------------------------------------------------------* * ivas_ism_render_sf() @@ -254,10 +152,8 @@ void ivas_ism_render_sf( int16_t tc_offset; int16_t interp_offset; float gain, prev_gain; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float tc_local[MAX_NUM_OBJECTS][L_FRAME48k]; float *p_tc[MAX_NUM_OBJECTS]; -#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -270,7 +166,6 @@ void ivas_ism_render_sf( tc_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( st_ivas->hDecoderConfig->Opt_tsm ) { for ( i = 0; i < num_objects; i++ ) @@ -286,18 +181,13 @@ void ivas_ism_render_sf( p_tc[i] = tc_local[i]; } } -#endif for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { set_f( output_f[i], 0.0f, n_samples_to_render ); } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) -#else - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) -#endif { ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); interp_offset = 0; @@ -306,11 +196,7 @@ void ivas_ism_render_sf( for ( i = 0; i < num_objects; i++ ) { /* Combined rotation: rotate the object positions depending the head and external orientations */ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) -#else - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) -#endif { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); @@ -333,11 +219,7 @@ void ivas_ism_render_sf( if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) { g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX tc = p_tc[i]; -#else - tc = &st_ivas->hTcBuffer->tc[i][tc_offset]; -#endif for ( k = 0; k < n_samples_to_render; k++ ) { g2 = 1.0f - *g1; @@ -346,21 +228,15 @@ void ivas_ism_render_sf( } /* update here only in case of head rotation */ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) -#else - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) -#endif { st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); -#endif return; } @@ -512,118 +388,6 @@ void ivas_omasa_separate_object_renderer_close( return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*-------------------------------------------------------------------------* - * ivas_omasa_separate_object_render() - * - * Rendering separated objects and mixing them to the parametrically rendered signals - *-------------------------------------------------------------------------*/ - -void ivas_omasa_separate_object_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float input_f[][L_FRAME48k], /* i : separated object signal */ - float *output_f[], /* i/o: output signals */ - const int16_t output_frame /* i : output frame length per channel */ -) -{ - VBAP_HANDLE hVBAPdata; - int16_t nchan_out_woLFE; - ISM_RENDERER_HANDLE hRendererData; - int16_t j, k, j2; - int16_t obj; - float gains[MAX_OUTPUT_CHANNELS]; - float g1, g2; - int16_t lfe_index; - int16_t azimuth, elevation; - int16_t num_objects; - uint8_t single_separated; - int16_t block; - int16_t subframe_len; - int16_t idx_offset; - int16_t dirac_read_idx; - - hVBAPdata = st_ivas->hVBAPdata; - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - hRendererData = st_ivas->hIsmRendererData; - lfe_index = st_ivas->hDirACRend->hOutSetup.index_lfe[0]; - subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; - - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - single_separated = 1; - num_objects = 1; - } - else - { - single_separated = 0; - num_objects = st_ivas->nchan_ism; - } - - for ( obj = 0; obj < num_objects; obj++ ) - { - delay_signal( input_f[obj], output_frame, st_ivas->hMasaIsmData->delayBuffer[obj], st_ivas->hMasaIsmData->delayBuffer_size ); /* Delay the signal to match CLDFB delay */ - - for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) - { - idx_offset = block * subframe_len; - dirac_read_idx = ( st_ivas->hSpatParamRendCom->dirac_read_idx + block ) % st_ivas->hSpatParamRendCom->dirac_md_buffer_length; - - if ( single_separated ) - { - azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; - elevation = st_ivas->hMasaIsmData->elevation_separated_ism[dirac_read_idx]; - } - else - { - azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; - elevation = st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; - } - - if ( st_ivas->hOutSetup.is_planar_setup ) - { - /* If no elevation support in output format, then rendering should be done with zero elevation */ - elevation = 0; - } - - if ( hVBAPdata != NULL ) - { - vbap_determine_gains( hVBAPdata, gains, azimuth, elevation, 1 ); - } - else - { - ivas_dirac_dec_get_response( azimuth, elevation, gains, st_ivas->hDirACRend->hOutSetup.ambisonics_order ); - } - - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( st_ivas->hDirACRend->hOutSetup.num_lfe > 0 ) - { - j2 = j + ( j >= lfe_index ); - } - else - { - j2 = j; - } - - if ( fabsf( gains[j] ) > 0.0f || fabsf( hRendererData->prev_gains[obj][j] ) > 0.0f ) - { - for ( k = 0; k < subframe_len; k++ ) - { - g1 = hRendererData->interpolator[k]; - g2 = 1.0f - g1; - output_f[j2][k + idx_offset] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k + idx_offset]; - } - } - hRendererData->prev_gains[obj][j] = gains[j]; - } - } - } - - st_ivas->hSpatParamRendCom->dirac_read_idx = ( st_ivas->hSpatParamRendCom->dirac_read_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hSpatParamRendCom->dirac_md_buffer_length; - - return; -} -#endif /*-------------------------------------------------------------------------* * ivas_omasa_separate_object_render_jbm() @@ -632,11 +396,9 @@ void ivas_omasa_separate_object_render( *-------------------------------------------------------------------------*/ void ivas_omasa_separate_object_render_jbm( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const uint16_t nSamplesRendered, /* i : number of samples rendered */ -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX - float input_f_in[][L_FRAME48k], /* i : separated object signal */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const uint16_t nSamplesRendered, /* i : number of samples rendered */ + float input_f_in[][L_FRAME48k], /* i : separated object signal */ float *output_f[], /* o : rendered time signal */ const int16_t subframes_rendered, /* i : number of subframes rendered */ const int16_t slots_rendered /* i : number of CLDFB slots rendered */ @@ -687,15 +449,12 @@ void ivas_omasa_separate_object_render_jbm( output_f_local[j] = output_f[j]; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( st_ivas->hDecoderConfig->Opt_tsm ) { -#endif for ( obj = 0; obj < num_objects; obj++ ) { input_f[obj] = &st_ivas->hTcBuffer->tc[obj + 2][offsetSamples]; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX } else { @@ -704,7 +463,6 @@ void ivas_omasa_separate_object_render_jbm( input_f[obj] = input_f_in[obj]; } } -#endif slots_to_render = nSamplesRendered / hSpatParamRendCom->slot_size; first_sf = subframes_rendered; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 162525d7f931b956eafb513c28fae0c747a088ad..a7e492817b71267313ae2caed255e1690fdc3b0b 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -73,9 +73,6 @@ ivas_error ivas_jbm_dec_tc( int16_t n, output_frame, nchan_out; Decoder_State *st; /* used for bitstream handling */ float *p_output[MAX_TRANSPORT_CHANNELS]; /* 'float' buffer for output synthesis */ -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX - float output_f[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; /* TODO: can be allocated dynamically using st_ivas->p_output_f */ -#endif int16_t nchan_remapped; int16_t nb_bits_metadata[MAX_SCE + 1]; int32_t output_Fs, ivas_total_brate; @@ -99,18 +96,13 @@ ivas_error ivas_jbm_dec_tc( for ( n = 0; n < MAX_TRANSPORT_CHANNELS; n++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX p_output[n] = st_ivas->p_output_f[n]; if ( p_output[n] != NULL ) { set_zero( p_output[n], L_FRAME48k ); } -#else - p_output[n] = output_f[n]; -#endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( !st_ivas->hDecoderConfig->Opt_tsm ) { for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) @@ -119,7 +111,6 @@ ivas_error ivas_jbm_dec_tc( } } -#endif /*----------------------------------------------------------------* * Decoding + pre-rendering *----------------------------------------------------------------*/ @@ -163,14 +154,7 @@ ivas_error ivas_jbm_dec_tc( /* Metadata decoding and configuration */ if ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) { -#ifdef NONBE_FIX_898_ISM_BRATE_CRASH ivas_ism_dtx_dec( st_ivas, nb_bits_metadata ); -#else - if ( ( error = ivas_ism_dtx_dec( st_ivas, nb_bits_metadata ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /* decode dominant object first so the noise energy of the other objects can be limited */ if ( ( error = ivas_sce_dec( st_ivas, st_ivas->hISMDTX.sce_id_dtx, &p_output[st_ivas->hISMDTX.sce_id_dtx], output_frame, nb_bits_metadata[st_ivas->hISMDTX.sce_id_dtx] ) ) != IVAS_ERR_OK ) @@ -731,11 +715,7 @@ ivas_error ivas_jbm_dec_tc( * Write IVAS transport channels *----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_tsm == 1 || !st_ivas->hDecoderConfig->Opt_5ms ) -#else if ( st_ivas->hDecoderConfig->Opt_tsm == 1 ) -#endif { ivas_syn_output_f( p_output, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data ); } @@ -805,11 +785,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_tsm || !st_ivas->hDecoderConfig->Opt_5ms ) -#else if ( st_ivas->hDecoderConfig->Opt_tsm ) -#endif { ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); } @@ -898,10 +874,8 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else { -#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); -#endif ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); } } @@ -965,9 +939,6 @@ ivas_error ivas_jbm_dec_render( { int16_t n, nchan_out; int16_t nchan_transport; -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX - float output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* 'float' buffer for output synthesis */ -#endif int16_t nchan_remapped; int32_t output_Fs; AUDIO_CONFIG output_config; @@ -994,14 +965,9 @@ ivas_error ivas_jbm_dec_render( for ( n = 0; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX p_output[n] = st_ivas->p_output_f[n]; -#else - p_output[n] = &output[n][0]; -#endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( !st_ivas->hDecoderConfig->Opt_tsm ) { for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) @@ -1016,25 +982,12 @@ ivas_error ivas_jbm_dec_render( } else { -#endif for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) { p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX } -#endif -#ifndef NONBE_UNIFIED_DECODING_PATHS - /*----------------------------------------------------------------* - * Combine orientations - *----------------------------------------------------------------*/ - - if ( ( error = combine_external_and_head_orientations_dec( st_ivas->hHeadTrackData, st_ivas->hExtOrientationData, st_ivas->hCombinedOrientationData ) ) != IVAS_ERR_OK ) - { - return error; - } -#else /*----------------------------------------------------------------* * Update combined orientation access index *----------------------------------------------------------------*/ @@ -1046,7 +999,6 @@ ivas_error ivas_jbm_dec_render( ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); } -#endif /*----------------------------------------------------------------* * Rendering @@ -1138,7 +1090,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#if ( defined NONBE_UNIFIED_DECODING_PATHS && defined SPLIT_REND_WITH_HEAD_ROT ) +#if defined SPLIT_REND_WITH_HEAD_ROT if ( ( 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, p_output, *nSamplesRendered, output_Fs, 0 ) ) != IVAS_ERR_OK ) #else @@ -1147,9 +1099,6 @@ ivas_error ivas_jbm_dec_render( { return error; } -#ifndef FIX_881_REMOVE_LFE_ADDITION_IN_ISM - ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); -#endif } #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) @@ -1237,7 +1186,6 @@ ivas_error ivas_jbm_dec_render( { *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX /* shift SBA channels to avoid overwrite by ISM upmix in 1 object case and non-TSM unified channel memory*/ if ( st_ivas->nchan_ism == 1 && st_ivas->hDecoderConfig->Opt_tsm == 0 ) { @@ -1246,7 +1194,6 @@ ivas_error ivas_jbm_dec_render( p_tc[1] = p_output[2]; p_tc[2] = p_output[3]; } -#endif /* render objects */ ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered ); @@ -1259,38 +1206,10 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = ivas_osba_render_sf( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) { return error; } -#else - float output_ism[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float *p_output_ism[MAX_OUTPUT_CHANNELS]; - - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) - { - p_output_ism[n] = &output_ism[n][0]; - } - - if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) - { - ivas_ism_render_sf( st_ivas, p_output_ism, *nSamplesRendered ); - } - for ( n = 0; n < nchan_out; n++ ) - { - if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) - { - v_add( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); - } - v_multc( p_output[n], 0.5f, p_output[n], *nSamplesRendered ); - } -#endif } else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/ { @@ -1330,19 +1249,11 @@ ivas_error ivas_jbm_dec_render( #endif for ( n = st_ivas->hIntSetup.nchan_out_woLFE - 1; n >= 0; n-- ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX mvr2r( p_output[n], p_output[n + st_ivas->nchan_ism], *nSamplesRendered ); -#else - mvr2r( output[n], output[n + st_ivas->nchan_ism], *nSamplesRendered ); -#endif } for ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX set_zero( p_output[n], *nSamplesRendered ); -#else - set_zero( output[n], *nSamplesRendered ); -#endif } } } @@ -1378,7 +1289,7 @@ ivas_error ivas_jbm_dec_render( { #endif -#if ( defined NONBE_UNIFIED_DECODING_PATHS && defined SPLIT_REND_WITH_HEAD_ROT ) +#if defined SPLIT_REND_WITH_HEAD_ROT if ( ( 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 : p_tc, p_output, *nSamplesRendered, output_Fs, 0 ) ) != IVAS_ERR_OK ) #else @@ -1499,11 +1410,7 @@ ivas_error ivas_jbm_dec_render( /* we still need to copy the separate channel if available */ if ( st_ivas->hOutSetup.separateChannelEnabled ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#else - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#endif } ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); @@ -1512,11 +1419,7 @@ ivas_error ivas_jbm_dec_render( { for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX set_zero( p_output[n], *nSamplesRendered ); -#else - set_zero( output[n], *nSamplesRendered ); -#endif } } } @@ -1528,22 +1431,13 @@ ivas_error ivas_jbm_dec_render( output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, p_output[LFE_CHANNEL], *nSamplesRendered ); mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#else - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, output[LFE_CHANNEL], *nSamplesRendered ); - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#endif } else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { /* Delay the separated channel to sync with the DirAC rendering */ -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#else - mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); -#endif } } } @@ -1558,18 +1452,12 @@ ivas_error ivas_jbm_dec_render( st_ivas->hTcBuffer->n_samples_available -= *nSamplesRendered; st_ivas->hTcBuffer->n_samples_rendered += *nSamplesRendered; -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update global combined orientation start index */ ivas_combined_orientation_update_start_index( st_ivas->hCombinedOrientationData, *nSamplesRendered ); -#endif if ( st_ivas->hTcBuffer->n_samples_discard > 0 ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX for ( n = 0; n < min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); n++ ) -#else - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) -#endif { p_output[n] += st_ivas->hTcBuffer->n_samples_discard; } @@ -1661,12 +1549,10 @@ ivas_error ivas_jbm_dec_flush_renderer( float output[MAX_CICP_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; float *p_output[MAX_CICP_CHANNELS]; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( !st_ivas->hDecoderConfig->Opt_tsm ) { return IVAS_ERR_OK; } -#endif *nSamplesRendered = 0; hTcBuffer = st_ivas->hTcBuffer; @@ -1679,10 +1565,8 @@ ivas_error ivas_jbm_dec_flush_renderer( n_samples_still_available -= n_samples_to_render; assert( n_samples_still_available < tc_granularity_new ); -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#endif if ( n_slots_still_available ) { @@ -1706,11 +1590,7 @@ ivas_error ivas_jbm_dec_flush_renderer( hTcBuffer->n_samples_buffered = hTcBuffer->n_samples_granularity + n_samples_still_available; hTcBuffer->n_samples_available = 0; hTcBuffer->n_samples_flushed = n_samples_to_render; -#ifdef NONBE_FIX_855_JBM_FLUSH_OFFSET hTcBuffer->n_samples_rendered = 0; -#else - hTcBuffer->n_samples_rendered = hTcBuffer->n_samples_granularity; -#endif for ( ch_idx = 0; ch_idx < MAX_CICP_CHANNELS; ch_idx++ ) { @@ -1736,7 +1616,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_ism_render_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ); -#if ( defined NONBE_UNIFIED_DECODING_PATHS && defined SPLIT_REND_WITH_HEAD_ROT ) +#if defined SPLIT_REND_WITH_HEAD_ROT if ( ( 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, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) #else @@ -1746,9 +1626,6 @@ ivas_error ivas_jbm_dec_flush_renderer( { return error; } -#ifndef FIX_881_REMOVE_LFE_ADDITION_IN_ISM - ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, p_output, p_output ); -#endif } } else @@ -1762,7 +1639,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#if ( defined NONBE_UNIFIED_DECODING_PATHS && defined SPLIT_REND_WITH_HEAD_ROT ) +#if defined SPLIT_REND_WITH_HEAD_ROT if ( ( 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, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) #else @@ -1865,15 +1742,11 @@ ivas_error ivas_jbm_dec_flush_renderer( { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong IVAS format in VoIP renderer flushing!" ); } -#ifdef NONBE_FIX_855_JBM_FLUSH_OFFSET hTcBuffer->n_samples_rendered = hTcBuffer->n_samples_granularity; -#endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update global combined orientation start index */ ivas_combined_orientation_update_start_index( st_ivas->hCombinedOrientationData, *nSamplesRendered ); -#endif *nSamplesRendered = n_samples_to_render; @@ -2176,15 +2049,11 @@ int16_t ivas_jbm_dec_get_num_tc_channels( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( st_ivas->ivas_format == MONO_FORMAT ) { num_tc = st_ivas->hDecoderConfig->nchan_out; } else if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) -#else - if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) -#endif { num_tc = 1; } @@ -2488,10 +2357,8 @@ ivas_error ivas_jbm_dec_tc_buffer_open( } else { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( st_ivas->hDecoderConfig->Opt_tsm ) { -#endif if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); @@ -2513,13 +2380,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open( { hTcBuffer->tc[ch_idx] = NULL; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX } else { hTcBuffer->tc_buffer = NULL; } -#endif } } @@ -2596,15 +2461,11 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( assert( ( hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered ) < n_samples_granularity ); #endif /* realloc buffers */ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( hTcBuffer->tc_buffer != NULL ) { -#endif free( hTcBuffer->tc_buffer ); hTcBuffer->tc_buffer = NULL; -#ifdef NONBE_UNIFIED_DECODING_PATHS } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -2619,7 +2480,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( nsamp_to_allocate == 0 ) { hTcBuffer->tc_buffer = NULL; @@ -2630,11 +2490,8 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } else { -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( st_ivas->hDecoderConfig->Opt_tsm ) { -#endif if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); @@ -2656,16 +2513,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { hTcBuffer->tc[ch_idx] = NULL; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX } else { hTcBuffer->tc_buffer = NULL; } -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS } -#endif return IVAS_ERR_OK; } @@ -2908,18 +2761,14 @@ void ivas_jbm_dec_copy_tc_no_tsm( n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; /* copy full tcs*/ -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( st_ivas->hDecoderConfig->Opt_tsm ) { -#endif for ( ch_idx = 0; ch_idx < n_ch_full_copy; ch_idx++ ) { mvr2r( tc[ch_idx], st_ivas->hTcBuffer->tc[ch_idx], hTcBuffer->n_samples_buffered ); } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX } ch_idx = 0; -#endif /* CLDFB ana for ParamMC/ParamISM */ if ( n_ch_cldfb > 0 ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a160275ea96358f2132e79d2f868d75799107005..7139b734d28b235d9e9d7b94c3b0723b59517968 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -622,11 +622,7 @@ ivas_error ivas_masa_dec_open( st_ivas->hMasa = hMasa; /* allocate transport channels*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) -#else if ( st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) -#endif { int16_t nchan_to_allocate, nchan_transport; TC_BUFFER_MODE buffer_mode; @@ -1262,19 +1258,12 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms == 1 ) + if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) { -#endif - if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) - { - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - } -#ifndef NONBE_UNIFIED_DECODING_PATHS + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; } -#endif ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); @@ -1458,9 +1447,6 @@ ivas_error ivas_masa_dec_reconfigure( st_ivas->ism_mode = ISM_MODE_NONE; } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms == 1 ) -#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 3352a79781cd11b2eec741dabdc85a972b751d19..962b28d4d915850f9c728e5fae09a3727ae73377 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -439,11 +439,7 @@ ivas_error ivas_param_mc_dec_open( ivas_param_mc_dec_init( hParamMC, nchan_transport, nchan_out_cov ); -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms && hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) -#else if ( hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) -#endif { int16_t n_cldfb_slots; @@ -975,7 +971,6 @@ ivas_error ivas_param_mc_dec_reconfig( } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( nchan_transport_old != nchan_transport ) { if ( hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) @@ -1024,7 +1019,6 @@ ivas_error ivas_param_mc_dec_reconfig( } } } -#endif return error; } @@ -1489,11 +1483,7 @@ void ivas_param_mc_dec_digest_tc( /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_tsm || !st_ivas->hDecoderConfig->Opt_5ms ) -#else if ( st_ivas->hDecoderConfig->Opt_tsm ) -#endif { float RealBuffer[CLDFB_NO_CHANNELS_MAX]; float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; @@ -1812,9 +1802,6 @@ void ivas_param_mc_dec_render( #endif #endif st_ivas->hCombinedOrientationData, -#ifndef NONBE_UNIFIED_DECODING_PATHS - subframe_idx, -#endif hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); @@ -1836,10 +1823,8 @@ void ivas_param_mc_dec_render( } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, hParamMC->num_freq_bands * hParamMC->subframe_nbslots[subframe_idx] ); -#endif } else if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_CLDFB ) { diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 57065ed325a34a55963913bddbef4579d8539693..fdbca9f546c576ac8a06f9c06122f5a999cd09a1 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -64,9 +64,6 @@ const int16_t MC_PARAMUPMIX_CHIDX2[MC_PARAMUPMIX_COMBINATIONS] = { 2, 3, 6, 7 }; * Local function prototypes *-----------------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_mod_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t ch ); -#endif static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -77,12 +74,8 @@ static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[ static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering ); -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], float *pcm_in[], float **pp_out_pcm, const int16_t output_frame ); -#endif static int16_t huff_read( Decoder_State *st, const int16_t ( *ht )[2] ); -#ifdef FIX_891_PARAMUPMIX_CLEANUP static void huffman_decode( Decoder_State *st, const PAR_TYPE parType, int32_t *vq ); static void dequant_alpha( int32_t *vq, float *v ); @@ -90,15 +83,6 @@ static void dequant_alpha( int32_t *vq, float *v ); static void dequant_beta( int32_t *aq, int32_t *bq, float *beta ); static void get_ec_data( Decoder_State *st, const PAR_TYPE parType, int32_t *parQ, int32_t *alphaQEnv, float ab[IVAS_MAX_NUM_BANDS] ); -#else -static void huffman_decode( Decoder_State *st, const int16_t nv, const int16_t ivStart, PAR_TYPE parType, QUANT_TYPE quant_type, const int16_t bNoDt, int32_t *vq ); - -static void dequant_alpha( const int16_t nv, const int16_t ivStart, const QUANT_TYPE quant_type, int32_t *vq, float *v ); - -static void dequant_beta( const int16_t nv, const int16_t ivStart, const QUANT_TYPE quant_type, int32_t *aq, int32_t *bq, float *beta ); - -static void get_ec_data( Decoder_State *st, const PAR_TYPE parType, const QUANT_TYPE quant_type, const int16_t nParBand, const int16_t parBandStart, int32_t *parQ, int32_t *alphaQEnv, float ab[IVAS_MAX_NUM_BANDS] ); -#endif /*------------------------------------------------------------------------- @@ -153,17 +137,9 @@ void ivas_mc_paramupmix_dec_read_BS( for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP get_ec_data( st0, ALPHA, hMCParamUpmix->alpha_quant[i], alpha_quant, hMCParamUpmix->alphas[i] ); get_ec_data( st0, BETA, hMCParamUpmix->beta_quant[i], alpha_quant, hMCParamUpmix->betas[i] ); -#else - get_ec_data( st0, ALPHA, FINE /*quant_type*/, IVAS_MAX_NUM_BANDS /*nParBand*/, - 0 /*parBandStart*/, hMCParamUpmix->alpha_quant[i], alpha_quant, hMCParamUpmix->alphas[i] ); - - get_ec_data( st0, BETA, FINE /*quant_type*/, IVAS_MAX_NUM_BANDS /*nParBand*/, - 0 /*parBandStart*/, hMCParamUpmix->beta_quant[i], alpha_quant, hMCParamUpmix->betas[i] ); -#endif } *nb_bits += st0->next_bit_pos; st0->bit_stream = bit_stream_orig; @@ -184,299 +160,6 @@ void ivas_mc_paramupmix_dec_read_BS( return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*------------------------------------------------------------------------- - * ivas_mc_paramupmix_dec() - * - * MC ParamUpmix decoding process - *------------------------------------------------------------------------*/ - -void ivas_mc_paramupmix_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[] /* i/o: synthesized core-coder transport channels */ -) -{ - MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; - int16_t i, k, ch; - int16_t slot_idx; - int16_t first_empty_channel; - int16_t nchan_out_transport; - /*CLDFB*/ - float Cldfb_RealBuffer[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - int16_t channel_active[MAX_OUTPUT_CHANNELS]; - int32_t output_Fs; - int16_t output_frame; - float Pcm_decorr[MC_PARAMUPMIX_COMBINATIONS][L_FRAME48k]; /* decorrelated channels */ - float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ - int16_t noparamupmix_delay; - AUDIO_CONFIG output_config; - int16_t subframeIdx, idx_in, index_slot, maxBand; - float Cldfb_RealBuffer_subfr[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_subfr[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#ifdef SPLIT_REND_WITH_HEAD_ROT - float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#else - float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif - - hMCParamUpmix = st_ivas->hMCParamUpmix; - assert( hMCParamUpmix ); - push_wmops( "mc_paramupmix_dec" ); - - set_s( channel_active, 0, MAX_CICP_CHANNELS ); - nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; - set_s( channel_active, 1, nchan_out_transport ); /* change to nchan_out_transport */ - output_Fs = st_ivas->hDecoderConfig->output_Fs; - output_config = st_ivas->hDecoderConfig->output_config; - output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); - - if ( ( output_config == IVAS_AUDIO_CONFIG_STEREO ) || ( output_config == IVAS_AUDIO_CONFIG_MONO ) ) - { - first_empty_channel = 8; /* Don't upmix */ - - /* Compensate loudness for not doing full upmix */ - for ( i = 4; i < 8; i++ ) - { - v_multc( output_f[i], 2.0f, output_f[i], L_FRAME48k ); - } - } - else - { - first_empty_channel = 12; - - for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) - { - pPcm_temp[i] = Pcm_decorr[i]; /* decorrelated */ - } - - paramupmix_td_decorr_process( hMCParamUpmix->hTdDecorr, &( output_f[4] ), pPcm_temp, output_frame ); - - for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) - { - pPcm_temp[2 * i] = output_f[i + 4]; /* un-decorrelated */ - pPcm_temp[2 * i + 1] = Pcm_decorr[i]; /* decorrelated */ - } - - /* CLDFB Analysis*/ - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS * 2; ch++ ) - { - /* slot loop for gathering the input data */ - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) - { - cldfbAnalysis_ts( &( pPcm_temp[ch][hMCParamUpmix->num_freq_bands * slot_idx] ), Cldfb_RealBuffer[ch][slot_idx], Cldfb_ImagBuffer[ch][slot_idx], hMCParamUpmix->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - } - } - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - ps_pred_process( hMCParamUpmix, - Cldfb_RealBuffer[2 * ch], /* in/out */ - Cldfb_ImagBuffer[2 * ch], - Cldfb_RealBuffer[2 * ch + 1], /* in/out decorr */ - Cldfb_ImagBuffer[2 * ch + 1], - ch ); - - /*-- m, s -> l, r ----------------------------*/ - for ( i = 0; i < CLDFB_NO_COL_MAX; i++ ) - { - for ( k = 0; k < CLDFB_NO_CHANNELS_MAX; k++ ) - { - float qlre = Cldfb_RealBuffer[2 * ch][i][k]; - float qlim = Cldfb_ImagBuffer[2 * ch][i][k]; - float qrre = Cldfb_RealBuffer[2 * ch + 1][i][k]; - float qrim = Cldfb_ImagBuffer[2 * ch + 1][i][k]; - - Cldfb_RealBuffer[2 * ch][i][k] = qlre + qrre; - Cldfb_ImagBuffer[2 * ch][i][k] = qlim + qrim; - Cldfb_RealBuffer[2 * ch + 1][i][k] = qlre - qrre; - Cldfb_ImagBuffer[2 * ch + 1][i][k] = qlim - qrim; - } - } - - mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_prev[ch], IVAS_MAX_NUM_BANDS ); - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 ); - /* fastconv binaural rendering and CLDFB synthesis */ - for ( subframeIdx = 0; subframeIdx < ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); subframeIdx++ ) - { - index_slot = subframeIdx * MAX_PARAM_SPATIAL_SUBFRAMES; - /* cldfb analysis of non-coupled, non-LFE channels */ - idx_in = 0; - for ( ch = 0; ch < first_empty_channel - 2 * MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - if ( st_ivas->hIntSetup.index_lfe[0] != ch ) - { - pPcm_temp[ch] = output_f[ch]; - /* slot loop for gathering the input data */ - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - cldfbAnalysis_ts( &( pPcm_temp[ch][hMCParamUpmix->num_freq_bands * ( index_slot + slot_idx )] ), - Cldfb_RealBuffer_subfr[idx_in][slot_idx], - Cldfb_ImagBuffer_subfr[idx_in][slot_idx], - maxBand, st_ivas->cldfbAnaDec[2 * MC_PARAMUPMIX_COMBINATIONS + idx_in] ); - } - idx_in++; - } - } - - /* copy and reorder cldfb analysis of coupled channels */ - for ( ch = 0; ch < MAX_PARAM_SPATIAL_SUBFRAMES; ch++ ) - { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - mvr2r( Cldfb_RealBuffer[MC_PARAMUPMIX_CHIDX1[ch]][index_slot + slot_idx], Cldfb_RealBuffer_subfr[idx_in][slot_idx], CLDFB_NO_CHANNELS_MAX ); - mvr2r( Cldfb_ImagBuffer[MC_PARAMUPMIX_CHIDX1[ch]][index_slot + slot_idx], Cldfb_ImagBuffer_subfr[idx_in][slot_idx], CLDFB_NO_CHANNELS_MAX ); - mvr2r( Cldfb_RealBuffer[MC_PARAMUPMIX_CHIDX2[ch]][index_slot + slot_idx], Cldfb_RealBuffer_subfr[idx_in + 1][slot_idx], CLDFB_NO_CHANNELS_MAX ); - mvr2r( Cldfb_ImagBuffer[MC_PARAMUPMIX_CHIDX2[ch]][index_slot + slot_idx], Cldfb_ImagBuffer_subfr[idx_in + 1][slot_idx], CLDFB_NO_CHANNELS_MAX ); - } - idx_in += 2; - } - - if ( st_ivas->hCombinedOrientationData && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - ivas_param_mc_mc2sba_cldfb( st_ivas->hTransSetup, hMCParamUpmix->hoa_encoder, slot_idx, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr, maxBand, GAIN_LFE ); - } - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - /*LFE handling for split rendering cases*/ - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) - { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) - { - mvr2r( Cldfb_RealBuffer_subfr[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_RealBuffer[ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - mvr2r( Cldfb_ImagBuffer_subfr[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_ImagBuffer[ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - } - } - st_ivas->hSplitBinRend.hCldfbDataOut->config = st_ivas->hIntSetup.output_config; - } -#endif - } -#endif - - /* Implement binaural rendering */ - ivas_binRenderer( st_ivas->hBinRenderer, -#ifdef SPLIT_REND_WITH_HEAD_ROT - &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, -#endif - st_ivas->hCombinedOrientationData, -#ifndef NONBE_UNIFIED_DECODING_PATHS - subframeIdx, -#endif - JBM_CLDFB_SLOTS_IN_SUBFRAME, -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - NULL, -#endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - Cldfb_RealBuffer_subfr, - Cldfb_ImagBuffer_subfr ); - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - int16_t pos_idx; - - for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) - { - for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) - { - for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) - { - mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - } - } - } - } -#endif - -#ifdef NONBE_UNIFIED_DECODING_PATHS - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, maxBand * MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif - - /* Implement CLDFB synthesis */ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[0][ch][slot_idx]; - ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[0][ch][slot_idx]; -#else - RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch][slot_idx]; - ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch][slot_idx]; -#endif - } - - cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][index_slot * maxBand] ), maxBand * MAX_PARAM_SPATIAL_SUBFRAMES, st_ivas->cldfbSynDec[ch] ); - } - } - } - else - { - pPcm_temp[0] = output_f[4]; - pPcm_temp[1] = output_f[6]; - pPcm_temp[2] = output_f[5]; - pPcm_temp[3] = output_f[7]; - pPcm_temp[4] = output_f[8]; - pPcm_temp[5] = output_f[10]; - pPcm_temp[6] = output_f[9]; - pPcm_temp[7] = output_f[11]; - - /* CLDFB synthesis */ - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS * 2; ch++ ) - { - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) - { - float *ptr_im[1], *ptr_re[1]; - ptr_re[0] = Cldfb_RealBuffer[ch][slot_idx]; - ptr_im[0] = Cldfb_ImagBuffer[ch][slot_idx]; - - cldfbSynthesis( ptr_re, ptr_im, &( pPcm_temp[ch][hMCParamUpmix->num_freq_bands * slot_idx] ), - hMCParamUpmix->num_freq_bands, st_ivas->cldfbSynDec[ch] ); - } - } - - /* adjust delay of other channels */ - noparamupmix_delay = NS2SA( output_Fs, IVAS_FB_DEC_DELAY_NS ); - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - float tmp_buf[L_SUBFRAME5MS_48k]; - mvr2r( &output_f[ch][output_frame - noparamupmix_delay], tmp_buf, noparamupmix_delay ); - mvr2r( output_f[ch], &output_f[ch][noparamupmix_delay], output_frame - noparamupmix_delay ); - mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], noparamupmix_delay ); - mvr2r( tmp_buf, hMCParamUpmix->pcm_delay[ch], noparamupmix_delay ); - } - } - } - - for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); ch++ ) - { - set_f( output_f[ch], 0.0f, output_frame ); - } - - pop_wmops(); - return; -} -#endif /*------------------------------------------------------------------------- * ivas_mc_paramupmix_dec_digest_tc() @@ -584,19 +267,13 @@ void ivas_mc_paramupmix_dec_render( ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX for ( ch = 0; ch < min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ) ); ch++ ) -#else - for ( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) -#endif { output_f_local[ch] += n_samples_sf; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); -#endif } for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) @@ -693,26 +370,15 @@ ivas_error ivas_mc_paramupmix_dec_open( hMCParamUpmix->free_param_interpolator = 0; hMCParamUpmix->param_interpolator = NULL; -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms == 1 ) + if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) { -#endif - if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); - } - hMCParamUpmix->free_param_interpolator = 1; - - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); -#ifndef NONBE_UNIFIED_DECODING_PATHS + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); } -#endif + hMCParamUpmix->free_param_interpolator = 1; + + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms == 1 && st_ivas->hTcBuffer == NULL ) -#else if ( st_ivas->hTcBuffer == NULL ) -#endif { int16_t nchan_to_allocate; int16_t nchan_tc; @@ -898,70 +564,6 @@ static void ivas_param_upmix_dec_decorr_subframes( /*****************************************************************************************/ /* local functions */ /*****************************************************************************************/ -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -static void ps_pred_process( - MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, - float qmf_mod_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* in/out */ - float qmf_mod_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float qmf_side_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* in/out */ - float qmf_side_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t ch ) -{ - float vmre, vmim, vsre, vsim; - int16_t iqmf, ipar, ismp, iismp; - float alpha_smp, dalpha, beta_smp, dbeta; - float *alpha1, *alpha2; - float *beta1, *beta2; - float *alpha_prev = hMCParamUpmix->alpha_prev[ch]; - float *beta_prev = hMCParamUpmix->beta_prev[ch]; - - const int16_t qmf_to_par_band[] = { - 0, 1, 2, 3, 4, 5, 5, 6, 6, 7, - 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, - 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 - }; - - for ( iqmf = 0; iqmf < CLDFB_NO_CHANNELS_MAX; iqmf++ ) - { - /* For changing no of parameter bands (ipar1 != ipar2), TIGGER_FRAMING assumed */ - ipar = qmf_to_par_band[iqmf]; - alpha1 = alpha_prev; - beta1 = beta_prev; - - ismp = 0; - alpha2 = hMCParamUpmix->alphas[ch]; - beta2 = hMCParamUpmix->betas[ch]; - alpha_smp = alpha1[ipar]; - beta_smp = beta1[ipar]; - dalpha = ( alpha2[ipar] - alpha1[ipar] ) / CLDFB_NO_COL_MAX; - dbeta = ( beta2[ipar] - beta1[ipar] ) / CLDFB_NO_COL_MAX; - - for ( iismp = 0; iismp < CLDFB_NO_COL_MAX; iismp++ ) - { - alpha_smp += dalpha; - beta_smp += dbeta; - - vmre = qmf_mod_re[ismp][iqmf]; - vmim = qmf_mod_im[ismp][iqmf]; - vsre = qmf_side_re[ismp][iqmf]; - vsim = qmf_side_im[ismp][iqmf]; - - qmf_side_re[ismp][iqmf] = alpha_smp * vmre + beta_smp * vsre; - qmf_side_im[ismp][iqmf] = alpha_smp * vmim + beta_smp * vsim; - - ismp++; - } - - alpha1 = alpha2; - beta1 = beta2; - } - - return; -} -#endif static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, @@ -1191,9 +793,6 @@ static void ivas_mc_paramupmix_dec_sf( &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, #endif st_ivas->hCombinedOrientationData, -#ifndef NONBE_UNIFIED_DECODING_PATHS - subframeIdx, -#endif st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, @@ -1296,53 +895,6 @@ static void ivas_mc_paramupmix_dec_sf( return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -static void paramupmix_td_decorr_process( - ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */ - float *pcm_in[], /* i : input audio channels */ - float **pp_out_pcm, /* o : output audio channels */ - const int16_t output_frame /* i : output frame length */ -) -{ - int16_t j, k; - int16_t offset; - float in_duck_gain[L_FRAME48k], out_duck_gain[L_FRAME48k]; - - offset = (int16_t) ( output_frame * FRAMES_PER_SEC * IVAS_DECORR_PARM_LOOKAHEAD_TAU ); - - /* Look-ahead delay */ - for ( k = 0; k < MC_PARAMUPMIX_COMBINATIONS; k++ ) - { - mvr2r( pcm_in[k], pp_out_pcm[k], output_frame ); - delay_signal( pp_out_pcm[k], output_frame, hTdDecorr[k]->look_ahead_buf, offset ); - - /* In ducking gains */ - if ( hTdDecorr[k]->ducking_flag ) - { - ivas_td_decorr_get_ducking_gains( hTdDecorr[k]->pTrans_det, pcm_in[k], in_duck_gain, out_duck_gain, output_frame, 0 ); - - for ( j = 0; j < output_frame; j++ ) - { - pp_out_pcm[k][j] = pp_out_pcm[k][j] * in_duck_gain[j]; - } - } - - /* All pass delay section */ - ivas_td_decorr_APD_iir_filter( &hTdDecorr[k]->APD_filt_state[0], pp_out_pcm[k], hTdDecorr[k]->num_apd_sections, output_frame ); - - /* Out ducking gains */ - if ( hTdDecorr[k]->ducking_flag ) - { - for ( j = 0; j < output_frame; j++ ) - { - pp_out_pcm[k][j] = pp_out_pcm[k][j] * out_duck_gain[j]; - } - } - } - - return; -} -#endif static int16_t huff_read( Decoder_State *st, @@ -1364,19 +916,10 @@ static int16_t huff_read( static void huffman_decode( Decoder_State *st, -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t nv, - const int16_t ivStart, const PAR_TYPE parType, - const QUANT_TYPE quant_type, - const int16_t bNoDt, -#else - const PAR_TYPE parType, -#endif int32_t *vq ) { const int16_t( *huff_node_table )[2]; -#ifdef FIX_891_PARAMUPMIX_CLEANUP int16_t iv, nquant, offset; nquant = 0; @@ -1393,38 +936,8 @@ static void huffman_decode( } offset = nquant - 1; /* range of df [-(nquant - 1), nquant - 1] */ -#else - int16_t iv, bdt, nquant, offset; - nquant = 0; - switch ( parType ) - { - case ALPHA: - nquant = ivas_mc_paramupmix_alpha_quant_table[quant_type].nquant; - break; - case BETA: - nquant = ivas_mc_paramupmix_beta_quant_table[quant_type][0].nquant; - break; - default: - assert( 0 ); - } - - offset = nquant - 1; /* range of df/dt [-(nquant - 1), nquant - 1] */ -#endif -#ifdef FIX_891_PARAMUPMIX_CLEANUP st->next_bit_pos++; -#else - if ( bNoDt ) - { - bdt = 0; - } - else - { - bdt = st->bit_stream[st->next_bit_pos]; - st->next_bit_pos++; - } -#endif -#ifdef FIX_891_PARAMUPMIX_CLEANUP switch ( parType ) { case ALPHA: @@ -1455,76 +968,16 @@ static void huffman_decode( { vq[iv] = huff_read( st, huff_node_table ) + vq[iv - 1] - offset; } -#else - if ( bdt ) - { /* Get dt */ - switch ( parType ) - { - case ALPHA: - huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.alpha[quant_type]; - break; - case BETA: - huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.beta[quant_type]; - break; - default: - huff_node_table = NULL; - assert( 0 ); - } - for ( iv = ivStart; iv < nv; iv++ ) - { - vq[iv] = huff_read( st, huff_node_table ) + vq[iv] - offset; - } - } - else /* Get f0, df */ - { - switch ( parType ) - { - case ALPHA: - huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.alpha[quant_type]; - break; - case BETA: - huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.beta[quant_type]; - break; - default: - huff_node_table = NULL; - assert( 0 ); - } - vq[ivStart] = huff_read( st, huff_node_table ); - - switch ( parType ) - { - case ALPHA: - huff_node_table = ivas_mc_paramupmix_huff_nodes_df.alpha[quant_type]; - break; - case BETA: - huff_node_table = ivas_mc_paramupmix_huff_nodes_df.beta[quant_type]; - break; - default: - assert( 0 ); - } - - for ( iv = ivStart + 1; iv < nv; iv++ ) - { - vq[iv] = huff_read( st, huff_node_table ) + vq[iv - 1] - offset; - } - } -#endif return; } static void dequant_alpha( -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t nv, - const int16_t ivStart, - const QUANT_TYPE quant_type, -#endif int32_t *vq, float *v ) { int16_t iv; -#ifdef FIX_891_PARAMUPMIX_CLEANUP const ACPL_QUANT_TABLE *quant_table = &ivas_mc_paramupmix_alpha_quant_table; for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ ) @@ -1532,29 +985,11 @@ static void dequant_alpha( v[iv] = quant_table->data[vq[iv]]; } -#else - const ACPL_QUANT_TABLE *quant_table = &ivas_mc_paramupmix_alpha_quant_table[quant_type]; - - for ( iv = 0; iv < ivStart; iv++ ) - { - v[iv] = 0; - } - - for ( iv = ivStart; iv < nv; iv++ ) - { - v[iv] = quant_table->data[vq[iv]]; - } -#endif return; } static void dequant_beta( -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t nv, - const int16_t ivStart, - const QUANT_TYPE quant_type, -#endif int32_t *aq, int32_t *bq, float *beta ) @@ -1562,25 +997,12 @@ static void dequant_beta( int16_t iv; const ACPL_QUANT_TABLE *quant_table; -#ifdef FIX_891_PARAMUPMIX_CLEANUP for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ ) { quant_table = &ivas_mc_paramupmix_beta_quant_table[ivas_param_upmx_mx_qmap[aq[iv]]]; beta[iv] = quant_table->data[bq[iv]]; } -#else - for ( iv = 0; iv < ivStart; iv++ ) - { - beta[iv] = 0; - } - - for ( iv = ivStart; iv < nv; iv++ ) - { - quant_table = &ivas_mc_paramupmix_beta_quant_table[quant_type][ivas_param_upmx_mx_qmap[quant_type][aq[iv]]]; - beta[iv] = quant_table->data[bq[iv]]; - } -#endif return; } @@ -1588,38 +1010,20 @@ static void dequant_beta( static void get_ec_data( Decoder_State *st, const PAR_TYPE parType, -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const QUANT_TYPE quant_type, - const int16_t nParBand, - const int16_t parBandStart, -#endif int32_t *parQ, int32_t *alphaQEnv, float ab[IVAS_MAX_NUM_BANDS] ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP huffman_decode( st, parType, parQ ); -#else - huffman_decode( st, nParBand, parBandStart, parType, quant_type, 0, parQ ); -#endif if ( parType == ALPHA ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP dequant_alpha( parQ, ab ); mvl2l( parQ, alphaQEnv, (int16_t) IVAS_MAX_NUM_BANDS ); -#else - dequant_alpha( nParBand, parBandStart, quant_type, parQ, ab ); - mvl2l( parQ, alphaQEnv, (int16_t) nParBand ); -#endif } else { -#ifdef FIX_891_PARAMUPMIX_CLEANUP dequant_beta( alphaQEnv, parQ, ab ); -#else - dequant_beta( nParBand, parBandStart, quant_type, alphaQEnv, parQ, ab ); -#endif } return; diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c old mode 100755 new mode 100644 index 167d8b6727ee3c5d7a4a79c6e212c9cbce850218..4be9304f4b735cdda34532e79647d45f4da519ea --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -773,53 +773,46 @@ static ivas_error ivas_mc_dec_reconfig( /* side effect of the renderer selection can be a changed internal config */ ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms ) + /* transfer subframe info from DirAC or ParamMC to central tc buffer */ + if ( last_mc_mode == MC_MODE_PARAMMC ) { -#endif - /* transfer subframe info from DirAC or ParamMC to central tc buffer */ - if ( last_mc_mode == MC_MODE_PARAMMC ) - { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hParamMC->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hParamMC->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hParamMC->slots_rendered; - mvs2s( st_ivas->hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } - else if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->hSpatParamRendCom != NULL ) - { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } + st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hParamMC->subframes_rendered; + st_ivas->hTcBuffer->num_slots = st_ivas->hParamMC->num_slots; + st_ivas->hTcBuffer->slots_rendered = st_ivas->hParamMC->slots_rendered; + mvs2s( st_ivas->hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } + else if ( last_mc_mode == MC_MODE_MCMASA && st_ivas->hSpatParamRendCom != NULL ) + { + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; + st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } - /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv - render what still fits in the new granularity */ - tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); - if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) - { + /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv + render what still fits in the new granularity */ + tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); + if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) + { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, last_mc_mode, ISM_MODE_NONE, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, last_mc_mode, ISM_MODE_NONE, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, last_mc_mode, ISM_MODE_NONE, nSamplesRendered, data ) ) != IVAS_ERR_OK ) #endif - { - return error; - } + { + return error; } - /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ - else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) + } + /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ + else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) + { + if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } -#ifndef NONBE_UNIFIED_DECODING_PATHS } -#endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { @@ -1325,9 +1318,6 @@ static ivas_error ivas_mc_dec_reconfig( * JBM TC buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms == 1 ) -#endif { int16_t tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; @@ -1395,19 +1385,12 @@ static ivas_error ivas_mc_dec_reconfig( * floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !st_ivas->hDecoderConfig->Opt_5ms ) - { -#endif - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef NONBE_UNIFIED_DECODING_PATHS + if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) + { + return error; } -#endif return error; } diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 3e6d630a8e1ba1539dcf794df1a24851d3cd5e51..13ecf277e95d24bab8ce86840e3f765b470e4ed3 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -285,12 +285,8 @@ static void dec_prm_tcx_spec( *-----------------------------------------------------------------*/ void ivas_mdct_dec_side_bits_frame_channel( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO - int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ -#else - int16_t param_lpc[MCT_MAX_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ -#endif + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ int16_t p_param[CPE_CHANNELS][NB_DIV], /* o : pointer to param buffer */ Decoder_State *st0, /* i : pointer to bitstream handle */ int16_t nTnsBitsTCX10[CPE_CHANNELS][NB_DIV], /* o : number of bits for TNS */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index a0f522711e8b9985bd1cf760c036c7e506200eb6..10e2a47deaf1bc88c4de334bce00ea2b8bdfdcfd 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -98,16 +98,7 @@ ivas_error ivas_td_binaural_renderer( ism_md_subframe_update = 2; } -#ifdef NONBE_UNIFIED_DECODING_PATHS return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, st_ivas->hCombinedOrientationData, ism_md_subframe_update, output, output_frame, MAX_PARAM_SPATIAL_SUBFRAMES ); - -#else - return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, - ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation : NULL, - ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, - ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL, - ism_md_subframe_update, output, output_frame, MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif } @@ -226,16 +217,9 @@ ivas_error ivas_td_binaural_renderer_sf( /* Update the listener's location/orientation */ if ( ( error = TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, -#ifdef NONBE_UNIFIED_DECODING_PATHS ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] : 0, ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->Quaternions[st_ivas->hCombinedOrientationData->subframe_idx] : NULL, - ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->listenerPos[st_ivas->hCombinedOrientationData->subframe_idx] : NULL -#else - ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] : 0, - ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, - ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL -#endif - ) ) != IVAS_ERR_OK ) + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->listenerPos[st_ivas->hCombinedOrientationData->subframe_idx] : NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -274,10 +258,8 @@ ivas_error ivas_td_binaural_renderer_sf( output_f_local[ch] += output_frame; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, output_frame ); -#endif } st_ivas->hTcBuffer->subframes_rendered = last_sf; @@ -286,7 +268,6 @@ ivas_error ivas_td_binaural_renderer_sf( } -#ifdef NONBE_UNIFIED_DECODING_PATHS #ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * ivas_td_binaural_renderer_sf_splitBinaural() @@ -309,9 +290,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( int16_t original_subframes_rendered; int16_t original_slots_rendered; float *p_bin_output[BINAURAL_CHANNELS]; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float output_local[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // VE2SB: TBV -#endif push_wmops( "ivas_td_binaural_renderer_sf_splitBinaural" ); pMultiBinPoseData = &st_ivas->hSplitBinRend.splitrend.multiBinPoseData; @@ -381,11 +360,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( /* set output channels */ for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX p_bin_output[i] = output_local[pos_idx * BINAURAL_CHANNELS + i]; -#else - p_bin_output[i] = output[pos_idx * BINAURAL_CHANNELS + i]; -#endif } st_ivas->hTcBuffer->subframes_rendered = original_subframes_rendered; st_ivas->hTcBuffer->slots_rendered = original_slots_rendered; @@ -405,12 +380,10 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX for ( i = 0; i < pMultiBinPoseData->num_poses * BINAURAL_CHANNELS; i++ ) { mvr2r( output_local[i], output[i], nSamplesRendered ); } -#endif /* Restore original head rotation */ for ( i = 0; i < st_ivas->hCombinedOrientationData->num_subframes; ++i ) @@ -425,4 +398,3 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( return IVAS_ERR_OK; } #endif -#endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index daf217575a0334e92e0f682c79dc7f8b3eaa7d0c..33a504bae706fff4046d25c9dc2a2a5fcda3e332 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -400,18 +400,11 @@ ivas_error ivas_omasa_dec_config( * floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !st_ivas->hDecoderConfig->Opt_5ms ) + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { -#endif - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef NONBE_UNIFIED_DECODING_PATHS + return error; } -#endif } @@ -579,45 +572,6 @@ ivas_error ivas_omasa_ism_metadata_dec( return IVAS_ERR_OK; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*--------------------------------------------------------------------------* - * ivas_omasa_dirac_rend() - * - * Rendering in OMASA format - *--------------------------------------------------------------------------*/ - -void ivas_omasa_dirac_rend( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* o : output synthesis signal */ - const int16_t output_frame /* i : output frame length per channel */ -) -{ - int16_t n, dirac_read_idx; - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - mvr2r( output[2], data_separated_objects[0], output_frame ); - } - else - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - mvr2r( output[n + 2], data_separated_objects[n], output_frame ); - } - } - - dirac_read_idx = st_ivas->hSpatParamRendCom->dirac_read_idx; - - ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - - st_ivas->hSpatParamRendCom->dirac_read_idx = dirac_read_idx; /* Original read index is needed for the next function which will update it again */ - - ivas_omasa_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); - - return; -} -#endif /*--------------------------------------------------------------------------* * ivas_omasa_dirac_rend_jbm() @@ -636,7 +590,6 @@ void ivas_omasa_dirac_rend_jbm( { int16_t subframes_rendered; int16_t slots_rendered; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX int16_t n; float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; @@ -651,77 +604,17 @@ void ivas_omasa_dirac_rend_jbm( mvr2r( output_f[n + CPE_CHANNELS], data_separated_objects[n], nSamplesAsked ); } } -#endif subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; ivas_dirac_dec_render( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_f ); -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered, slots_rendered ); -#else - ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, output_f, subframes_rendered, slots_rendered ); -#endif return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS -/*--------------------------------------------------------------------------* - * ivas_omasa_dirac_td_binaural() - * - * Binaural rendering in OMASA format - *--------------------------------------------------------------------------*/ - -ivas_error ivas_omasa_dirac_td_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* o : output synthesis signal */ - const int16_t output_frame /* i : output frame length per channel */ -) -{ - int16_t n; - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - float gain = OMASA_TDREND_MATCHING_GAIN; - ivas_error error; - float *p_sepobj[MAX_NUM_OBJECTS]; - - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) - { - p_sepobj[n] = &data_separated_objects[n][0]; - } - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - mvr2r( output[2 + n], data_separated_objects[n], output_frame ); - v_multc( data_separated_objects[n], gain, data_separated_objects[n], output_frame ); - } - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - delay_signal( data_separated_objects[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); - } - - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - -#ifdef NONBE_UNIFIED_DECODING_PATHS - /* reset combined orientation access index before calling the td renderer */ - ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#endif - - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_sepobj, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - - for ( n = 0; n < BINAURAL_CHANNELS; n++ ) - { - v_add( output[n], p_sepobj[n], output[n], output_frame ); - } - - return IVAS_ERR_OK; -} -#endif /*--------------------------------------------------------------------------* * ivas_omasa_dirac_td_binaural_render() @@ -767,10 +660,8 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ivas_dirac_dec_binaural_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, nchan_transport, output_f ); -#ifdef NONBE_UNIFIED_DECODING_PATHS /* reset combined orientation access index before calling the td renderer */ ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#endif if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_sepobj, *nSamplesRendered ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index a30ddfb55719dc3a51a43e10469b56eadfa97717..32c8b0fef8a310e787f79ab7df0853fbb1a8af2a 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -134,7 +134,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( { int16_t n; ivas_error error; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float output_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; // VE2SB: TBV float *p_sepobj[BINAURAL_CHANNELS]; int16_t channel_offset; @@ -145,13 +144,8 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( } channel_offset = st_ivas->nchan_ism; -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, &output_f[channel_offset] ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, &output_f[2] ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -199,11 +193,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( { #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_sepobj, *nSamplesRendered ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, output_f, *nSamplesRendered ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -213,11 +203,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( int16_t i; for ( i = 0; i < nSamplesAsked; i++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX output_f[n][i] = 0.5f * output_f[channel_offset + n][i] + 0.5f * p_sepobj[n][i]; -#else - output_f[n][i] = 0.5f * output_f[2 + n][i] + 0.5f * output_f[n][i]; -#endif } } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -226,141 +212,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( return IVAS_ERR_OK; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*--------------------------------------------------------------------------* - * ivas_osba_dirac_td_binaural() - * - * Binaural rendering in OSBA format - *--------------------------------------------------------------------------*/ - -ivas_error ivas_osba_dirac_td_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* o : output synthesis signal */ - const int16_t output_frame /* i : output frame length per channel */ -) -{ - int16_t n; - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - ivas_error error; - float *p_sepobj[MAX_NUM_OBJECTS]; - int16_t channel_offset; - - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) - { - p_sepobj[n] = &data_separated_objects[n][0]; - } - - channel_offset = st_ivas->nchan_ism; - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - mvr2r( output[n], data_separated_objects[n], output_frame ); - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - delay_signal( data_separated_objects[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); - } - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - if ( ( error = ivas_sba_upmixer_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, &output[channel_offset], st_ivas->nchan_transport, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - -#ifdef DEBUG_OSBA - { - for ( int16_t t = 0; t < output_frame; t++ ) - { - for ( int16_t c = 0; c < BINAURAL_CHANNELS; c++ ) - { - int16_t val = (int16_t) ( output[channel_offset + c][t] + 0.5f ); - dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/sba_fast_conv_out.raw" ); - } - } - } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - int16_t slot_idx, num_cldfb_bands, b, nchan_transport_orig; - float Cldfb_RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - - num_cldfb_bands = st_ivas->hSplitBinRend.splitrend.hCldfbHandles->cldfbAna[0]->no_channels; - nchan_transport_orig = st_ivas->nchan_transport; - st_ivas->nchan_transport = st_ivas->nchan_ism; - - if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - - st_ivas->nchan_transport = nchan_transport_orig; - - for ( n = 0; n < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++n ) - { - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) - { - cldfbAnalysis_ts( &( output[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend.splitrend.hCldfbHandles->cldfbAna[n] ); - - for ( b = 0; b < num_cldfb_bands; b++ ) - { - st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx][b] = - ( 0.5f * st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx][b] ) + - ( 0.5f * Cldfb_RealBuffer[b] ); - - st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx][b] = - ( 0.5f * st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx][b] ) + - ( 0.5f * Cldfb_ImagBuffer[b] ); - } - } - } - } - else - { -#endif - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_sepobj, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - -#ifdef DEBUG_OSBA - for ( int16_t t = 0; t < output_frame; t++ ) - { - for ( int16_t c = 0; c < BINAURAL_CHANNELS; c++ ) - { - int16_t val = (int16_t) ( p_sepobj[c][t] + 0.5f ); - dbgwrite( &val, sizeof( int16_t ), 1, 1, "./res/ism_td_bin_out.raw" ); - } - } -#endif - for ( n = 0; n < BINAURAL_CHANNELS; n++ ) - { - int16_t i; - for ( i = 0; i < output_frame; i++ ) - { - output[n][i] = 0.5f * output[channel_offset + n][i] + 0.5f * p_sepobj[n][i]; - } - } -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - - return IVAS_ERR_OK; -} -#endif /*-------------------------------------------------------------------------* * ivas_osba_ism_metadata_dec() @@ -392,7 +243,6 @@ ivas_error ivas_osba_ism_metadata_dec( return IVAS_ERR_OK; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX /*-------------------------------------------------------------------------* * ivas_osba_render_sf() * @@ -444,64 +294,3 @@ ivas_error ivas_osba_render_sf( return IVAS_ERR_OK; } -#else -/*-------------------------------------------------------------------------* - * ivas_osba_render() - * - * Object + SBA rendering process. - *-------------------------------------------------------------------------*/ - -ivas_error ivas_osba_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[], /* i/o: core-coder transport channels/object output */ - const int16_t output_frame /* i : output frame length per channel */ -) -{ - float tmp_ism_out[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float *p_tmp_ism_out[MAX_OUTPUT_CHANNELS]; - int16_t n, nchan_out, nchan_ism; - ivas_error error; - - nchan_out = st_ivas->hDecoderConfig->nchan_out; - nchan_ism = st_ivas->nchan_ism; - - for ( n = 0; n < max( nchan_out, nchan_ism ); n++ ) - { - p_tmp_ism_out[n] = &tmp_ism_out[n][0]; - } - - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - for ( n = 0; n < nchan_ism; n++ ) - { - mvr2r( output_f[n], tmp_ism_out[n], output_frame ); - delay_signal( tmp_ism_out[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); - } - - if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI ) - { - ivas_ism2sba( p_tmp_ism_out, st_ivas->hIsmRendererData, st_ivas->hIsmMetaData, st_ivas->nchan_ism, output_frame, st_ivas->hIntSetup.ambisonics_order ); - } - else - { - ivas_ism_render( st_ivas, p_tmp_ism_out, output_frame ); - } - } - - if ( ( error = ivas_sba_upmixer_renderer( st_ivas, output_f, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - for ( n = 0; n < nchan_out; n++ ) - { - v_add( output_f[n + nchan_ism], tmp_ism_out[n], output_f[n], output_frame ); - v_multc( output_f[n], 0.5f, output_f[n], output_frame ); - } - } - - return IVAS_ERR_OK; -} -#endif diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index d05bf16feff287ef99b535e1ae81c802ab10fff5..cfe91dfab627b1eb62aac4551d08f13a948550d1 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -580,29 +580,6 @@ static const int16_t huff_nodes_first_band_alpha[32][2] = { -2, -32 } }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/* Alpha Coarse Huffman table df0 */ -static const int16_t huff_nodes_first_band_alpha_coarse[16][2] = -{ - { -9, 1 }, - { -8, 2 }, - { -10, 3 }, - { 5, 4 }, - { -7, 6 }, - { -11, 7 }, - { -5, 8 }, - { -6, 9 }, - { -12, 10 }, - { -13, 11 }, - { -4, 12 }, - { -14, 13 }, - { -3, 14 }, - { -15, 15 }, - { -2, -16 }, - { -1, -17 } -}; - -#endif /* Alpha Fine Huffman table df */ static const int16_t huff_nodes_alpha_1D_DF[64][2] = { @@ -672,45 +649,6 @@ static const int16_t huff_nodes_alpha_1D_DF[64][2] = { -2, -62 } }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/* Alpha Coarse Huffman table df */ -static const int16_t huff_nodes_alpha_1D_DF_coarse[32][2] = -{ - { -17, 1 }, - { -18, 2 }, - { -16, 3 }, - { -15, 4 }, - { -19, 5 }, - { 7, 6 }, - { -14, -20 }, - { 9, 8 }, - { -13, -21 }, - { 11, 10 }, - { -22, 12 }, - { -12, 13 }, - { -23, 14 }, - { -11, 15 }, - { -10, 16 }, - { -24, 17 }, - { -9, -25 }, - { 19, 18 }, - { -26, 20 }, - { -8, 21 }, - { 23, 22 }, - { 25, 24 }, - { -27, 26 }, - { -7, 27 }, - { -1, -33 }, - { -6, 28 }, - { -28, 29 }, - { -29, 30 }, - { -5, -31 }, - { -30, 31 }, - { -3, -4 }, - { -2, -32 } -}; - -#endif /* Alpha Fine Huffman table dt */ static const int16_t huff_nodes_alpha_1D_DT[64][2] = { @@ -780,88 +718,25 @@ static const int16_t huff_nodes_alpha_1D_DT[64][2] = { -2, -63 } }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/* Alpha Coarse Huffman table dt */ -static const int16_t huff_nodes_alpha_1D_DT_coarse[32][2] = -{ - { -17, 1 }, - { -18, 2 }, - { -16, 3 }, - { -19, 4 }, - { -15, 5 }, - { 7, 6 }, - { -14, -20 }, - { 9, 8 }, - { -21, 10 }, - { -13, 11 }, - { 13, 12 }, - { -12, -22 }, - { 15, 14 }, - { -11, -23 }, - { 17, 16 }, - { -24, 18 }, - { -10, 19 }, - { -25, 20 }, - { -9, 21 }, - { 23, 22 }, - { -26, 24 }, - { -8, 25 }, - { 27, 26 }, - { -1, -33 }, - { -7, -27 }, - { 29, 28 }, - { -28, 30 }, - { -6, 31 }, - { -5, -29 }, - { -3, -31 }, - { -4, -30 }, - { -2, -32 } -}; - -#endif /* Beta Fine Huffman table df0 */ static const int16_t huff_nodes_first_band_beta[8][2] = { { -1, 1 }, { -2, 2 }, { -3, 3 }, { -4, 4 }, { -5, 5 }, { -6, 6 }, { -7, 7 }, { -8, -9 } }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/* Beta Coarse Huffman table df0 */ -static const int16_t huff_nodes_first_band_beta_coarse[4][2] = -{ - { -1, 1 }, { -2, 2 }, { -3, 3 }, { -4, -5 } -}; - -#endif /* Beta Fine Huffman table df */ static const int16_t huff_nodes_beta_1D_DF[16][2] = { { -9, 1 }, { -10, 2 }, { -8, 3 }, { -11, 4 }, { -7, 5 }, { 7, 6 }, { -6, -12 }, { 9, 8 }, { -5, -13 }, { 11, 10 }, { -4, -14 }, { -15, 12 }, { -3, 13 }, { -16, 14 }, { -2, 15 }, { -1, -17 } }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/* Beta Coarse Huffman table df */ -static const int16_t huff_nodes_beta_1D_DF_coarse[8][2] = -{ - { -5, 1 }, { -6, 2 }, { -4, 3 }, { -3, 4 }, { -7, 5 }, { -2, 6 }, { -8, 7 }, { -1, -9 } -}; - -#endif /* Beta Fine Huffman table dt */ static const int16_t huff_nodes_beta_1D_DT[16][2] = { { -9, 1 }, { -10, 2 }, { -8, 3 }, { -11, 4 }, { -7, 5 }, { 7, 6 }, { -6, -12 }, { -13, 8 }, { -5, 9 }, { -14, 10 }, { -4, 11 }, { -15, 12 }, { -3, 13 }, { -16, 14 }, { -2, 15 }, { -1, -17 } }; -#ifndef FIX_891_PARAMUPMIX_CLEANUP -/* Beta Coarse Huffman table dt */ -static const int16_t huff_nodes_beta_1D_DT_coarse[8][2] = -{ - { -5, 1 }, { -6, 2 }, { -4, 3 }, { -7, 4 }, { -3, 5 }, { -8, 6 }, { -2, 7 }, { -1, -9 } -}; -#endif -#ifdef FIX_891_PARAMUPMIX_CLEANUP const HUFF_NODE_TABLE ivas_mc_paramupmix_huff_nodes_df0 = { huff_nodes_first_band_alpha, @@ -879,24 +754,6 @@ const HUFF_NODE_TABLE ivas_mc_paramupmix_huff_nodes_dt = huff_nodes_alpha_1D_DT, huff_nodes_beta_1D_DT }; -#else -const HUFF_NODE_TABLE ivas_mc_paramupmix_huff_nodes_df0 = -{ - { huff_nodes_first_band_alpha, huff_nodes_first_band_alpha_coarse }, - { huff_nodes_first_band_beta, huff_nodes_first_band_beta_coarse } -}; -const HUFF_NODE_TABLE ivas_mc_paramupmix_huff_nodes_df = -{ - { huff_nodes_alpha_1D_DF, huff_nodes_alpha_1D_DF_coarse }, - { huff_nodes_beta_1D_DF, huff_nodes_beta_1D_DF_coarse } -}; - -const HUFF_NODE_TABLE ivas_mc_paramupmix_huff_nodes_dt = -{ - { huff_nodes_alpha_1D_DT, huff_nodes_alpha_1D_DT_coarse }, - { huff_nodes_beta_1D_DT, huff_nodes_beta_1D_DT_coarse } -}; -#endif /* clang-format on */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c old mode 100755 new mode 100644 index 2092d7c2dfd6b21ccc9b3b28eec6d3f9e4dedb11..dc48d483a8fb35dc87305b6cf84db571ef828da9 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -119,9 +119,6 @@ ivas_error ivas_sba_dec_reconfigure( int32_t last_ivas_total_brate; int16_t num_channels, num_md_sub_frames; int16_t nchan_out_buff, nchan_out_buff_old; -#ifndef NONBE_UNIFIED_DECODING_PATHS - int16_t sba_analysis_order_old; -#endif int16_t sba_analysis_order_old_flush; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; @@ -133,20 +130,13 @@ ivas_error ivas_sba_dec_reconfigure( ivas_total_brate = hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; sba_analysis_order_old_flush = st_ivas->sba_analysis_order; -#ifndef NONBE_UNIFIED_DECODING_PATHS - sba_analysis_order_old = ivas_sba_get_analysis_order( last_ivas_total_brate, st_ivas->sba_order ); -#endif /*-----------------------------------------------------------------* * Set SBA high-level parameters * Save old SBA high-level parameters *-----------------------------------------------------------------*/ -#ifdef NONBE_UNIFIED_DECODING_PATHS nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate ); -#else - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, sba_analysis_order_old, last_ivas_total_brate ); -#endif ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nchan_hp20_old = getNumChanSynthesis( st_ivas ); @@ -253,7 +243,6 @@ ivas_error ivas_sba_dec_reconfigure( { return error; } -#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA /* make sure the changed number of slots in the last subframe is not lost in the following steps */ if ( st_ivas->hSpatParamRendCom != NULL ) @@ -261,7 +250,6 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->hSpatParamRendCom->subframe_nbslots[st_ivas->hSpatParamRendCom->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; -#endif } } @@ -405,12 +393,9 @@ ivas_error ivas_sba_dec_reconfigure( ivas_mono_dmx_renderer_close( &st_ivas->hMonoDmxRenderer ); } - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) -#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA - , - st_ivas->ivas_format -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, + ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), + st_ivas->ivas_format ) ) != IVAS_ERR_OK ) { return error; } @@ -608,9 +593,6 @@ ivas_error ivas_sba_dec_reconfigure( * JBM TC buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms == 1 || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_tc; @@ -664,7 +646,6 @@ ivas_error ivas_sba_dec_reconfigure( } /* resync SPAR and DirAC JBM info from TC Buffer */ -#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) { mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); @@ -674,21 +655,6 @@ ivas_error ivas_sba_dec_reconfigure( mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpar->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); st_ivas->hSpar->nb_subframes = st_ivas->hTcBuffer->nb_subframes; st_ivas->hSpar->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; -#else - if ( st_ivas->hSpatParamRendCom != NULL ) - { - if ( st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) - { - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpar->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - st_ivas->hSpar->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - st_ivas->hSpar->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - } - } -#endif if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { @@ -697,9 +663,7 @@ ivas_error ivas_sba_dec_reconfigure( for ( n = 0; n < MAX_JBM_SUBFRAMES_5MS; n++ ) { st_ivas->hSpatParamRendCom->subframe_nbslots[n] = st_ivas->hTcBuffer->subframe_nbslots[n] * granularityMultiplier; -#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA st_ivas->hSpar->subframe_nbslots[n] = st_ivas->hSpatParamRendCom->subframe_nbslots[n]; -#endif } } @@ -707,19 +671,12 @@ ivas_error ivas_sba_dec_reconfigure( * floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !st_ivas->hDecoderConfig->Opt_5ms ) - { -#endif - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef NONBE_UNIFIED_DECODING_PATHS + if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) + { + return error; } -#endif return error; } @@ -875,10 +832,8 @@ ivas_error ivas_sba_dec_render( output_f_local[ch] += n_samples_sf; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); -#endif } if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index 6c5ecdb3e5a53a922ce7b443cc50c5a0671fcfee..8367509acb4480e31b45be637cac9b20006caf71 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -934,13 +934,11 @@ void ivas_sba_dirac_stereo_dec( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX /* reset the other channels to 0 (they are not used since here) */ for ( int16_t ch = CPE_CHANNELS; ch < st_ivas->nchan_transport; ch++ ) { set_zero( output[ch], output_frame ); } -#endif return; } diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index a87cdaca303e516f524010a78b1819f0fde8b57d..9bb16732d06077c41343683b6faafdbeaceb9147 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -339,71 +339,6 @@ int16_t ivas_sba_remapTCs( return ( nchan_remapped ); } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*-------------------------------------------------------------------------* - * ivas_ism2sba() - * - * ISM transformed into SBA in TD domain. - *-------------------------------------------------------------------------*/ - -void ivas_ism2sba( - float *buffer_td[], /* i/o: TD signal buffers */ - ISM_RENDERER_HANDLE hIsmRendererData, /* i/o: renderer data */ - const ISM_METADATA_HANDLE hIsmMetaData[], /* i : object metadata */ - const int16_t nchan_ism, /* i : number of objects */ - const int16_t output_frame, /* i : output frame length per channel */ - const int16_t sba_order /* i : Ambisonic (SBA) order */ -) -{ - int16_t i, j, k; - float buffer_tmp[16][L_FRAME48k]; - float gains[16]; - float g1, g2; - int16_t azimuth, elevation; - int16_t sba_num_chans; - - assert( ( sba_order <= 3 ) && "Only order up to 3 is supported!" ); - assert( hIsmRendererData != NULL && "hIsmRendererData not allocated!" ); - - /* Init*/ - sba_num_chans = ( sba_order + 1 ) * ( sba_order + 1 ); - for ( j = 0; j < sba_num_chans; j++ ) - { - set_zero( buffer_tmp[j], output_frame ); - } - - for ( i = 0; i < nchan_ism; i++ ) - { - // TODO tmu review when #215 is resolved - azimuth = (int16_t) floorf( hIsmMetaData[i]->azimuth + 0.5f ); - elevation = (int16_t) floorf( hIsmMetaData[i]->elevation + 0.5f ); - - /*get HOA gets for direction (ACN/SN3D)*/ - ivas_dirac_dec_get_response( azimuth, elevation, gains, sba_order ); - - for ( j = 0; j < sba_num_chans; j++ ) - { - g1 = 1.f; - g2 = 0.f; - for ( k = 0; k < output_frame; k++ ) - { - buffer_tmp[j][k] += ( g2 * gains[j] + g1 * hIsmRendererData->prev_gains[i][j] ) * buffer_td[i][k]; - g2 += 1.f / ( output_frame - 1 ); - g1 = 1.0f - g2; - } - hIsmRendererData->prev_gains[i][j] = gains[j]; - } - } - - for ( j = 0; j < sba_num_chans; j++ ) - { - mvr2r( buffer_tmp[j], buffer_td[j], output_frame ); - } - - return; -} -#endif - /*-------------------------------------------------------------------------* * ivas_ism2sba_sf() @@ -423,9 +358,7 @@ void ivas_ism2sba_sf( { int16_t i, j, k; float g1, *g2, *tc, *out, gain, prev_gain; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float buffer_tmp[HOA3_CHANNELS][L_FRAME48k]; // VE2SB: TBV -#endif int16_t sba_num_chans; assert( ( sba_order <= 3 ) && "Only order up to 3 is supported!" ); @@ -435,11 +368,7 @@ void ivas_ism2sba_sf( sba_num_chans = ( sba_order + 1 ) * ( sba_order + 1 ); for ( j = 0; j < sba_num_chans; j++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX set_zero( buffer_tmp[j], n_samples_to_render ); -#else - set_zero( buffer_out[j], n_samples_to_render ); -#endif } for ( i = 0; i < num_objects; i++ ) @@ -448,11 +377,7 @@ void ivas_ism2sba_sf( { g2 = hIsmRendererData->interpolator + offset; tc = buffer_in[i] + offset; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX out = buffer_tmp[j]; -#else - out = buffer_out[j]; -#endif gain = hIsmRendererData->gains[i][j]; prev_gain = hIsmRendererData->prev_gains[i][j]; for ( k = 0; k < n_samples_to_render; k++ ) @@ -463,68 +388,14 @@ void ivas_ism2sba_sf( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX for ( j = 0; j < sba_num_chans; j++ ) { mvr2r( buffer_tmp[j], buffer_out[j], n_samples_to_render ); } -#endif return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX -/*-------------------------------------------------------------------* - * ivas_sba_upmixer_renderer() - * - * SBA upmix & rendering - *-------------------------------------------------------------------*/ - -ivas_error ivas_sba_upmixer_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - float *output[], /* i/o: transport/output audio channels */ - const int16_t output_frame /* i : output frame length */ -) -{ - int16_t nchan_internal; - int16_t sba_ch_idx; - ivas_error error; - - push_wmops( "ivas_sba_upmixer_renderer" ); - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - - /* Upmixer + Renderer */ - ivas_spar_dec_upmixer( st_ivas, output, nchan_internal, output_frame ); - - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) - { - float *output_f[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; - int16_t ch; - AUDIO_CONFIG output_config; - - output_config = ( st_ivas->ivas_format == SBA_ISM_FORMAT ? st_ivas->hOutSetup.output_config : st_ivas->hDecoderConfig->output_config ); - - sba_ch_idx = 0; - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - sba_ch_idx = st_ivas->nchan_ism; - } - - for ( ch = 0; ch < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) - sba_ch_idx; ch++ ) - { - output_f[ch] = output[ch]; - } - - if ( ( error = ivas_sba_linear_renderer( output_f, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->nchan_ism, output_config, st_ivas->hOutSetup ) ) != IVAS_ERR_OK ) - { - return error; - } - } - pop_wmops(); - - return IVAS_ERR_OK; -} -#endif /*-------------------------------------------------------------------* * ivas_sba_linear_renderer() diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 76e5c6f1fbad8ce91e4e4f49f68f30614349d1e5..a7e105b36c8d5bb9182521e95612fb5cec0b527c 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -212,11 +212,7 @@ ivas_error ivas_spar_dec_open( } /* allocate transport channels*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else if ( st_ivas->hTcBuffer == NULL ) -#endif { int16_t nchan_to_allocate; int16_t nchan_tc; @@ -259,14 +255,6 @@ ivas_error ivas_spar_dec_open( granularity = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ); } -#ifndef NONBE_UNIFIED_DECODING_PATHS - /* make sure we have a TC buffer with the correct granularity for rate switching in OSBA */ - if ( !st_ivas->hDecoderConfig->Opt_5ms ) - { - nchan_tc = 0; - nchan_to_allocate = 0; - } -#endif if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK ) { return error; @@ -1062,10 +1050,8 @@ static void ivas_spar_calc_smooth_facs( float *cldfb_in_ts_re[CLDFB_NO_COL_MAX], float *cldfb_in_ts_im[CLDFB_NO_COL_MAX], int16_t nbands_spar, -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING const int16_t nSlots, const int16_t isFirstSubframe, -#endif ivas_fb_bin_to_band_data_t *bin2band, float *smooth_fac, float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1] ) @@ -1087,18 +1073,13 @@ static void ivas_spar_calc_smooth_facs( subframe_band_nrg[b] = 0.f; while ( bin < CLDFB_NO_CHANNELS_MAX && b == bin2band->p_cldfb_map_to_spar_band[bin] ) { -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING for ( ts = 0; ts < nSlots; ts++ ) -#else - for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) -#endif { subframe_band_nrg[b] += cldfb_in_ts_re[ts][bin] * cldfb_in_ts_re[ts][bin] + cldfb_in_ts_im[ts][bin] * cldfb_in_ts_im[ts][bin]; } bin++; } subframe_band_nrg[b] = sqrtf( subframe_band_nrg[b] ); -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING if ( isFirstSubframe && nSlots < MAX_PARAM_SPATIAL_SUBFRAMES ) { /* fill up to full 5ms subframe */ @@ -1106,11 +1087,8 @@ static void ivas_spar_calc_smooth_facs( } else { -#endif smooth_buf[b][0] = subframe_band_nrg[b]; -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING } -#endif /* calculate short and long energy averages */ smooth_short_avg[b] = EPSILON; for ( i = 0; i < 2 * SBA_DIRAC_NRG_SMOOTH_SHORT; i++ ) @@ -1147,11 +1125,9 @@ static void ivas_spar_calc_smooth_facs( smooth_fac[b] = max( min_smooth_gains1[b], min( max_smooth_gains2[b], smooth_fac[b] ) ); } -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING /* only update if we collected a full 5ms worth of energies for the buffer */ if ( isFirstSubframe || nSlots == MAX_PARAM_SPATIAL_SUBFRAMES ) { -#endif for ( b = 0; b < nbands_spar; b++ ) { for ( i = 2 * SBA_DIRAC_NRG_SMOOTH_LONG; i > 0; i-- ) @@ -1159,9 +1135,7 @@ static void ivas_spar_calc_smooth_facs( smooth_buf[b][i] = smooth_buf[b][i - 1]; } } -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING } -#endif return; } @@ -1487,10 +1461,8 @@ void ivas_spar_dec_upmixer( output_f_local[n] += n_samples_sf; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); -#endif } for ( n = 0; n < nchan_internal_total; n++ ) @@ -1711,11 +1683,7 @@ void ivas_spar_dec_upmixer_sf( if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { -#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); -#else - ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); -#endif } for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index a3c7fcf780b32b3230135ed2f1ac533c8e686c56..8c955660587ac227ad9eb1eac83d2f3e8a386de6 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -76,21 +76,14 @@ static void ivas_spar_dec_compute_ramp_down_post_matrix( ivas_spar_md_dec_state_ static void ivas_spar_md_fill_invalid_bands( ivas_spar_dec_matrices_t *pSpar_coeffs, ivas_spar_dec_matrices_t *pSpar_coeffs_prev, const int16_t *valid_bands, int16_t *base_band_age, const int16_t num_bands, const int16_t numch_out, const int16_t num_md_sub_frames ); -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC static void ivas_spar_md_fill_invalid_bandcoeffs( ivas_band_coeffs_t *pBand_coeffs, ivas_band_coeffs_t *pBand_coeffs_prev, const int16_t *valid_bands, int16_t *base_band_age, int16_t *first_valid_frame, const int16_t num_bands ); -#endif static ivas_error ivas_spar_set_dec_config( ivas_spar_md_dec_state_t *hMdDec, const int16_t nchan_transport, float *pFC ); static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decoder_State *st, const int16_t bw, const int16_t num_bands, int16_t *num_dmx_per_band, int16_t *num_dec_per_band ); static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 ); -static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t sba_inactive_mode -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - , - const int32_t last_active_brate -#endif -); +static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t sba_inactive_mode ); /*------------------------------------------------------------------------- @@ -111,12 +104,10 @@ ivas_error ivas_spar_md_dec_matrix_open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( ( hMdDec->band_coeffs_prev = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } -#endif if ( ( hMdDec->mixer_mat = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); @@ -379,13 +370,11 @@ void ivas_spar_md_dec_matrix_close( free( hMdDecoder->spar_md.band_coeffs ); hMdDecoder->spar_md.band_coeffs = NULL; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( hMdDecoder->band_coeffs_prev != NULL ) { free( hMdDecoder->band_coeffs_prev ); hMdDecoder->band_coeffs_prev = NULL; } -#endif if ( hMdDecoder->mixer_mat != NULL ) { @@ -564,17 +553,13 @@ ivas_error ivas_spar_md_dec_init( /* initialize PLC state */ set_s( hMdDec->valid_bands, 0, IVAS_MAX_NUM_BANDS ); set_s( hMdDec->base_band_age, 0, IVAS_MAX_NUM_BANDS ); -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC set_s( hMdDec->base_band_coeffs_age, 0, IVAS_MAX_NUM_BANDS ); -#endif hMdDec->spar_plc_num_lost_frames = 0; hMdDec->spar_plc_enable_fadeout_flag = 1; hMdDec->dtx_md_smoothing_cntr = 1; ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS ); -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ivas_clear_band_coeffs( hMdDec->band_coeffs_prev, IVAS_MAX_NUM_BANDS ); -#endif ivas_clear_band_coeff_idx( hMdDec->spar_md.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx_mapped, IVAS_MAX_NUM_BANDS ); @@ -598,9 +583,7 @@ ivas_error ivas_spar_md_dec_init( set_zero( hMdDec->mixer_mat_prev2[i][j], IVAS_MAX_NUM_BANDS ); } } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC hMdDec->first_valid_frame = 1; -#endif return IVAS_ERR_OK; } @@ -782,14 +765,8 @@ void ivas_spar_md_dec_process( } ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate, - st_ivas->hQMetaData->sba_inactive_mode -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - , - st_ivas->last_active_ivas_total_brate -#endif - ); + st_ivas->hQMetaData->sba_inactive_mode ); -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC assert( nB == hMdDec->spar_md.num_bands ); assert( bw == 1 ); ivas_spar_md_fill_invalid_bandcoeffs( @@ -799,7 +776,6 @@ void ivas_spar_md_dec_process( &hMdDec->base_band_coeffs_age[0], &hMdDec->first_valid_frame, nB ); -#endif ivas_dec_mono_sba_handling( st_ivas ); @@ -811,12 +787,6 @@ void ivas_spar_md_dec_process( /* set correct number of bands*/ nB = IVAS_MAX_NUM_BANDS; -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - if ( bw == IVAS_RED_BAND_FACT ) - { - nB = nB >> 1; - } -#endif #ifdef DEBUG_LBR_SBA /* Dumping SPAR Coefficients */ char f_name[100]; @@ -888,17 +858,6 @@ void ivas_spar_md_dec_process( } fprintf( fid, "%.6f\n", hMdDec->mixer_mat[1][0][band] ); } -#endif -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - if ( bw == IVAS_RED_BAND_FACT ) - { - nB = nB << 1; - } - - for ( b = nB; b < num_bands_out; b++ ) - { - hMdDec->valid_bands[b] = 1; - } #endif ivas_spar_md_fill_invalid_bands( &hMdDec->spar_coeffs, &hMdDec->spar_coeffs_prev, &hMdDec->valid_bands[0], &hMdDec->base_band_age[0], num_bands_out, num_md_chs, num_md_sub_frames ); @@ -1512,7 +1471,6 @@ void ivas_spar_dec_gen_umx_mat( return; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC static void ivas_spar_md_band_upmix( ivas_band_coeffs_t *band_coeffs, int16_t *nB, @@ -1554,7 +1512,6 @@ static void ivas_spar_md_band_upmix( return; } -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_spar_dec_parse_md_bs() @@ -1569,29 +1526,16 @@ static void ivas_spar_dec_parse_md_bs( int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, - const int16_t sba_inactive_mode -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - , - const int32_t last_active_brate -#endif -) + const int16_t sba_inactive_mode ) { int16_t i, j, k, num_bands; -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - int16_t ii, jj, ndec, ndm, b, idx; -#else int16_t ii, jj, ndec, ndm; -#endif uint16_t qsi; ivas_quant_strat_t qs; int16_t strat, no_ec; int16_t do_diff[IVAS_MAX_NUM_BANDS]; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - int16_t bw_final, bw_fact; - int32_t active_brate; -#endif *dtx_vad = 1; *bands_bw = 1; qsi = 0; @@ -1663,7 +1607,6 @@ static void ivas_spar_dec_parse_md_bs( ivas_parse_parameter_bitstream_dtx( &hMdDec->spar_md, st0, *bands_bw, *nB, hMdDec->spar_md_cfg.num_dmx_chans_per_band, hMdDec->spar_md_cfg.num_decorr_per_band ); -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( *bands_bw != 1 ) { ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0]; @@ -1678,42 +1621,6 @@ static void ivas_spar_dec_parse_md_bs( ndm ); } -#else - active_brate = ( ivas_total_brate > IVAS_SID_5k2 ) ? ivas_total_brate : last_active_brate; - - if ( active_brate >= IVAS_24k4 ) - { - bw_final = 1; - } - else - { - bw_final = 2; - } - - bw_fact = *bands_bw / bw_final; - - for ( i = *nB - 1; i >= 0; i-- ) - { - ndec = hMdDec->spar_md_cfg.num_decorr_per_band[bw_fact * i]; - - for ( b = bw_fact - 1; b >= 0; b-- ) - { - idx = i * bw_fact + b; - for ( j = 0; j < FOA_CHANNELS - 1; j++ ) - { - hMdDec->spar_md.band_coeffs[idx].pred_re[j] = hMdDec->spar_md.band_coeffs[i].pred_re[j]; - } - for ( j = 0; j < ndec; j++ ) - { - hMdDec->spar_md.band_coeffs[idx].P_re[j] = hMdDec->spar_md.band_coeffs[i].P_re[j]; - } - hMdDec->valid_bands[idx] = 1; - } - } - - *bands_bw = bw_final; - *nB = num_bands / bw_final; -#endif return; } @@ -1765,14 +1672,10 @@ static void ivas_spar_dec_parse_md_bs( do_diff[i] = ( ( ( i + 1 ) & 3 ) != strat - 4 ); do_repeat[i] = 0; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( hMdDec->spar_md_cfg.prev_quant_idx >= 0 ) { -#endif ivas_map_prior_coeffs_quant( &hMdDec->spar_md_prev, &hMdDec->spar_md_cfg, qsi, *nB ); -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC } -#endif } #ifdef SPAR_HOA_DBG fprintf( stdout, "\n\n no_ec = %d, strat = %d\n", no_ec, strat ); @@ -1832,18 +1735,9 @@ static void ivas_spar_dec_parse_md_bs( { hMdDec->spar_md_prev.band_coeffs_idx[i].decd_index_re[j] = hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j]; } -#ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC - hMdDec->valid_bands[*bands_bw * i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; - for ( j = 1; j < *bands_bw; j++ ) - { - hMdDec->valid_bands[*bands_bw * i + j] = hMdDec->valid_bands[*bands_bw * i]; - } -#else hMdDec->valid_bands[i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; -#endif } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0]; ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[0]; if ( *bands_bw != 1 ) @@ -1858,7 +1752,6 @@ static void ivas_spar_dec_parse_md_bs( ndm ); } -#endif return; } @@ -2131,7 +2024,6 @@ static void ivas_decode_huffman_bs( return; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC static void ivas_spar_plc_get_band_age( const int16_t *valid_bands, int16_t *base_band_age, @@ -2200,7 +2092,6 @@ static void ivas_spar_get_plc_interp_weights( } return; } -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_spar_md_fill_invalid_bands() @@ -2221,34 +2112,8 @@ static void ivas_spar_md_fill_invalid_bands( int16_t valid_band_idx[IVAS_MAX_NUM_BANDS], idx = -1; int16_t last_valid_band_idx[IVAS_MAX_NUM_BANDS]; float w = 0; -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ivas_spar_plc_get_band_age( valid_bands, base_band_age, num_bands, last_valid_band_idx, valid_band_idx, &all_valid, &idx ); -#else - set_s( valid_band_idx, 0, IVAS_MAX_NUM_BANDS ); - set_s( last_valid_band_idx, 0, IVAS_MAX_NUM_BANDS ); - - all_valid = 1; - for ( b = 0; b < num_bands; b++ ) - { - if ( valid_bands[b] != 0 ) - { - base_band_age[b] = 0; /* reset band age */ - idx++; - valid_band_idx[idx] = b; - } - else - { - base_band_age[b] += 1; /* increment the age of invalid bands */ - - if ( base_band_age[b] > 3 ) - { - last_valid_band_idx[b] = idx; - } - all_valid = 0; - } - } -#endif assert( idx > 0 ); /* some bands should be valid */ if ( all_valid == 0 ) @@ -2258,33 +2123,9 @@ static void ivas_spar_md_fill_invalid_bands( /* check against non zero in if and else if */ if ( base_band_age[b] > 3 ) /* old invalid bands */ { -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t id0, id1; ivas_spar_get_plc_interp_weights( valid_band_idx, last_valid_band_idx[b], idx, b, &w, &id0, &id1 ); -#else - int16_t tmp_id, id0, id1; - - tmp_id = last_valid_band_idx[b]; - if ( tmp_id < 0 ) /* Extrapolation */ - { - id1 = valid_band_idx[0]; - id0 = 0; - w = 1; - } - else if ( tmp_id == idx ) /* Extrapolation */ - { - id1 = valid_band_idx[tmp_id]; - id0 = valid_band_idx[tmp_id]; - w = 0; - } - else /* Interpolation */ - { - id0 = valid_band_idx[tmp_id]; - id1 = valid_band_idx[tmp_id + 1]; - w = ( (float) ( b - id0 ) ) / ( id1 - id0 ); - } -#endif for ( i = 0; i < num_channels; i++ ) { for ( j = 0; j < num_channels; j++ ) @@ -2330,7 +2171,6 @@ static void ivas_spar_md_fill_invalid_bands( return; } -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC static void ivas_spar_md_fill_invalid_bandcoeffs( ivas_band_coeffs_t *pBand_coeffs, ivas_band_coeffs_t *pBand_coeffs_prev, @@ -2410,7 +2250,6 @@ static void ivas_spar_md_fill_invalid_bandcoeffs( return; } -#endif /*-----------------------------------------------------------------------------------------* diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index c2c31152f8dc142040c8259cd806f6077ca9493b..81427d9cfa4ca9ccd5bec73e6a148b7cbe60be4b 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -603,11 +603,9 @@ typedef struct ivas_spar_md_dec_state_t float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[IVAS_MAX_NUM_BANDS]; float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; -#ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t first_valid_frame; ivas_band_coeffs_t *band_coeffs_prev; int16_t base_band_coeffs_age[IVAS_MAX_NUM_BANDS]; -#endif } ivas_spar_md_dec_state_t; @@ -914,20 +912,16 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { - float *tc_buffer; /* the buffer itself */ -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX + float *tc_buffer; /* the buffer itself */ float *tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ // VE2SB: TBV -#else - float *tc[MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ -#endif - TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ - int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ - int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ - int16_t nchan_buffer_full; /* number of channels to be fully buffered */ - int16_t n_samples_available; /* samples still available for rendering in the current frame */ - int16_t n_samples_buffered; /* full number of samples in the buffer (including spill to next frame) */ - int16_t n_samples_rendered; /* samples already rendered in the current frame */ - int16_t n_samples_granularity; /* render granularity */ + TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ + int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ + int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ + int16_t nchan_buffer_full; /* number of channels to be fully buffered */ + int16_t n_samples_available; /* samples still available for rendering in the current frame */ + int16_t n_samples_buffered; /* full number of samples in the buffer (including spill to next frame) */ + int16_t n_samples_rendered; /* samples already rendered in the current frame */ + int16_t n_samples_granularity; /* render granularity */ int16_t n_samples_flushed; int16_t subframe_nbslots[MAX_JBM_SUBFRAMES_5MS]; int16_t nb_subframes; @@ -1022,11 +1016,7 @@ typedef struct decoder_config_structure #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t Opt_Limiter; #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS IVAS_RENDER_FRAMESIZE render_framesize; -#else - int16_t Opt_5ms; -#endif int16_t Opt_delay_comp; /* flag indicating delay compensation active */ } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; diff --git a/lib_dec/ivas_stereo_dft_dec.c b/lib_dec/ivas_stereo_dft_dec.c old mode 100755 new mode 100644 index 388bf8d0789c2ee48f89863737dcdcf97f8892a3..96c536ff93b7ad3934ef7c42187b8f550b368f81 --- a/lib_dec/ivas_stereo_dft_dec.c +++ b/lib_dec/ivas_stereo_dft_dec.c @@ -1733,13 +1733,9 @@ void stereo_dft_dec( *-------------------------------------------------------------------------*/ void stereo_dft_dec_res( - CPE_DEC_HANDLE hCPE, /* i/o: decoder CPE handle */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + CPE_DEC_HANDLE hCPE, /* i/o: decoder CPE handle */ float res_buf[STEREO_DFT_N_8k], /* i : residual buffer */ -#else - float res_buf[STEREO_DFT_BUF_MAX], /* i : residual buffer */ -#endif - float *output /* o : output */ + float *output /* o : output */ ) { int16_t i; @@ -1877,14 +1873,10 @@ void stereo_dft_dec_read_BS( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder stereo handle */ const int16_t bwidth, /* i : bandwidth */ const int16_t output_frame, /* i : output frame length */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO - float res_buf[STEREO_DFT_N_8k], /* o : residual buffer */ -#else - float res_buf[STEREO_DFT_BUF_MAX], /* o : residual buffer */ -#endif - int16_t *nb_bits, /* o : number of bits read */ - float *coh, /* i/o: Coherence */ - const int16_t ivas_format /* i : ivas format */ + float res_buf[STEREO_DFT_N_8k], /* o : residual buffer */ + int16_t *nb_bits, /* o : number of bits read */ + float *coh, /* i/o: Coherence */ + const int16_t ivas_format /* i : ivas format */ ) { int16_t b, N_div, nbands; diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index 95d7ba6d68ff20e8cce58293eadf6476d882899b..0eda835d87c9cff41107f66bd29aabe1ffe1065f 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -209,23 +209,18 @@ void stereo_decoder_tcx( STEREO_MDCT_DEC_DATA *hStereoMdct, /* i/o: MDCT stereo decoder structure */ int16_t ms_mask[NB_DIV][MAX_SFB], /* i : bandwise MS mask */ float *spec_r_0[NB_DIV], /* i/o: spectrum right channel */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO - float *spec_l[], /* i/o: spectrum left channel [NB_DIV][N] */ - float *spec_r[], /* i/o: spectrum right channel [NB_DIV][N] */ -#else - float *spec_l[NB_DIV], /* i/o: spectrum left channel */ - float *spec_r[NB_DIV], /* i/o: spectrum right channel */ -#endif - const int16_t mdct_stereo_mode[], /* i : stereo mode (FB/band wise MS, dual mono */ - const int16_t core_l, /* i : core for left channel (TCX20/TCX10) */ - const int16_t core_r, /* i : core for right channel (TCX20/TCX10) */ - const int16_t igf, /* i : flag for IGF activity */ - const int16_t L_frameTCX_l, /* i : TCX frame length of left channel */ - const int16_t L_frameTCX_r, /* i : TCX frame length of right channel */ - const int16_t mct_on, /* i : flag mct block (1) or stereo (0) */ - const int16_t last_core_l, /* i : last core for left channel */ - const int16_t last_core_r, /* i : last core for right channel */ - const int16_t tmp_plc_upmix /* i : indicates temp upmix for PLC decision */ + float *spec_l[], /* i/o: spectrum left channel [NB_DIV][N] */ + float *spec_r[], /* i/o: spectrum right channel [NB_DIV][N] */ + const int16_t mdct_stereo_mode[], /* i : stereo mode (FB/band wise MS, dual mono */ + const int16_t core_l, /* i : core for left channel (TCX20/TCX10) */ + const int16_t core_r, /* i : core for right channel (TCX20/TCX10) */ + const int16_t igf, /* i : flag for IGF activity */ + const int16_t L_frameTCX_l, /* i : TCX frame length of left channel */ + const int16_t L_frameTCX_r, /* i : TCX frame length of right channel */ + const int16_t mct_on, /* i : flag mct block (1) or stereo (0) */ + const int16_t last_core_l, /* i : last core for left channel */ + const int16_t last_core_r, /* i : last core for right channel */ + const int16_t tmp_plc_upmix /* i : indicates temp upmix for PLC decision */ ) { int16_t i, k, sfb, nSubframes; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a665d3ea8751b033d0ecb43196d029e90251232f..6ab684163570671617846ecddf985cfddb09e53d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -83,9 +83,7 @@ struct IVAS_DEC PCMDSP_APA_HANDLE hTimeScaler; bool needNewFrame; bool hasBeenFedFrame; -#ifdef NONBE_UNIFIED_DECODING_PATHS bool updateOrientation; -#endif uint16_t nSamplesAvailableNext; int16_t nSamplesRendered; int16_t nTransportChannelsOld; @@ -126,9 +124,7 @@ static PCM_RESOLUTION pcm_type_API_to_internal( const IVAS_DEC_PCM_TYPE pcmType static void *pcm_buffer_offset( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int32_t offset ); static ivas_error set_pcm_buffer_to_zero( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int16_t nZeroSamples ); #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); -#endif /*---------------------------------------------------------------------* @@ -175,9 +171,7 @@ ivas_error IVAS_DEC_Open( hIvasDec->hasBeenFedFirstGoodFrame = false; hIvasDec->hasDecodedFirstGoodFrame = false; hIvasDec->isInitialized = false; -#ifdef NONBE_UNIFIED_DECODING_PATHS hIvasDec->updateOrientation = false; -#endif hIvasDec->mode = mode; @@ -274,9 +268,6 @@ static void init_decoder_config( hDecoderConfig->Opt_tsm = 0; #ifdef SPLIT_REND_WITH_HEAD_ROT hDecoderConfig->Opt_Limiter = 1; -#endif -#ifndef NONBE_UNIFIED_DECODING_PATHS - hDecoderConfig->Opt_5ms = 0; #endif hDecoderConfig->Opt_delay_comp = 0; hDecoderConfig->Opt_ExternalOrientation = 0; @@ -372,15 +363,11 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const AUDIO_CONFIG outputConfig, /* i : output configuration */ - const int16_t tsmEnabled, /* i : enable time scale modification */ -#ifndef NONBE_UNIFIED_DECODING_PATHS - const int16_t enable5ms, /* i : enable 5ms rendering path */ -#else - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ -#endif + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const uint32_t sampleRate, /* i : output sampling frequency */ + const AUDIO_CONFIG outputConfig, /* i : output configuration */ + const int16_t tsmEnabled, /* i : enable time scale modification */ + const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ @@ -439,9 +426,6 @@ ivas_error IVAS_DEC_Configure( } hDecoderConfig->Opt_tsm = tsmEnabled; -#ifndef NONBE_UNIFIED_DECODING_PATHS - hDecoderConfig->Opt_5ms = enable5ms; -#endif hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = enableHeadRotation; hDecoderConfig->orientation_tracking = orientation_tracking; @@ -454,7 +438,6 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_dpid_on = Opt_dpid_on; hDecoderConfig->Opt_aeid_on = acousticEnvironmentId != 65535 ? TRUE : FALSE; -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( renderFramesize == IVAS_RENDER_FRAMESIZE_UNKNOWN ) { return IVAS_ERR_WRONG_PARAMS; @@ -467,7 +450,6 @@ ivas_error IVAS_DEC_Configure( { hDecoderConfig->render_framesize = renderFramesize; } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -523,11 +505,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; hDecoderConfig->Opt_Headrotation = 1; -#ifndef NONBE_UNIFIED_DECODING_PATHS - hDecoderConfig->Opt_5ms = false; -#else hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; -#endif hDecoderConfig->Opt_Limiter = 0; @@ -535,50 +513,6 @@ ivas_error IVAS_DEC_EnableSplitRendering( } #endif -#ifndef NONBE_UNIFIED_DECODING_PATHS -/*---------------------------------------------------------------------* - * IVAS_DEC_Set5msFlag( ) - * - * Get the 5ms flag - *---------------------------------------------------------------------*/ - -ivas_error IVAS_DEC_Set5msFlag( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const int16_t enable5ms /* i : 5ms flag */ -) -{ - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hDecoderConfig == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - hIvasDec->st_ivas->hDecoderConfig->Opt_5ms = enable5ms; - - return IVAS_ERR_OK; -} - - -/*---------------------------------------------------------------------* - * IVAS_DEC_Get5msFlag( ) - * - * Get the 5ms flag - *---------------------------------------------------------------------*/ - -ivas_error IVAS_DEC_Get5msFlag( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - int16_t *enable5ms /* o : 5ms flag */ -) -{ - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || enable5ms == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - *enable5ms = (int16_t) hIvasDec->st_ivas->hDecoderConfig->Opt_5ms; - - return IVAS_ERR_OK; -} -#else /*---------------------------------------------------------------------* * get_render_framesize_ms( ) * @@ -717,7 +651,6 @@ ivas_error IVAS_DEC_GetNumOrientationSubframes( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -749,9 +682,6 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->Opt_VOIP = 1; hDecoderConfig->Opt_tsm = 1; -#ifndef NONBE_UNIFIED_DECODING_PATHS - hDecoderConfig->Opt_5ms = 1; -#endif if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); @@ -900,68 +830,6 @@ ivas_error IVAS_DEC_FeedFrame_Serial( * Main function to decode to PCM data *---------------------------------------------------------------------*/ -#ifndef NONBE_UNIFIED_DECODING_PATHS -static ivas_error _GetSamples( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - const PCM_RESOLUTION pcm_resolution, - void *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels */ -#else - int16_t *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels */ -#endif - int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ -) -{ - Decoder_Struct *st_ivas; - ivas_error error; - - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - st_ivas = hIvasDec->st_ivas; - - *nOutSamples = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) - { -#if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT - assert( pcm_resolution == PCM_INT16 ); -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = evs_dec_main( st_ivas, *nOutSamples, NULL, (int16_t *) pcmBuf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec_main( st_ivas, *nOutSamples, NULL, pcmBuf ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } - } - else if ( hIvasDec->mode == IVAS_DEC_MODE_IVAS ) - { - /* run the main IVAS decoding routine */ - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_dec( st_ivas, pcm_resolution, pcmBuf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dec( st_ivas, pcmBuf ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } - - hIvasDec->isInitialized = true; /* Initialization done in ivas_dec() */ - } - - if ( hIvasDec->hasBeenFedFirstGoodFrame ) - { - hIvasDec->hasDecodedFirstGoodFrame = true; - } - - return IVAS_ERR_OK; -} -#endif ivas_error IVAS_DEC_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -977,11 +845,7 @@ ivas_error IVAS_DEC_GetSamples( ) { ivas_error error; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX int16_t nOutSamplesElse, nSamplesToRender; -#else - int16_t nOutSamplesElse, result, nSamplesToRender; -#endif uint16_t nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; uint8_t nTransportChannels, nOutChannels; @@ -996,7 +860,6 @@ ivas_error IVAS_DEC_GetSamples( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( hIvasDec->updateOrientation ) { /*----------------------------------------------------------------* @@ -1021,7 +884,6 @@ ivas_error IVAS_DEC_GetSamples( hIvasDec->updateOrientation = false; } -#endif if ( !hIvasDec->hasBeenFedFrame && hIvasDec->nSamplesAvailableNext == 0 ) { @@ -1066,29 +928,6 @@ ivas_error IVAS_DEC_GetSamples( /* :TODO: change nSamplesAsked also if we are in 5ms 0dof split rendering... */ #endif } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !hIvasDec->st_ivas->hDecoderConfig->Opt_5ms ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = _GetSamples( hIvasDec, pcm_type_API_to_internal( pcmType ), pcmBuf, nOutSamples ) ) != IVAS_ERR_OK ) -#else - if ( ( error = _GetSamples( hIvasDec, pcmBuf, nOutSamples ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } -#ifdef DEBUGGING - assert( *nOutSamples == nSamplesAsked ); -#endif - hIvasDec->nSamplesAvailableNext = 0; - hIvasDec->nSamplesRendered = *nOutSamples; - nSamplesRendered = *nOutSamples; - hIvasDec->needNewFrame = true; - hIvasDec->hasBeenFedFrame = false; - *needNewFrame = true; - } - else -#endif { /* check if we need to run the setup function, tc decoding and feeding the renderer */ if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) @@ -1096,11 +935,7 @@ ivas_error IVAS_DEC_GetSamples( int16_t nResidualSamples, nSamplesTcsScaled; nSamplesRendered += nSamplesRendered_loop; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && nTransportChannels != hIvasDec->nTransportChannelsOld ) -#else - if ( nTransportChannels != hIvasDec->nTransportChannelsOld ) -#endif { if ( ( error = IVAS_DEC_VoIP_reconfigure( hIvasDec, nTransportChannels, l_ts ) ) != IVAS_ERR_OK ) { @@ -1122,7 +957,6 @@ ivas_error IVAS_DEC_GetSamples( return IVAS_ERR_UNKNOWN; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( apa_exec( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer, &nTimeScalerOutSamples ) != 0 ) { return IVAS_ERR_UNKNOWN; @@ -1130,26 +964,11 @@ ivas_error IVAS_DEC_GetSamples( assert( nTimeScalerOutSamples <= APA_BUF ); nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; -#else - result = apa_exec( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer, &nTimeScalerOutSamples ); - if ( result != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - assert( nTimeScalerOutSamples <= APA_BUF ); -#endif } else { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX nSamplesTcsScaled = hIvasDec->nSamplesFrame; -#else - nTimeScalerOutSamples = hIvasDec->nSamplesFrame * nTransportChannels; -#endif } -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX - nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; -#endif /* Feed decoded transport channels samples to the renderer */ if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) @@ -1249,15 +1068,9 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS && hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) -#else - if ( st_ivas->hDecoderConfig->Opt_5ms && hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && - ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE || - hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) -#endif { numSamplesPerChannelToSplitEncode = (int16_t) ( output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); numSamplesPerChannelCacheSize = numSamplesPerChannelToDecode - numSamplesPerChannelToSplitEncode; @@ -1356,11 +1169,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( /* convert to int16 with limiting for BINAURAL_SPLIT_PCM */ if ( pcm_out_flag ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ) -#else - if ( st_ivas->hDecoderConfig->Opt_5ms ) -#endif { #ifndef DISABLE_LIMITER ivas_limiter_dec( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToSplitEncode, st_ivas->BER_detect ); @@ -1890,9 +1699,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( #ifdef SPLIT_REND_WITH_HEAD_ROT hHeadTrackData->sr_pose_pred_axis = rot_axis; #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS hIvasDec->updateOrientation = true; -#endif return IVAS_ERR_OK; } @@ -1923,9 +1730,7 @@ ivas_error IVAS_DEC_FeedRefRotData( pOtr->refRot.z = rotation.z; pOtr->refRot.y = rotation.y; -#ifdef NONBE_UNIFIED_DECODING_PATHS hIvasDec->updateOrientation = true; -#endif return IVAS_ERR_OK; } @@ -1954,9 +1759,7 @@ ivas_error IVAS_DEC_FeedRefVectorData( pOtr = hIvasDec->st_ivas->hHeadTrackData->OrientationTracker; -#ifdef NONBE_UNIFIED_DECODING_PATHS hIvasDec->updateOrientation = true; -#endif return ivas_orient_trk_SetReferenceVector( pOtr, listenerPos, refPos ); } @@ -2000,9 +1803,7 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( hExternalOrientationData->enableRotationInterpolation[subframe_idx] = enableRotationInterpolation; hExternalOrientationData->numFramesToTargetOrientation[subframe_idx] = numFramesToTargetOrientation; -#ifdef NONBE_UNIFIED_DECODING_PATHS hIvasDec->updateOrientation = true; -#endif return IVAS_ERR_OK; } @@ -3091,9 +2892,7 @@ static ivas_error printConfigInfo_dec( { ivas_error error; char config_str[50]; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX AUDIO_CONFIG output_config; -#endif /*-----------------------------------------------------------------* * Print info on screen @@ -3193,26 +2992,18 @@ static ivas_error printConfigInfo_dec( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX output_config = st_ivas->hDecoderConfig->output_config; get_channel_config( output_config, &config_str[0] ); -#else - get_channel_config( st_ivas->hDecoderConfig->output_config, &config_str[0] ); -#endif fprintf( stdout, "Output configuration: %s\n", config_str ); -#ifdef NONBE_UNIFIED_DECODING_PATHS -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX #ifdef SPLIT_REND_WITH_HEAD_ROT if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif #endif { fprintf( stdout, "Render framesize: %dms\n", get_render_frame_size_ms( st_ivas->hDecoderConfig->render_framesize ) ); } -#endif if ( st_ivas->hDecoderConfig->Opt_HRTF_binary ) { fprintf( stdout, "HRIR/BRIR file: ON\n" ); @@ -3278,16 +3069,6 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "TSM mode: ON\n" ); } -#ifndef NONBE_UNIFIED_DECODING_PATHS - /*-----------------------------------------------------------------* - * Print 5ms API mode info - *-----------------------------------------------------------------*/ - - if ( st_ivas->hDecoderConfig->Opt_5ms ) - { - fprintf( stdout, "API 5ms mode: ON\n" ); - } -#endif return IVAS_ERR_OK; } @@ -3392,9 +3173,6 @@ static ivas_error evs_dec_main( int16_t *pcmBuf ) { DEC_CORE_HANDLE *hCoreCoder; -#ifndef NONBE_UNIFIED_DECODING_PATHS_FIX - float output[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN][L_FRAME48k]; -#endif float mixer_left, mixer_rigth; float *p_output[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN]; int16_t ch; @@ -3407,11 +3185,7 @@ static ivas_error evs_dec_main( for ( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX p_output[ch] = st_ivas->p_output_f[ch]; -#else - p_output[ch] = output[ch]; -#endif } /* run the main EVS decoding routine */ @@ -3419,22 +3193,14 @@ static ivas_error evs_dec_main( { if ( hCoreCoder[0]->Opt_AMR_WB ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = amr_wb_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], p_output[0] ) ) != IVAS_ERR_OK ) -#else - if ( ( error = amr_wb_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0] ) ) != IVAS_ERR_OK ) -#endif { return error; } } else { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], p_output[0], FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3444,33 +3210,21 @@ static ivas_error evs_dec_main( { if ( hCoreCoder[0]->bfi == 0 ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], p_output[0], FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( hCoreCoder[0]->bfi == 2 ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], p_output[0], FRAMEMODE_FUTURE ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_FUTURE ) ) != IVAS_ERR_OK ) -#endif { return error; } } else { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], p_output[0], FRAMEMODE_MISSING ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_MISSING ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3483,20 +3237,11 @@ static ivas_error evs_dec_main( { mixer_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; mixer_rigth = 1.f - mixer_left; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX v_multc( p_output[0], mixer_rigth, p_output[1], nOutSamples ); v_multc( p_output[0], mixer_left, p_output[0], nOutSamples ); -#else - v_multc( output[0], mixer_rigth, output[1], nOutSamples ); - v_multc( output[0], mixer_left, output[0], nOutSamples ); -#endif } -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->Opt_5ms ) -#else if ( !st_ivas->hDecoderConfig->Opt_tsm ) -#endif { ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, nOutSamples ); } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index bccc190f980fde29e2e157e09863560a7834acbb..5ed4da72d5397113bcc2fa937c2b3323544e3ab6 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -125,11 +125,7 @@ ivas_error IVAS_DEC_Configure( const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : audio configuration */ const int16_t tsmEnabled, /* i : enable TSM */ -#ifndef NONBE_UNIFIED_DECODING_PATHS - const int16_t enable5ms, /* i : enable 5ms rendering path */ -#else const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ -#endif const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ @@ -316,17 +312,6 @@ ivas_error IVAS_DEC_EnableSplitRendering( ); #endif -#ifndef NONBE_UNIFIED_DECODING_PATHS -ivas_error IVAS_DEC_Set5msFlag( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const int16_t enable5ms /* i : 5ms flag */ -); - -ivas_error IVAS_DEC_Get5msFlag( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - int16_t *enable5ms /* o : 5ms flag */ -); -#else ivas_error IVAS_DEC_SetRenderFramesize( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const IVAS_RENDER_FRAMESIZE render_framesize /* i : render framesize */ @@ -356,7 +341,6 @@ ivas_error IVAS_DEC_GetRenderFramesizeMs( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint32_t *render_framesize /* o : render framesize in samples */ ); -#endif #ifdef DEBUGGING bool IVAS_DEC_GetBerDetectFlag( diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c old mode 100755 new mode 100644 index 9e4b601a53243397e429485d02e46c3fe5301fb8..4b6e9f9eea4aced49fa3cc798f6e9870b1eacb6b --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -109,22 +109,13 @@ void HBAutocorrelation( #define TNS_GAIN_THRESHOLD_FOR_WHITE ( 3.0f ) void TNSAnalysisStereo( - Encoder_State **sts, /* i : encoder state handle */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + Encoder_State **sts, /* i : encoder state handle */ float *mdst_spectrum[CPE_CHANNELS][NB_DIV], /* o : MDST spectrum */ -#else - float *mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* o : MDST spectrum */ -#endif - const int16_t bWhitenedDomain, /* i : whitened domain flag */ -#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO - int16_t tnsSize[CPE_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ - int16_t tnsBits[CPE_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ -#else - int16_t tnsSize[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ - int16_t tnsBits[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ -#endif - int16_t param_core[][NB_DIV * NPRM_DIV], /* o : TNS parameters */ - const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ + const int16_t bWhitenedDomain, /* i : whitened domain flag */ + int16_t tnsSize[CPE_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ + int16_t tnsBits[CPE_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ + int16_t param_core[][NB_DIV * NPRM_DIV], /* o : TNS parameters */ + const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ ) { int16_t ch, k, L_spec, L_frame, nSubframes, iFilter; diff --git a/lib_enc/core_enc_init.c b/lib_enc/core_enc_init.c index 9d61013db7eeba10827aff68b0ae17d9fc3079a3..9562985d16918ad78f1fa0785f007064339a6d54 100644 --- a/lib_enc/core_enc_init.c +++ b/lib_enc/core_enc_init.c @@ -64,10 +64,8 @@ static void init_modes( Encoder_State *st, const int32_t last_total_brate ); void init_coder_ace_plus( Encoder_State *st, /* i : Encoder state */ const int32_t last_total_brate, /* i : last total bitrate */ -#ifdef FIX_920_IGF_INIT_ERROR - const int32_t igf_brate, /* i : IGF configuration bitrate */ -#endif - const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ + const int32_t igf_brate, /* i : IGF configuration bitrate */ + const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ) { TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; @@ -157,11 +155,7 @@ void init_coder_ace_plus( if ( st->igf && st->hIGFEnc != NULL ) { -#ifdef FIX_920_IGF_INIT_ERROR IGFEncSetMode( st->hIGFEnc, igf_brate, st->bwidth, st->element_mode, st->rf_mode ); -#else - IGFEncSetMode( st->hIGFEnc, st->total_brate, st->bwidth, st->element_mode, st->rf_mode ); -#endif } else if ( st->hIGFEnc != NULL ) { diff --git a/lib_enc/core_enc_switch.c b/lib_enc/core_enc_switch.c index df81980d81c6cf06adecc67f0ef36bd2c634ed0e..be6c6efb1b10c9ad1977753a3340a89c71830884 100755 --- a/lib_enc/core_enc_switch.c +++ b/lib_enc/core_enc_switch.c @@ -152,11 +152,7 @@ void core_coder_mode_switch( else { st->igf = getIgfPresent( st->element_mode, st->total_brate, st->bwidth, st->rf_mode ); -#ifdef FIX_920_IGF_INIT_ERROR init_coder_ace_plus( st, last_total_brate, st->total_brate, MCT_flag ); -#else - init_coder_ace_plus( st, last_total_brate, MCT_flag ); -#endif } if ( st->igf && st->hBWE_TD != NULL ) diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index b441c2b07abc9c84280853cc5a0c4e9bab534469..cd7d502728f40e16f2af0d7730af5a9ae5054c1e 100755 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -825,11 +825,7 @@ ivas_error init_encoder( set_f( st->totalNoise_increase_hist, 0.f, TOTALNOISE_HIST_SIZE ); st->totalNoise_increase_len = 0; -#ifdef FIX_920_IGF_INIT_ERROR init_coder_ace_plus( st, st->last_total_brate, igf_brate, 0 /* initialization value */ ); -#else - init_coder_ace_plus( st, st->last_total_brate, 0 /* initialization value */ ); -#endif /*-----------------------------------------------------------------* * FD-CNG encoder diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 251ef2a32d5f26ffa1711cf7bf6606cd3765245f..480b559dc70aa276fe7af4e354cba67d9e50b4e1 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -656,14 +656,10 @@ ivas_error ivas_cpe_enc( if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) { max_bits -= nb_bits_metadata; -#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION if ( hCPE->brate_surplus < 0 ) { -#endif max_bits += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); -#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION } -#endif } stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, max_bits ); @@ -675,7 +671,6 @@ ivas_error ivas_cpe_enc( } else { -#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION #ifdef DEBUGGING if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) { @@ -686,10 +681,6 @@ ivas_error ivas_cpe_enc( assert( ( ( hCPE->element_brate / FRAMES_PER_SEC - nb_bits ) >= ( 0.8f * sts[0]->bits_frame_nominal ) ) && "Stereo DFT: bit budget is violated" ); } -#endif -#else - assert( ( ( hCPE->element_brate / FRAMES_PER_SEC - nb_bits ) >= ( 0.8f * sts[0]->bits_frame_nominal ) ) && "Stereo DFT: bit budget is violated" ); - #endif /* Flexible total bitrate in M channel */ sts[0]->total_brate = hCPE->element_brate - ( nb_bits * FRAMES_PER_SEC ); diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index 2d1e6d37fadc7017bed547e8a3c0b9a43cafca81..bcb519f078a1977f2acbb88add314290606dbd8b 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -56,35 +56,18 @@ static void ivas_mc_paramupmix_dmx( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, float *data_f[], const int16_t input_frame ); static void ivas_mc_paramupmix_param_est_enc( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, float *input_frame_t[], const int16_t input_frame, float alphas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS], float betas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS] ); -#ifdef FIX_891_PARAMUPMIX_CLEANUP static void get_huff_table( const PAR_TYPE par_type, HUFF_TAB *df0, HUFF_TAB *df ); -#else -static void get_huff_table( const PAR_TYPE par_type, const QUANT_TYPE quant_type, HUFF_TAB *df0, HUFF_TAB *df, HUFF_TAB *dt ); -#endif static void write_huff_bits( const int32_t value, const uint16_t length, uint16_t bit_buffer[MC_PARAMUPMIX_MAX_BITS], int16_t *bit_pos ); -#ifdef FIX_891_PARAMUPMIX_CLEANUP static void huffman_encode( const int32_t *vqPrev, const int32_t *vq, const PAR_TYPE parType, const int16_t nq, uint16_t bit_buffer[MC_PARAMUPMIX_MAX_BITS], int16_t *bit_pos ); -#else -static void huffman_encode( const int16_t bdfOnly, const int16_t bdtAllowed, const int16_t nv, const int16_t ivStart, const int32_t *vqPrev, const int32_t *vq, const PAR_TYPE parType, const QUANT_TYPE quant_type, const int16_t nq, uint16_t bit_buffer[MC_PARAMUPMIX_MAX_BITS], int16_t *bit_pos ); -#endif static void put_ec_data( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, const int16_t ch, const float pars[IVAS_MAX_NUM_BANDS], const float alphas[IVAS_MAX_NUM_BANDS], const PAR_TYPE parType, uint16_t bit_buffer[MC_PARAMUPMIX_MAX_BITS], int16_t *bit_pos ); -#ifdef FIX_891_PARAMUPMIX_CLEANUP static void quantize_alpha( const float *alpha, int16_t *pnq, int32_t aq[IVAS_MAX_NUM_BANDS], float *adeq ); static void quantize_pars( const float *v, const int16_t nq, const float *data, int32_t vq[IVAS_MAX_NUM_BANDS], float *vdeq ); -#else -static void quantize_alpha( const int16_t nv, const float *alpha, const QUANT_TYPE quant_type, int16_t *pnq, int32_t aq[IVAS_MAX_NUM_BANDS], float *adeq ); - -static void quantize_pars( const int16_t nv, const float *v, const int16_t nq, const float *data, int32_t vq[IVAS_MAX_NUM_BANDS], float *vdeq ); - -static void quantize_pars( const int16_t nv, const float *v, const int16_t nq, const float *data, int32_t vq[IVAS_MAX_NUM_BANDS], float *vdeq ); - -#endif /*------------------------------------------------------------------------- * ivas_mc_paramupmix_enc() @@ -374,19 +357,11 @@ void ivas_mc_paramupmix_enc_close( static void get_huff_table( const PAR_TYPE par_type, -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const QUANT_TYPE quant_type, - HUFF_TAB *df0, - HUFF_TAB *df, - HUFF_TAB *dt ) -#else HUFF_TAB *df0, HUFF_TAB *df ) -#endif { switch ( par_type ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP case ALPHA: df0->value = huff_alpha_table.df0.value; df0->length = huff_alpha_table.df0.length; @@ -399,24 +374,6 @@ static void get_huff_table( df->value = huff_beta_table.df.value; df->length = huff_beta_table.df.length; break; -#else - case ALPHA: - df0->value = huff_alpha_table[quant_type].df0.value; - df0->length = huff_alpha_table[quant_type].df0.length; - df->value = huff_alpha_table[quant_type].df.value; - df->length = huff_alpha_table[quant_type].df.length; - dt->value = huff_alpha_table[quant_type].dt.value; - dt->length = huff_alpha_table[quant_type].dt.length; - break; - case BETA: - df0->value = huff_beta_table[quant_type].df0.value; - df0->length = huff_beta_table[quant_type].df0.length; - df->value = huff_beta_table[quant_type].df.value; - df->length = huff_beta_table[quant_type].df.length; - dt->value = huff_beta_table[quant_type].dt.value; - dt->length = huff_beta_table[quant_type].dt.length; - break; -#endif } return; @@ -441,88 +398,37 @@ static void write_huff_bits( static void huffman_encode( -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t bdfOnly, - const int16_t bdtAllowed, - const int16_t nv, - const int16_t ivStart, -#endif const int32_t *vqPrev, const int32_t *vq, const PAR_TYPE parType, -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const QUANT_TYPE quant_type, -#endif const int16_t nq, uint16_t bit_buffer[MC_PARAMUPMIX_MAX_BITS], int16_t *bit_pos ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP int16_t iv; -#else - int16_t iv, ndf, ndt; -#endif int32_t icode; int16_t offset; -#ifdef FIX_891_PARAMUPMIX_CLEANUP HUFF_TAB df0, df; -#else - HUFF_TAB df0, df, dt; -#endif -#ifdef FIX_891_PARAMUPMIX_CLEANUP get_huff_table( parType, &df0, &df ); -#else - get_huff_table( parType, quant_type, &df0, &df, &dt ); -#endif offset = nq - 1; /* range [-(nquant - 1), nquant - 1] */ -#ifndef FIX_891_PARAMUPMIX_CLEANUP - /* Get code length for time and freq diff coding */ - ndf = 0; - ndt = 0; -#endif -#ifdef FIX_891_PARAMUPMIX_CLEANUP for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ ) -#else - for ( iv = ivStart; iv < nv; iv++ ) -#endif { -#ifdef FIX_891_PARAMUPMIX_CLEANUP if ( iv == 0 ) -#else - if ( iv == ivStart ) -#endif { icode = vq[iv]; -#ifndef FIX_891_PARAMUPMIX_CLEANUP - ndf += df0.length[icode]; -#endif } else { icode = vq[iv] - vq[iv - 1] + offset; -#ifndef FIX_891_PARAMUPMIX_CLEANUP - ndf += df.length[icode]; -#endif } icode = vq[iv] - vqPrev[iv] + offset; -#ifndef FIX_891_PARAMUPMIX_CLEANUP - ndt += dt.length[icode]; -#endif - } - -#ifndef FIX_891_PARAMUPMIX_CLEANUP - if ( !bdtAllowed ) /* Time diff not allowed due to conformance or other reason even if bdfOnly = 0 */ - { - ndt = ndf + 1; } -#endif /* Write the bitstream */ -#ifdef FIX_891_PARAMUPMIX_CLEANUP bit_buffer[( *bit_pos )++] = (uint16_t) 0 & 1; for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ ) { @@ -537,49 +443,12 @@ static void huffman_encode( write_huff_bits( df.value[icode], df.length[icode], bit_buffer, bit_pos ); } } -#else - if ( bdfOnly || ndf < ndt ) - { - bit_buffer[( *bit_pos )++] = (uint16_t) 0 & 1; - for ( iv = ivStart; iv < nv; iv++ ) - { - if ( iv == ivStart ) - { - icode = vq[iv]; - write_huff_bits( df0.value[icode], df0.length[icode], bit_buffer, bit_pos ); - } - else - { - icode = vq[iv] - vq[iv - 1] + offset; - write_huff_bits( df.value[icode], df.length[icode], bit_buffer, bit_pos ); - } - } - } - else - { - bit_buffer[( *bit_pos )++] = (uint16_t) 1 & 1; - for ( iv = ivStart; iv < nv; iv++ ) - { - icode = vq[iv] - vqPrev[iv] + offset; -#ifdef DEBUGGING - if ( icode < 0 || icode >= 2 * nq - 1 ) - { - assert( 0 ); - } -#endif - write_huff_bits( dt.value[icode], dt.length[icode], bit_buffer, bit_pos ); - } - } -#endif return; } static void quantize_pars( -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t nv, -#endif const float *v, const int16_t nq, const float *data, @@ -588,11 +457,7 @@ static void quantize_pars( { int16_t iv, iq, iq0, iq1; -#ifdef FIX_891_PARAMUPMIX_CLEANUP for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ ) -#else - for ( iv = 0; iv < nv; iv++ ) -#endif { iq0 = 0; iq1 = nq - 1; @@ -627,13 +492,7 @@ static void quantize_pars( static void quantize_alpha( -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t nv, -#endif const float *alpha, -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const QUANT_TYPE quant_type, -#endif int16_t *pnq, int32_t aq[IVAS_MAX_NUM_BANDS], float *adeq ) @@ -641,17 +500,10 @@ static void quantize_alpha( int16_t nq; const float *data; -#ifdef FIX_891_PARAMUPMIX_CLEANUP nq = ivas_mc_paramupmix_alpha_quant_table.nquant; data = ivas_mc_paramupmix_alpha_quant_table.data; quantize_pars( alpha, nq, data, aq, adeq ); -#else - nq = ivas_mc_paramupmix_alpha_quant_table[quant_type].nquant; - data = ivas_mc_paramupmix_alpha_quant_table[quant_type].data; - - quantize_pars( nv, alpha, nq, data, aq, adeq ); -#endif *pnq = nq; return; @@ -659,37 +511,19 @@ static void quantize_alpha( static void quantize_beta( -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const int16_t nv, -#endif const float *beta, const int32_t aq[IVAS_MAX_NUM_BANDS], -#ifndef FIX_891_PARAMUPMIX_CLEANUP - const QUANT_TYPE quant_type, -#endif int16_t *pnq, int32_t bq[IVAS_MAX_NUM_BANDS], float *bdeq ) { int16_t iv, iq, iq0, iq1; -#ifdef FIX_891_PARAMUPMIX_CLEANUP const ACPL_QUANT_TABLE *tables = ivas_mc_paramupmix_beta_quant_table; -#else - const ACPL_QUANT_TABLE *tables = ivas_mc_paramupmix_beta_quant_table[quant_type]; -#endif ACPL_QUANT_TABLE quant_table; -#ifdef FIX_891_PARAMUPMIX_CLEANUP for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ ) -#else - for ( iv = 0; iv < nv; iv++ ) -#endif { -#ifdef FIX_891_PARAMUPMIX_CLEANUP quant_table = tables[ivas_param_upmx_mx_qmap[aq[iv]]]; -#else - quant_table = tables[ivas_param_upmx_mx_qmap[quant_type][aq[iv]]]; -#endif iq0 = 0; iq1 = quant_table.nquant - 1; @@ -719,11 +553,7 @@ static void quantize_beta( } } -#ifdef FIX_891_PARAMUPMIX_CLEANUP *pnq = ivas_mc_paramupmix_beta_quant_table[0].nquant; -#else - *pnq = ivas_mc_paramupmix_beta_quant_table[quant_type][0].nquant; -#endif return; } @@ -738,14 +568,7 @@ static void put_ec_data( uint16_t bit_buffer[MC_PARAMUPMIX_MAX_BITS], int16_t *bit_pos ) { -#ifndef FIX_891_PARAMUPMIX_CLEANUP - int16_t npar = IVAS_MAX_NUM_BANDS; - int16_t onlyFreq = 1; -#endif int16_t nq; -#ifndef FIX_891_PARAMUPMIX_CLEANUP - QUANT_TYPE quant_type = FINE; -#endif int32_t alphaQuant[IVAS_MAX_NUM_BANDS]; int32_t betaQuant[IVAS_MAX_NUM_BANDS]; float alphaDequant[IVAS_MAX_NUM_BANDS]; @@ -753,21 +576,12 @@ static void put_ec_data( if ( parType == ALPHA ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP quantize_alpha( pars, &nq, alphaQuant, alphaDequant ); -#else - quantize_alpha( npar, pars, quant_type, &nq, alphaQuant, alphaDequant ); -#endif } else { -#ifdef FIX_891_PARAMUPMIX_CLEANUP quantize_alpha( alphas, &nq, alphaQuant, alphaDequant ); quantize_beta( pars, alphaQuant, &nq, betaQuant, betaDequant ); -#else - quantize_alpha( npar, alphas, quant_type, &nq, alphaQuant, alphaDequant ); - quantize_beta( npar, pars, alphaQuant, quant_type, &nq, betaQuant, betaDequant ); -#endif } if ( hMCParamUpmix->first_frame ) @@ -786,19 +600,11 @@ static void put_ec_data( /* Always one parameter set per frame for transient frames. Original PS framing is used internally. */ if ( parType == ALPHA ) { -#ifdef FIX_891_PARAMUPMIX_CLEANUP huffman_encode( hMCParamUpmix->alpha_quant_prev[ch], alphaQuant, ALPHA, nq, bit_buffer, bit_pos ); -#else - huffman_encode( onlyFreq, 1, npar, 0, hMCParamUpmix->alpha_quant_prev[ch], alphaQuant, ALPHA, quant_type, nq, bit_buffer, bit_pos ); -#endif } else { -#ifdef FIX_891_PARAMUPMIX_CLEANUP huffman_encode( hMCParamUpmix->beta_quant_prev[ch], betaQuant, BETA, nq, bit_buffer, bit_pos ); -#else - huffman_encode( onlyFreq, 1, npar, 0, hMCParamUpmix->beta_quant_prev[ch], betaQuant, BETA, quant_type, nq, bit_buffer, bit_pos ); -#endif } if ( parType == ALPHA ) diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index 2bb4efdd835d74c21fe2b9edcc42104da9eec397..9d04a20689b5348063e79e226a7e41f818d98e6e 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -723,7 +723,6 @@ const float Stereo_dmx_wnd_coef_48k[L_FRAME48k] = { }; -#ifdef FIX_891_PARAMUPMIX_CLEANUP /*----------------------------------------------------------------------------------* * ParamUpmix ROM tables *----------------------------------------------------------------------------------*/ @@ -771,119 +770,6 @@ const HUFF_TABLE huff_beta_table = 4, 7, 8, 9, 9, 11, 13 } } }; -#else -const HUFF_TABLE huff_alpha_table[2] = -{ - { /* Alfa Fine */ - { /* df0 */ - { 0x0002ce, 0x000b5e, 0x0004fe, 0x0005ae, 0x00027e, 0x0002de, 0x00016a, 0x0000b2, 0x00004a, 0x00004b, - 0x0000b6, 0x00004e, 0x000024, 0x00002e, 0x00000a, 0x000006, 0x000000, 0x000007, 0x000008, 0x00002f, - 0x000026, 0x000058, 0x0000b4, 0x00009e, 0x00016e, 0x000166, 0x0002df, 0x0002cf, 0x00027c, 0x00027d, - 0x0004ff, 0x000b5f, 0x0002d6 }, - { 10, 12, 11, 11, 10, 10, 9, 8, 7, 7, - 8, 7, 6, 6, 4, 3, 1, 3, 4, 6, - 6, 7, 8, 8, 9, 9, 10, 10, 10, 10, - 11, 12, 10 } - }, - { /* df */ - { 0x0011de, 0x011ffe, 0x013dea, 0x013df6, 0x008eea, 0x013df7, 0x013dee, 0x013deb, 0x013dec, 0x008eee, - 0x008ffe, 0x009efe, 0x0047fe, 0x004f7c, 0x0023fe, 0x0011fe, 0x0013fe, 0x0008f6, 0x0009ee, 0x000476, - 0x00047a, 0x0004f6, 0x00023a, 0x00027a, 0x00027e, 0x00013e, 0x00009a, 0x00004c, 0x00004e, 0x000012, - 0x00000a, 0x000006, 0x000000, 0x000007, 0x00000b, 0x000010, 0x000022, 0x000046, 0x00009b, 0x00013c, - 0x00011c, 0x00023e, 0x00023c, 0x0004fe, 0x00047e, 0x0009fe, 0x0008fe, 0x0008f7, 0x0013ff, 0x0011df, - 0x0027bc, 0x004f7e, 0x004776, 0x009efa, 0x009ef4, 0x013dfe, 0x008eeb, 0x008ee8, 0x013dff, 0x008ee9, - 0x008eef, 0x011fff, 0x013ded, 0x013def, 0x0011dc }, - { 13, 17, 17, 17, 16, 17, 17, 17, 17, 16, - 16, 16, 15, 15, 14, 13, 13, 12, 12, 11, - 11, 11, 10, 10, 10, 9, 8, 7, 7, 5, - 4, 3, 1, 3, 4, 5, 6, 7, 8, 9, - 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, - 14, 15, 15, 16, 16, 17, 16, 16, 17, 16, - 16, 17, 17, 17, 13 } - }, - { /* dt */ - { 0x00eeee, 0x03b3ee, 0x03b3f6, 0x03b3fc, 0x01d9bc, 0x01d9bd, 0x01d9b2, 0x03b3fe, 0x01d9be, 0x01d9f6, - 0x01d9fc, 0x00ecda, 0x00ecfa, 0x00eeef, 0x00766e, 0x007776, 0x003b3a, 0x003bba, 0x001d9a, 0x001ddc, - 0x001dde, 0x000eec, 0x000764, 0x000772, 0x0003b0, 0x0003b8, 0x0001da, 0x0001de, 0x000072, 0x000038, - 0x00001e, 0x000006, 0x000000, 0x000002, 0x00001f, 0x00003a, 0x000073, 0x0001df, 0x0001db, 0x0003ba, - 0x0003b1, 0x000773, 0x000765, 0x000eed, 0x000ecc, 0x001d9e, 0x001d9c, 0x003bbe, 0x003b3b, 0x00777e, - 0x00767c, 0x00eefe, 0x00ecfc, 0x00ecd8, 0x01d9fd, 0x01d9fa, 0x01d9bf, 0x01d9b6, 0x01d9b3, 0x03b3fd, - 0x01d9b7, 0x03b3ff, 0x03b3ef, 0x03b3f7, 0x00eeff }, - { 16, 18, 18, 18, 17, 17, 17, 18, 17, 17, - 17, 16, 16, 16, 15, 15, 14, 14, 13, 13, - 13, 12, 11, 11, 10, 10, 9, 9, 7, 6, - 5, 3, 1, 2, 5, 6, 7, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, - 15, 16, 16, 16, 17, 17, 17, 17, 17, 18, - 17, 18, 18, 18, 16 } - } - }, /* End Alfa Fine */ - { /* Alfa Coarse */ - { /* df0 */ - { 0x0003be, 0x0003fe, 0x0001fe, 0x0000fe, 0x00003e, 0x00003a, 0x00001e, 0x000002, 0x000000, 0x000006, - 0x00001c, 0x00007e, 0x000076, 0x0000ee, 0x0001de, 0x0003ff, 0x0003bf }, - { 10, 10, 9, 8, 6, 6, 5, 2, 1, 3, - 5, 7, 7, 8, 9, 10, 10 } - }, - { /* df */ - { 0x007c76, 0x03e3fe, 0x01f1f6, 0x01f1f7, 0x00f8ea, 0x007c74, 0x007c7c, 0x001f1c, 0x000f9e, 0x0007ce, - 0x0003e2, 0x0001f0, 0x0000fa, 0x00007e, 0x00000e, 0x000006, 0x000000, 0x000002, 0x00001e, 0x00007f, - 0x0000fb, 0x0001f2, 0x0003e6, 0x0007c6, 0x000f9f, 0x001f1e, 0x007c7e, 0x00f8fe, 0x00f8fa, 0x01f1fe, - 0x00f8eb, 0x03e3ff, 0x007c77 }, - { 15, 18, 17, 17, 16, 15, 15, 13, 12, 11, - 10, 9, 8, 7, 4, 3, 1, 2, 5, 7, - 8, 9, 10, 11, 12, 13, 15, 16, 16, 17, - 16, 18, 15 } - }, - { /* dt */ - { 0x003efc, 0x00fbfa, 0x007ddc, 0x00fbfe, 0x007dde, 0x007dfc, 0x003ef6, 0x001f76, 0x000fba, 0x000fbe, - 0x0003ec, 0x0001f2, 0x0000f8, 0x00007e, 0x00001e, 0x000006, 0x000000, 0x000002, 0x00000e, 0x00007f, - 0x0000fa, 0x0001f3, 0x0003ed, 0x0007dc, 0x000fbc, 0x001f7a, 0x003ef7, 0x007dfe, 0x007ddf, 0x00fbff, - 0x007ddd, 0x00fbfb, 0x003efd }, - { 14, 16, 15, 16, 15, 15, 14, 13, 12, 12, - 10, 9, 8, 7, 5, 3, 1, 2, 4, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, - 15, 16, 14 } - } - } /* End Alfa Coarse */ -}; - -const HUFF_TABLE huff_beta_table[2] = -{ - { /* Beta Fine */ - { /* df0 */ - { 0x000000, 0x000002, 0x000006, 0x00000e, 0x00001e, 0x00003e, 0x00007e, 0x0000fe, 0x0000ff }, - { 1, 2, 3, 4, 5, 6, 7, 8, 8 } - }, - { /* df */ - { 0x001f1e, 0x000f8e, 0x0003e2, 0x0001f2, 0x0000fa, 0x00007e, 0x00001e, 0x000006, 0x000000, 0x000002, - 0x00000e, 0x00007f, 0x0000fb, 0x0001f3, 0x0001f0, 0x0007c6, 0x001f1f }, - { 13, 12, 10, 9, 8, 7, 5, 3, 1, 2, - 4, 7, 8, 9, 9, 11, 13 } - }, - { /* dt */ - { 0x007dfe, 0x003efe, 0x000fbe, 0x0003ee, 0x0000fa, 0x00007e, 0x00001e, 0x000006, 0x000000, 0x000002, - 0x00000e, 0x00007f, 0x00007c, 0x0001f6, 0x0007de, 0x001f7e, 0x007dff }, - { 15, 14, 12, 10, 8, 7, 5, 3, 1, 2, - 4, 7, 7, 9, 11, 13, 15 } - } - }, /* End Beta Fine */ - { /* Beta Coarse */ - { /* df0 */ - { 0x000000, 0x000002, 0x000006, 0x00000e, 0x00000f }, - { 1, 2, 3, 4, 4 } - }, - { /* df */ - { 0x0000fe, 0x00003e, 0x00000e, 0x000006, 0x000000, 0x000002, 0x00001e, 0x00007e, 0x0000ff }, - { 8, 6, 4, 3, 1, 2, 5, 7, 8 } - }, - { /* dt */ - { 0x0000fe, 0x00007e, 0x00001e, 0x000006, 0x000000, 0x000002, 0x00000e, 0x00003e, 0x0000ff }, - { 8, 7, 5, 3, 1, 2, 4, 6, 8 } - } - } /* End Beta Coarse */ -}; -#endif const int16_t mc_paramupmix_fb_remix_order[4] = {0, 1, 2, 3}; diff --git a/lib_enc/ivas_rom_enc.h b/lib_enc/ivas_rom_enc.h index 9e6363fb06ec947ccab5b1a2d6ed6826c1b47e3c..60d4ddcf79ebbccb097965b8e413d5ac317dba22 100644 --- a/lib_enc/ivas_rom_enc.h +++ b/lib_enc/ivas_rom_enc.h @@ -126,7 +126,6 @@ extern const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 4]; extern const float Stereo_dmx_wnd_coef_32k[L_FRAME32k]; extern const float Stereo_dmx_wnd_coef_48k[L_FRAME48k]; -#ifdef FIX_891_PARAMUPMIX_CLEANUP /*----------------------------------------------------------------------------------* * ParamUpmix ROM tables *----------------------------------------------------------------------------------*/ @@ -135,12 +134,6 @@ extern const HUFF_TABLE huff_alpha_table; extern const HUFF_TABLE huff_beta_table; extern const int16_t mc_paramupmix_fb_remix_order[4]; -#else -extern const HUFF_TABLE huff_alpha_table[2]; -extern const HUFF_TABLE huff_beta_table[2]; -extern const int16_t mc_paramupmix_fb_remix_order[4]; - -#endif /*----------------------------------------------------------------------------------* * ParamMC ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_NoiseGen.c b/lib_rend/ivas_NoiseGen.c index ecd7d7b098181201a8d9cfe7be56fc25501a0c14..3de2370827eb70f764cb15d3a45e53b949ec3e98 100644 --- a/lib_rend/ivas_NoiseGen.c +++ b/lib_rend/ivas_NoiseGen.c @@ -39,48 +39,6 @@ #include "ivas_prot_rend.h" #include "wmc_auto.h" -#ifndef FIX_917_LCLD_WARNINGS -/*------------------------------------------------------------------------------------------* - * Function CreateNoiseGen() - * - * - *------------------------------------------------------------------------------------------*/ -// todo: not used!! -NoiseGen *CreateNoiseGen( void ) -{ - int32_t n; - - NoiseGen *psNoiseGen = NULL; - - psNoiseGen = (NoiseGen *) malloc( sizeof( NoiseGen ) ); - psNoiseGen->iNoiseBufferLength = 2048; - psNoiseGen->iNoiseBufferMask = 2047; - psNoiseGen->iNoiseBufferIndex = 0; - - psNoiseGen->pfNoiseBuffer = (float *) malloc( psNoiseGen->iNoiseBufferLength * sizeof( float ) ); - - /* Generate Laplacian distributed noise */ - for ( n = 0; n < psNoiseGen->iNoiseBufferLength; n++ ) - { - float fNoise = 0.0f; - float fScale = 0.707f; - fNoise = (float) ( ( rand() & ( RAND_MAX - 1 ) ) - ( RAND_MAX >> 1 ) ) / (float) RAND_MAX; - - if ( fNoise < 0.0 ) - { - fNoise = fScale * (float) logf( 1.0f + 1.9999999f * fNoise ); - } - else - { - fNoise = -fScale * (float) logf( 1.0f - 1.9999999f * fNoise ); - } - - psNoiseGen->pfNoiseBuffer[n] = fNoise; - } - - return psNoiseGen; -} -#endif /*------------------------------------------------------------------------------------------* * Function DeleteNoiseGen() diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index 53cd3ab6b8e5dd2849b4dd09f971da3546a15c48..edbde3cb015b554a1dad566e3bab10293a79656d 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -275,107 +275,6 @@ static void ComputeBandEnergy( return; } -#ifndef FIX_917_LCLD_WARNINGS -/*-------------------------------------------------------------------* - * Function TryMerge() - * - * - *-------------------------------------------------------------------*/ - -/* THis is temporary cost function */ -static float TryMerge( - const int32_t iNumBands, - const int32_t iStartBlock, - const int32_t iGroupLength, - const float fMaxAllowedDiffdB, - float **ppfBandEnergy, - float **ppfBandEnergydB, -#ifdef APPLY_WEIGHT - float **ppfWeight, -#endif - float *pfMegredEnergydB ) -{ - int32_t b; - int32_t n; - float fMeanCost; - float fMaxCost; - float fMinDiffCost; - float fMaxDiffCost; - float fInvGroupSize = 1.0f / (float) iGroupLength; - float fInvNumBands = 1.0f / (float) iNumBands; - - for ( b = 0; b < iNumBands; b++ ) - { - float fGroupEnergy; - - - fGroupEnergy = 0.0; - for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) - { - fGroupEnergy += ppfBandEnergy[n][b]; - } - fGroupEnergy *= fInvGroupSize; - fGroupEnergy = 10.0f * log10f( fGroupEnergy ); // Note epsolon was added when computing BandEnergy; - - pfMegredEnergydB[b] = fGroupEnergy; - } - - fMeanCost = 0.0; - fMaxCost = 0.0; - fMinDiffCost = 0.0; - fMaxDiffCost = 0.0; - for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) - { - float fMeanAbsDiff; - float fMaxAbsDiff; - float fMaxDiff; - float fMinDiff; - - fMeanAbsDiff = 0.0; - fMaxAbsDiff = 0.0; - fMaxDiff = 0.0; - fMinDiff = 0.0; - for ( b = 0; b < iNumBands; b++ ) - { - float fDiff; - float fAbsDiff; - - fDiff = pfMegredEnergydB[b] - ppfBandEnergydB[n][b]; // Changed the order of this - fAbsDiff = fabsf( fDiff ); -#ifdef APPLY_WEIGHT - fAbsDiff *= ppfWeight[n][b]; -#endif - - fMeanAbsDiff += fAbsDiff; - fMaxAbsDiff = ( fMaxAbsDiff > fAbsDiff ) ? fMaxAbsDiff : fAbsDiff; - - - fMaxDiff = ( fMaxDiff > fDiff ) ? fMaxDiff : fDiff; - fMinDiff = ( fMinDiff < fDiff ) ? fMinDiff : fDiff; - } - fMeanAbsDiff *= fInvNumBands; - - fMeanCost = ( fMeanCost > fMeanAbsDiff ) ? fMeanCost : fMeanAbsDiff; - fMaxCost = ( fMaxCost > fMaxAbsDiff ) ? fMaxCost : fMaxAbsDiff; - - fMaxDiffCost = ( fMaxDiffCost > fMaxDiff ) ? fMaxDiffCost : fMaxDiff; - fMinDiffCost = ( fMinDiffCost < fMinDiff ) ? fMinDiffCost : fMinDiff; - } - - // printf("%f\t%f\t%f\t%f\n",fMeanCost,fMaxCost,fMaxDiffCost,fMinDiffCost); - - /*if(fMinDiffCost < -9.0){ // This prevents cliping - fMeanCost = 1e12; //Some large value - }*/ - - if ( fMaxCost > fMaxAllowedDiffdB ) - { - fMeanCost = 1e12f; // Some large value - } - - return fMeanCost; -} -#endif /*-------------------------------------------------------------------* * Function ComputeMergeRMS() @@ -588,122 +487,6 @@ static float TryMerge2( return fMergedCost; } -#ifndef FIX_917_LCLD_WARNINGS -/*-------------------------------------------------------------------* - * Function ComputeGreedyGroups() - * - * - *-------------------------------------------------------------------*/ - -static void ComputeGreedyGroups( - RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int32_t iChannels, - const int32_t iNumBands, - const float fMeanAllowedDiffdB, - const float fMaxAllowedDiffdB ) -{ - float fBestMeanCost; - - fBestMeanCost = 0.0; - while ( fBestMeanCost < fMeanAllowedDiffdB ) - { - GMNode *psGMNode; - GMNode *psBestGMNode; - - fBestMeanCost = fMeanAllowedDiffdB; - psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; - psBestGMNode = NULL; - while ( psGMNode->psNext != NULL ) - { - float fMeanCost; - int32_t iGroupLength; - - iGroupLength = psGMNode->iGroupLength + psGMNode->psNext->iGroupLength; - - fMeanCost = TryMerge( iNumBands * iChannels, - psGMNode->iGroupStart, - iGroupLength, // psGMNode->iGroupLength, //Fix this bug - fMaxAllowedDiffdB, - psRMSEnvelopeGrouping->ppfBandEnergy, - psRMSEnvelopeGrouping->ppfBandEnergydB, -#ifdef APPLY_WEIGHT - psRMSEnvelopeGrouping->ppfWeight, -#endif - psGMNode->pfMergedEnergydB ); - - - if ( fMeanCost < fBestMeanCost ) - { - fBestMeanCost = fMeanCost; - psBestGMNode = psGMNode; - } - - psGMNode = psGMNode->psNext; - } - - if ( fBestMeanCost < fMeanAllowedDiffdB && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) - { - psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; - psBestGMNode->psNext = psBestGMNode->psNext->psNext; - } - } - - return; -} -#endif - -#ifndef FIX_917_LCLD_WARNINGS -/*-------------------------------------------------------------------* - * Function ComputeGreedyGroups2() - * - * - *-------------------------------------------------------------------*/ - -static void ComputeGreedyGroups2( - RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int32_t iChannels, - const int32_t iNumBands, - const int32_t *piBandwidths ) -{ - float fBestMergeCost; - // int32_t iDone = 0; - fBestMergeCost = -1.0; - - while ( fBestMergeCost < 0.0 ) - { - GMNode *psGMNode; - GMNode *psBestGMNode; - - fBestMergeCost = 0.0; - psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; - psBestGMNode = NULL; - while ( psGMNode->psNext != NULL ) - { - float fMergeCost; - - fMergeCost = TryMerge2( iChannels, iNumBands, piBandwidths, psRMSEnvelopeGrouping->ppfBandEnergy, psRMSEnvelopeGrouping->ppfBandEnergydB, psGMNode, psGMNode->psNext ); - - if ( fMergeCost < fBestMergeCost ) - { - fBestMergeCost = fMergeCost; - psBestGMNode = psGMNode; - } - - psGMNode = psGMNode->psNext; - } - - if ( fBestMergeCost < 0.0 && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) - { - psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; - psBestGMNode->iGroupRMSEnvelopeCost = -1; - psBestGMNode->fGroupSNRPenalty = -1.0; - psBestGMNode->psNext = psBestGMNode->psNext->psNext; - } - } - - return; -} -#endif /*-------------------------------------------------------------------* * Function ComputeGreedyGroups3() @@ -918,9 +701,6 @@ void ComputeEnvelopeGrouping( } /* Perform grouping via Greedy Merge */ -#ifndef FIX_917_LCLD_WARNINGS - /* ComputeGreedyGroups2( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths );*/ -#endif /* Allows control over max groups can call using 16 if want same as previous call */ ComputeGreedyGroups3( psRMSEnvelopeGrouping, iChannels, iNumBands, piBandwidths, LCLD_BLOCKS_PER_FRAME ); diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 2b160d46257dae3a9cbcaad847032bb89453ae2f..eb6fe495e0560429187a175a7e480b866e00d2c5 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1862,10 +1862,8 @@ ivas_error ivas_rend_crendProcess( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_len ); -#endif } else { @@ -1903,12 +1901,10 @@ ivas_error ivas_rend_crendProcessSubframe( float *output[], /* i/o: input/output audio channels */ const int16_t n_samples_to_render, /* i : output frame length per channel */ const int32_t output_Fs /* i : output sampling rate */ -#ifdef NONBE_UNIFIED_DECODING_PATHS #ifdef SPLIT_REND_WITH_HEAD_ROT , const int16_t pos_idx #endif -#endif ) { int16_t subframe_idx, subframe_len; @@ -1922,11 +1918,7 @@ ivas_error ivas_rend_crendProcessSubframe( CREND_HANDLE hCrend; #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_UNIFIED_DECODING_PATHS hCrend = pCrend->hCrend[pos_idx]; -#else - hCrend = pCrend->hCrend[0]; -#endif #else hCrend = pCrend->hCrend; #endif @@ -2012,11 +2004,7 @@ ivas_error ivas_rend_crendProcessSubframe( if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0, pos_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0, 0 ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0 ) ) != IVAS_ERR_OK ) @@ -2028,11 +2016,7 @@ ivas_error ivas_rend_crendProcessSubframe( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( pCrend->hCrend[0]->hReverb != NULL ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_process( pCrend->hCrend[0]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2062,10 +2046,8 @@ ivas_error ivas_rend_crendProcessSubframe( return IVAS_ERR_INVALID_INPUT_FORMAT; } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_len ); -#endif } /* move to output */ @@ -2223,7 +2205,6 @@ ivas_error ivas_rend_crendProcessSplitBin( } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS #ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------------------------------* * Function ivas_rend_crend_ProcessSubframesSplitBin() @@ -2393,4 +2374,3 @@ ivas_error ivas_rend_crendProcessSubframesSplitBin( return IVAS_ERR_OK; } #endif -#endif diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 52f771806981d346ce43a359d826419106a59543..936d68b4047e4e9910bb873d5b7a420d234af6a8 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -312,11 +312,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( #endif /* allocate transport channels */ -#ifndef NONBE_UNIFIED_DECODING_PATHS - if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL ) -#else if ( st_ivas->hTcBuffer == NULL ) -#endif { int16_t nchan_to_allocate; int16_t n_samples_granularity; @@ -468,11 +464,9 @@ void ivas_dirac_dec_binaural_render( uint16_t nchan_out; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; int16_t output_length; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_out = BINAURAL_CHANNELS; #ifdef DEBUGGING @@ -480,11 +474,7 @@ void ivas_dirac_dec_binaural_render( #endif for ( ch = 0; ch < nchan_out; ch++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX output_f_local[ch] = output_f_local_buff[ch]; -#else - output_f_local[ch] = output_f[ch]; -#endif } slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -503,9 +493,7 @@ void ivas_dirac_dec_binaural_render( #ifdef DEBUGGING assert( slots_to_render == 0 ); #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX output_length = 0; -#endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe_idx]; @@ -516,23 +504,17 @@ void ivas_dirac_dec_binaural_render( output_f_local[ch] += n_samples_sf; } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX output_length += n_samples_sf; -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); -#endif } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX for ( ch = 0; ch < nchan_out; ch++ ) { mvr2r( output_f_local_buff[ch], output_f[ch], output_length ); } -#endif if ( hSpatParamRendCom->slots_rendered == hSpatParamRendCom->num_slots ) { hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; @@ -576,113 +558,6 @@ void ivas_dirac_dec_binaural_sba_gain( return; } -#ifndef NONBE_UNIFIED_DECODING_PATHS -/*------------------------------------------------------------------------- - * ivas_dirac_dec_binaural() - * - * Parametric binaural renderer main function - *------------------------------------------------------------------------*/ - -void ivas_dirac_dec_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ - float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t num_subframes /* i : number of subframes to render */ -) -{ - int16_t subframe; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - float cng_td_buffer[L_FRAME16k]; - float *p_output[MAX_OUTPUT_CHANNELS]; - int16_t ch; - int16_t slot_size; - int16_t numInChannels; - float *decorr_signal[BINAURAL_CHANNELS], decorr_signal_buff[BINAURAL_CHANNELS][L_FRAME48k]; - - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - - slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - p_output[ch] = output_f[ch]; - p_output[ch + BINAURAL_CHANNELS] = decorr_signal_buff[ch]; - } - numInChannels = nchan_transport; - if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) - { - numInChannels++; - } - else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) - { - numInChannels += (uint8_t) st_ivas->nchan_ism; - } - - for ( ch = 0; ch < numInChannels; ch++ ) - { - st_ivas->hTcBuffer->tc[ch] = &output_f[ch][0]; - } - - ivas_dirac_dec_set_md_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - ivas_spar_dec_set_render_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - } -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDiracDecBin[0]->useTdDecorr ) -#else - if ( st_ivas->hDiracDecBin->useTdDecorr ) -#endif - { - int16_t output_frame; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - decorr_signal[ch] = decorr_signal_buff[ch]; - st_ivas->hTcBuffer->tc[ch + BINAURAL_CHANNELS] = decorr_signal[ch]; - } - output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_td_decorr_process( st_ivas->hDiracDecBin[0]->hTdDecorr, p_output, decorr_signal, output_frame ); -#else - ivas_td_decorr_process( st_ivas->hDiracDecBin->hTdDecorr, p_output, decorr_signal, output_frame ); -#endif - } - - if ( nchan_transport == 1 && st_ivas->nchan_transport != 2 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) - { - Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; - st_ivas->hTcBuffer->tc[nchan_transport] = &cng_td_buffer[0]; - generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[nchan_transport], DEFAULT_JBM_CLDFB_TIMESLOTS, st->cna_dirac_flag && st->flag_cna ); - } - - for ( subframe = 0; subframe < num_subframes; subframe++ ) - { - int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe]; - - ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, p_output, nchan_transport, subframe ); - - for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ ) - { - p_output[ch] += n_samples_sf; - } - -#ifdef NONBE_UNIFIED_DECODING_PATHS - ivas_combined_orientation_update_index( hCombinedOrientationData, n_samples_sf ); -#endif - - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + 1 ) % hSpatParamRendCom->dirac_md_buffer_length; - } - - for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ ) - { - st_ivas->hTcBuffer->tc[ch] = NULL; - } - - return; -} -#endif /*------------------------------------------------------------------------- * Local functions @@ -887,11 +762,7 @@ static void ivas_dirac_dec_binaural_internal( { for ( j = 0; j < 3; j++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS Rmat[i][j] = hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx][i][j]; -#else - Rmat[i][j] = hCombinedOrientationData->Rmat[subframe][i][j]; -#endif } } @@ -907,13 +778,8 @@ static void ivas_dirac_dec_binaural_internal( } #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, st_ivas->hMasaIsmData ); -#else - ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, st_ivas->hMasaIsmData ); -#endif #endif if ( config_data.ivas_format == ISM_FORMAT ) @@ -948,13 +814,8 @@ static void ivas_dirac_dec_binaural_internal( nchanSeparateChannels = (uint8_t) st_ivas->nchan_ism; } -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, nchanSeparateChannels, st_ivas->hMasaIsmData ); -#else - ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, nchanSeparateChannels, st_ivas->hMasaIsmData ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT pMultiBinPoseData = &st_ivas->hSplitBinRend.splitrend.multiBinPoseData; @@ -3605,11 +3466,7 @@ static void ivas_masa_ext_rend_parambin_internal( { for ( j = 0; j < 3; j++ ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS Rmat[i][j] = hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx][i][j]; -#else - Rmat[i][j] = hCombinedOrientationData->Rmat[subframe][i][j]; -#endif } } @@ -3626,13 +3483,8 @@ static void ivas_masa_ext_rend_parambin_internal( #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, NULL ); -#else - ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, NULL ); -#endif #endif /* Always using CLDFB decorrelation in MASA EXT renderer */ @@ -3647,15 +3499,9 @@ static void ivas_masa_ext_rend_parambin_internal( subFrameTotalEne, IIReneLimiter, NULL ); #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, 0, NULL ); -#else - ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, - 0, NULL ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT pMultiBinPoseData = NULL; @@ -3802,9 +3648,7 @@ void ivas_masa_ext_rend_parambin_render( p_output[ch] += n_samples_sf; } -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_combined_orientation_update_index( hCombinedOrientationData, n_samples_sf ); -#endif hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + 1 ) % hSpatParamRendCom->dirac_md_buffer_length; } diff --git a/lib_rend/ivas_lcld_encoder.c b/lib_rend/ivas_lcld_encoder.c index 4bc64df16a70dc678da9abf04e76a07c3b3c3ea7..8052edee4a6d552467003afe502cb34a7eefa6f5 100644 --- a/lib_rend/ivas_lcld_encoder.c +++ b/lib_rend/ivas_lcld_encoder.c @@ -1200,143 +1200,6 @@ static void QuantizeSpectrumDPCM_Opt( return; } -#ifndef FIX_917_LCLD_WARNINGS -static void QuantizeSpectrumDPCM( - const int32_t iNumGroups, - const int32_t *piGroupLengths, - const int32_t iNumBands, - const int32_t *piBandwidths, - int32_t **ppiAlloc, - float **ppfReal, - float **ppfImag, - int32_t **ppiQReal, - int32_t **ppiQImag, - int32_t **ppiSignReal, - int32_t **ppiSignImag, - int32_t *piPredEnable, - float *pfA1Real, - float *pfA1Imag ) /* Pass in 2 previous value buffers NULLABLE */ -{ - int32_t b, m, n, iBlockOffset; - float fVal, fPrevReal, fPrevImag, fPredReal, fPredImag; - int32_t iFBOffset; - int32_t k, iAlloc, iQuantValue, iMaxQuantVal; - float fSCFGain, fInvSCFGain; - - iFBOffset = 0; - for ( b = 0; b < iNumBands; b++ ) - { - for ( m = 0; m < piBandwidths[b]; m++ ) - { - iBlockOffset = 0; - fPrevReal = 0.0; - fPrevImag = 0.0; - for ( n = 0; n < iNumGroups; n++ ) - { - - iAlloc = ppiAlloc[n][b]; - iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; - fSCFGain = c_afScaleFactor[iAlloc]; - fInvSCFGain = c_afInvScaleFactor[iAlloc]; - - for ( k = 0; k < piGroupLengths[n]; k++ ) - { - fPredReal = 0.0; - fPredImag = 0.0; - - if ( piPredEnable[iFBOffset] == 1 ) - { - fPredReal = pfA1Real[iFBOffset] * fPrevReal - pfA1Imag[iFBOffset] * fPrevImag; - fPredImag = pfA1Real[iFBOffset] * fPrevImag + pfA1Imag[iFBOffset] * fPrevReal; - } - else - { // don't need - fPredReal = 0.0; - fPredImag = 0.0; - } - - fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; - if ( fVal > 0.0 ) - { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); - ppiSignReal[iBlockOffset][iFBOffset] = 0; - } - else - { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); - ppiSignReal[iBlockOffset][iFBOffset] = 1; - } -#ifdef _DEBUG_VERBOSE - if ( iQuantValue > iMaxQuantVal ) - { - printf( "Value out of range %d\t%d\t%d\t%d\n", b, iAlloc, iQuantValue, iMaxQuantVal ); - iQuantValue = iMaxQuantVal; - } -#else - iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; -#endif - - ppiQReal[iBlockOffset][iFBOffset] = iQuantValue; - - fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; - if ( fVal > 0.0 ) - { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); - ppiSignImag[iBlockOffset][iFBOffset] = 0; - } - else - { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); - ppiSignImag[iBlockOffset][iFBOffset] = 1; - } - -#ifdef _DEBUG_VERBOSE - if ( iQuantValue > iMaxQuantVal ) - { - printf( "Value out of range %d\t%d\t%d\t%d\n", b, iAlloc, iQuantValue, iMaxQuantVal ); - iQuantValue = iMaxQuantVal; - } -#else - iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; -#endif - ppiQImag[iBlockOffset][iFBOffset] = iQuantValue; - - if ( piPredEnable[iFBOffset] == 1 ) - { - if ( ppiSignReal[iBlockOffset][iFBOffset] == 0 ) - { - fPrevReal = fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; - } - else - { - fPrevReal = -fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; - } - if ( ppiSignImag[iBlockOffset][iFBOffset] == 0 ) - { - fPrevImag = fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; - } - else - { - fPrevImag = -fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; - } - } - else - { - fPrevReal = 0.0; - fPrevImag = 0.0; - } - - iBlockOffset++; - } - } - - iFBOffset++; - } - } - - return; -} -#endif static int32_t CountLCLDBits( const int32_t iNumGroups, diff --git a/lib_rend/ivas_lcld_prot.h b/lib_rend/ivas_lcld_prot.h index 1ff4e37e55377aa940a0ae600bac33b709a42364..2af8355c9772f5b4e1d55d0b8bb1bc7b6f0d1446 100644 --- a/lib_rend/ivas_lcld_prot.h +++ b/lib_rend/ivas_lcld_prot.h @@ -195,11 +195,6 @@ typedef struct NOISE_GEN float *pfNoiseBuffer; } NoiseGen; -#ifndef FIX_917_LCLD_WARNINGS -NoiseGen *CreateNoiseGen( - void -); -#endif void DeleteNoiseGen( NoiseGen *psNoiseGen diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index a1e686020a6961ef9b1147b626b6cc65bf3cb115..9ae6a872fe79eeb3fda3cae104b478ea1ed6ba59 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -280,24 +280,18 @@ void ivas_td_binaural_close( *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_unwrap( - const REVERB_HANDLE hReverb, /* i : Reverberator handle */ - const AUDIO_CONFIG transport_config, /* i : Transport configuration */ - BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD binaural object renderer handle */ - const int16_t num_src, /* i : number of sources to render */ - const int16_t lfe_idx, /* i : LFE channel index */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ -#ifdef NONBE_UNIFIED_DECODING_PATHS + const REVERB_HANDLE hReverb, /* i : Reverberator handle */ + const AUDIO_CONFIG transport_config, /* i : Transport configuration */ + BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD binaural object renderer handle */ + const int16_t num_src, /* i : number of sources to render */ + const int16_t lfe_idx, /* i : LFE channel index */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientaton data handle */ -#else - const int16_t *enableCombinedOrientation, /* i : Combined orientation flag */ - const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ - const IVAS_VECTOR3 *Pos, /* i : Listener position data per subframe */ -#endif - const int16_t ism_md_subframe_update, /* i : Number of subframes to delay ism metadata to sync with audio */ - float *output[], /* i/o: SCE channels / Binaural synthesis */ - const int16_t output_frame, /* i : output frame length */ - const int16_t num_subframes /* i : number of subframes to render */ + const int16_t ism_md_subframe_update, /* i : Number of subframes to delay ism metadata to sync with audio */ + float *output[], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame, /* i : output frame length */ + const int16_t num_subframes /* i : number of subframes to render */ ) { int16_t subframe_length; @@ -307,13 +301,10 @@ ivas_error ivas_td_binaural_renderer_unwrap( int16_t c_indx, nS; float *p_reverb_signal[BINAURAL_CHANNELS]; int16_t ch; -#ifdef NONBE_UNIFIED_DECODING_PATHS int16_t *enableCombinedOrientation; /* i : Combined orientation flag */ IVAS_QUATERNION *Quaternions; /* i : Head tracking data per subframe */ IVAS_VECTOR3 *Pos; /* i : Listener position data per subframe */ -#endif -#ifdef NONBE_UNIFIED_DECODING_PATHS enableCombinedOrientation = NULL; Quaternions = NULL; Pos = NULL; @@ -323,7 +314,6 @@ ivas_error ivas_td_binaural_renderer_unwrap( Quaternions = hCombinedOrientationData->Quaternions; Pos = hCombinedOrientationData->listenerPos; } -#endif for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { @@ -355,11 +345,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Update the listener's location/orientation */ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? enableCombinedOrientation[hCombinedOrientationData->subframe_idx] : 0, ( Quaternions != NULL ) ? &Quaternions[hCombinedOrientationData->subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[hCombinedOrientationData->subframe_idx] : NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? enableCombinedOrientation[subframe_idx] : 0, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -389,10 +375,8 @@ ivas_error ivas_td_binaural_renderer_unwrap( } } -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update combined orientation access index */ ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_length ); -#endif } if ( hReverb != NULL ) @@ -766,15 +750,7 @@ ivas_error ivas_td_binaural_renderer_ext( hIsmMetaData[0]->non_diegetic_flag = currentPos->non_diegetic_flag; } -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData, -#else - if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, - - ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->enableCombinedOrientation : NULL, - ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->Quaternions : NULL, - ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->listenerPos : NULL, -#endif ism_md_subframe_update_ext, p_output, output_frame, (int16_t) ( ( output_frame * FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) / output_Fs ) ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 795779800bc38863462de3050a1623d5d71a69be..78db534f79537c8193f86fd9c1db9c6ac4b33f27 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -278,11 +278,7 @@ int16_t ivas_get_nchan_buffers_dec( if ( st_ivas->ivas_format == MONO_FORMAT ) { -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; -#else - nchan_out_buff = 0; -#endif } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { @@ -327,7 +323,6 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef NONBE_UNIFIED_DECODING_PATHS_FIX #ifdef SPLIT_REND_WITH_HEAD_ROT else if ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else @@ -336,7 +331,6 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = 2 * CPE_CHANNELS; } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 0bd5a09f5c916b00a7ef661f03d4447bfcd1f319..de3830bead0dc25cd6caf26ecde05affb566b7fa 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -221,15 +221,6 @@ void ivas_dirac_dec_binaural_sba_gain( const int16_t output_frame /* i : output frame length */ ); -#ifndef NONBE_UNIFIED_DECODING_PATHS -void ivas_dirac_dec_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ - float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t num_subframes /* i : number of subframes to render */ -); -#endif void ivas_dirac_dec_binaural_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ @@ -638,13 +629,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t lfe_idx, /* i : LFE channel index */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ -#ifdef NONBE_UNIFIED_DECODING_PATHS COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientaton data handle */ -#else - const int16_t *enableCombinedOrientation, /* i : Combined orientation flag */ - const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ - const IVAS_VECTOR3 *Pos, /* i : Listener position data per subframe */ -#endif const int16_t ism_md_subframe_update, float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame, /* i : output frame length */ @@ -964,12 +949,10 @@ ivas_error ivas_rend_crendProcessSubframe( float *output[], /* i/o: input/output audio channels */ const int16_t n_samples_to_render, /* i : output frame length per channel */ const int32_t output_Fs /* i : output sampling rate */ -#ifdef NONBE_UNIFIED_DECODING_PATHS #ifdef SPLIT_REND_WITH_HEAD_ROT , const int16_t pos_idx #endif -#endif ); @@ -1333,7 +1316,6 @@ void rotateFrame_sd( const int16_t subframe_idx /* i : subframe index */ ); -#ifdef NONBE_UNIFIED_DECODING_PATHS void ivas_combined_orientation_update_index( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */ const int16_t samples_rendered /* i : samples rendered since the last call */ @@ -1347,7 +1329,6 @@ void ivas_combined_orientation_update_start_index( void ivas_combined_orientation_set_to_start_index( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ); -#endif void rotateFrame_shd_cldfb( float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain real part */ @@ -1379,9 +1360,7 @@ void ivas_external_orientation_close( ivas_error ivas_combined_orientation_open( COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* o : combined orientation handle */ -#ifdef NONBE_UNIFIED_DECODING_PATHS const int32_t fs, /* i : sampling rate */ -#endif const int16_t num_subframes /* i : number of subframes */ ); @@ -1830,7 +1809,6 @@ ivas_error ObjRenderIvasFrame_splitBinaural( const int16_t output_frame /* i : output frame length */ ); -#ifdef NONBE_UNIFIED_DECODING_PATHS ivas_error ivas_td_binaural_renderer_sf_splitBinaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[], /* i/o: SCE channels / Binaural synthesis */ @@ -1852,7 +1830,6 @@ ivas_error ivas_rend_crendProcessSubframesSplitBin( const int16_t n_samples_to_render, /* i : output frame length per channel */ const int32_t output_Fs /* i : output sampling rate */ ); -#endif ivas_error ivas_rend_crendProcessSplitBin( const CREND_WRAPPER *pCrend, diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 7c4bdd94b6e23911e77e7eade3a183f50f1f8a34..f19828f74b7637c3c4334bfffdee7f82d56a1b42 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -394,11 +394,7 @@ void rotateFrame_shd( SHrotmatgen( SHrotmat_prev, hCombinedOrientationData->Rmat_prev, shd_rot_max_order ); #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS SHrotmatgen( SHrotmat, hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx], shd_rot_max_order ); -#else - SHrotmatgen( SHrotmat, hCombinedOrientationData->Rmat[subframe_idx], shd_rot_max_order ); -#endif for ( i = 0; i < subframe_len; i++ ) { @@ -452,11 +448,7 @@ void rotateFrame_shd( for ( i = 0; i < 3; i++ ) { mvr2r( -#ifdef NONBE_UNIFIED_DECODING_PATHS hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx][i], -#else - hCombinedOrientationData->Rmat[subframe_idx][i], -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->Rmat_prev[0][i], #else @@ -552,11 +544,7 @@ void rotateFrame_sd( } /* gains for current subframe rotation */ -#ifdef NONBE_UNIFIED_DECODING_PATHS rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx], hTransSetup.is_planar_setup ); -#else - rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hCombinedOrientationData->Rmat[subframe_idx], hTransSetup.is_planar_setup ); -#endif if ( hEFAPdata != NULL && ( hTransSetup.ls_azimuth[ch_in_woLFE] != azimuth || hTransSetup.ls_elevation[ch_in_woLFE] != elevation ) ) { @@ -595,11 +583,7 @@ void rotateFrame_sd( for ( i = 0; i < 3; i++ ) { mvr2r( -#ifdef NONBE_UNIFIED_DECODING_PATHS hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx][i], -#else - hCombinedOrientationData->Rmat[subframe_idx][i], -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->Rmat_prev[0][i], #else @@ -888,10 +872,8 @@ void ivas_external_orientation_close( ivas_error ivas_combined_orientation_open( COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* o : combined orientation handle */ -#ifdef NONBE_UNIFIED_DECODING_PATHS - const int32_t fs, /* i : sampling rate */ -#endif - const int16_t num_subframes /* i : number of subframes */ + const int32_t fs, /* i : sampling rate */ + const int16_t num_subframes /* i : number of subframes */ ) { int16_t i; @@ -955,9 +937,7 @@ ivas_error ivas_combined_orientation_open( } } ( *hCombinedOrientationData )->sr_pose_pred_axis = DEFAULT_AXIS; -#ifdef NONBE_UNIFIED_DECODING_PATHS ( *hCombinedOrientationData )->sr_low_res_flag = 0; -#endif #else for ( j = 0; j < 3; j++ ) { @@ -979,11 +959,9 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->isExtOrientationFrozen = 0; ( *hCombinedOrientationData )->isHeadRotationFrozen = 0; -#ifdef NONBE_UNIFIED_DECODING_PATHS ( *hCombinedOrientationData )->subframe_idx = 0; ( *hCombinedOrientationData )->subframe_size = (int16_t) ( fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ); ( *hCombinedOrientationData )->cur_subframe_samples_rendered = 0; -#endif return IVAS_ERR_OK; } @@ -1356,12 +1334,10 @@ ivas_error combine_external_and_head_orientations( #ifdef SPLIT_REND_WITH_HEAD_ROT hCombinedOrientationData->sr_pose_pred_axis = sr_pose_pred_axis; #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS hCombinedOrientationData->subframe_idx = 0; hCombinedOrientationData->cur_subframe_samples_rendered = 0; hCombinedOrientationData->subframe_idx_start = 0; hCombinedOrientationData->cur_subframe_samples_rendered_start = 0; -#endif return IVAS_ERR_OK; } @@ -1716,7 +1692,6 @@ void SHrotmatgen( } -#ifdef NONBE_UNIFIED_DECODING_PATHS /*------------------------------------------------------------------------- * ivas_combined_orientation_update_index() * @@ -1805,5 +1780,3 @@ void ivas_combined_orientation_update_start_index( return; } - -#endif diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 8b513f3d87efea7c00c8ccfdf7d90300e6c2d3e6..5b060eef5a470b37942bb17e8d6ab522af842a35 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -163,39 +163,6 @@ void ivas_splitBinPostRendClose( return; } -#ifndef FIX_917_LCLD_WARNINGS -/*-----------------------------------------------------------------------------------------* - * Function ivas_huffman_code_bits_present() - * - * Huffman code bits present - *-----------------------------------------------------------------------------------------*/ - -static int32_t ivas_split_rend_huffman_code_bits_present( - const int32_t *codebook, - const int32_t code, - const int32_t bits, - const int16_t len ) -{ - int16_t index = len + 1; - int16_t i = 0; - int32_t code_t, ind_t, bits_t; - - while ( i < len ) - { - ind_t = codebook[0]; - bits_t = codebook[1]; - code_t = codebook[2]; - if ( ( code == code_t ) && ( bits == bits_t ) ) - { - return ind_t; - } - codebook = codebook + 3; - i++; - } - - return index; -} -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_split_rend_huffman_decode_opt() @@ -1161,58 +1128,6 @@ static void get_interpolation_vars( return; } -#ifndef FIX_917_LCLD_WARNINGS -/*-----------------------------------------------------------------------------------------* - * Function interpolate_gain_matrix() - * - * - *-----------------------------------------------------------------------------------------*/ - -static void interpolate_gain_matrix( - BIN_HR_SPLIT_REND_MD rot_md[][MAX_SPLIT_MD_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], - const int16_t sf_idx, - const int16_t band_idx, - const int16_t ind[2], - const float interp_fact, - float gain[BINAURAL_CHANNELS] ) -{ - float gd1, gd2, gd3, gd4, diff; - - gd1 = 1.0f; - gd2 = 1.0f; - gd3 = 1.0f; - gd4 = 1.0f; - if ( ind[0] != 0 ) - { - gd1 = rot_md[ind[0] - 1][sf_idx][band_idx].gd; - gd3 = rot_md[ind[0] - 1][sf_idx][band_idx].gd2; - } - if ( ind[1] != 0 ) - { - gd2 = rot_md[ind[1] - 1][sf_idx][band_idx].gd; - gd4 = rot_md[ind[1] - 1][sf_idx][band_idx].gd2; - } -#if 0 - diff = gd1 / gd2; - pitch_gain_l = gd2 * powf( diff, 1.0f - interp_pitch_fact ); - pitch_gain_l = max( 0.0f, pitch_gain_l ); - - diff = gd3 / gd4; - pitch_gain_r = gd4 * powf( diff, 1.0f - interp_pitch_fact ); - pitch_gain_r = max( 0.0f, pitch_gain_r ); -#else - diff = gd1 - gd2; - gain[0] = gd1 - ( diff * interp_fact ); - gain[0] = max( 0.0f, gain[0] ); - - diff = gd3 - gd4; - gain[1] = gd3 - ( diff * interp_fact ); - gain[1] = max( 0.0f, gain[1] ); -#endif - - return; -} -#endif /*-----------------------------------------------------------------------------------------* * Function interpolate_pred_matrix() diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 21c8c3a9ce371ebe62420fee06f7e4c4023f381d..ccd6641b52bd30595093932dea89e3aca56a5b7e 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -729,22 +729,18 @@ typedef struct ivas_combined_orientation_struct IVAS_VECTOR3 listenerPos[MAX_PARAM_SPATIAL_SUBFRAMES]; #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; -#ifdef NONBE_UNIFIED_DECODING_PATHS int16_t sr_low_res_flag; -#endif #endif IVAS_QUATERNION Quaternion_frozen_ext; IVAS_QUATERNION Quaternion_frozen_head; int8_t isExtOrientationFrozen; int8_t isHeadRotationFrozen; int16_t num_subframes; -#ifdef NONBE_UNIFIED_DECODING_PATHS int16_t subframe_idx; int16_t subframe_size; int16_t cur_subframe_samples_rendered; int16_t subframe_idx_start; int16_t cur_subframe_samples_rendered_start; -#endif } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8524542532274d22342df6c51454362cc66152c3..1d9fb1c32dad9967dab6167729eb9d5859d2be7f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3142,11 +3142,7 @@ ivas_error IVAS_REND_Open( } /* Initilize combined orientation data */ -#ifdef NONBE_UNIFIED_DECODING_PATHS if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), outputSampleRate, num_subframes ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), num_subframes ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -5880,10 +5876,8 @@ static ivas_error renderInputIsm( /* Apply input gain to new audio */ v_multc( inAudio.data, ismInput->base.gain, inAudio.data, inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); -#ifdef NONBE_UNIFIED_DECODING_PATHS /* set combined orientation subframe info to start info */ ivas_combined_orientation_set_to_start_index( *ismInput->base.ctx.pCombinedOrientationData ); -#endif switch ( getAudioConfigType( outConfig ) ) { @@ -6611,10 +6605,8 @@ static ivas_error renderInputMc( /* Apply input gain to new audio */ v_multc( inAudio.data, mcInput->base.gain, inAudio.data, inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); -#ifdef NONBE_UNIFIED_DECODING_PATHS /* set combined orientation subframe info to start info */ ivas_combined_orientation_set_to_start_index( *( mcInput->base.ctx.pCombinedOrientationData ) ); -#endif switch ( getAudioConfigType( outConfig ) ) { @@ -7468,10 +7460,8 @@ static ivas_error renderInputSba( /* Apply input gain to new audio */ v_multc( inAudio.data, sbaInput->base.gain, inAudio.data, inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); -#ifdef NONBE_UNIFIED_DECODING_PATHS /* set combined orientation subframe info to start info */ ivas_combined_orientation_set_to_start_index( *( sbaInput->base.ctx.pCombinedOrientationData ) ); -#endif switch ( getAudioConfigType( outConfig ) ) { @@ -7776,10 +7766,8 @@ static ivas_error renderInputMasa( maxBin = (int16_t) ( *masaInput->base.ctx.pOutSampleRate * INV_CLDFB_BANDWIDTH ); -#ifdef NONBE_UNIFIED_DECODING_PATHS /* set combined orientation subframe info to start info */ ivas_combined_orientation_set_to_start_index( *( masaInput->base.ctx.pCombinedOrientationData ) ); -#endif if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_MASA ) { @@ -8272,10 +8260,8 @@ static ivas_error getSamplesInternal( } #endif -#ifdef NONBE_UNIFIED_DECODING_PATHS /* update global cominbed orientation start index */ ivas_combined_orientation_update_start_index( hIvasRend->hCombinedOrientationData, outAudio.config.numSamplesPerChannel ); -#endif return IVAS_ERR_OK; }