diff --git a/apps/decoder.c b/apps/decoder.c index 3d59643ca8d9e25a29b6c0bf29b3c97be5e2a5a9..a3e9fb000a36132ccabbfc1a4bf4c140b121252c 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -67,13 +67,9 @@ static #endif int32_t frame = 0; /* Counter of frames */ -#define MIN_NUM_BITS_ACTIVE_FRAME 56 -#define NUM_BITS_SID_IVAS_5K2 104 -#ifdef SBA_AND_OBJECTS +#define MIN_NUM_BITS_ACTIVE_FRAME 56 +#define NUM_BITS_SID_IVAS_5K2 104 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( ( IVAS_MAX_OUTPUT_CHANNELS + IVAS_MAX_NUM_OBJECTS ) * IVAS_MAX_FRAME_SIZE ) -#else -#define MAX_OUTPUT_PCM_BUFFER_SIZE ( IVAS_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE ) -#endif #define IVAS_PUBLIC_ORIENT_TRK_NONE ( 0 ) @@ -149,9 +145,7 @@ typedef struct #endif uint16_t acousticEnvironmentId; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; -#ifdef API_5MS bool framing_5ms; -#endif } DecArguments; @@ -974,9 +968,7 @@ static bool parseCmdlIVAS_dec( arg->delayCompensationEnabled = true; arg->voipMode = false; arg->complexityLevel = IVAS_DEC_COMPLEXITY_LEVEL_THREE; -#ifdef API_5MS arg->framing_5ms = false; -#endif arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; @@ -1223,14 +1215,12 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_MIME; i++; } -#ifdef API_5MS else if ( strcmp( argv_to_upper, "-FR5" ) == 0 ) { arg->framing_5ms = true; fprintf( stderr, "Warning: this is a placeholder for 5ms framing.\n" ); i++; } -#endif else if ( strcmp( argv_to_upper, "-T" ) == 0 ) { arg->enableHeadRotation = true; @@ -1565,9 +1555,7 @@ static void usage_dec( void ) fprintf( stdout, "-VOIP_framesize : VoIP mode: acoustic frontend fetch frame size (must be multiples of 5!)\n" ); #endif #endif -#ifdef API_5MS fprintf( stdout, "-fr5 : option to perform rendering + head-tracking with 5ms frame size\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" ); @@ -1789,16 +1777,9 @@ static ivas_error initOnFirstGoodFrame( return error; } /* If outputting ISM, get number of objects, open output files and write zero metadata for initial bad frames */ -#ifdef MASA_AND_OBJECTS if ( *pBsFormat == IVAS_DEC_BS_OBJ || *pBsFormat == IVAS_DEC_BS_MASA_ISM -#ifdef SBA_AND_OBJECTS - || *pBsFormat == IVAS_DEC_BS_SBA_ISM -#endif - ) -#else - if ( *pBsFormat == IVAS_DEC_BS_OBJ ) -#endif + || *pBsFormat == IVAS_DEC_BS_SBA_ISM ) { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, pNumObj ) ) != IVAS_ERR_OK ) { @@ -1838,11 +1819,7 @@ static ivas_error initOnFirstGoodFrame( } /* If outputting MASA, open output file and write metadata for initial bad frames */ -#ifdef MASA_AND_OBJECTS if ( *pBsFormat == IVAS_DEC_BS_MASA || *pBsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - else if ( *pBsFormat == IVAS_DEC_BS_MASA ) -#endif { if ( ( error = MasaFileWriter_open( arg.outputWavFilename, arg.delayCompensationEnabled, ppMasaWriter ) ) != IVAS_ERR_OK ) { @@ -1850,10 +1827,8 @@ static ivas_error initOnFirstGoodFrame( return error; } -#ifdef MASA_AND_OBJECTS if ( numInitialBadFrames > 0 ) { -#endif /* Duplicate good first frame metadata to fill the beginning of stream. */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) @@ -1870,9 +1845,7 @@ static ivas_error initOnFirstGoodFrame( return error; } } -#ifdef MASA_AND_OBJECTS } -#endif } } @@ -2181,15 +2154,7 @@ static ivas_error decodeG192( /* Write MASA/ISM metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) { -#ifdef MASA_AND_OBJECTS - if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM -#ifdef SBA_AND_OBJECTS - || bsFormat == IVAS_DEC_BS_SBA_ISM -#endif - ) -#else - if ( bsFormat == IVAS_DEC_BS_OBJ ) -#endif + if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM ) { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) { @@ -2214,12 +2179,8 @@ static ivas_error decodeG192( } } } -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - else if ( bsFormat == IVAS_DEC_BS_MASA ) -#endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) @@ -2302,7 +2263,6 @@ static ivas_error decodeG192( { fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } -#ifdef MASA_AND_OBJECTS else if ( bsFormat == IVAS_DEC_BS_MASA_ISM ) { for ( i = 0; i < numObj; i++ ) @@ -2311,7 +2271,6 @@ static ivas_error decodeG192( } fprintf( stdout, "\nOutput MASA metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } -#endif } /*------------------------------------------------------------------------------------------* @@ -2780,11 +2739,7 @@ static ivas_error decodeVoIP( { int16_t i; -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - if ( bsFormat == IVAS_DEC_BS_OBJ ) -#endif { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) { @@ -2809,12 +2764,8 @@ static ivas_error decodeVoIP( } } } -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - else if ( bsFormat == IVAS_DEC_BS_MASA ) -#endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) @@ -3218,11 +3169,7 @@ static ivas_error decodeVariableSpeed( /* Write ISm metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) { -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - if ( bsFormat == IVAS_DEC_BS_OBJ ) -#endif { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) { @@ -3247,12 +3194,8 @@ static ivas_error decodeVariableSpeed( } } } -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - else if ( bsFormat == IVAS_DEC_BS_MASA ) -#endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) @@ -3402,11 +3345,7 @@ static ivas_error decodeVariableSpeed( /* Write ISm metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) { -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - if ( bsFormat == IVAS_DEC_BS_OBJ ) -#endif { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) { @@ -3431,12 +3370,8 @@ static ivas_error decodeVariableSpeed( } } } -#ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) -#else - else if ( bsFormat == IVAS_DEC_BS_MASA ) -#endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) @@ -3496,7 +3431,6 @@ static ivas_error decodeVariableSpeed( { fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } -#ifdef MASA_AND_OBJECTS else if ( bsFormat == IVAS_DEC_BS_MASA_ISM ) { for ( i = 0; i < numObj; i++ ) @@ -3505,7 +3439,6 @@ static ivas_error decodeVariableSpeed( } fprintf( stdout, "\nOutput MASA metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } -#endif } /* add zeros at the end to have equal length of synthesized signals */ diff --git a/apps/encoder.c b/apps/encoder.c index 577c6bf5b6af1c7d7bd9f065a0fa478a62bd0389..2b4016bcb8789bb3523532a9e373721edbb7b036 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -88,16 +88,13 @@ typedef union _EncInputFormatConfig /* MC details */ IVAS_ENC_MC_LAYOUT mcLayout; -#ifdef MASA_AND_OBJECTS struct EncMasaIsmConfig { int16_t numObjects; const char *metadataFiles[IVAS_MAX_NUM_OBJECTS]; IVAS_ENC_MASA_VARIANT masaVariant; } masa_ism; -#endif -#ifdef SBA_AND_OBJECTS struct EncSbaIsmConfig { int16_t numObjects; @@ -105,7 +102,6 @@ typedef union _EncInputFormatConfig IVAS_ENC_SBA_ORDER order; bool isPlanar; } sba_ism; -#endif } EncInputFormatConfig; @@ -255,11 +251,7 @@ int main( * Print out file names *------------------------------------------------------------------------------------------*/ -#ifdef SBA_AND_OBJECTS if ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_SBA_ISM ) -#else - if ( arg.inputFormat == IVAS_ENC_INPUT_ISM ) -#endif { for ( i = 0; i < arg.inputFormatConfig.ism.numObjects; i++ ) { @@ -454,7 +446,6 @@ int main( } break; -#ifdef SBA_AND_OBJECTS case IVAS_ENC_INPUT_SBA_ISM: if ( ( error = IVAS_ENC_ConfigureForSBAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba_ism.numObjects, arg.inputFormatConfig.sba_ism.order, arg.inputFormatConfig.sba_ism.isPlanar, arg.pca ) ) != IVAS_ERR_OK ) { @@ -462,9 +453,7 @@ int main( exit( -1 ); } break; -#endif -#ifdef MASA_AND_OBJECTS case IVAS_ENC_INPUT_MASA_ISM: if ( ( error = IVAS_ENC_ConfigureForMASAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masa_ism.numObjects, arg.inputFormatConfig.masa_ism.masaVariant ) ) != IVAS_ERR_OK ) { @@ -472,7 +461,6 @@ int main( exit( -1 ); } break; -#endif default: fprintf( stderr, "\nInvalid input type\n\n" ); @@ -558,17 +546,9 @@ int main( } } -#ifdef MASA_AND_OBJECTS - const int16_t numIsmInputs = ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_MASA_ISM -#ifdef SBA_AND_OBJECTS - || arg.inputFormat == IVAS_ENC_INPUT_SBA_ISM -#endif - ) + const int16_t numIsmInputs = ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_MASA_ISM || arg.inputFormat == IVAS_ENC_INPUT_SBA_ISM ) ? arg.inputFormatConfig.ism.numObjects : 0; -#else - const int16_t numIsmInputs = arg.inputFormat == IVAS_ENC_INPUT_ISM ? arg.inputFormatConfig.ism.numObjects : 0; -#endif for ( i = 0; i < numIsmInputs; ++i ) { @@ -1547,7 +1527,6 @@ static bool parseCmdlIVAS_enc( return false; } } -#ifdef MASA_AND_OBJECTS else if ( strcmp( to_upper( argv[i] ), "-ISM_MASA" ) == 0 ) { arg->inputFormat = IVAS_ENC_INPUT_MASA_ISM; @@ -1640,9 +1619,7 @@ static bool parseCmdlIVAS_enc( usage_enc(); } } -#endif -#ifdef SBA_AND_OBJECTS else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 ) { arg->inputFormat = IVAS_ENC_INPUT_SBA_ISM; @@ -1731,7 +1708,6 @@ static bool parseCmdlIVAS_enc( } } } -#endif else if ( strcmp( argv_to_upper, "-STEREO_DMX_EVS" ) == 0 ) { @@ -1937,19 +1913,15 @@ static void usage_enc( void ) fprintf( stdout, "-masa Ch File : MASA format \n" ); fprintf( stdout, " where Ch specifies the number of MASA input/transport channels (1 or 2): \n" ); fprintf( stdout, " and File specifies input file containing parametric MASA metadata \n" ); -#ifdef SBA_AND_OBJECTS fprintf( stdout, "-ism_sba IsmCh +/-Order IsmFiles : SBA and ISM combined format\n" ); fprintf( stdout, " where IsmCh specifies the number of ISMs (1-4)\n" ); fprintf( stdout, " and Order specifies the SBA order (1 to 3) \n" ); fprintf( stdout, " and IsmFiles specify input files containing ISM metadata, one file per object \n" ); -#endif -#ifdef MASA_AND_OBJECTS fprintf( stdout, "-ism_masa IsmCh MasaCh IsmFiles MasaFile : MASA and ISM combined format \n" ); fprintf( stdout, " where IsmCh specifies the number of ISMs (1-4),\n" ); fprintf( stdout, " MasaCh specifies the number of MASA input/transport channels (1-2), \n" ); fprintf( stdout, " IsmFiles specify input files containing ISM metadata, one file per object, \n" ); fprintf( stdout, " and MasaFile specifies input file containing parametric MASA metadata \n" ); -#endif fprintf( stdout, "-mc InputConf : Multi-channel format\n" ); fprintf( stdout, " where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4\n" ); fprintf( stdout, " Loudspeaker positions are assumed to have azimuth and elevation as per \n" ); diff --git a/apps/renderer.c b/apps/renderer.c index 85dca6fb1d1c48813d692a31edee89c310606eb1..0ab2de02166b6e7c4b34b7d160b5bc9ca4ba40a4 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -174,9 +174,7 @@ typedef struct int8_t orientation_tracking; int16_t nonDiegeticPan; float nonDiegeticPanGain; -#ifdef FIX_706_REND_COMPLEXITY_LEVELS IVAS_REND_COMPLEXITY_LEVEL complexityLevel; -#endif bool delayCompensationEnabled; bool quietModeEnabled; bool sceneDescriptionInput; @@ -188,9 +186,7 @@ typedef struct bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; float syncMdDelay; -#ifdef API_5MS bool framing_5ms; -#endif uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; uint16_t acousticEnvironmentId; } CmdlnArgs; @@ -210,9 +206,7 @@ typedef enum CmdLnOptionId_orientationTracking, CmdlnOptionId_lfePosition, CmdlnOptionId_lfeMatrix, -#ifdef FIX_706_REND_COMPLEXITY_LEVELS CmdLnOptionId_complexityLevel, -#endif CmdLnOptionId_noDelayCmp, CmdLnOptionId_quietModeEnabled, CmdLnOptionId_inputMetadata, @@ -224,9 +218,7 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, -#ifdef API_5MS CmdLnOptionId_framing5ms, -#endif CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, CmdLnOptionId_acousticEnvironmentId @@ -339,14 +331,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "ndc", .description = "[flag] Turn off delay compensation", }, -#ifdef FIX_706_REND_COMPLEXITY_LEVELS { .id = CmdLnOptionId_complexityLevel, .match = "complexity_level", .matchShort = "level", .description = "Complexity level, level = (1, 2, 3), will be defined after characterisation.", }, -#endif { .id = CmdLnOptionId_quietModeEnabled, .match = "quiet", @@ -377,14 +367,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, -#ifdef API_5MS { .id = CmdLnOptionId_framing5ms, .match = "framing_5ms", .matchShort = "fr5", .description = "Render audio with 5 ms framing.", }, -#endif { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", @@ -785,9 +773,7 @@ int main( int16_t delayNumSamples = -1; int16_t delayNumSamples_orig = 0; int16_t zeroPad = 0; -#ifdef FIX_LARGE_RENDERER_DELAY_COMP int16_t zeroPadToWrite = 0; -#endif int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; @@ -1811,11 +1797,7 @@ int main( if ( audioWriter != NULL ) { #endif -#ifdef FIX_LARGE_RENDERER_DELAY_COMP if ( delayNumSamples * num_out_channels < outBufferSize ) -#else - if ( delayNumSamples < outBufferSize ) -#endif { if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK ) { @@ -1826,11 +1808,7 @@ int main( } else { -#ifdef FIX_LARGE_RENDERER_DELAY_COMP delayNumSamples -= (int16_t) ( outBufferSize / num_out_channels ); -#else - delayNumSamples -= (int16_t) outBufferSize; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT } @@ -1930,7 +1908,6 @@ int main( if ( audioWriter != NULL ) { #endif -#ifdef FIX_LARGE_RENDERER_DELAY_COMP for ( zeroPadToWrite = zeroPad; zeroPadToWrite > frameSize_smpls; zeroPadToWrite -= frameSize_smpls ) { memset( outInt16Buffer, 0, outBufferSize * sizeof( int16_t ) ); @@ -1948,14 +1925,6 @@ int main( exit( -1 ); } zeroPadToWrite = 0; -#else - memset( outInt16Buffer, 0, zeroPad * outBuffer.config.numChannels * sizeof( int16_t ) ); - if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPad * outBuffer.config.numChannels ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nOutput audio file writer error\n" ); - exit( -1 ); - } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT } #endif @@ -2553,9 +2522,7 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); -#ifdef API_5MS args.framing_5ms = false; -#endif args.syncMdDelay = 0; for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) @@ -2686,7 +2653,6 @@ static void parseOption( strncpy( args->inLfePanningMatrixFile, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); args->lfeCustomRoutingEnabled = true; break; -#ifdef FIX_706_REND_COMPLEXITY_LEVELS case CmdLnOptionId_complexityLevel: assert( numOptionValues == 1 ); args->complexityLevel = (int32_t) ( strtol( optionValues[0], NULL, 10 ) ); @@ -2700,7 +2666,6 @@ static void parseOption( fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" ); } break; -#endif case CmdLnOptionId_noDelayCmp: assert( numOptionValues == 0 ); args->delayCompensationEnabled = false; @@ -2718,13 +2683,11 @@ static void parseOption( exit( -1 ); } break; -#ifdef API_5MS 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/bitstream.c b/lib_com/bitstream.c index 6975167457ef63852e0b89e36b858597ae7db6d1..2c90b913b577c4ad38635eaee2ea56c9f4f78485 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -394,11 +394,7 @@ int16_t get_ivas_max_num_indices( return 1650; } } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - else if ( ivas_format == SBA_FORMAT ) -#endif { if ( ivas_total_brate <= IVAS_16k4 ) { @@ -484,7 +480,6 @@ int16_t get_ivas_max_num_indices( return 1650; } } -#ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT ) { if ( ivas_total_brate <= IVAS_16k4 ) @@ -524,7 +519,6 @@ int16_t get_ivas_max_num_indices( return 1850; } } -#endif else if ( ivas_format == MC_FORMAT ) { if ( ivas_total_brate <= IVAS_16k4 ) @@ -643,11 +637,7 @@ int16_t get_ivas_max_num_indices_metadata( return 80; } } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - else if ( ivas_format == SBA_FORMAT ) -#endif { if ( ivas_total_brate <= IVAS_16k4 ) { @@ -721,7 +711,6 @@ int16_t get_ivas_max_num_indices_metadata( return 1750; } } -#ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT ) { if ( ivas_total_brate <= IVAS_16k4 ) @@ -765,7 +754,6 @@ int16_t get_ivas_max_num_indices_metadata( return 1750 + 30; } } -#endif else if ( ivas_format == MC_FORMAT ) { if ( ivas_total_brate <= IVAS_13k2 ) @@ -2568,22 +2556,14 @@ ivas_error preview_indices( { if ( bit_stream[2] ) { -#if defined MASA_AND_OBJECTS || defined SBA_AND_OBJECTS if ( bit_stream[3] ) { -#ifdef SBA_AND_OBJECTS st_ivas->ivas_format = SBA_ISM_FORMAT; -#endif } else { -#ifdef MASA_AND_OBJECTS st_ivas->ivas_format = MASA_ISM_FORMAT; -#endif } -#else - /* placeholder for combined format signaling */ -#endif } } break; @@ -2748,7 +2728,6 @@ ivas_error preview_indices( ivas_sba_config( 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 ) ); } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { /* read number of objects from the bitstream */ @@ -2775,8 +2754,6 @@ ivas_error preview_indices( ivas_sba_config( 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 ) ); } -#endif -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { /* read number of objects from the bitstream */ @@ -2789,7 +2766,6 @@ ivas_error preview_indices( st_ivas->ism_mode = ivas_omasa_ism_mode_select( total_brate, st_ivas->nchan_ism ); } } -#endif } st_ivas->hDecoderConfig->ivas_total_brate = total_brate; diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 75529a916fa04bfbad13e99611a771270f7dd492..b8fcb059348754daa781848d8dea118b194a42b8 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -263,9 +263,7 @@ enum{ enum { IND_IVAS_FORMAT, -#ifdef MASA_AND_OBJECTS IND_SMODE_OMASA, -#endif IND_SMODE, IND_SID_TYPE, IND_BWIDTH, diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index afccf2d68ec0b402c952049fb04b1581c16c523c..630493a60f16f3bd69730b1033bca2bea6a1e689 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -73,20 +73,12 @@ int32_t get_delay( { delay = IVAS_ENC_DELAY_NS; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT ) -#endif { delay = 0; /* All delay is compensated in the decoder with MASA */ } } -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - if ( ivas_format == SBA_FORMAT ) -#endif { /* compensate for DirAC/SPAR filterbank delay */ delay += IVAS_FB_ENC_DELAY_NS; @@ -122,11 +114,7 @@ int32_t get_delay( } #endif -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT ) -#endif { delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with MASA */ } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 387aec683b119b6ae07dba0581f928810686230d..ff944358454284adc6f1ad8636656ae9597b846b 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -69,12 +69,8 @@ typedef enum SBA_FORMAT, /* IVAS SBA (ambisonics) format */ MASA_FORMAT, /* IVAS MASA format */ MC_FORMAT, /* IVAS multi-channel format */ -#ifdef MASA_AND_OBJECTS MASA_ISM_FORMAT, /* IVAS combined MASA + objects format*/ -#endif -#ifdef SBA_AND_OBJECTS SBA_ISM_FORMAT /* IVAS combined SBA + objects format */ -#endif } IVAS_FORMAT; @@ -84,9 +80,7 @@ typedef enum #define IVAS_FORMAT_SIGNALING_NBITS 2 /* number of bits for signaling the IVAS format */ #define IVAS_FORMAT_SIGNALING_NBITS_EXTENDED ( IVAS_FORMAT_SIGNALING_NBITS + 1 ) -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS #define IVAS_COMBINED_FORMAT_SIGNALLING_BITS 1 -#endif /*----------------------------------------------------------------------------------* @@ -121,16 +115,10 @@ typedef enum RENDERER_PARAM_ISM, RENDERER_BINAURAL_MIXER_CONV, RENDERER_BINAURAL_MIXER_CONV_ROOM, - RENDERER_NON_DIEGETIC_DOWNMIX -#ifdef SBA_AND_OBJECTS - , RENDERER_OSBA_STEREO -#endif -#ifdef SBA_AND_OBJECTS - , RENDERER_OSBA_AMBI -#endif -#ifdef SBA_AND_OBJECTS - , RENDERER_OSBA_LS -#endif + RENDERER_NON_DIEGETIC_DOWNMIX, + RENDERER_OSBA_STEREO, + RENDERER_OSBA_AMBI, + RENDERER_OSBA_LS } RENDERER_TYPE; #ifdef DEBUGGING @@ -139,7 +127,6 @@ typedef enum RENDER_TYPE_OVERRIDE_NONE, RENDER_TYPE_OVERRIDE_CREND, RENDER_TYPE_OVERRIDE_FASTCONV - } ivas_renderTypeOverride; #endif @@ -316,22 +303,16 @@ typedef enum #define ISM_METADATA_INACTIVE_FLAG_BITS 1 /* flag to signal whether MD are sent in low-rate inactive frame */ #define ISM_METADATA_FLAG_BITS 2 -#ifdef MASA_AND_OBJECTS #define ISM_INACTIVE_IMP 0 /* == ISM_NO_META */ -#endif #define ISM_NO_META 0 #define ISM_LOW_IMP 1 #define ISM_MEDIUM_IMP 2 #define ISM_HIGH_IMP 3 -#ifdef MASA_AND_OBJECTS #define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM no meta / inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC ) -#ifdef MASA_AND_OBJECTS #define ADJUST_ISM_BRATE_NEG 6000 #define ADJUST_ISM_BRATE_POS 8000 -#endif -#endif #define ISM_AZIMUTH_NBITS 7 #define ISM_AZIMUTH_MIN -180.0f @@ -385,17 +366,11 @@ typedef enum { ISM_MODE_NONE, ISM_MODE_DISC, /* discrete ISM */ - ISM_MODE_PARAM /* parametric ISM */ -#ifdef MASA_AND_OBJECTS - , + ISM_MODE_PARAM, /* parametric ISM */ ISM_MASA_MODE_MASA_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using MASA parameters */ ISM_MASA_MODE_PARAM_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using parametric object model */ - ISM_MASA_MODE_DISC /* MASA ISM mode when all objects are encoded separarately */ -#endif -#ifdef SBA_AND_OBJECTS - , + ISM_MASA_MODE_DISC, /* MASA ISM mode when all objects are encoded separarately */ ISM_SBA_MODE_DISC /* MASA ISM mode when all objects are encoded separarately */ -#endif } ISM_MODE; @@ -1172,12 +1147,10 @@ enum #define MASA_DELTA_AZI_DCT 10 #define MASA_TRANSP_BITS 1 -#ifdef MASA_AND_OBJECTS #define NO_BITS_MASA_ISM_NO_OBJ 2 #define MASA2TOTAL_THR 0.98f #define BITS_MASA2TOTTAL_DCT0 6 #define STEP_M2T 0.1f -#endif #define MASA_HEADER_BITS 2 #define MASA_SUBFRAME_BITS 1 #define MASA_LOWBITRATE_MODE_BITS 1 @@ -1241,12 +1214,8 @@ enum #define MASA_ANGLE_AT_EQUATOR_DEG 0.738796268264740f #define MASA_INV_ANGLE_AT_EQUATOR_DEG 1.353553128183453f #define MASA_STEREO_MIN_BITRATE IVAS_24k4 -#ifdef MASA_AND_OBJECTS #define MAXIMUM_OMASA_FREQ_BANDS 8 /* Corresponds to maximum number of coding bands at 32 kbps */ -#ifdef MASA_AND_OBJECTS #define OMASA_STEREO_SW_CNT_MAX 100 -#endif -#endif #define MASA_BIT_REDUCT_PARAM 10 #define MASA_MAXIMUM_TWO_DIR_BANDS 24 diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index 605635b6348c3e3b6a865f615cbd623db740f004..29a057ed76afcba955e0dca110cec68c915aa271 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -142,11 +142,7 @@ ivas_error ivas_dirac_config( ( (Decoder_Struct *) st_ivas )->hDirAC->hFbMdft = hFbMdft; } -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - if ( ivas_format == SBA_FORMAT ) -#endif { hConfig->nbands = IVAS_MAX_NUM_BANDS; @@ -164,11 +160,7 @@ ivas_error ivas_dirac_config( } hConfig->enc_param_start_band = 0; hConfig->dec_param_estim = FALSE; -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) /* skip for MASA decoder */ -#else - if ( ivas_format == SBA_FORMAT ) /* skip for MASA decoder */ -#endif { if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band ) ) != IVAS_ERR_OK ) { @@ -177,11 +169,7 @@ ivas_error ivas_dirac_config( if ( hQMetaData != NULL ) { -#ifdef SBA_AND_OBJECTS if ( enc_dec == ENC || ( ivas_format != SBA_FORMAT && ivas_format != SBA_ISM_FORMAT ) ) /* Todo: This condition should probably be corrected in main */ -#else - if ( enc_dec == ENC || ivas_format != SBA_FORMAT ) -#endif { hConfig->nbands = hQMetaData->q_direction[0].cfg.nbands; } @@ -204,11 +192,7 @@ ivas_error ivas_dirac_config( } } -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - if ( ivas_format == SBA_FORMAT ) -#endif { ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft ); } diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c index 325637c9375b99fa5abd3cfe132c85de254edd43..366a8a38cced9a97e9489915fe376538259040c3 100644 --- a/lib_com/ivas_fb_mixer.c +++ b/lib_com/ivas_fb_mixer.c @@ -474,13 +474,9 @@ void ivas_FB_mixer_close( void ivas_fb_mixer_pcm_ingest( IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *pcm_in[], /* i : input audio channels */ -#else - float pcm_in[][L_FRAME48k], /* i : input audio channels */ -#endif - float **ppOut_pcm, /* o : output audio channels */ - const int16_t frame_len, /* i : frame length */ + float *pcm_in[], /* i : input audio channels */ + float **ppOut_pcm, /* o : output audio channels */ + const int16_t frame_len, /* i : frame length */ const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] ) { int16_t i; diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index b01577dacd7f7283fb6102381410d532095cc2c6..e1bdcfabc0b6c4767d8895a0b32dc0e4ac95f6d0 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -63,11 +63,7 @@ * Convert bit-budget to bitrate *-------------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS void bitbudget_to_brate( -#else -static void bitbudget_to_brate( -#endif const int16_t x[], /* i : bitbudgets */ int32_t y[], /* o : bitrates */ const int16_t N /* i : number of entries to be converted */ @@ -91,20 +87,17 @@ static void bitbudget_to_brate( *-------------------------------------------------------------------*/ ivas_error ivas_ism_config( - const int32_t ism_total_brate, /* i : ISM total bitrate */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t nchan_ism, /* i : number of objects */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - const int16_t ism_extended_metadata_flag, /* i : extended metadata flag */ - const int16_t null_metadata_flag[MAX_NUM_OBJECTS], /* i : NULL MD flag */ - const int16_t ism_imp[], /* i : ISM importance flags */ - int32_t element_brate[], /* o : element bitrate per object */ - int32_t total_brate[], /* o : total bitrate per object */ - int16_t nb_bits_metadata[] /* i/o: number of metadata bits */ -#ifdef MASA_AND_OBJECTS - , - const int16_t combined_format_flag /* i : flag indicating combined format */ -#endif + const int32_t ism_total_brate, /* i : ISM total bitrate */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t nchan_ism, /* i : number of objects */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + const int16_t ism_extended_metadata_flag, /* i : extended metadata flag */ + const int16_t null_metadata_flag[MAX_NUM_OBJECTS], /* i : NULL MD flag */ + const int16_t ism_imp[], /* i : ISM importance flags */ + int32_t element_brate[], /* o : element bitrate per object */ + int32_t total_brate[], /* o : total bitrate per object */ + int16_t nb_bits_metadata[], /* i/o: number of metadata bits */ + const int16_t combined_format_flag /* i : flag indicating combined format */ ) { int16_t ch; @@ -117,18 +110,14 @@ ivas_error ivas_ism_config( ivas_error error; error = IVAS_ERR_OK; -#ifdef MASA_AND_OBJECTS if ( combined_format_flag ) { n_ISms = nchan_ism; } else { -#endif n_ISms = nchan_transport; -#ifdef MASA_AND_OBJECTS } -#endif /* initialization */ ism_metadata_flag_global = 0; @@ -141,7 +130,6 @@ ivas_error ivas_ism_config( } } -#ifdef MASA_AND_OBJECTS /* decision about bitrates per channel */ if ( combined_format_flag ) { @@ -193,45 +181,6 @@ ivas_error ivas_ism_config( } } } -#else - /* decision about bitrates per channel - constant during the session (at one ivas_total_brate) */ - bits_ism = (int16_t) ( ism_total_brate / FRAMES_PER_SEC ); - set_s( bits_element, bits_ism / n_ISms, n_ISms ); - bits_element[n_ISms - 1] += bits_ism % n_ISms; - bitbudget_to_brate( bits_element, element_brate, n_ISms ); - - /* count ISM common signaling bits */ - if ( hIsmMeta != NULL ) - { - if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) - { - nb_bits_metadata[0] += ISM_EXTENDED_METADATA_BITS; - - if ( ism_extended_metadata_flag ) - { - nb_bits_metadata[0] += ISM_METADATA_IS_NDP_BITS; - } - } - nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism; - - for ( ch = 0; ch < n_ISms; ch++ ) - { - if ( null_metadata_flag[ch] ) - { - nb_bits_metadata[0] += ISM_METADATA_MD_FLAG_BITS; - nb_bits_metadata[0] += ISM_METADATA_FLAG_BITS; - } - else - { - if ( ism_imp[ch] == ISM_NO_META ) - { - nb_bits_metadata[0] += ISM_METADATA_MD_FLAG_BITS; - nb_bits_metadata[0] += ISM_METADATA_INACTIVE_FLAG_BITS; - } - } - } - } -#endif /* split metadata bitbudget equally between channels */ if ( nb_bits_metadata != NULL ) @@ -399,19 +348,16 @@ ivas_error ivas_ism_config( } #endif -#ifdef MASA_AND_OBJECTS if ( combined_format_flag ) { diff = 0; } -#endif break; } } } } -#ifdef MASA_AND_OBJECTS if ( combined_format_flag ) { if ( diff > 0 ) @@ -434,7 +380,6 @@ ivas_error ivas_ism_config( } } } -#endif bitbudget_to_brate( bits_CoreCoder, total_brate, n_ISms ); } @@ -444,11 +389,7 @@ ivas_error ivas_ism_config( { int32_t tmpL; tmpL = sum_l( total_brate, n_ISms ) + bits_side * FRAMES_PER_SEC; -#ifdef MASA_AND_OBJECTS if ( ism_total_brate != tmpL ) -#else - if ( sum_l( element_brate, n_ISms ) != tmpL ) -#endif { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: Mismatch in ISM bit-budget distribution. Exiting!\n" ); } @@ -654,11 +595,8 @@ ISM_MODE ivas_ism_mode_select( * ---------------------------------------------------------------*/ void ivas_ism_metadata_close( - ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ -#ifdef MASA_AND_OBJECTS - , - const int16_t first_idx /* i : index of first handle to deallocate */ -#endif + ISM_METADATA_HANDLE hIsmMetaData[], /* i/o : object metadata handles */ + const int16_t first_idx /* i : index of first handle to deallocate */ ) { int16_t n; @@ -668,11 +606,7 @@ void ivas_ism_metadata_close( return; } -#ifdef MASA_AND_OBJECTS for ( n = first_idx; n < MAX_NUM_OBJECTS; n++ ) -#else - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) -#endif { if ( hIsmMetaData[n] != NULL ) { diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 23fb559beebe4a0d1ee57583b266b622ba8f3aad..5076dc6661b6a548a2851e6960bf73c799eb19a5 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -75,13 +75,10 @@ void ivas_masa_set_elements( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ int16_t *element_mode, /* o : element mode */ int16_t *nSCE, /* o : number of SCEs */ - int16_t *nCPE /* o : number of CPEs */ -#ifdef MASA_AND_OBJECTS - , - const int16_t ivas_format, /* i : IVAS format */ - const ISM_MODE ism_mode, /* i : ISM mode */ - const int32_t ism_total_brate /* i : initial ISM total bitrate */ -#endif + int16_t *nCPE, /* o : number of CPEs */ + const int16_t ivas_format, /* i : IVAS format */ + const ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t ism_total_brate /* i : initial ISM total bitrate */ ) { if ( nchan_transport == 2 ) @@ -93,7 +90,6 @@ void ivas_masa_set_elements( *element_mode = IVAS_SCE; /* This is needed for the initialization phase to initialize codec mode to SCE, since it is written first to the file*/ } -#ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) { *nCPE = 1; @@ -111,7 +107,6 @@ void ivas_masa_set_elements( } } } -#endif else { *nCPE = 1; @@ -123,12 +118,10 @@ void ivas_masa_set_elements( } } hQMetaData->bits_frame_nominal = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ); -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) { hQMetaData->bits_frame_nominal -= (int16_t) ( ism_total_brate / FRAMES_PER_SEC ); } -#endif } else if ( nchan_transport == 1 ) { @@ -807,7 +800,6 @@ void deindex_sph_idx( } -#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------- * valid_ratio_index() * @@ -1008,4 +1000,3 @@ int32_t calculate_cpe_brate_MASA_ISM( return cpe_brate; } -#endif diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 25415e56d6b5e3b9395efd2dc147ce7f897720d3..14236c919d4333b73e8e9100a0fb7ccb9b89b347 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -41,7 +41,6 @@ #include "debug.h" #endif -#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------- * Local constants *---------------------------------------------------------------*/ @@ -240,7 +239,6 @@ int32_t ivas_interformat_brate( ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 24400 and 1 object */ ) { -#ifdef FIX_694_OMASA_EXTREME if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && element_brate == IVAS_13k2 ) { if ( ism_imp == ISM_LOW_IMP ) @@ -258,7 +256,6 @@ int32_t ivas_interformat_brate( } else { -#endif if ( ism_imp == ISM_LOW_IMP ) { nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP3 ); @@ -271,11 +268,8 @@ int32_t ivas_interformat_brate( { nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP3 ); } -#ifdef FIX_694_OMASA_EXTREME } -#endif } -#ifdef FIX_694_OMASA_EXTREME else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ && element_brate == 16000 ) { if ( ism_imp == ISM_LOW_IMP ) @@ -291,7 +285,6 @@ int32_t ivas_interformat_brate( nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP3 ); } } -#endif else { if ( ism_imp == ISM_LOW_IMP ) @@ -559,4 +552,3 @@ int16_t calculate_brate_limit_flag( return brate_limit_flag; } -#endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index dd003e6ad701864125a9456c24f7dfd23068c22d..2e12b0481c815751280b087c21b1d286b3551cd1 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -157,11 +157,7 @@ ivas_error ivas_cpe_enc( ivas_error ivas_mct_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data[MCT_MAX_CHANNELS], /* i : input signal buffers */ -#else - float data[MCT_MAX_CHANNELS][L_FRAME48k], /* i : input signals */ -#endif const int16_t input_frame, /* i : input frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ); @@ -369,11 +365,7 @@ ivas_error ivas_hp20_dec_reconfig( ivas_error ivas_sce_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t sce_id, /* i : SCE # identifier */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[1], /* o : output synthesis signal */ -#else - float output[1][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame, /* i : output frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ); @@ -381,22 +373,14 @@ ivas_error ivas_sce_dec( ivas_error ivas_cpe_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t cpe_id, /* i : CPE # identifier */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* o : output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame, /* i : output frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ); ivas_error ivas_mct_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame, /* i : output frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ); @@ -457,11 +441,7 @@ ivas_error ivas_core_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ const int16_t n_channels, /* i : number of channels to be decoded */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* o : output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* o : output synthesis signal */ -#endif float outputHB[CPE_CHANNELS][L_FRAME48k], /* o : output HB synthesis signal */ float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX], /* o : DFT buffers */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ @@ -500,11 +480,7 @@ void decod_gen_2sbfr( void synchro_synthesis( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis signal */ -#endif const int16_t output_frame, /* i : Number of samples */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ ); @@ -658,11 +634,7 @@ void ivas_post_proc( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ const int16_t n, /* i : channel number */ float synth[], /* i/o: output synthesis signal */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis signal */ -#endif const int16_t output_frame, /* i : output frame length */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ ); @@ -705,11 +677,7 @@ MC_LS_SETUP ivas_mc_map_output_config_to_mc_ls_setup( void smooth_dft2td_transition( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i/o: synthesis @external Fs */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: synthesis @external Fs */ -#endif const int16_t output_frame /* i : output frame length */ ); @@ -918,19 +886,15 @@ ivas_error ivas_ism_config( const int16_t ism_imp[], /* i : ISM importance flags */ int32_t element_brate[], /* o : element bitrate per object */ int32_t total_brate[], /* o : total bitrate per object */ - int16_t nb_bits_metadata[] /* i/o: number of metadata bits */ -#ifdef MASA_AND_OBJECTS - , const int16_t combined_format_flag /* i : flag indicating combined format */ -#endif + int16_t nb_bits_metadata[], /* i/o: number of metadata bits */ + const int16_t combined_format_flag /* i : flag indicating combined format */ ); -#ifdef MASA_AND_OBJECTS void bitbudget_to_brate( const int16_t x[], /* i : bitbudgets */ int32_t y[], /* o : bitrates */ const int16_t N /* i : number of entries to be converted */ ); -#endif void ivas_ism_reset_metadata( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handles */ @@ -983,25 +947,14 @@ ivas_error ivas_ism_metadata_dec_create( ivas_error ivas_ism_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data[MAX_NUM_OBJECTS], /* i : input signal */ -#else - float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ -#endif const int16_t input_frame, /* i : input frame length per channel */ - int16_t *nb_bits_metadata /* i : number of metadata bits */ -#ifdef MASA_AND_OBJECTS - , - const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ -#endif + int16_t *nb_bits_metadata, /* i : number of metadata bits */ + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ ); ivas_error ivas_ism_metadata_enc( -#ifdef MASA_AND_OBJECTS int32_t *ism_total_brate, /* i/o: ISM total bitrate */ -#else - const int32_t ism_total_brate, /* i : ISM total bitrate */ -#endif const int16_t nchan_ism, /* i : number of ISM channels */ const int16_t nchan_transport, /* i : number of transport channels */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ @@ -1011,17 +964,11 @@ ivas_error ivas_ism_metadata_enc( const int16_t localVAD[], /* i : VAD flag */ const int16_t ism_mode, /* i : ISM mode */ const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ - const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ -#ifdef MASA_AND_OBJECTS - , + const int16_t ism_extended_metadata_flag, /* i : Extended metadata flag */ const float lp_noise_CPE, /* i : LP filtered total noise estimation */ const int16_t flag_omasa_ener_brate, /* i : less bitrate for objects in OMASA flag */ - int16_t *omasa_stereo_sw_cnt -#endif -#ifdef SBA_AND_OBJECTS - , + int16_t *omasa_stereo_sw_cnt, const int16_t ini_frame -#endif ); ivas_error ivas_ism_metadata_dec( @@ -1036,10 +983,8 @@ ivas_error ivas_ism_metadata_dec( ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ int16_t *ism_extended_metadata_flag, /* i/o: Extended metadata active in renderer */ - int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */ -#ifdef SBA_AND_OBJECTS - , DEC_CORE_HANDLE st0 /* i : core-coder handle */ -#endif + int16_t *ism_extmeta_cnt, /* i/o: Number of change frames observed */ + DEC_CORE_HANDLE st0 /* i : core-coder handle */ ); @@ -1059,11 +1004,7 @@ ivas_error ivas_param_ism_enc_open( void ivas_param_ism_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data[MAX_NUM_OBJECTS], /* i : input signal */ -#else - float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ -#endif const int16_t input_frame /* i : input frame length per channel */ ); @@ -1073,20 +1014,13 @@ void ivas_param_ism_enc_close( ); void ivas_ism_metadata_close( - ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ -#ifdef MASA_AND_OBJECTS - , + ISM_METADATA_HANDLE hIsmMetaData[], /* i/o : object metadata handles */ const int16_t first_idx /* i : index of first handle to deallocate */ -#endif ); void ivas_param_ism_stereo_dmx( Encoder_Struct *st_ivas, /* i : IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data[MAX_NUM_OBJECTS], /* i/o: input signal/stereo dmx */ -#else - float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i/o: input signal/stereo dmx */ -#endif const int16_t input_frame /* i : Length of input frame */ ); @@ -1118,11 +1052,7 @@ void ivas_param_ism_dec_close( void ivas_param_ism_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output_f[][L_FRAME48k] /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif ); void ivas_ism_dec_digest_tc( @@ -1865,21 +1795,13 @@ void stereo_tca_init_dec( void stereo_tca_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *synth[CPE_CHANNELS], /* i/o: output synth */ -#else - float synth[CPE_CHANNELS][L_FRAME48k], /* i/o: output synth */ -#endif const int16_t output_frame /* i : length of a frame per channel */ ); void stereo_tca_scale_R_channel( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output, /* i/o: output synthesis, R channel */ -#else - float output[L_FRAME48k], /* i/o: output synthesis, R channel */ -#endif const int16_t output_frame /* i : frame length */ ); @@ -1935,11 +1857,7 @@ void stereo_icBWE_dec( void stereo_icBWE_decproc( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i/o: output symthesis */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output symthesis */ -#endif float outputHB[CPE_CHANNELS][L_FRAME48k], /* i : HB synthesis */ const int16_t last_core, /* i : last core, primary channel */ const int16_t last_bwidth, /* i : last bandwidth */ @@ -2017,9 +1935,7 @@ void stereo_tdm_prep_dwnmx ( ); int16_t stereo_tdm_ener_analysis( -#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#endif CPE_ENC_HANDLE hCPE, /* i : CPE structure */ const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ @@ -2042,10 +1958,8 @@ void stereo_td_init_dec( ); void tdm_configure_dec( -#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ @@ -2095,10 +2009,8 @@ void tdm_ol_pitch_comparison( ); void tdm_configure_enc( -#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag in TD stereo OR LRTD primary channel */ @@ -2115,10 +2027,8 @@ ivas_error signaling_enc_secondary( ); void tdm_bit_alloc( -#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ int32_t *total_brate_pri, /* o : Allocated primary channel bitrate */ @@ -2587,11 +2497,7 @@ void stereo_decoder_tcx( void stereo_mdct_core_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *signal_out[CPE_CHANNELS], /* o : synthesis @internal_FS */ -#else - float signal_out[CPE_CHANNELS][L_FRAME48k], /* o : synthesis @internal_FS */ -#endif float signal_outFB[CPE_CHANNELS][L_FRAME48k] /* o : synthesis @output_FS */ ); @@ -2759,21 +2665,13 @@ void synchonize_channels_mdct_sid( void updateBuffersForDmxMdctStereo( CPE_DEC_HANDLE hCPE, /* i/o: CPE handle */ const int16_t output_frame, /* i : output frame length */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i/o: decoder output */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: decoder output */ -#endif float synth[CPE_CHANNELS][L_FRAME48k] /* i/o: decoder synthesis */ ); void applyDmxMdctStereo( const CPE_DEC_HANDLE hCPE, /* i : CPE handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* o : output from core decoder */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* o : output from core decoder */ -#endif const int16_t output_frame /* i : output frame length */ ); @@ -2840,11 +2738,7 @@ void stereo_cng_init_dec( ); void stereo_cng_compute_PScorr( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i : Output signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i : Output signal */ -#endif float *c_PS_LT, /* i/o: Correlation */ const int16_t L_frame_0, /* i : L_frame channel 0 */ const int16_t L_frame_1 /* i : L_frame channel 1 */ @@ -2857,11 +2751,7 @@ void stereo_cng_dec_update( void stereo_cna_update_params( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i : Output signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i : Output signal */ -#endif const int16_t output_frame, /* i : Output frame length */ const int16_t tdm_ratio_idx /* i : TDM ratio index */ ); @@ -3179,11 +3069,7 @@ void ivas_mct_core_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ const int16_t nCPE, /* i : number of CPEs */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *signal_out[] /* o : synthesis @internal_FS */ -#else - float signal_out[][L_FRAME48k] /* o : synthesis @internal_FS */ -#endif ); void ivas_mct_dec_mct( @@ -3498,11 +3384,7 @@ void ivas_dirac_param_est_enc( DIRAC_ENC_HANDLE hDirAC, IVAS_QDIRECTION *q_direction, const uint8_t useLowerRes, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], -#else - float data_f[][L_FRAME48k], -#endif float **pp_fr_real, float **pp_fr_imag, const int16_t input_frame, @@ -3593,44 +3475,28 @@ void ivas_sba_get_spar_hoa_md_flag( ); void ivas_sba_zero_vert_comp( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *sba_data[], /* i : SBA signals */ -#else - float sba_data[][L_FRAME48k], /* i/o: SBA data frame */ -#endif const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int16_t sba_planar, /* i : SBA planar flag */ const int16_t input_frame /* i : input frame length */ ); void ivas_sba_getTCs( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *sba_data[], /* i : SBA signals */ -#else - float sba_data[][L_FRAME48k], /* i : SBA signals */ -#endif Encoder_Struct *st_ivas, /* i/o: Encoder struct */ const int16_t input_frame /* i : frame length */ ); /*! r: SBA DirAC stereo flag */ int16_t ivas_sba_remapTCs( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *sba_data[], /* i/o: SBA signals */ -#else - float sba_data[][L_FRAME48k], /* i/o: SBA signals */ -#endif Decoder_Struct *st_ivas, /* i/o: decoder struct */ const int16_t output_frame /* i : frame length */ ); void ivas_sba_dirac_stereo_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* o : output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame, /* i : output frame length per channel */ const int16_t mcmasa /* i : McMASA flag */ ); @@ -3689,11 +3555,7 @@ void ivas_dirac_enc( DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i/o: SBA channels */ -#else - float data_f[][L_FRAME48k], /* i/o: SBA channels */ -#endif float **ppIn_FR_real, /* o : real freq domain values */ float **ppIn_FR_imag, /* o : imag freq domain values */ const int16_t input_frame, /* i : input frame length */ @@ -3749,9 +3611,7 @@ void ivas_dirac_dec_read_BS( SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial rendering data handle */ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q metadata */ int16_t *nb_bits, /* o : number of bits read */ -#ifdef SBA_AND_OBJECTS const int16_t last_bit_pos, /* i : last read bitstream position*/ -#endif const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); @@ -3770,11 +3630,7 @@ void ivas_dirac_dec_set_md_map( void ivas_dirac_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif const int16_t nchan_transport /* i : number of transport channels */ ); @@ -3855,11 +3711,7 @@ void calculate_hodirac_sector_parameters( void ivas_mc_paramupmix_enc( Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i/o: input/transport MC data */ -#else - float data_f[][L_FRAME48k], /* i/o: input: MC data */ -#endif const int16_t input_frame /* i : input frame length */ ); @@ -3874,11 +3726,7 @@ void ivas_mc_paramupmix_enc_close( void ivas_mc_paramupmix_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output_f[][L_FRAME48k] /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif ); ivas_error ivas_mc_paramupmix_dec_open( @@ -3955,11 +3803,7 @@ void ivas_param_mc_enc_close( void ivas_param_mc_enc( Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i/o: input/transport MC data */ -#else - float data_f[][L_FRAME48k], /* i/o: input: MC data */ -#endif const int16_t input_frame /* i : input frame length */ ); @@ -4212,11 +4056,7 @@ void ivas_spar_enc_close( ivas_error ivas_spar_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i/o: input/transport audio channels */ -#else - float data_f[][L_FRAME48k], /* i/o: input/transport audio channels */ -#endif const int16_t input_frame, /* i : input frame length */ int16_t *nb_bits_metadata, /* i : number of MD bits written */ BSTR_ENC_HANDLE hMetaData /* o : MetaData handle */ @@ -4250,11 +4090,7 @@ void ivas_spar_config( ivas_error ivas_sba_upmixer_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: transport/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: transport/output audio channels */ -#endif const int16_t output_frame /* i : output frame length */ ); @@ -4262,9 +4098,7 @@ 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 */ const int16_t nchan_in, /* i : number of input ambisonics channels */ -#ifdef SBA_AND_OBJECTS const int16_t nchan_ism, -#endif const AUDIO_CONFIG output_config, /* i : output audio configuration */ const IVAS_OUTPUT_SETUP output_setup, /* i : output format setup */ const float hoa_dec_mtx[] /* i : HOA decoding mtx */ @@ -4272,11 +4106,7 @@ ivas_error ivas_sba_linear_renderer( void ivas_sba_mix_matrix_determiner( SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: transport/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: transport/output audio channels */ -#endif const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame, /* i : output frame length */ @@ -4329,13 +4159,8 @@ ivas_error ivas_spar_md_enc_init void ivas_agc_dec_process( ivas_agc_dec_state_t *hAgcDec, /* i/o: AGC decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *pcm_in[], /* i : input audio channels */ float *pcm_out[], /* o : output audio channels */ -#else - float pcm_in[][L_FRAME48k], /* i : input audio channels */ - float pcm_out[][L_FRAME48k], /* o : output audio channels */ -#endif const int16_t n_channels, /* i : number of channels */ const int16_t output_Fs /* i : output sampling rate */ ); @@ -4457,11 +4282,7 @@ int16_t ivas_is_res_channel( void ivas_spar_dec_agc_pca( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: input/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: input/output audio channels */ -#endif const int16_t output_frame /* i : output frame length */ ); @@ -4504,11 +4325,7 @@ void ivas_spar_dec_upmixer_sf( void ivas_spar_dec_upmixer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: input/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: input/output audio channels */ -#endif const int16_t nchan_internal, /* i : number of internal channels */ const int16_t output_frame /* i : output frame length */ ); @@ -4855,11 +4672,7 @@ void ivas_pca_dec( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ const int16_t bfi, /* i : bad frame indicator */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *pcm_out[] /* o : output audio channels */ -#else - float pcm_out[][L_FRAME48k] /* o : output audio channels */ -#endif ); /* PCA utilities */ @@ -5124,13 +4937,9 @@ void ivas_masa_enc_reconfigure( ); ivas_error ivas_masa_dec_reconfigure( -#ifdef MASA_AND_OBJECTS Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ int16_t *data /* o : flushed PCM samples */ -#else - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#endif ); ivas_error ivas_masa_encode( @@ -5142,9 +4951,7 @@ ivas_error ivas_masa_encode( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t Opt_DTX_ON, /* i : DTX on flag */ - const int16_t element_mode /* i : element mode */ -#ifdef MASA_AND_OBJECTS - , + const int16_t element_mode, /* i : element mode */ const ISM_MODE ism_mode, /* i : ISM format mode */ const int16_t nchan_ism, /* i : number of ISM channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ @@ -5152,16 +4959,11 @@ ivas_error ivas_masa_encode( OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ const int16_t ism_imp, /* i : importance of separated object */ const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ -#endif ); void ivas_masa_estimate_energy( MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i : Input audio channels */ -#else - float data_f[][L_FRAME48k], /* i : Input audio channels */ -#endif const int16_t input_frame, /* i : frame length */ const int16_t nchan_transport /* i : number of MASA input/transport channels */ ); @@ -5177,16 +4979,12 @@ void ivas_masa_set_elements( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ int16_t *element_mode, /* o : element mode */ int16_t *nSCE, /* o : number of SCEs */ - int16_t *nCPE /* o : number of CPEs */ -#ifdef MASA_AND_OBJECTS - , + int16_t *nCPE, /* o : number of CPEs */ const int16_t ivas_format, /* i : IVAS format */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t ism_total_brate /* i : initial ISM total bitrate */ -#endif ); -#ifdef MASA_AND_OBJECTS /*! r: valid or not 1/0 */ int16_t valid_ratio_index( int16_t index, /* i : index to be checked */ @@ -5268,7 +5066,6 @@ void ivas_get_stereo_panning_gains( const float eleDeg, float panningGains[2] ); -#endif void ivas_masa_set_coding_config( MASA_CODEC_CONFIG* config, /* i/o: MASA coding config structure */ @@ -5333,11 +5130,7 @@ void update_bits_next_block( void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: synthesized core-coder transport channels */ -#else - float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ -#endif const int16_t output_frame /* i : output frame length per channel */ #ifdef CR_FIX_585_MASA_2TC_DTX_EXT , @@ -5496,11 +5289,8 @@ ivas_error vbap_init_data( VBAP_HANDLE *hVBAPdata, /* i/o: handle for VBAP data structure that will be initialized */ const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ - const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ -#ifdef MASA_AND_OBJECTS - , + const int16_t num_speaker_nodes, /* i : number of speaker nodes in the set */ const IVAS_FORMAT ivas_format /* i : IVAS format */ -#endif ); void vbap_free_data( @@ -5511,11 +5301,8 @@ void vbap_determine_gains( const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ float *gains, /* o : gain vector for speaker nodes for given direction */ const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ - const int16_t ele_deg /* i : elevation in degrees for panning direction (positive up) */ -#ifdef MASA_AND_OBJECTS - , + const int16_t ele_deg, /* i : elevation in degrees for panning direction (positive up) */ const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ -#endif ); void v_sort_ind( @@ -5547,11 +5334,7 @@ void ivas_ls_setup_conversion( void ivas_ls_setup_conversion_process_mdct( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[] /* i/o: output synthesis signal */ -#else - float output[][L_FRAME48k] /* i/o: output synthesis signal */ -#endif ); void ivas_ls_setup_conversion_process_mdct_param_mc( @@ -5632,11 +5415,7 @@ void ivas_mcmasa_enc( MCMASA_ENC_HANDLE hMcMasa, /* i/o: Encoder McMASA handle */ IVAS_QMETADATA_HANDLE hQMeta, /* o : Qmetadata handle */ MASA_ENCODER_HANDLE hMasa, /* i/o: Encoder MASA handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i : Input frame of audio */ -#else - float data_f[][L_FRAME48k], /* i : Input frame of audio */ -#endif const int16_t input_frame, /* i : Input frame size */ const int16_t nchan_transport, /* i : Number of transport channels */ const int16_t nchan_inp /* i : Number of input channels */ @@ -5645,11 +5424,7 @@ void ivas_mcmasa_enc( void ivas_mcmasa_param_est_enc( MCMASA_ENC_HANDLE hMcMasa, /* i/o: Encoder McMASA handle */ MASA_ENCODER_HANDLE hMasa, /* i/o: Encoder MASA handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i : Input frame of audio */ -#else - float data_f[][L_FRAME48k], /* i : Input frame of audio */ -#endif float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated elevation */ float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated azimuth */ float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated direct-to-total ratio*/ @@ -5690,8 +5465,7 @@ void computeReferencePower_enc( const int16_t num_freq_bands, /* i : Number of frequency bands */ const IVAS_FORMAT ivas_format, /* i : ivas_format */ int16_t ref_power_w, /* i : use 0 if hodirac is enabled */ - const int16_t nchan_ana /* i : number of analysis channels */ - , + const int16_t nchan_ana, /* i : number of analysis channels */ int16_t *mono_frame_count, int16_t *dirac_mono_flag ); @@ -5702,31 +5476,19 @@ ivas_error ivas_mono_dmx_renderer_open( void ivas_mono_downmix_render_passive( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/mono output */ -#endif const int16_t output_frame /* i : output frame length */ ); void ivas_mono_stereo_downmix_mcmasa( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[], /* i/o: synthesized core-coder transport channels/mono or stereo output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/mono or stereo output */ -#endif int16_t output_frame /* i : output frame length per channel */ ); void ivas_lfe_synth_with_filters( MCMASA_LFE_SYNTH_DATA_HANDLE hMasaLfeSynth, /* i/o: LFE synthesis structure for McMASA */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* o : output signals */ -#else - float data_f[][L_FRAME48k], /* o : output signals */ -#endif const int16_t output_frame, /* i : output frame length per channel */ const int16_t separateChannelIndex, /* i : separate channel index */ const int16_t lfeChannelIndex /* i : LFE channel index */ @@ -5827,7 +5589,6 @@ void ivas_filter_process( * OSBA prototypes *----------------------------------------------------------------------------------*/ -#ifdef SBA_AND_OBJECTS ivas_error ivas_osba_enc_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ); @@ -5843,11 +5604,7 @@ ivas_error ivas_osba_enc_reconfig( void ivas_osba_enc( OSBA_ENC_HANDLE hOSba, /* i/o: OSBA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f[], /* i/o: Input / transport audio signals */ -#else - float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ - #endif const int16_t input_frame, /* i : Input frame size */ const int16_t nchan_ism, /* i : Number of objects for parameter analysis */ const ISM_MODE ism_mode, /* i : ISM mode */ @@ -5865,11 +5622,7 @@ ivas_error ivas_sba_ism_separate_object_renderer_open( ivas_error ivas_osba_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame /* i : output frame length per channel */ ); @@ -5882,21 +5635,15 @@ ivas_error ivas_osba_ism_metadata_dec( ivas_error ivas_osba_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[], /* i/o: core-coder transport channels/object output */ -#else - float output_f[][L_FRAME48k], /* i/o: core-coder transport channels/object output */ -#endif const int16_t output_frame /* i : output frame length per channel */ ); void ivas_masa_ism_data_close( MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ ); -#endif -#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------------------------* * OMASA prototypes *---------------------------------------------------------------------------------*/ @@ -5930,20 +5677,12 @@ void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f[], /* i/o: Input / transport audio signals */ -#else - float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ -#endif const int16_t input_frame, /* i : Input frame size */ const int16_t nchan_transport, /* i : Number of transport channels */ const int16_t nchan_ism, /* i : Number of objects for parameter analysis*/ const ISM_MODE ism_mode, /* i : ISM mode */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_separated_object, /* o : Separated object audio signal */ -#else - float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ -#endif int16_t* idx_separated_object /* o : Index of the separated object */ ); @@ -5973,11 +5712,7 @@ void ivas_set_ism_importance_interformat( int16_t ivas_omasa_ener_brate( const int16_t nchan_ism, /* i : number of ISMs */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], /* i : Input / transport audio signals */ -#else - float data_f[][L_FRAME48k], /* i : Input / transport audio signals */ -#endif const int16_t input_frame /* i : Input frame size */ ); @@ -6011,13 +5746,8 @@ void ivas_set_omasa_TC( void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], /* i : Transport audio signals 1 */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f2[], /* i : Transport audio signals 2 */ float *data_out_f[], /* o : Merged transport audio signals */ -#else - float data_in_f2[][L_FRAME48k], /* i : Transport audio signals 2 */ - float data_out_f[][L_FRAME48k], /* o : Merged transport audio signals */ -#endif const int16_t input_frame, /* i : Input frame size */ const int16_t num_transport_channels /* i : Number of transport audio signals */ ); @@ -6041,15 +5771,10 @@ ivas_error ivas_omasa_ism_metadata_dec( ivas_error ivas_omasa_dirac_td_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef MASA_AND_OBJECTS 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 */ @@ -6058,27 +5783,19 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( const int16_t nchan_transport, /* i : number of transport channels */ float *output_f[] /* o : rendered time signal */ ); -#endif void ivas_omasa_dirac_rend( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP void ivas_omasa_rearrange_channels( float *output[], /* o : output synthesis signal */ const int16_t nchan_transport_ism, /* i : number of ISM TCs */ const int16_t output_frame /* i : output frame length per channel */ ); -#endif -#ifdef MASA_AND_OBJECTS void ivas_omasa_dirac_rend_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ @@ -6087,7 +5804,6 @@ void ivas_omasa_dirac_rend_jbm( const int16_t nchan_transport, /* i : number of transport channels */ float *output_f[] /* o : rendered time signal */ ); -#endif void ivas_omasa_preProcessStereoTransportsForMovedObjects( Decoder_Struct *st_ivas, @@ -6108,15 +5824,10 @@ void ivas_omasa_separate_object_renderer_close( void ivas_omasa_separate_object_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float input_f[][L_FRAME48k], /* i : separated object signal */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[], /* i/o: output signals */ -#else - float output_f[][L_FRAME48k], /* i/o: output signals */ -#endif const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef MASA_AND_OBJECTS 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 */ @@ -6124,7 +5835,6 @@ void ivas_omasa_separate_object_render_jbm( const int16_t subframes_rendered, /* i : number of subframes rendered */ const int16_t slots_rendered /* i : number of CLDFB slots rendered */ ); -#endif void ivas_omasa_encode_masa_to_total( float masa_to_total_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], @@ -6147,7 +5857,6 @@ void ivas_omasa_modify_masa_energy_ratios( float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS] ); -#endif /*----------------------------------------------------------------------------------* * TD Binaural Object renderer @@ -6198,11 +5907,7 @@ void ivas_FB_mixer_close( void ivas_fb_mixer_pcm_ingest( IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *pcm_in[], /* i : input audio channels */ -#else - float pcm_in[][L_FRAME48k], /* i : input audio channels */ -#endif float **ppOut_pcm, /* o : output audio channels */ const int16_t frame_length, /* i : frame length */ const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 27f66ba373c0cf1b1ead62222acfc02e8eb5cd8d..de266ed6c5621c11471d4233b6fbdb395c2139f3 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2823,7 +2823,6 @@ const float McMASA_LFEGain_vectors[64] = -2.14f, 0.26f, 0.84f, 1.02f }; -#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------------------------* * OMASA ROM tables *----------------------------------------------------------------------------------*/ @@ -2891,7 +2890,6 @@ const float dct12[12*12]= 0.2887f, -0.3772f, 0.2887f, -0.1562f, -0.0000f, 0.1562f, -0.2887f, 0.3772f, -0.4082f, 0.3772f, -0.2887f, 0.1562f, 0.2887f, -0.4048f, 0.3943f, -0.3772f, 0.3536f, -0.3239f, 0.2887f, -0.2485f, 0.2041f, -0.1562f, 0.1057f, -0.0533f }; -#endif /*----------------------------------------------------------------------------------* * ISM ROM tables diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 159ee1129220aaa2835a6dee4159b1e959e2da4c..c559a4f382d73f30076b42a3c6ca56242598c5da 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -327,7 +327,6 @@ extern const float cb_azi_chan[]; extern const float McMASA_LFEGain_vectors[64]; -#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------------------------* * MASA and ISM (OMASA) combined format ROM tables *----------------------------------------------------------------------------------*/ @@ -337,7 +336,6 @@ extern const float dct4[]; extern const float dct5[]; extern const float dct8[]; extern const float dct12[]; -#endif /*----------------------------------------------------------------------------------* * ISM ROM tables diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index bfc5a833ecbb9510550359a5fd727091eda934b8..baf899e1f501b20489a039e992e068a64ed7fcd0 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -311,11 +311,7 @@ void ivas_sba_get_spar_hoa_md_flag( *-------------------------------------------------------------------*/ void ivas_sba_zero_vert_comp( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *sba_data[], /* i : SBA signals */ -#else - float sba_data[][L_FRAME48k], /* i : SBA signals */ -#endif + float *sba_data[], /* i : SBA signals */ const int16_t sba_order, /* i : SBA order */ const int16_t sba_planar, /* i : SBA planar flag */ const int16_t input_frame /* i : frame length */ diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index a9a7516c899a90007506167f210102245b8b82cf..4e9a7bff9ffcbcc288f19023cb9d63b5b042cb56 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -81,13 +81,11 @@ typedef struct int16_t ism_md_inc_diff_cnt; /* counter of continuous frames where MD are transmitted in inactive segments when MD significantly changes */ float last_true_radius; /* last true Q radius value */ -#ifdef MASA_AND_OBJECTS int16_t ism_imp; /* ISM importance flag */ int16_t ism_md_null_flag; int16_t ism_md_lowrate_flag; float q_azimuth_old; float q_elevation_old; -#endif } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; @@ -453,7 +451,6 @@ typedef struct ivas_masa_common_spatial_meta_struct } MASA_COMMON_SPATIAL_META; -#ifdef MASA_AND_OBJECTS typedef struct ivas_omasa_meta_struct { uint8_t num_dirs; @@ -461,7 +458,6 @@ typedef struct ivas_omasa_meta_struct MASA_COMMON_SPATIAL_META common_meta; } OMASA_SPATIAL_META, *OMASA_SPATIAL_META_HANDLE; -#endif typedef struct ivas_masa_metadata_frame_struct { diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index a2c817da15cbf1db45791ce326e2d2a7660db491..8282cb9dbdd173f65ea34d91eed100e0cfbc9b74 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -74,10 +74,8 @@ *-------------------------------------------------------------------*/ void tdm_bit_alloc( -#ifdef MASA_AND_OBJECTS - const int16_t ivas_format, /* i : IVAS format */ - const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif + const int16_t ivas_format, /* i : IVAS format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ int32_t *total_brate_pri, /* o : Allocated primary channel bitrate */ @@ -140,11 +138,7 @@ void tdm_bit_alloc( *total_brate_sec = tdm_bit_allc_tbl[idx][coder_type]; /* secondary channel bitrate allocation based on the energy scaling ratio */ -#ifdef MASA_AND_OBJECTS if ( ( ( ivas_format != MASA_ISM_FORMAT || ism_mode == ISM_MODE_NONE ) && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && coder_type > UNVOICED ) ) -#else - if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) -#endif { bit_rate_diff = (float) ( element_brate_wo_meta - 2 * *total_brate_sec ); @@ -314,9 +308,7 @@ void tdm_bit_alloc( { *total_brate_sec = min( *total_brate_sec, element_brate_wo_meta - ( 5900 + BWE_brate ) ); -#ifdef FIX_694_OMASA_EXTREME *total_brate_sec = max( *total_brate_sec, tdm_bit_allc_tbl[idx][coder_type] ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */ -#endif } /* Secondary channel bitrate adjusment */ diff --git a/lib_com/ivas_td_decorr.c b/lib_com/ivas_td_decorr.c index e0dd9f5cff59a2169a5604a766262fdbcd78ee3b..9e91517d4d38867c68a4ddc596705b13adcdb1c4 100644 --- a/lib_com/ivas_td_decorr.c +++ b/lib_com/ivas_td_decorr.c @@ -118,11 +118,7 @@ ivas_error ivas_td_decorr_reconfig_dec( ivas_error error; useTdDecorr_new = 0; -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - if ( ivas_format == SBA_FORMAT ) -#endif { if ( nchan_transport == 1 ) { @@ -150,11 +146,7 @@ ivas_error ivas_td_decorr_reconfig_dec( if ( *useTdDecorr ) { -#ifdef SBA_AND_OBJECTS if ( ivas_total_brate >= IVAS_13k2 && ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) ) -#else - if ( ivas_total_brate >= IVAS_13k2 && ivas_format == SBA_FORMAT ) -#endif { if ( *hTdDecorr == NULL ) { diff --git a/lib_com/options.h b/lib_com/options.h index 949bbb9333c19f47a90f1df5400c6f1038397f6d..0f5f3b7fed7a534121494e293b0f3646935de119 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,35 +150,13 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ - -#define SBA_AND_OBJECTS -#ifdef SBA_AND_OBJECTS -#define OSBA_BR_SWITCHING -#define FIX_691_OSBA_NULL_META /* FhG: Issue 691: Fix crashes for OSBA with NULL metadata */ -#endif - /*#define SPLIT_REND_WITH_HEAD_ROT*/ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_PRED_QUANT_63_PNTS #define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN /* Nokia: Issue 623: Split rendering support for parambin renderer */ #define FIX_658_SPLIT_REND_MASA /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/ -#ifdef SBA_AND_OBJECTS #define OSBA_SPLIT_RENDERING #endif -#endif - -#define FIX_264_AUDIO_CHANNELS_TO_HEAP /* VA: issue 243: Move audio channels memory from stack to heap */ -#define FIX_691_OSBA_CRASH /* FhG: Fix for issue 691: Crash for OSBA Stereo out */ -#define FIX_694_OMASA_EXTREME /* Nokia: fix for crash in OMASA on extreme sample */ -#define FIX_679_JBM_MC2SBA /* FhG: fix issue 679: check for transport vs. internal channel count in JBM prior to ivas_mc2sba() */ -#define FIX_591_PARAMISM_JBM_ENER_CORRECTION /* FhG: fix energy correction in ParamISM rendering */ -#define FIX_551_HEADTRACKER_INIT /* FhG: move setting of orientation tracking type to earlier */ - -#define FIX_LARGE_RENDERER_DELAY_COMP /* Fix renderer delay compensation with delays greater than 1 frame */ - -#define API_5MS /*FhG, Dlb: add 5ms framing cmd line arg*/ -#define FIX_706_REND_COMPLEXITY_LEVELS /* VoiceAge: Implement complexity levels to renderer */ /* ################## End BE DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_agc_dec.c b/lib_dec/ivas_agc_dec.c index 476ff0be1c08afaa55dc7880752242cbc021008a..56a679de596ff92bddf09b764a8cb404b51a320e 100644 --- a/lib_dec/ivas_agc_dec.c +++ b/lib_dec/ivas_agc_dec.c @@ -173,15 +173,10 @@ void ivas_spar_agc_dec_close( void ivas_agc_dec_process( ivas_agc_dec_state_t *hAgcDec, /* i/o: AGC decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *pcm_in[], /* i : input audio channels */ - float *pcm_out[], /* o : output audio channels */ -#else - float pcm_in[][L_FRAME48k], /* i : input audio channels */ - float pcm_out[][L_FRAME48k], /* o : output audio channels */ -#endif - const int16_t n_channels, /* i : number of channels */ - const int16_t output_frame /* i : output frame length */ + float *pcm_in[], /* i : input audio channels */ + float *pcm_out[], /* o : output audio channels */ + const int16_t n_channels, /* i : number of channels */ + const int16_t output_frame /* i : output frame length */ ) { int16_t i, idx; diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 938d75b1035e957ee8842698473ff6a3f4c12b1f..ee949f8665f4322fa45c9c4825e5a20aa747815e 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -55,16 +55,12 @@ *-------------------------------------------------------------------*/ ivas_error ivas_core_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - SCE_DEC_HANDLE hSCE, /* i/o: SCE decoder structure */ - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ - const int16_t n_channels, /* i : number of channels to be decoded */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[L_FRAME48k], /* o : output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* o : output synthesis signal */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + SCE_DEC_HANDLE hSCE, /* i/o: SCE decoder structure */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ + const int16_t n_channels, /* i : number of channels to be decoded */ + float *output[L_FRAME48k], /* o : output synthesis signal */ float hb_synth[CPE_CHANNELS][L_FRAME48k], /* o : output HB synthesis signal */ float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX], /* o : DFT buffers */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ @@ -278,7 +274,6 @@ ivas_error ivas_core_dec( } } -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ @@ -287,7 +282,6 @@ ivas_error ivas_core_dec( { ivas_combined_format_brate_sanity( hCPE->element_brate, sts[0]->core, &( sts[0]->core_brate ), &tmps ); } -#endif /*------------------------------------------------------------------* * Core Decoding diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index c85dfd334441718b7c43aa3cce28e48f223ff4fe..5318ec07a4c3749a6beebcbd0ee519149924974b 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -52,9 +52,7 @@ static void read_stereo_mode_and_bwidth( CPE_DEC_HANDLE hCPE, const Decoder_Struct *st_ivas ); -#ifdef MASA_AND_OBJECTS static void stereo_mode_combined_format_dec( const Decoder_Struct *st_ivas, CPE_DEC_HANDLE hCPE ); -#endif /*--------------------------------------------------------------------------* @@ -64,13 +62,9 @@ static void stereo_mode_combined_format_dec( const Decoder_Struct *st_ivas, CPE_ *--------------------------------------------------------------------------*/ ivas_error ivas_cpe_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t cpe_id, /* i : CPE # identifier */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[CPE_CHANNELS], /* o : output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* o : output synthesis signal */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int16_t cpe_id, /* i : CPE # identifier */ + float *output[CPE_CHANNELS], /* o : output synthesis signal */ const int16_t output_frame, /* i : output frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ) @@ -85,10 +79,8 @@ ivas_error ivas_cpe_dec( Decoder_State **sts; int32_t ivas_total_brate; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t cpe_brate; int32_t element_brate_ref; -#endif error = IVAS_ERR_OK; @@ -105,17 +97,13 @@ ivas_error ivas_cpe_dec( sts[0]->BER_detect |= st_ivas->BER_detect; sts[1]->BER_detect |= st_ivas->BER_detect; -#ifdef MASA_AND_OBJECTS element_brate_ref = hCPE->element_brate; -#endif /*------------------------------------------------------------------* * Read stereo technology info & audio bandwidth *-----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS stereo_mode_combined_format_dec( st_ivas, hCPE ); -#endif read_stereo_mode_and_bwidth( hCPE, st_ivas ); @@ -182,18 +170,14 @@ ivas_error ivas_cpe_dec( { if ( st_ivas->hQMetaData != NULL && ivas_total_brate > IVAS_SID_5k2 ) { -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.7f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } else { -#endif stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); -#ifdef MASA_AND_OBJECTS } -#endif } else { @@ -249,7 +233,6 @@ ivas_error ivas_cpe_dec( /* read DFT Stereo side info */ nb_bits = (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal ); -#ifdef MASA_AND_OBJECTS cpe_brate = st_ivas->hCPE[0]->element_brate; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -257,7 +240,6 @@ ivas_error ivas_cpe_dec( sts[1]->bit_stream += hCPE->brate_surplus / FRAMES_PER_SEC; } else -#endif { sts[1]->bit_stream = sts[0]->bit_stream + ivas_total_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; } @@ -268,11 +250,7 @@ ivas_error ivas_cpe_dec( sts[1]->bit_stream -= SID_FORMAT_NBITS; } -#ifdef MASA_AND_OBJECTS 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 ) -#else - if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ivas_total_brate > IVAS_SID_5k2 ) -#endif { sts[0]->total_brate = hCPE->element_brate; /* Only mono downmix was transmitted in this case */ } @@ -284,13 +262,11 @@ ivas_error ivas_cpe_dec( /* subtract metadata bitbudget */ sts[0]->total_brate -= ( nb_bits_metadata * FRAMES_PER_SEC ); -#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ if ( 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 || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { sts[0]->total_brate += hCPE->brate_surplus; } -#endif } else { @@ -302,9 +278,7 @@ ivas_error ivas_cpe_dec( /* signal bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); -#ifdef MASA_AND_OBJECTS sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); -#endif if ( st_ivas->hQMetaData != NULL ) { sts[1]->bits_frame_channel -= st_ivas->hQMetaData->metadata_max_bits; @@ -312,7 +286,6 @@ ivas_error ivas_cpe_dec( } else if ( hCPE->element_mode == IVAS_CPE_MDCT ) { -#ifdef MASA_AND_OBJECTS /* compute bit-rate surplus per channel in combined format coding */ int32_t brate_surplus[CPE_CHANNELS]; if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -320,7 +293,6 @@ ivas_error ivas_cpe_dec( brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; } -#endif if ( is_DTXrate( ivas_total_brate ) == 1 && ( sts[0]->first_CNG == 0 || sts[1]->first_CNG == 0 ) ) { @@ -347,14 +319,12 @@ ivas_error ivas_cpe_dec( sts[n]->bits_frame_nominal = (int16_t) ( sts[n]->total_brate / FRAMES_PER_SEC ); sts[n]->bits_frame_channel = (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) / n_channels ); -#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); sts[n]->total_brate += brate_surplus[n]; } -#endif } if ( !st_ivas->hMCT ) @@ -420,10 +390,8 @@ ivas_error ivas_cpe_dec( if ( !st_ivas->bfi ) { tdm_configure_dec( -#ifdef MASA_AND_OBJECTS st_ivas->ivas_format, st_ivas->ism_mode, -#endif hCPE, &tdm_ratio_idx, nb_bits_metadata ); sts[1]->bit_stream = sts[0]->bit_stream + ( sts[0]->total_brate / FRAMES_PER_SEC ); @@ -570,12 +538,10 @@ ivas_error ivas_cpe_dec( hCPE->last_element_brate = hCPE->element_brate; hCPE->last_element_mode = hCPE->element_mode; -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { hCPE->element_brate = element_brate_ref; } -#endif if ( hCPE->element_mode == IVAS_CPE_DFT || hCPE->element_mode == IVAS_CPE_TD ) { @@ -606,14 +572,12 @@ ivas_error ivas_cpe_dec( dbgwrite( output[j], sizeof( float ), output_frame, 1, fname( debug_dir, "output.cpe", j, cpe_id, DEC ) ); } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) { tmpF = 0; dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.sce", 0, cpe_id, DEC ) ); dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, cpe_id, DEC ) ); } -#endif } } #endif @@ -640,9 +604,7 @@ ivas_error create_cpe_dec( Decoder_State *st; int32_t output_Fs; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t cpe_brate; -#endif error = IVAS_ERR_OK; @@ -681,11 +643,7 @@ ivas_error create_cpe_dec( hCPE->lt_es_em = 0.0f; /* Note: nchan_out is considered to be related to the structure. This is nchan_out for CPE and for MASA_format is always 2. */ -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MC_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MC_FORMAT ) -#endif { hCPE->nchan_out = CPE_CHANNELS; } @@ -694,7 +652,6 @@ ivas_error create_cpe_dec( hCPE->nchan_out = min( CPE_CHANNELS, st_ivas->hDecoderConfig->nchan_out ); } -#ifdef MASA_AND_OBJECTS if ( 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 || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { cpe_brate = element_brate; @@ -707,9 +664,6 @@ ivas_error create_cpe_dec( if ( ( ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || ( st_ivas->ivas_format == MASA_ISM_FORMAT && cpe_brate < MASA_STEREO_MIN_BITRATE ) ) && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) -#else - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) -#endif { hCPE->nchan_out = 1; } @@ -720,9 +674,7 @@ ivas_error create_cpe_dec( set_f( hCPE->prev_synth[n], 0, NS2SA( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ) ); } -#ifdef MASA_AND_OBJECTS hCPE->brate_surplus = 0; -#endif /*-----------------------------------------------------------------* * DFT stereo I/O Buffers: allocate and initialize @@ -730,13 +682,8 @@ ivas_error create_cpe_dec( for ( i = 0; i < CPE_CHANNELS; i++ ) { -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || st_ivas->sba_dirac_stereo_flag ) -#else - if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || - ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || st_ivas->sba_dirac_stereo_flag ) -#endif { if ( ( hCPE->input_mem[i] = (float *) malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) { @@ -1149,7 +1096,6 @@ static void read_stereo_mode_and_bwidth( } -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------------- * stereo_mode_combined_format_dec() * @@ -1191,4 +1137,3 @@ static void stereo_mode_combined_format_dec( return; } -#endif diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index b7a0297bf6690ab6f635e95d6dfffd051abcf74e..ae8b1f158ea7428297123efd4550c8686380a9cf 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -61,42 +61,17 @@ ivas_error ivas_dec( ) { int16_t n, output_frame, nchan_out; - Decoder_State *st; /* used for bitstream handling */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP -#ifdef SBA_AND_OBJECTS + Decoder_State *st; /* used for bitstream handling */ float *output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* 'float' buffer for output synthesis */ -#else - float *output[MAX_OUTPUT_CHANNELS]; /* 'float' buffer for output synthesis */ -#endif -#else -#ifdef SBA_AND_OBJECTS - float output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ -#else - float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ -#endif -#endif int16_t nchan_remapped; -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - float output_lfe_ch[L_FRAME48k]; -#endif -#if defined MASA_AND_OBJECTS || defined SBA_AND_OBJECTS int16_t nb_bits_metadata[MAX_SCE + 1]; -#else - int16_t nb_bits_metadata[MAX_SCE]; -#endif int32_t output_Fs, ivas_total_brate; AUDIO_CONFIG output_config; float pan_left, pan_right; ivas_error error; -#ifdef SBA_AND_OBJECTS float *p_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; -#else - float *p_output[MAX_OUTPUT_CHANNELS]; -#endif int16_t num_md_sub_frames; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; @@ -129,18 +104,10 @@ ivas_error ivas_dec( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); -#ifdef SBA_AND_OBJECTS for ( n = 0; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) -#else - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) -#endif { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP output[n] = st_ivas->p_output_f[n]; p_output[n] = output[n]; -#else - p_output[n] = &output[n][0]; -#endif } @@ -186,7 +153,6 @@ ivas_error ivas_dec( if ( st_ivas->bfi && st_ivas->ini_frame == 0 ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP for ( n = 0; n < nchan_out; n++ ) { /* note: these are intra-frame heap memories */ @@ -197,7 +163,6 @@ ivas_error ivas_dec( output[n] = st_ivas->p_output_f[n]; p_output[n] = output[n]; } -#endif /* zero output when first frame(s) is lost */ for ( n = 0; n < nchan_out; n++ ) @@ -255,24 +220,16 @@ ivas_error ivas_dec( } 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->hDirAC->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0] -#endif - ) ) != IVAS_ERR_OK ) + 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->hDirAC->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 -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0] -#endif - ) ) != IVAS_ERR_OK ) + 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; } @@ -547,9 +504,7 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) { if ( ( error = ivas_sba_linear_renderer( p_output, output_frame, nchan_remapped, -#ifdef SBA_AND_OBJECTS 0, -#endif output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ) ) != IVAS_ERR_OK ) { return error; @@ -568,7 +523,6 @@ ivas_error ivas_dec( } } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { int16_t nchan_ism, nchan_transport_ism; @@ -666,24 +620,9 @@ ivas_error ivas_dec( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP ivas_omasa_rearrange_channels( output, nchan_transport_ism, output_frame ); -#else - /* in case of external rendering, rearrange the channels order */ - mvr2r( output[0], output[MAX_OUTPUT_CHANNELS - 2], output_frame ); - mvr2r( output[1], output[MAX_OUTPUT_CHANNELS - 1], output_frame ); - - for ( n = 0; n < nchan_transport_ism; n++ ) - { - mvr2r( output[st_ivas->nchan_transport + n], output[n], output_frame ); - } - mvr2r( output[MAX_OUTPUT_CHANNELS - 2], output[n], output_frame ); - mvr2r( output[MAX_OUTPUT_CHANNELS - 1], output[++n], output_frame ); -#endif } } -#endif -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { int16_t nchan_ism, sba_ch_idx; @@ -880,7 +819,6 @@ ivas_error ivas_dec( } } } -#endif 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]; @@ -888,11 +826,7 @@ ivas_error ivas_dec( /* LFE channel decoder */ if ( st_ivas->mc_mode == MC_MODE_MCT ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output[LFE_CHANNEL] ); -#else - ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); -#endif } if ( st_ivas->mc_mode == MC_MODE_MCT ) @@ -902,9 +836,6 @@ ivas_error ivas_dec( return error; } -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); -#endif /* HP filtering */ for ( n = 0; n < st_ivas->nchan_transport; n++ ) { @@ -985,11 +916,7 @@ ivas_error ivas_dec( } else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output[LFE_CHANNEL] ); -#else - ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); -#endif ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] ); @@ -998,9 +925,6 @@ ivas_error ivas_dec( return error; } -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); -#endif ivas_mc_paramupmix_dec( st_ivas, output ); /* HP filtering */ @@ -1276,11 +1200,8 @@ ivas_error ivas_dec( st_ivas->ini_active_frame++; } -#ifdef MASA_AND_OBJECTS st_ivas->last_ivas_format = st_ivas->ivas_format; -#endif -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /* in case first frame(s) was/were lost, deallocate output buffers */ if ( st_ivas->bfi && st_ivas->ini_frame == 0 ) { @@ -1290,7 +1211,6 @@ ivas_error ivas_dec( st_ivas->p_output_f[n] = NULL; } } -#endif #ifdef DEBUG_MODE_INFO dbgwrite( &st_ivas->bfi, sizeof( int16_t ), 1, output_frame, "res/bfi" ); diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index abd09846a74fba26043418c814b8a53ee2dcea56..dbabd37154cfa5cfdfa1d23b4852b0d4e71872a1 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -102,11 +102,7 @@ static ivas_error ivas_dirac_dec_config_internal( if ( flag_config == DIRAC_OPEN ) { -#ifdef SBA_AND_OBJECTS hDirAC->spar_to_dirac_write_idx = ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) ? DELAY_DIRAC_PARAM_DEC_SFR : 0; -#else - hDirAC->spar_to_dirac_write_idx = st_ivas->ivas_format == SBA_FORMAT ? DELAY_DIRAC_PARAM_DEC_SFR : 0; -#endif hDirAC->dithering_seed = DIRAC_DITH_SEED; st_ivas->hDirAC = hDirAC; } @@ -174,11 +170,7 @@ static ivas_error ivas_dirac_rend_config( num_protos_diff_old = 0; nchan_transport_orig = st_ivas->nchan_transport; -#ifndef SBA_AND_OBJECTS - if ( st_ivas->ivas_format == SBA_FORMAT ) -#else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { st_ivas->nchan_transport = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); } @@ -188,11 +180,7 @@ static ivas_error ivas_dirac_rend_config( { nchan_transport = 1; } -#ifdef SBA_AND_OBJECTS if ( flag_config == DIRAC_RECONFIGURE && ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) ) -#else - if ( flag_config == DIRAC_RECONFIGURE && st_ivas->ivas_format == SBA_FORMAT ) -#endif { int16_t tmp1, tmp2, tmp3; ivas_sba_config( ivas_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport_old, st_ivas->sba_planar, &tmp1, &tmp2, &tmp3 ); @@ -251,20 +239,12 @@ static ivas_error ivas_dirac_rend_config( hDirACRend->panningConf = DIRAC_PANNING_HOA3; nchan_out_woLFE = 1; } -#ifdef MASA_AND_OBJECTS else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) && hDirACRend->hOutSetup.is_loudspeaker_setup ) -#else - else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) && hDirACRend->hOutSetup.is_loudspeaker_setup ) -#endif { hDirACRend->synthesisConf = DIRAC_SYNTHESIS_PSD_LS; hDirACRend->panningConf = DIRAC_PANNING_VBAP; } -#ifdef MASA_AND_OBJECTS else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && !hDirACRend->hOutSetup.is_loudspeaker_setup && st_ivas->nchan_transport > 1 ) -#else - else if ( st_ivas->ivas_format == MASA_FORMAT && !hDirACRend->hOutSetup.is_loudspeaker_setup && st_ivas->nchan_transport > 1 ) -#endif { hDirACRend->synthesisConf = DIRAC_SYNTHESIS_PSD_SHD; hDirACRend->panningConf = DIRAC_PANNING_HOA3; @@ -306,9 +286,7 @@ static ivas_error ivas_dirac_rend_config( hDirACRend->masa_stereo_type_detect = NULL; } -#ifdef MASA_AND_OBJECTS hSpatParamRendCom->numIsmDirections = 0; /* By default, no ism directions, set correct number runtime when needed */ -#endif /*-----------------------------------------------------------------* * (re)configure sub-modules @@ -392,11 +370,7 @@ static ivas_error ivas_dirac_rend_config( hDirACRend->sba_map_tc = sba_map_tc; -#ifdef SBA_AND_OBJECTS if ( ( st_ivas->ivas_format == SBA_FORMAT ) || ( st_ivas->ivas_format == SBA_ISM_FORMAT ) ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { if ( st_ivas->sba_order > SBA_FOA_ORDER && ivas_total_brate >= IVAS_512k ) { @@ -566,17 +540,10 @@ static ivas_error ivas_dirac_rend_config( vbap_free_data( &( st_ivas->hVBAPdata ) ); } -#ifdef MASA_AND_OBJECTS if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE, st_ivas->ivas_format ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } else if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_MONO ) { @@ -872,10 +839,8 @@ ivas_error ivas_dirac_dec_config( case RENDERER_BINAURAL_FASTCONV_ROOM: case RENDERER_SBA_LINEAR_ENC: case RENDERER_SBA_LINEAR_DEC: -#ifdef SBA_AND_OBJECTS case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: -#endif need_dirac_rend = 1; break; default: @@ -1084,28 +1049,21 @@ void ivas_dirac_dec_read_BS( SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial rendering data handle */ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata */ int16_t *nb_bits, /* o : number of bits read */ -#ifdef SBA_AND_OBJECTS - const int16_t last_bit_pos, /* i : last read bitstream position*/ -#endif - const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ - int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ + const int16_t last_bit_pos, /* i : last read bitstream position*/ + const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ + int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ) { int16_t i, j, b, dir, orig_dirac_bands; int16_t next_bit_pos_orig; -#ifndef SBA_AND_OBJECTS - *nb_bits = 0; -#endif if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { next_bit_pos_orig = st->next_bit_pos; st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); -#ifdef SBA_AND_OBJECTS if ( last_bit_pos > 0 ) { st->next_bit_pos = last_bit_pos; } -#endif /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits )++; @@ -1257,12 +1215,8 @@ void ivas_qmetadata_to_dirac( int16_t no_secs = 1; q_direction = &( hQMetaData->q_direction[0] ); -#ifdef MASA_AND_OBJECTS hSpatParamRendCom->numParametricDirections = hQMetaData->no_directions; hSpatParamRendCom->numSimultaneousDirections = hSpatParamRendCom->numParametricDirections + hSpatParamRendCom->numIsmDirections; -#else - hSpatParamRendCom->numSimultaneousDirections = hQMetaData->no_directions; -#endif if ( hMasa != NULL && ivas_total_brate > IVAS_SID_5k2 ) { @@ -1643,12 +1597,8 @@ void ivas_dirac_dec_set_md_map( *------------------------------------------------------------------------*/ void ivas_dirac_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif + 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 */ ) { @@ -1665,11 +1615,7 @@ void ivas_dirac_dec( for ( n = 0; n < nchan_out; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP output_f_local[n] = output_f[n]; -#else - output_f_local[n] = &output_f[n][0]; -#endif } for ( n = 0; n < nchan_transport; n++ ) @@ -1828,10 +1774,8 @@ void ivas_dirac_dec_render_sf( 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 -#ifdef MASA_AND_OBJECTS float Cldfb_RealBuffer_Temp[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Temp[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#endif int16_t index, num_freq_bands; /* local copies of azi, ele, diffuseness */ @@ -1860,11 +1804,7 @@ void ivas_dirac_dec_render_sf( onset_filter_subframe = ( DirAC_mem.onset_filter == NULL ) ? NULL : DirAC_mem.onset_filter + hSpatParamRendCom->num_freq_bands; hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ); -#ifdef SBA_AND_OBJECTS if ( st_ivas->hQMetaData != NULL && st_ivas->ivas_format != SBA_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#else - if ( st_ivas->hQMetaData != NULL && st_ivas->ivas_format != SBA_FORMAT ) -#endif { coherence_flag = st_ivas->hQMetaData->coherence_flag; } @@ -1998,9 +1938,7 @@ void ivas_dirac_dec_render_sf( hDirACRend, st_ivas->hVBAPdata, st_ivas->hMasa, -#ifdef MASA_AND_OBJECTS st_ivas->hMasaIsmData, -#endif azimuth, elevation, md_idx, @@ -2015,9 +1953,7 @@ void ivas_dirac_dec_render_sf( hDirACRend, st_ivas->hVBAPdata, st_ivas->hMasa, -#ifdef MASA_AND_OBJECTS st_ivas->hMasaIsmData, -#endif azimuth, elevation, md_idx, @@ -2028,7 +1964,6 @@ void ivas_dirac_dec_render_sf( } } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) { for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) @@ -2051,7 +1986,6 @@ void ivas_dirac_dec_render_sf( ivas_omasa_preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, hSpatParamRendCom->num_freq_bands, subframe_idx ); } } -#endif for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) { @@ -2064,11 +1998,7 @@ void ivas_dirac_dec_render_sf( { md_idx = hSpatParamRendCom->render_to_md_map[subframe_idx]; } -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { for ( ch = 0; ch < nchan_transport; ch++ ) { @@ -2076,7 +2006,6 @@ void ivas_dirac_dec_render_sf( mvr2r( pppQMfFrame_ts_im[ch][slot_idx], Cldfb_ImagBuffer[ch][0], hSpatParamRendCom->num_freq_bands ); } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) { for ( ch = 0; ch < nchan_transport; ch++ ) @@ -2085,7 +2014,6 @@ void ivas_dirac_dec_render_sf( mvr2r( Cldfb_ImagBuffer_Temp[ch][slot_idx], Cldfb_ImagBuffer[ch][0], hSpatParamRendCom->num_freq_bands ); } } -#endif else { /* CLDFB Analysis*/ @@ -2100,11 +2028,7 @@ void ivas_dirac_dec_render_sf( } /* CNG in DirAC, extra CLDFB ana for CNA*/ -#ifdef SBA_AND_OBJECTS 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->ivas_format == SBA_ISM_FORMAT ) ) -#else - 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 ) -#endif { Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; @@ -2526,11 +2450,7 @@ void ivas_dirac_dec_render_sf( cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] ); } } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - else if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { for ( ch = 0; ch < hDirACRend->hOutSetup.nchan_out_woLFE; ch++ ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e900c153137edb0d9697c891109a0a248188db72..1f401bb42084a678bf330a5141f702a12e35c0ba 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -386,26 +386,19 @@ ivas_error ivas_dec_setup( /* reconfigure in case a change of operation mode is detected */ if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { -#ifdef MASA_AND_OBJECTS if ( st_ivas->last_ivas_format == MASA_FORMAT ) { -#endif if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->nCPE == 1 ) { st_ivas->hCPE[0]->nchan_out = 1; } else { -#ifdef MASA_AND_OBJECTS if ( ( error = ivas_masa_dec_reconfigure( st_ivas, nSamplesRendered, data ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } } -#ifdef MASA_AND_OBJECTS } else { @@ -414,11 +407,9 @@ ivas_error ivas_dec_setup( return error; } } -#endif } } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ @@ -439,8 +430,6 @@ ivas_error ivas_dec_setup( } } } -#endif -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { /* the number of objects is written at the end of the bitstream, in the SBA metadata */ @@ -476,21 +465,12 @@ ivas_error ivas_dec_setup( else { 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 ); -#ifdef OSBA_BR_SWITCHING /*correct number of CPEs for discrete ISM coding*/ if ( st_ivas->ini_frame > 0 && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; } -#endif - } -#ifndef OSBA_BR_SWITCHING - /*correct number of CPEs for discrete ISM coding*/ - if ( st_ivas->ini_frame > 0 && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; } -#endif if ( ivas_total_brate >= IVAS_256k ) { @@ -501,7 +481,6 @@ ivas_error ivas_dec_setup( st_ivas->ism_mode = ISM_MODE_NONE; } } -#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { /* read MC configuration */ @@ -743,25 +722,15 @@ static ivas_error ivas_read_format( { if ( st_ivas->bit_stream[*num_bits_read] ) { -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS ( *num_bits_read )++; -#ifdef SBA_AND_OBJECTS if ( st_ivas->bit_stream[*num_bits_read] ) { st_ivas->ivas_format = SBA_ISM_FORMAT; } else -#endif { -#ifdef MASA_AND_OBJECTS st_ivas->ivas_format = MASA_ISM_FORMAT; -#endif } -#else - /* placeholder for combined format signaling */ - - ( *num_bits_read )++; -#endif } ( *num_bits_read )++; @@ -775,7 +744,6 @@ static ivas_error ivas_read_format( else { st_ivas->ivas_format = SBA_FORMAT; -#ifdef SBA_AND_OBJECTS /* read Ambisonic (SBA) planar flag */ st_ivas->sba_planar = st_ivas->bit_stream[( *num_bits_read ) + 1]; @@ -786,7 +754,6 @@ static ivas_error ivas_read_format( { st_ivas->ivas_format = SBA_ISM_FORMAT; } -#endif } ( *num_bits_read )++; @@ -887,15 +854,10 @@ int16_t getNumChanSynthesis( { n = CPE_CHANNELS; } -#ifdef SBA_AND_OBJECTS else if ( ( st_ivas->hMCT != NULL || st_ivas->ivas_format == SBA_FORMAT ) && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#else - else if ( st_ivas->hMCT != NULL || st_ivas->ivas_format == SBA_FORMAT ) -#endif { n = st_ivas->nchan_transport; } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -907,7 +869,6 @@ int16_t getNumChanSynthesis( n = st_ivas->nchan_transport; } } -#endif return n; } @@ -996,12 +957,10 @@ ivas_error ivas_init_decoder_front( { return error; } -#ifdef FIX_551_HEADTRACKER_INIT if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, st_ivas->hDecoderConfig->orientation_tracking ) ) != IVAS_ERR_OK ) { return error; } -#endif } /*-------------------------------------------------------------------* @@ -1089,11 +1048,7 @@ ivas_error ivas_init_decoder( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { -#ifdef MASA_AND_OBJECTS int16_t i, n, k; -#else - int16_t i, n; -#endif int16_t sce_id, cpe_id; int16_t numCldfbAnalyses, numCldfbSyntheses; int16_t granularity, n_channels_transport_jbm; @@ -1102,9 +1057,7 @@ ivas_error ivas_init_decoder( AUDIO_CONFIG output_config; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; @@ -1118,22 +1071,16 @@ ivas_error ivas_init_decoder( if ( output_config == AUDIO_CONFIG_EXTERNAL ) { -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { hDecoderConfig->nchan_out = audioCfg2channels( AUDIO_CONFIG_HOA3 ); hDecoderConfig->nchan_out += st_ivas->nchan_ism; } - else -#endif -#ifdef MASA_AND_OBJECTS - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { hDecoderConfig->nchan_out = st_ivas->nchan_transport + st_ivas->nchan_ism; } - else -#endif - if ( !( st_ivas->ism_mode == ISM_MODE_PARAM ) ) + else if ( !( st_ivas->ism_mode == ISM_MODE_PARAM ) ) { hDecoderConfig->nchan_out = st_ivas->nchan_transport; } @@ -1149,7 +1096,6 @@ ivas_error ivas_init_decoder( ivas_output_init( &( st_ivas->hOutSetup ), output_config ); -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) { st_ivas->hOutSetup.ambisonics_order = SBA_HOA3_ORDER; @@ -1157,7 +1103,6 @@ ivas_error ivas_init_decoder( st_ivas->hOutSetup.output_config = AUDIO_CONFIG_HOA3; st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( AUDIO_CONFIG_HOA3 ); } -#endif /* Only initialize transport setup if it is used */ if ( st_ivas->transport_config != AUDIO_CONFIG_INVALID ) @@ -1207,19 +1152,6 @@ ivas_error ivas_init_decoder( } } -#ifndef FIX_551_HEADTRACKER_INIT - /*-----------------------------------------------------------------* - * Set head/orientation tracking - *-----------------------------------------------------------------*/ - - if ( st_ivas->hDecoderConfig->Opt_Headrotation ) - { - if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, st_ivas->hDecoderConfig->orientation_tracking ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------* @@ -1431,11 +1363,9 @@ ivas_error ivas_init_decoder( } else if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef MASA_AND_OBJECTS /* if we start in ISM_MODE_NONE in MASA_ISM, that appears as normal MASA, but we may change to a mode with ISMs */ st_ivas->ism_extmeta_active = -1; st_ivas->ism_extmeta_cnt = 0; -#endif if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) { return error; @@ -1480,7 +1410,6 @@ ivas_error ivas_init_decoder( /* set CNA/CNG flags */ ivas_sba_set_cna_cng_flag( st_ivas ); } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { int32_t temp_brate[MAX_SCE]; @@ -1566,7 +1495,6 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_691_OSBA_CRASH /* create CPE element for DFT Stereo like upmix */ if ( st_ivas->sba_dirac_stereo_flag && st_ivas->nCPE == 0 ) { @@ -1578,14 +1506,11 @@ ivas_error ivas_init_decoder( st_ivas->hCPE[0]->hCoreCoder[0] = st_ivas->hSCE[0]->hCoreCoder[0]; /* don't allocate unnecessary core coder, simply point to core coder of SCE element */ st_ivas->hCPE[0]->hCoreCoder[1] = NULL; } -#endif -#ifdef OSBA_BR_SWITCHING if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { st_ivas->nchan_transport += st_ivas->nchan_ism; } -#endif if ( st_ivas->nCPE > 1 ) { if ( ( error = create_mct_dec( st_ivas ) ) != IVAS_ERR_OK ) @@ -1594,12 +1519,10 @@ ivas_error ivas_init_decoder( } } -#ifdef OSBA_BR_SWITCHING if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { st_ivas->nchan_transport -= st_ivas->nchan_ism; } -#endif if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { @@ -1618,8 +1541,6 @@ ivas_error ivas_init_decoder( /* set CNA/CNG flags */ ivas_sba_set_cna_cng_flag( st_ivas ); } -#endif -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { st_ivas->ism_extmeta_active = -1; @@ -1707,7 +1628,6 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hCPE[0]->hCoreCoder[n] ); } } -#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { if ( st_ivas->mc_mode == MC_MODE_MCT ) @@ -1858,11 +1778,7 @@ ivas_error ivas_init_decoder( } else { -#ifdef MASA_AND_OBJECTS vbap_determine_gains( st_ivas->hVBAPdata, st_ivas->hLsSetupCustom->separate_ch_gains, 0, 0, 0 ); -#else - vbap_determine_gains( st_ivas->hVBAPdata, st_ivas->hLsSetupCustom->separate_ch_gains, 0, 0 ); -#endif } } @@ -2072,7 +1988,6 @@ ivas_error ivas_init_decoder( } } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -2099,23 +2014,15 @@ ivas_error ivas_init_decoder( } } } -#endif -#if defined SBA_AND_OBJECTS || defined SBA_AND_OBJECTS || defined SBA_AND_OBJECTS if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->ism_mode == ISM_MODE_DISC || st_ivas->ism_mode == ISM_SBA_MODE_DISC ) && -#else - if ( st_ivas->ivas_format == ISM_FORMAT && - st_ivas->ism_mode == ISM_MODE_DISC && -#endif ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || -#ifdef SBA_AND_OBJECTS st_ivas->renderer_type == RENDERER_OSBA_STEREO || st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || -#endif st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) @@ -2126,7 +2033,6 @@ ivas_error ivas_init_decoder( } } -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -2146,7 +2052,6 @@ ivas_error ivas_init_decoder( } } } -#endif /*-----------------------------------------------------------------* * LFE handles for rendering after rendering to adjust LFE delay to binaural filter delay @@ -2213,11 +2118,7 @@ ivas_error ivas_init_decoder( } /* CLDFB Interpolation weights */ -#ifdef SBA_AND_OBJECTS if ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !st_ivas->sba_dirac_stereo_flag && st_ivas->hDecoderConfig->nchan_out != 1 ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT && !st_ivas->sba_dirac_stereo_flag && st_ivas->hDecoderConfig->nchan_out != 1 ) -#endif { ivas_spar_get_cldfb_gains( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig ); } @@ -2266,7 +2167,6 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*-----------------------------------------------------------------* * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ @@ -2291,7 +2191,6 @@ ivas_error ivas_init_decoder( { st_ivas->p_output_f[n] = NULL; } -#endif return error; } @@ -2517,9 +2416,7 @@ void ivas_initialize_handles_dec( st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; st_ivas->hoa_dec_mtx = NULL; -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS st_ivas->hMasaIsmData = NULL; -#endif st_ivas->hHeadTrackData = NULL; st_ivas->hHrtfTD = NULL; @@ -2540,13 +2437,11 @@ void ivas_initialize_handles_dec( st_ivas->hTcBuffer = NULL; st_ivas->hJbmMetadata = NULL; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /* floating-point output audio buffers */ for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { st_ivas->p_output_f[i] = NULL; } -#endif return; } @@ -2620,11 +2515,7 @@ void ivas_destroy_dec( } /* ISM metadata handles */ -#ifdef MASA_AND_OBJECTS ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); -#else - ivas_ism_metadata_close( st_ivas->hIsmMetaData ); -#endif /* ISM renderer handle */ if ( st_ivas->hIsmRendererData != NULL ) @@ -2734,15 +2625,11 @@ void ivas_destroy_dec( free( st_ivas->hMonoDmxRenderer ); st_ivas->hMonoDmxRenderer = NULL; } -#ifdef SBA_AND_OBJECTS /* MASA ISM structure */ ivas_masa_ism_data_close( &st_ivas->hMasaIsmData ); -#endif -#ifdef MASA_AND_OBJECTS /* OMASA structure */ ivas_omasa_data_close( &st_ivas->hMasaIsmData ); -#endif /* Head track data handle */ ivas_headTrack_close( &st_ivas->hHeadTrackData ); @@ -2796,7 +2683,6 @@ void ivas_destroy_dec( st_ivas->hJbmMetadata = NULL; } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /* floating-point output audio buffers */ for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ ) { @@ -2806,7 +2692,6 @@ void ivas_destroy_dec( st_ivas->p_output_f[i] = NULL; } } -#endif /* main IVAS handle */ free( st_ivas ); @@ -2828,22 +2713,17 @@ void ivas_init_dec_get_num_cldfb_instances( int16_t *numCldfbSyntheses /* o : number of needed CLDFB synthesis instances */ ) { -#ifdef SBA_AND_OBJECTS IVAS_FORMAT ivas_format; -#endif *numCldfbAnalyses = st_ivas->nchan_transport; *numCldfbSyntheses = st_ivas->hDecoderConfig->nchan_out; -#ifdef SBA_AND_OBJECTS ivas_format = ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ? SBA_FORMAT : st_ivas->ivas_format; /* treat ISM_SBA_MODE_NONE just like SBA_FORMAT */ -#endif switch ( st_ivas->renderer_type ) { case RENDERER_BINAURAL_PARAMETRIC: case RENDERER_BINAURAL_PARAMETRIC_ROOM: case RENDERER_STEREO_PARAMETRIC: -#ifdef MASA_AND_OBJECTS if ( st_ivas->nchan_transport == 1 ) { *numCldfbAnalyses = st_ivas->nchan_transport + 1; @@ -2854,7 +2734,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses = st_ivas->nchan_transport + 1; } -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -2862,13 +2741,8 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses += st_ivas->nchan_ism; } } -#endif -#ifdef SBA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -2890,56 +2764,15 @@ void ivas_init_dec_get_num_cldfb_instances( break; case RENDERER_NON_DIEGETIC_DOWNMIX: case RENDERER_MONO_DOWNMIX: -#ifdef SBA_AND_OBJECTS if ( ivas_format == ISM_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif - { - /* CLDFB not used in rendering */ - *numCldfbAnalyses = 0; - *numCldfbSyntheses = 0; - } - break; -#else - if ( st_ivas->nchan_transport == 1 ) - { - *numCldfbAnalyses = st_ivas->nchan_transport + 1; - } - - if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hOutSetup.separateChannelEnabled ) - { - *numCldfbAnalyses = st_ivas->nchan_transport + 1; - } -#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN - if ( st_ivas->hDiracDecBin[0]->useTdDecorr ) -#else - if ( st_ivas->hDiracDecBin->useTdDecorr ) -#endif - { - *numCldfbAnalyses += 2; - } - break; - case RENDERER_NON_DIEGETIC_DOWNMIX: - case RENDERER_MONO_DOWNMIX: -#ifdef SBA_AND_OBJECTS - if ( ivas_format == ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == ISM_FORMAT ) -#endif { /* CLDFB not used in rendering */ *numCldfbAnalyses = 0; *numCldfbSyntheses = 0; } break; -#endif case RENDERER_DIRAC: -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { *numCldfbAnalyses = st_ivas->hSpar->hFbMixer->fb_cfg->num_in_chans; @@ -2956,11 +2789,7 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbSyntheses = MAX_OUTPUT_CHANNELS; } } -#ifdef SBA_AND_OBJECTS if ( ivas_format != SBA_FORMAT ) -#else - if ( st_ivas->ivas_format != SBA_FORMAT ) -#endif { if ( st_ivas->nchan_transport > 2 && st_ivas->sba_planar ) { @@ -3001,14 +2830,10 @@ void ivas_init_dec_get_num_cldfb_instances( case RENDERER_BINAURAL_MIXER_CONV_ROOM: case RENDERER_BINAURAL_FASTCONV: case RENDERER_BINAURAL_FASTCONV_ROOM: -#ifdef SBA_AND_OBJECTS case RENDERER_OSBA_STEREO: case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { if ( st_ivas->sba_dirac_stereo_flag ) { @@ -3188,7 +3013,6 @@ static ivas_error doSanityChecks_IVAS( } } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == AUDIO_CONFIG_EXTERNAL ) @@ -3196,7 +3020,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); } } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != AUDIO_CONFIG_BINAURAL && output_config != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 740c6581671458e87dd96406a3465bddb78bbd58..073b01824d853a1ea13b80683f75446161af9c4f 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -62,9 +62,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( int16_t tc_nchan_tc_new; int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t ch, nchan_out_buff, nchan_out_buff_old; -#endif AUDIO_CONFIG intern_config_old; IVAS_OUTPUT_SETUP hIntSetupOld; RENDERER_TYPE renderer_type_old; @@ -78,16 +76,10 @@ static ivas_error ivas_ism_bitrate_switching_dec( st_ivas->ism_mode = last_ism_mode; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas ); -#endif - if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL -#ifdef MASA_AND_OBJECTS - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -334,7 +326,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ @@ -363,7 +354,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( } } } -#endif /*-----------------------------------------------------------------* * Reconfigure TC buffer diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c old mode 100755 new mode 100644 index 587eddd195e43c9c2c727534d02378e0920a3bda..13c8ceeb80386fdcc6fa492529bd2fb500b3f679 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -149,19 +149,13 @@ ivas_error ivas_ism_metadata_dec( ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ int16_t *ism_extmeta_active, /* i/o: Extended metadata active in renderer */ - int16_t *ism_extmeta_cnt /* i/o: Number of change frames observed */ -#ifdef SBA_AND_OBJECTS - , - DEC_CORE_HANDLE st0 /* i : core-coder handle */ -#endif + int16_t *ism_extmeta_cnt, /* i/o: Number of change frames observed */ + DEC_CORE_HANDLE st0 /* i : core-coder handle */ ) { int16_t ch, nb_bits_start = 0, last_bit_pos; int16_t idx_radius; int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; -#ifndef SBA_AND_OBJECTS - DEC_CORE_HANDLE st0; -#endif int16_t ism_extmeta_bitstream; int16_t non_diegetic_flag_global; float yaw, pitch, radius; @@ -184,9 +178,6 @@ ivas_error ivas_ism_metadata_dec( push_wmops( "ism_meta_dec" ); /* initialization */ -#ifndef SBA_AND_OBJECTS - st0 = hSCE[0]->hCoreCoder[0]; -#endif ism_metadata_flag_global = 0; nchan_transport_prev = *nchan_transport; @@ -212,17 +203,12 @@ ivas_error ivas_ism_metadata_dec( /*----------------------------------------------------------------* * Read ISM common signaling *----------------------------------------------------------------*/ -#ifdef SBA_AND_OBJECTS if ( ism_mode == ISM_SBA_MODE_DISC ) { /* number of objects was read in ivas_dec_setup() */ st0->next_bit_pos += NO_BITS_MASA_ISM_NO_OBJ; } - else -#endif -#ifdef MASA_AND_OBJECTS - if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#endif + else if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { /* number of objects was read in ivas_dec_setup() */ st0->next_bit_pos += nchan_ism; @@ -245,15 +231,7 @@ ivas_error ivas_ism_metadata_dec( } /* read extended metadata presence flag */ -#ifdef MASA_AND_OBJECTS -#ifdef SBA_AND_OBJECTS if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) && ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) -#else - if ( ism_mode == ISM_MODE_DISC && ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) -#endif -#else - if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) -#endif { ism_extmeta_bitstream = get_next_indice( st0, ISM_EXTENDED_METADATA_BITS ); @@ -283,21 +261,16 @@ ivas_error ivas_ism_metadata_dec( /* Read ISM metadata flags (one per object) */ for ( ch = 0; ch < *nchan_transport; ch++ ) { -#ifdef SBA_AND_OBJECTS if ( ism_mode == ISM_SBA_MODE_DISC ) { ism_imp[ch] = get_next_indice( st0, 1 ); } - else -#endif -#ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + else if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { /* ISM importance flag is already read in ivas_masa_decode() */ ism_imp[ch] = hIsmMeta[ch]->ism_imp; } else -#endif { ism_imp[ch] = get_next_indice( st0, ISM_METADATA_FLAG_BITS ); } @@ -321,24 +294,18 @@ ivas_error ivas_ism_metadata_dec( } /* read ISM_NO_META class signalling */ -#ifdef FIX_691_OSBA_NULL_META if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) -#else - if ( ism_mode == ISM_MODE_DISC ) -#endif { for ( ch = 0; ch < *nchan_transport; ch++ ) { if ( ism_imp[ch] == ISM_NO_META ) { -#ifdef MASA_AND_OBJECTS /* low-rate ISM_NO_META frame */ if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { null_metadata_flag[ch] = hIsmMeta[ch]->ism_md_null_flag; } else -#endif { null_metadata_flag[ch] = get_next_indice( st0, ISM_METADATA_INACTIVE_FLAG_BITS ); } @@ -349,7 +316,6 @@ ivas_error ivas_ism_metadata_dec( { if ( ism_imp[ch] == ISM_NO_META ) { -#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { lowrate_metadata_flag[ch] = hIsmMeta[ch]->ism_md_lowrate_flag; @@ -359,11 +325,7 @@ ivas_error ivas_ism_metadata_dec( ism_metadata_flag_global |= lowrate_metadata_flag[ch]; } } - else -#endif -#ifdef FIX_691_OSBA_NULL_META - if ( ism_mode != ISM_SBA_MODE_DISC ) -#endif + else if ( ism_mode != ISM_SBA_MODE_DISC ) { if ( null_metadata_flag[ch] ) { @@ -399,14 +361,7 @@ ivas_error ivas_ism_metadata_dec( for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMetaData = hIsmMeta[ch]; - if ( ism_mode == ISM_MODE_DISC -#ifdef SBA_AND_OBJECTS - || ism_mode == ISM_SBA_MODE_DISC -#endif -#ifdef MASA_AND_OBJECTS - || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ -#endif - ) + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { nb_bits_start = st0->next_bit_pos; } @@ -492,14 +447,7 @@ ivas_error ivas_ism_metadata_dec( } } /* save number of metadata bits read */ - if ( ism_mode == ISM_MODE_DISC -#ifdef SBA_AND_OBJECTS - || ism_mode == ISM_SBA_MODE_DISC -#endif -#ifdef MASA_AND_OBJECTS - || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ -#endif - ) + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { nb_bits_metadata[ch] = st0->next_bit_pos - nb_bits_start; } @@ -583,7 +531,6 @@ ivas_error ivas_ism_metadata_dec( hISMDTX.ism_dtx_hangover_cnt += 1; } -#ifdef SBA_AND_OBJECTS if ( ism_mode == ISM_SBA_MODE_DISC ) { /* set the bitstream pointer to its original position */ @@ -598,14 +545,11 @@ ivas_error ivas_ism_metadata_dec( pop_wmops(); return IVAS_ERR_OK; } -#endif -#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { ism_metadata_flag_global = 1; } -#endif /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel @@ -613,7 +557,6 @@ ivas_error ivas_ism_metadata_dec( if ( !bfi ) { -#ifdef MASA_AND_OBJECTS int16_t masa_ism_flag = 0; if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { @@ -624,14 +567,9 @@ ivas_error ivas_ism_metadata_dec( element_brate[ch] = hSCE[ch]->element_brate; } } -#endif - if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, ism_extmeta_bitstream, null_metadata_flag, ism_imp, element_brate, total_brate, nb_bits_metadata -#ifdef MASA_AND_OBJECTS - , - masa_ism_flag -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, ism_extmeta_bitstream, null_metadata_flag, ism_imp, element_brate, total_brate, nb_bits_metadata, + masa_ism_flag ) ) != IVAS_ERR_OK ) { return error; } @@ -641,11 +579,7 @@ ivas_error ivas_ism_metadata_dec( hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; -#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC ) -#endif { if ( ism_imp[ch] == ISM_NO_META && ( ( total_brate[ch] < ACELP_8k00 && element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) || ( total_brate[ch] <= ACELP_16k_LOW_LIMIT && element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) ) ) @@ -654,9 +588,7 @@ ivas_error ivas_ism_metadata_dec( } } -#ifdef MASA_AND_OBJECTS if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#endif { hSCE[ch]->element_brate = element_brate[ch]; } @@ -745,31 +677,21 @@ ivas_error ivas_ism_metadata_dec_create( st_ivas->hIsmMetaData[ch]->last_azimuth = 0; st_ivas->hIsmMetaData[ch]->last_elevation = 0; -#ifdef MASA_AND_OBJECTS st_ivas->hIsmMetaData[ch]->ism_imp = -1; st_ivas->hIsmMetaData[ch]->ism_md_null_flag = 0; st_ivas->hIsmMetaData[ch]->ism_md_lowrate_flag = 0; -#endif ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } -#ifdef MASA_AND_OBJECTS if ( element_brate_tmp != NULL ) { -#endif - if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL -#ifdef MASA_AND_OBJECTS - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, + 0 ) ) != IVAS_ERR_OK ) { return error; } -#ifdef MASA_AND_OBJECTS } -#endif st_ivas->hISMDTX.ism_dtx_hangover_cnt = IVAS_ISM_DTX_HO_MAX; diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 071513de38caeddfd845f50b3d83ec1d7405665d..a1f8534f98a6e87d9e1fdc5710afffd27b0d8e4e 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -733,11 +733,7 @@ void ivas_param_ism_dec_close( void ivas_param_ism_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output*/ -#else - float output_f[][L_FRAME48k] /* i/o: synthesized core-coder transport channels/DirAC output*/ -#endif + float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output*/ ) { int16_t ch, nchan_transport, nchan_out, nchan_out_woLFE, i; @@ -1124,9 +1120,7 @@ void ivas_param_ism_dec_digest_tc( float direct_response[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN]; DIRAC_DEC_HANDLE hDirAC; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; -#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION int16_t fade_len; -#endif /* Initialization */ hDirAC = st_ivas->hDirAC; @@ -1136,12 +1130,8 @@ void ivas_param_ism_dec_digest_tc( ene_tc = 0.0f; ene_sum = 0.0f; last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain; -#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION output_frame = nCldfbSlots * hSpatParamRendCom->num_freq_bands; fade_len = output_frame / 2; -#else - output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); -#endif nchan_transport = st_ivas->nchan_transport; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -1246,13 +1236,8 @@ void ivas_param_ism_dec_digest_tc( { /* Smoothing */ gain = 0.75f * gain + 0.25f * last_gain; -#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION grad = ( gain - last_gain ) / (float) fade_len; /* slope between two consecutive gains, 480 samples length */ for ( i = 0; i < fade_len; i++ ) -#else - grad = ( gain - last_gain ) * 2.0f / (float) output_frame; /* slope between two consecutive gains, 480 samples length */ - for ( i = 0; i < output_frame / 2; i++ ) -#endif { transport_channels_f[0][i] *= ( last_gain + i * grad ); transport_channels_f[1][i] *= ( last_gain + i * grad ); diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index e8a7ac5808c74b53b4ec21d81c834095dc44b73e..9cb92cd2fbb9ff7aa5766b5575d5a5b6b06dd67c 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -346,7 +346,6 @@ void ivas_ism_get_stereo_gains( } -#ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------------* * ivas_masa_oism_separate_object_renderer_open() * @@ -473,12 +472,8 @@ void ivas_omasa_separate_object_renderer_close( void ivas_omasa_separate_object_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float input_f[][L_FRAME48k], /* i : separated object signal */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[], /* i/o: output signals */ -#else - float output_f[][L_FRAME48k], /* i/o: output signals */ -#endif - const int16_t output_frame /* i : output frame length per channel */ + float *output_f[], /* i/o: output signals */ + const int16_t output_frame /* i : output frame length per channel */ ) { VBAP_HANDLE hVBAPdata; @@ -735,4 +730,3 @@ void ivas_omasa_separate_object_render_jbm( return; } -#endif diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index f7f339855002c76e05fdf8e1289b51c5dbd1431f..419cd56195d6d26205c03339aefa0ff14a1ef60d 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -71,30 +71,17 @@ ivas_error ivas_jbm_dec_tc( ) { int16_t n, output_frame, nchan_out; - Decoder_State *st; /* used for bitstream handling */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + Decoder_State *st; /* used for bitstream handling */ float *output[MAX_OUTPUT_CHANNELS]; /* 'float' buffer for output synthesis */ /* TODO: can be allocated dynamically using st_ivas->p_output_f */ float p_output_f[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; -#else - float output[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; /* 'float' buffer for transport channels, MAX_TRANSPORT_CHANNELS channels */ -#endif int16_t nchan_remapped; -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - float output_lfe_ch[L_FRAME48k]; -#endif -#ifdef MASA_AND_OBJECTS int16_t nb_bits_metadata[MAX_SCE + 1]; -#else - int16_t nb_bits_metadata[MAX_SCE]; -#endif int32_t output_Fs, ivas_total_brate; AUDIO_CONFIG output_config; ivas_error error; float *p_output[MAX_TRANSPORT_CHANNELS]; int16_t num_md_sub_frames; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; @@ -113,9 +100,7 @@ ivas_error ivas_jbm_dec_tc( for ( n = 0; n < MAX_TRANSPORT_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP output[n] = p_output_f[n]; -#endif p_output[n] = &output[n][0]; } @@ -170,24 +155,16 @@ ivas_error ivas_jbm_dec_tc( } 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->hDirAC->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0] -#endif - ) ) != IVAS_ERR_OK ) + 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->hDirAC->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 -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0] -#endif - ) ) != IVAS_ERR_OK ) + 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; } @@ -207,13 +184,11 @@ ivas_error ivas_jbm_dec_tc( { ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); } -#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) { /* loudness correction */ ivas_dirac_dec_binaural_sba_gain( output, st_ivas->nchan_transport, output_frame ); } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) { @@ -337,7 +312,6 @@ ivas_error ivas_jbm_dec_tc( ivas_dirac_dec_binaural_sba_gain( output, nchan_remapped, output_frame ); } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { int16_t nchan_ism, nchan_transport_ism; @@ -428,7 +402,6 @@ ivas_error ivas_jbm_dec_tc( ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } } -#endif 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]; @@ -441,11 +414,7 @@ ivas_error ivas_jbm_dec_tc( st_ivas->hCPE[1]->hCoreCoder[1]->hTcxCfg = st_ivas->hCPE[1]->hCoreCoder[0]->hTcxCfg; } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output[LFE_CHANNEL] ); -#else - ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); -#endif } if ( st_ivas->mc_mode == MC_MODE_MCT ) @@ -455,9 +424,6 @@ ivas_error ivas_jbm_dec_tc( return error; } -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); -#endif /* HP filtering */ for ( n = 0; n < st_ivas->nchan_transport; n++ ) { @@ -469,12 +435,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) { - if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) -#ifdef FIX_679_JBM_MC2SBA - >= -#else - <= -#endif + if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) >= ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); @@ -495,11 +456,7 @@ ivas_error ivas_jbm_dec_tc( } else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output[LFE_CHANNEL] ); -#else - ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); -#endif ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] ); @@ -508,9 +465,6 @@ ivas_error ivas_jbm_dec_tc( return error; } -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); -#endif /* Rendering */ if ( st_ivas->renderer_type == RENDERER_MC ) { @@ -667,9 +621,7 @@ ivas_error ivas_jbm_dec_tc( st_ivas->ini_active_frame++; } -#ifdef MASA_AND_OBJECTS st_ivas->last_ivas_format = st_ivas->ivas_format; -#endif #ifdef DEBUG_MODE_INFO dbgwrite( &st_ivas->bfi, sizeof( int16_t ), 1, output_frame, "res/bfi" ); @@ -719,12 +671,7 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); -#ifdef MASA_AND_OBJECTS if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) -#else - - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) -#endif { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); } @@ -757,7 +704,6 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( { ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -771,7 +717,6 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( ivas_ism_dec_digest_tc( st_ivas ); } } -#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { if ( st_ivas->mc_mode == MC_MODE_MCT ) @@ -814,11 +759,7 @@ ivas_error ivas_jbm_dec_render( { int16_t n, nchan_out; int16_t nchan_transport; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAPaa - float *output[MAX_OUTPUT_CHANNELS]; /* 'float' buffer for output synthesis */ -#else float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ -#endif int16_t nchan_remapped; int32_t output_Fs; AUDIO_CONFIG output_config; @@ -846,9 +787,6 @@ ivas_error ivas_jbm_dec_render( for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAPaa - output[n] = st_ivas->p_output_f[n]; -#endif p_output[n] = &output[n][0]; } @@ -985,9 +923,7 @@ ivas_error ivas_jbm_dec_render( } if ( ( error = ivas_sba_linear_renderer( p_output, *nSamplesRendered, nchan_remapped, -#ifdef SBA_AND_OBJECTS 0, -#endif output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ) ) != IVAS_ERR_OK ) { return error; @@ -1003,7 +939,6 @@ ivas_error ivas_jbm_dec_render( ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { nchan_remapped = st_ivas->nchan_transport; @@ -1027,26 +962,19 @@ ivas_error ivas_jbm_dec_render( ivas_omasa_dirac_rend_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } } -#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { if ( st_ivas->mc_mode == MC_MODE_MCT ) { -#ifdef FIX_679_JBM_MC2SBA int16_t crendInPlaceRotation = FALSE; -#endif *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) { -#ifdef FIX_679_JBM_MC2SBA if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) { crendInPlaceRotation = TRUE; -#endif ivas_mc2sba( st_ivas->hTransSetup, p_tc, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); -#ifdef FIX_679_JBM_MC2SBA } -#endif } /* Rendering */ @@ -1060,11 +988,7 @@ ivas_error ivas_jbm_dec_render( &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, -#ifdef FIX_679_JBM_MC2SBA crendInPlaceRotation ? p_output : p_tc, -#else - p_tc, -#endif p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) @@ -1362,7 +1286,6 @@ ivas_error ivas_jbm_dec_flush_renderer( return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong MC_MODE in VoIP renderer flushing!" ); } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) { if ( ism_mode_old == ISM_MASA_MODE_DISC ) @@ -1393,7 +1316,6 @@ ivas_error ivas_jbm_dec_flush_renderer( } } } -#endif else { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong IVAS format in VoIP renderer flushing!" ); @@ -1702,7 +1624,6 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL ) @@ -1717,7 +1638,6 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } } } -#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) @@ -1733,12 +1653,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( /* do all static dmx already in the TC decoder if less channels than transported... */ if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) { - if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) -#ifdef FIX_679_JBM_MC2SBA - >= -#else - > -#endif + if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) >= ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) { num_tc = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; @@ -2203,9 +2118,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( /* all renderers where we are done after TC decoding (might include DMX to mono/stereo */ case RENDERER_DISABLE: case RENDERER_MCMASA_MONO_STEREO: -#ifdef SBA_AND_OBJECTS case RENDERER_OSBA_STEREO: -#endif case RENDERER_MONO_DOWNMIX: buffer_mode = TC_BUFFER_MODE_BUFFER; break; @@ -2221,10 +2134,8 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: case RENDERER_NON_DIEGETIC_DOWNMIX: -#ifdef SBA_AND_OBJECTS case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: -#endif buffer_mode = TC_BUFFER_MODE_RENDERER; break; case RENDERER_MC_PARAMMC: diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index cec88e4e6cdd8badee094dcd224937e1d23905ca..6bc88b06c8a097f6788ad0c45961c2a35b73aec5 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -73,13 +73,11 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); -#ifdef MASA_AND_OBJECTS static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp, const int16_t dirac_bs_md_write_idx, const int16_t dirac_md_buffer_length ); static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K ); static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks, const int16_t idx_separated_object ); static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], uint16_t *bit_stream, int16_t *next_bit_pos, float *masa_to_total_energy_ratio, const int16_t idx_sep_obj, int16_t *num_zeros ); -#endif /*-----------------------------------------------------------------------* @@ -102,7 +100,6 @@ ivas_error ivas_masa_decode( IVAS_FORMAT ivas_format; int16_t low_bitrate_mode, tmp_elem_mode; ivas_error error; -#ifdef MASA_AND_OBJECTS int16_t obj; int16_t i, ch, ism_imp; int16_t dirac_bs_md_write_idx; @@ -110,18 +107,13 @@ ivas_error ivas_masa_decode( dirac_bs_md_write_idx = 0; ism_imp = 0; -#endif error = IVAS_ERR_OK; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; low_bitrate_mode = -1; /* This means that LBR mode is not used. */ -#ifdef MASA_AND_OBJECTS if ( st_ivas->hOutSetup.separateChannelEnabled || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->hOutSetup.separateChannelEnabled ) -#endif { masa_brate = st_ivas->hCPE[0]->element_brate; } @@ -152,19 +144,14 @@ ivas_error ivas_masa_decode( { if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { -#ifdef MASA_AND_OBJECTS if ( ivas_format != MASA_ISM_FORMAT ) { /* number of transport channels is always 2 for MASA_ISM format */ -#endif /* the number of MASA transport channels was read in ivas_dec_setup() */ st->next_bit_pos -= MASA_TRANSP_BITS; *nb_bits_read += MASA_TRANSP_BITS; -#ifdef MASA_AND_OBJECTS } -#endif -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { /* the number of objects was read */ @@ -254,7 +241,6 @@ ivas_error ivas_masa_decode( } } } -#endif /* read the MASA_ISM_FORMAT bit */ byteBuffer = st->bit_stream[( st->next_bit_pos )--]; @@ -324,7 +310,6 @@ ivas_error ivas_masa_decode( /* Remove already read bits from the bit budget */ hQMetaData->metadata_max_bits -= *nb_bits_read; -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) @@ -357,9 +342,7 @@ ivas_error ivas_masa_decode( } } } -#endif -#ifdef MASA_AND_OBJECTS masa_total_brate = ivas_total_brate; if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -369,11 +352,6 @@ ivas_error ivas_masa_decode( if ( masa_total_brate >= IVAS_384k ) { if ( masa_total_brate >= IVAS_512k ) -#else - if ( ivas_total_brate >= IVAS_384k ) - { - if ( ivas_total_brate >= IVAS_512k ) -#endif { *nb_bits_read += ivas_qmetadata_dec_decode_hr_384_512( hQMetaData, st->bit_stream, &st->next_bit_pos, hMasa->data.sph_grid16, 16, 4, hMasa->config.numCodingBands ); } @@ -387,13 +365,11 @@ ivas_error ivas_masa_decode( *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos, 0 ); } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { /* Modify spatial metadata based on the MASA-to-total energy ratios */ ivas_omasa_modify_masa_energy_ratios( hQMetaData, st_ivas->hMasaIsmData->masa_to_total_energy_ratio ); } -#endif /* Get direction decoding quality. EC 1 and 2 are handled by the default value. */ if ( hQMetaData->ec_flag == 2 ) @@ -428,12 +404,8 @@ ivas_error ivas_masa_decode( return error; } - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE -#ifdef MASA_AND_OBJECTS - , - st_ivas->ivas_format, st_ivas->ism_mode, 0 -#endif - ); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, + st_ivas->ivas_format, st_ivas->ism_mode, 0 ); hQMetaData->metadata_max_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; @@ -480,13 +452,10 @@ ivas_error ivas_masa_decode( if ( st_ivas->hDirAC != NULL ) { -#ifdef MASA_AND_OBJECTS dirac_bs_md_write_idx = st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx; /* Store the write-index for this frame */ -#endif ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0 ); } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( hQMetaData->q_direction == NULL ) @@ -527,11 +496,9 @@ ivas_error ivas_masa_decode( } } } -#endif st->next_bit_pos = next_bit_pos_orig; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { int32_t cpe_brate; @@ -549,7 +516,6 @@ ivas_error ivas_masa_decode( } else { -#endif if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) { st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ivas_total_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; @@ -559,9 +525,7 @@ ivas_error ivas_masa_decode( st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = 0; } } -#ifdef MASA_AND_OBJECTS } -#endif if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 ) { @@ -578,11 +542,7 @@ ivas_error ivas_masa_decode( } } -#ifdef MASA_AND_OBJECTS if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) -#else - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) -#endif { create_masa_ext_out_meta( hMasa, hQMetaData, st_ivas->nchan_transport ); } @@ -603,10 +563,8 @@ ivas_error ivas_masa_dec_open( { MASA_DECODER_HANDLE hMasa; ivas_error error; -#ifdef MASA_AND_OBJECTS int16_t i; int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; @@ -615,7 +573,6 @@ ivas_error ivas_masa_dec_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) ); } -#ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { @@ -624,14 +581,9 @@ ivas_error ivas_masa_dec_open( ism_total_brate += st_ivas->hSCE[i]->element_brate; } } -#endif - ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE -#ifdef MASA_AND_OBJECTS - , - st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate -#endif - ); + ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, + st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 ); @@ -680,20 +632,16 @@ ivas_error ivas_masa_dec_open( { buffer_mode = TC_BUFFER_MODE_BUFFER; } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { buffer_mode = TC_BUFFER_MODE_BUFFER; } -#endif nchan_to_allocate = ivas_jbm_dec_get_num_tc_channels( st_ivas ); -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { nchan_to_allocate = 1; } -#endif if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) { @@ -785,14 +733,11 @@ static ivas_error ivas_masa_dec_config( uint8_t maxBand; int16_t maxBin; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t ivas_total_brate; int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; hMasa = st_ivas->hMasa; -#ifdef MASA_AND_OBJECTS ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) @@ -813,17 +758,8 @@ static ivas_error ivas_masa_dec_config( { ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); } -#else - ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); -#endif - -#ifdef MASA_AND_OBJECTS if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k ) -#else - if ( ( st_ivas->ivas_format == MASA_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k ) -#endif { hMasa->config.mergeRatiosOverSubframes = 0; @@ -896,12 +832,8 @@ static ivas_error ivas_masa_dec_config( *-------------------------------------------------------------------*/ void ivas_masa_prerender( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: synthesized core-coder transport channels */ -#else - float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output[], /* i/o: synthesized core-coder transport channels */ const int16_t output_frame /* i : output frame length per channel */ #ifdef CR_FIX_585_MASA_2TC_DTX_EXT , @@ -1297,13 +1229,9 @@ static int16_t decode_lfe_to_total_energy_ratio( *-------------------------------------------------------------------*/ ivas_error ivas_masa_dec_reconfigure( -#ifdef MASA_AND_OBJECTS Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ int16_t *data /* o : flushed PCM samples */ -#else - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#endif ) { int16_t n, tmp, num_bits; @@ -1316,16 +1244,13 @@ ivas_error ivas_masa_dec_reconfigure( #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN int16_t pos_idx; #endif -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifdef MASA_AND_OBJECTS if ( st_ivas->hDecoderConfig->voip_active == 1 ) { if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) @@ -1335,7 +1260,6 @@ ivas_error ivas_masa_dec_reconfigure( st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; } } -#endif ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); @@ -1356,11 +1280,7 @@ ivas_error ivas_masa_dec_reconfigure( return error; } } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->renderer_type == RENDERER_DISABLE || st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) -#else - else if ( st_ivas->renderer_type == RENDERER_DISABLE ) -#endif { if ( st_ivas->hDirAC != NULL ) { @@ -1471,23 +1391,21 @@ ivas_error ivas_masa_dec_reconfigure( #endif } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching within OMASA is handled in ivas_omasa_dec_config() */ { -#endif /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN if ( st_ivas->hDiracDecBin[0] != NULL ) #else - if ( st_ivas->hDiracDecBin != NULL ) + if ( st_ivas->hDiracDecBin != NULL ) #endif { #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) #endif { return error; @@ -1506,11 +1424,8 @@ ivas_error ivas_masa_dec_reconfigure( /*-----------------------------------------------------------------* * Set-up MASA coding elements and bitrates *-----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS } -#endif -#ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { @@ -1519,40 +1434,30 @@ ivas_error ivas_masa_dec_reconfigure( ism_total_brate += st_ivas->hSCE[n]->element_brate; } } -#endif - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp -#ifdef MASA_AND_OBJECTS - , - st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate -#endif - ); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, + st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_FORMAT ) { st_ivas->nchan_ism = 0; st_ivas->ism_mode = ISM_MODE_NONE; } -#endif if ( st_ivas->hDecoderConfig->voip_active == 1 ) { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; TC_BUFFER_MODE buffer_mode_new; -#ifdef MASA_AND_OBJECTS int16_t n_samples_granularity; n_samples_granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); -#endif buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); tc_nchan_transport = ivas_jbm_dec_get_num_tc_channels( st_ivas ); tc_nchan_to_allocate = tc_nchan_transport; if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; @@ -1584,24 +1489,16 @@ ivas_error ivas_masa_dec_reconfigure( } } } -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; -#endif } if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) { -#ifdef MASA_AND_OBJECTS if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) -#endif { return error; } } -#ifdef MASA_AND_OBJECTS 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 ); @@ -1618,7 +1515,6 @@ ivas_error ivas_masa_dec_reconfigure( st_ivas->hSpatParamRendCom->subframe_nbslots[n] = st_ivas->hTcBuffer->subframe_nbslots[n] * granularityMultiplier; } } -#endif } return error; @@ -1662,9 +1558,7 @@ void ivas_spar_param_to_masa_param_mapping( /* Set values */ hDirAC = st_ivas->hDirAC; hSpatParamRendCom = st_ivas->hSpatParamRendCom; -#ifdef MASA_AND_OBJECTS hSpatParamRendCom->numParametricDirections = 1; -#endif hSpatParamRendCom->numSimultaneousDirections = 1; #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN hDiffuseDist = st_ivas->hDiracDecBin[0]->hDiffuseDist; @@ -2029,7 +1923,6 @@ static void create_masa_ext_out_meta( return; } -#ifdef MASA_AND_OBJECTS static void decode_index_slice( int16_t index, /* i : index to decode */ int16_t *ratio_idx_ism, /* o : decodec array of integers */ @@ -2575,5 +2468,3 @@ static int16_t ivas_decode_masaism_metadata( return ( nb_bits_read - *next_bit_pos ); } - -#endif diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 3c7b6113c6daed983470a14bfad72c6ee83114b5..bd0be4b14d750bac02885f2d97fb81ad2b527df3 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -36,9 +36,7 @@ #include "cnst.h" #include "prot.h" #include "ivas_prot.h" -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP #include "ivas_prot_rend.h" -#endif #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "ivas_rom_dec.h" @@ -68,11 +66,7 @@ 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 ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], float *pcm_in[], float **pp_out_pcm, const int16_t output_frame ); -#else -static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], float pcm_in[][L_FRAME48k], float **pp_out_pcm, const int16_t output_frame ); -#endif static int16_t huff_read( Decoder_State *st, const int16_t ( *ht )[2] ); @@ -172,11 +166,7 @@ void ivas_mc_paramupmix_dec_read_BS( void ivas_mc_paramupmix_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[] /* i/o: synthesized core-coder transport channels */ -#else - float output_f[][L_FRAME48k] /* i/o: synthesized core-coder transport channels */ -#endif + float *output_f[] /* i/o: synthesized core-coder transport channels */ ) { MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; @@ -469,17 +459,10 @@ void ivas_mc_paramupmix_dec( } } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas ); ch++ ) { set_f( output_f[ch], 0.0f, output_frame ); } -#else - for ( ch = first_empty_channel; ch < MAX_OUTPUT_CHANNELS; ch++ ) - { - set_f( output_f[ch], 0.0, L_FRAME48k ); - } -#endif pop_wmops(); @@ -1264,13 +1247,9 @@ static void ivas_mc_paramupmix_dec_sf( static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *pcm_in[], /* i : input audio channels */ -#else - float pcm_in[][L_FRAME48k], /* i : input audio channels */ -#endif - float **pp_out_pcm, /* o : output audio channels */ - const int16_t output_frame /* i : output frame length */ + 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; diff --git a/lib_dec/ivas_mct_core_dec.c b/lib_dec/ivas_mct_core_dec.c index 57ed6c7d1c31fed413f6e9615a3794565865122d..f7b12126acaa75beff526953363192a772ac9e2e 100644 --- a/lib_dec/ivas_mct_core_dec.c +++ b/lib_dec/ivas_mct_core_dec.c @@ -165,11 +165,7 @@ void ivas_mct_core_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ const int16_t nCPE, /* i : number of CPEs */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *signal_out[] /* o : synthesis @internal_FS */ -#else - float signal_out[][L_FRAME48k] /* o : synthesis @internal_FS */ -#endif + float *signal_out[] /* o : synthesis @internal_FS */ ) { int16_t i, k, ch, cpe_id, nChannels; @@ -221,13 +217,8 @@ void ivas_mct_core_dec( { /* Initialization or re-configuration of Stereo TCX */ sts[ch]->enablePlcWaveadjust = 0; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP x[ch][0] = signal_out[ch]; x[ch][1] = signal_out[ch] + ( L_FRAME48k / 2 ); -#else - x[ch][0] = &signal_out[ch][0]; - x[ch][1] = &signal_out[ch][0] + L_FRAME48k / 2; -#endif } /*--------------------------------------------------------------------------------* diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c old mode 100755 new mode 100644 index 3d8a3ab62138b35dd6e9730a1a08e58c8ed3c852..c9c372072fb01820261beba6ba17baade76c0a6f --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -63,12 +63,8 @@ static ivas_error ivas_mc_dec_reconfig( Decoder_Struct *st_ivas, uint16_t *nSamp *--------------------------------------------------------------------------*/ ivas_error ivas_mct_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif + 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 */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ) @@ -86,9 +82,7 @@ ivas_error ivas_mct_dec( STnsData tnsData[MCT_MAX_BLOCKS][CPE_CHANNELS][2]; Decoder_State **sts; float synth[CPE_CHANNELS][L_FRAME_PLUS]; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float output_lfe_ch[L_FRAME48k]; -#endif int32_t ivas_total_brate; ivas_error error; @@ -100,13 +94,11 @@ ivas_error ivas_mct_dec( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP if ( st_ivas->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) { /* save LFE channel */ mvr2r( output[LFE_CHANNEL], output_lfe_ch, output_frame ); } -#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT && !st_ivas->bfi ) { @@ -158,13 +150,8 @@ ivas_error ivas_mct_dec( for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP x[n][0] = output[n + cpe_id * CPE_CHANNELS]; x[n][1] = output[n + cpe_id * CPE_CHANNELS] + ( L_FRAME48k / 2 ); -#else - x[n][0] = &output[n + cpe_id * CPE_CHANNELS][0]; - x[n][1] = &output[n + cpe_id * CPE_CHANNELS][L_FRAME48k / 2]; -#endif set_zero( x[n][0], L_FRAME48k / 2 ); set_zero( x[n][1], L_FRAME48k / 2 ); } @@ -180,11 +167,7 @@ ivas_error ivas_mct_dec( ivas_mct_core_dec( hMCT, st_ivas->hCPE, nCPE, output ); /* for sba to stereo output disable any further processing for TCs > 2 as it is not needed*/ -#ifdef SBA_AND_OBJECTS if ( st_ivas->sba_dirac_stereo_flag && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#else - if ( st_ivas->sba_dirac_stereo_flag ) -#endif { for ( cpe_id = 1; cpe_id < nCPE; cpe_id++ ) { @@ -202,13 +185,8 @@ ivas_error ivas_mct_dec( for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP x[n][0] = output[n + cpe_id * CPE_CHANNELS]; x[n][1] = output[n + cpe_id * CPE_CHANNELS] + ( L_FRAME48k / 2 ); -#else - x[n][0] = &output[n + cpe_id * CPE_CHANNELS][0]; - x[n][1] = &output[n + cpe_id * CPE_CHANNELS][L_FRAME48k / 2]; -#endif } ivas_mdct_core_tns_ns( hCPE, fUseTns[cpe_id], tnsData[cpe_id], x, Aq[cpe_id], 1 ); @@ -228,13 +206,8 @@ ivas_error ivas_mct_dec( { for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP x_all[n + cpe_id * CPE_CHANNELS][0] = output[n + cpe_id * CPE_CHANNELS]; x_all[n + cpe_id * CPE_CHANNELS][1] = output[n + cpe_id * CPE_CHANNELS] + ( L_FRAME48k / 2 ); -#else - x_all[n + cpe_id * CPE_CHANNELS][0] = &output[n + cpe_id * CPE_CHANNELS][0]; - x_all[n + cpe_id * CPE_CHANNELS][1] = &output[n + cpe_id * CPE_CHANNELS][L_FRAME48k / 2]; -#endif } } @@ -248,13 +221,8 @@ ivas_error ivas_mct_dec( for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP x[n][0] = output[n + cpe_id * CPE_CHANNELS]; x[n][1] = output[n + cpe_id * CPE_CHANNELS] + ( L_FRAME48k / 2 ); -#else - x[n][0] = &output[n + cpe_id * CPE_CHANNELS][0]; - x[n][1] = &output[n + cpe_id * CPE_CHANNELS][L_FRAME48k / 2]; -#endif } ivas_mdct_core_reconstruct( hCPE, x, synth, fUseTns[cpe_id], 1 ); @@ -265,21 +233,13 @@ ivas_error ivas_mct_dec( for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef SBA_AND_OBJECTS if ( st_ivas->sba_dirac_stereo_flag && ( st_ivas->ivas_format != SBA_ISM_FORMAT || cpe_id >= nCPE - 2 ) ) -#else - if ( st_ivas->sba_dirac_stereo_flag ) -#endif { ivas_post_proc( NULL, hCPE, n, synth[n], NULL, output_frame, 1 ); } /* Postprocessing for ACELP/MDCT core switching and synchronization */ -#ifdef SBA_AND_OBJECTS if ( ( error = core_switching_post_dec( sts[n], synth[n], output[cpe_id * CPE_CHANNELS + n], hCPE->output_mem[1], st_ivas->ivas_format, 0, output_frame, 0 /*core_switching_flag*/, ( st_ivas->ivas_format != SBA_ISM_FORMAT || cpe_id >= nCPE - 2 ) ? st_ivas->sba_dirac_stereo_flag : 0, -1, hCPE->last_element_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = core_switching_post_dec( sts[n], synth[n], output[cpe_id * CPE_CHANNELS + n], hCPE->output_mem[1], st_ivas->ivas_format, 0, output_frame, 0 /*core_switching_flag*/, st_ivas->sba_dirac_stereo_flag, -1, hCPE->last_element_mode ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -300,11 +260,7 @@ ivas_error ivas_mct_dec( /* synthesis synchronization between stereo modes */ -#ifdef SBA_AND_OBJECTS if ( !st_ivas->sba_dirac_stereo_flag || ( st_ivas->ivas_format == SBA_ISM_FORMAT && cpe_id < nCPE - 2 ) ) -#else - if ( !st_ivas->sba_dirac_stereo_flag ) -#endif { synchro_synthesis( ivas_total_brate, hCPE, output + cpe_id * CPE_CHANNELS, output_frame, 0 ); } @@ -331,13 +287,9 @@ ivas_error ivas_mct_dec( mvr2r( output[n - 1], output[n + 1], output_frame ); } mvr2r( tmp, output[LFE_CHANNEL - 1], output_frame ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /* save LFE channel */ mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); -#else - set_zero( output[LFE_CHANNEL], output_frame ); -#endif } #ifdef DEBUG_MODE_INFO @@ -388,22 +340,9 @@ ivas_error create_mct_dec( *-----------------------------------------------------------------*/ /* Determine active channels */ - if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) || st_ivas->ivas_format == SBA_FORMAT -#ifdef SBA_AND_OBJECTS - || st_ivas->ivas_format == SBA_ISM_FORMAT -#endif - ) + if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) || st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { hMCT->nchan_out_woLFE = st_ivas->nchan_transport; - -#ifndef OSBA_BR_SWITCHING -#ifdef SBA_AND_OBJECTS - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - hMCT->nchan_out_woLFE += st_ivas->nchan_ism; - } -#endif -#endif } else if ( st_ivas->mc_mode == MC_MODE_MCT ) { @@ -511,11 +450,7 @@ ivas_error mct_dec_reconfigure( if ( b_nchan_change ) { /* Determine active channels */ - if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) || st_ivas->ivas_format == SBA_FORMAT -#ifdef OSBA_BR_SWITCHING - || st_ivas->ivas_format == SBA_ISM_FORMAT -#endif - ) + if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) || st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { hMCT->nchan_out_woLFE = st_ivas->nchan_transport; } diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c old mode 100755 new mode 100644 index b6c40ad1f07750e5cf46adb5c3accdace21c2370..56c13adf3703a1de2de7688b9ee5388ecb73c50a --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -84,12 +84,8 @@ ivas_error ivas_mono_dmx_renderer_open( *------------------------------------------------------------------------*/ void ivas_mono_downmix_render_passive( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/mono output */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ ) { @@ -98,14 +94,11 @@ void ivas_mono_downmix_render_passive( MONO_DOWNMIX_RENDERER_HANDLE hDownmix; numInputChannels = st_ivas->nSCE; -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { numInputChannels = st_ivas->nchan_ism; } -#endif -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) @@ -117,7 +110,6 @@ void ivas_mono_downmix_render_passive( numInputChannels = st_ivas->nchan_transport + st_ivas->nchan_ism; } } -#endif hDownmix = st_ivas->hMonoDmxRenderer; set_zero( proto_signal, output_frame ); @@ -158,12 +150,8 @@ void ivas_mono_downmix_render_passive( void ivas_mono_stereo_downmix_mcmasa( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[], /* i/o: synthesized core-coder transport channels/mono or stereo output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/mono or stereo output */ -#endif - int16_t output_frame /* i : output frame length per channel */ + float *output_f[], /* i/o: synthesized core-coder transport channels/mono or stereo output */ + int16_t output_frame /* i : output frame length per channel */ ) { int16_t i; diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index c37210c9a79bd4460b5f62299cffceb3ba3cd725..eb04843b3ded0f655694d428592978b152a1ed62 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -53,26 +53,16 @@ ivas_error ivas_td_binaural_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { -#ifdef MASA_AND_OBJECTS int16_t num_src; num_src = st_ivas->nchan_transport; -#ifdef SBA_AND_OBJECTS if ( ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) || ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { num_src = st_ivas->nchan_ism; } return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); -#else - - return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_transport, st_ivas->ivas_format, - st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); -#endif } @@ -90,19 +80,11 @@ ivas_error ivas_td_binaural_renderer( ) { int16_t ism_md_subframe_update; -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS int16_t nchan_transport; -#endif -#if defined MASA_AND_OBJECTS - nchan_transport = ( st_ivas->ism_mode == ISM_MASA_MODE_DISC -#if defined SBA_AND_OBJECTS - || st_ivas->ism_mode == ISM_SBA_MODE_DISC -#endif - ) + nchan_transport = ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ? st_ivas->nchan_ism : st_ivas->nchan_transport; -#endif if ( st_ivas->hDecoderConfig->Opt_delay_comp ) { @@ -113,22 +95,16 @@ ivas_error ivas_td_binaural_renderer( ism_md_subframe_update = 2; } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { ism_md_subframe_update = 2; } -#endif return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS nchan_transport, -#else - st_ivas->nchan_transport, -#endif LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation : NULL, @@ -161,7 +137,6 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t ism_md_subframe_update_jbm; int16_t c_indx, nS; -#ifdef MASA_AND_OBJECTS int16_t nchan_ism_internal, nchan_ism, ch_offset; /* Set the number of ISMs */ @@ -177,7 +152,6 @@ ivas_error ivas_td_binaural_renderer_sf( nchan_ism = st_ivas->nchan_transport; ch_offset = 0; } -#endif /* Number of subframes to delay metadata to sync with audio */ if ( st_ivas->hDecoderConfig->Opt_delay_comp ) @@ -189,29 +163,20 @@ ivas_error ivas_td_binaural_renderer_sf( ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 2 ); } -#endif for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { p_reverb_signal[ch] = reverb_signal[ch]; } -#ifdef MASA_AND_OBJECTS for ( ch = 0; ch < nchan_ism_internal; ch++ ) { tc_local[ch] = st_ivas->hTcBuffer->tc[ch + ch_offset] + st_ivas->hTcBuffer->n_samples_rendered; } -#else - for ( ch = 0; ch < st_ivas->hTcBuffer->nchan_transport_internal; ch++ ) - { - tc_local[ch] = st_ivas->hTcBuffer->tc[ch] + st_ivas->hTcBuffer->n_samples_rendered; - } -#endif for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { @@ -239,11 +204,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* Update object position(s) */ c_indx = 0; -#ifdef MASA_AND_OBJECTS for ( nS = 0; nS < nchan_ism; nS++ ) -#else - for ( nS = 0; nS < st_ivas->nchan_transport; nS++ ) -#endif { if ( !( st_ivas->ivas_format == MC_FORMAT && nS == LFE_CHANNEL ) ) /* Skip LFE for MC */ { @@ -254,11 +215,7 @@ ivas_error ivas_td_binaural_renderer_sf( } if ( subframe_idx == ism_md_subframe_update_jbm ) { -#ifdef MASA_AND_OBJECTS TDREND_Update_object_positions( st_ivas->hBinRendererTd, nchan_ism, st_ivas->ivas_format, st_ivas->hIsmMetaData ); -#else - TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->hIsmMetaData ); -#endif } /* Update the listener's location/orientation */ @@ -289,11 +246,7 @@ ivas_error ivas_td_binaural_renderer_sf( } -#ifdef MASA_AND_OBJECTS for ( ch = 0; ch < nchan_ism_internal; ch++ ) -#else - for ( ch = 0; ch < st_ivas->hTcBuffer->nchan_transport_internal; ch++ ) -#endif { tc_local[ch] += output_frame; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 77b488e4d2b04c4bb589ef8c6e042aab12e88cf7..de4a310d5a93614c3963cc2ab8b0eff7d9c7cee9 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -43,7 +43,6 @@ #include "wmc_auto.h" -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------------- * Local constants *------------------------------------------------------------------------*/ @@ -162,9 +161,7 @@ ivas_error ivas_omasa_dec_config( int32_t ivas_total_brate, ism_total_brate, cpe_brate; ISM_MODE ism_mode_old; IVAS_FORMAT ivas_format_orig; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t nchan_out_buff, nchan_out_buff_old; -#endif ivas_error error; RENDERER_TYPE old_renderer_type; @@ -179,9 +176,7 @@ ivas_error ivas_omasa_dec_config( ivas_format_orig = st_ivas->ivas_format; st_ivas->ivas_format = st_ivas->last_ivas_format; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas ); -#endif st_ivas->ivas_format = ivas_format_orig; nSCE_old = st_ivas->nSCE; @@ -404,7 +399,6 @@ ivas_error ivas_omasa_dec_config( return error; } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ @@ -433,7 +427,6 @@ ivas_error ivas_omasa_dec_config( } } } -#endif } return IVAS_ERR_OK; @@ -560,12 +553,8 @@ ivas_error ivas_omasa_ism_metadata_dec( { /* decode ISM metadata */ if ( ( error = ivas_ism_metadata_dec( ism_total_brate, *nchan_ism, nchan_transport_ism, 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 -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0] -#endif - ) ) != IVAS_ERR_OK ) + 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; } @@ -613,12 +602,8 @@ ivas_error ivas_omasa_ism_metadata_dec( *--------------------------------------------------------------------------*/ void ivas_omasa_dirac_rend( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif + 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 */ ) { @@ -685,12 +670,8 @@ void ivas_omasa_dirac_rend_jbm( *--------------------------------------------------------------------------*/ ivas_error ivas_omasa_dirac_td_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif + 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 */ ) { @@ -790,7 +771,6 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*--------------------------------------------------------------------------* * ivas_omasa_rearrange_channels() * @@ -818,5 +798,3 @@ void ivas_omasa_rearrange_channels( return; } -#endif -#endif diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c old mode 100755 new mode 100644 index 21c38a879dd1a1dcb4159c7712d48f03b9e8bcd9..47ef0efbe0fab3cdb958c0ca55259d38534f0298 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -43,8 +43,6 @@ #include "wmc_auto.h" -#ifdef SBA_AND_OBJECTS - /*-------------------------------------------------------------------* * ivas_masa_ism_data_open() * @@ -141,12 +139,8 @@ ivas_error ivas_sba_ism_separate_object_renderer_open( *--------------------------------------------------------------------------*/ ivas_error ivas_osba_dirac_td_binaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* o : output synthesis signal */ -#else - float output[][L_FRAME48k], /* o : output synthesis signal */ -#endif + 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 */ ) { @@ -303,12 +297,8 @@ ivas_error ivas_osba_ism_metadata_dec( *-------------------------------------------------------------------------*/ ivas_error ivas_osba_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[], /* i/o: core-coder transport channels/object output */ -#else - float output_f[][L_FRAME48k], /* i/o: core-coder transport channels/object output */ -#endif + 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 */ ) { @@ -367,4 +357,3 @@ ivas_error ivas_osba_render( return IVAS_ERR_OK; } -#endif diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index f93f6fb2f55eaf9a09a1dcb2b241a003eb69b96a..f03bb98e316c6cf67820f2c9384e084698878c54 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -560,11 +560,7 @@ void ivas_ls_setup_conversion( void ivas_ls_setup_conversion_process_mdct( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[] /* i/o: output synthesis signal */ -#else - float output[][L_FRAME48k] /* i/o: output synthesis signal */ -#endif + float *output[] /* i/o: output synthesis signal */ ) { /* Declaration of all required variables */ @@ -596,13 +592,8 @@ void ivas_ls_setup_conversion_process_mdct( /* Assign output pointer to variable x */ for ( chInIdx = 0; chInIdx < inChannels; chInIdx++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP x[chInIdx][0] = output[chInIdx]; x[chInIdx][1] = output[chInIdx] + ( L_FRAME48k / 2 ); -#else - x[chInIdx][0] = &output[chInIdx][0]; - x[chInIdx][1] = &output[chInIdx][0] + L_FRAME48k / 2; -#endif } /* Assign all the declared handles*/ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 76625c2a640c5bf2548a67399525cc55ed654abc..10491211c09c13a1fa5a58763c51687aa507f5be 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -139,16 +139,7 @@ void ivas_renderer_select( } } } - else if ( st_ivas->ivas_format == MASA_FORMAT -#ifdef MASA_AND_OBJECTS - || st_ivas->ivas_format == MASA_ISM_FORMAT -#endif -#ifdef SBA_AND_OBJECTS - || ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - || ( st_ivas->ivas_format == SBA_FORMAT -#endif - && st_ivas->nchan_transport <= 2 ) ) + else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; if ( output_config == AUDIO_CONFIG_BINAURAL @@ -164,11 +155,7 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_PARAMETRIC_ROOM; } } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - else if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { *internal_config = AUDIO_CONFIG_HOA3; if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB @@ -365,27 +352,14 @@ void ivas_renderer_select( } } } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) -#endif { -#ifdef SBA_AND_OBJECTS IVAS_FORMAT ivas_format; -#endif *renderer_type = RENDERER_DIRAC; -#ifdef SBA_AND_OBJECTS ivas_format = ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ? SBA_FORMAT : st_ivas->ivas_format; /* treat ISM_SBA_MODE_NONE just like SBA_FORMAT */ -#endif -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_FORMAT && ( output_config != AUDIO_CONFIG_5_1 && output_config != AUDIO_CONFIG_5_1_2 && output_config != AUDIO_CONFIG_5_1_4 && output_config != AUDIO_CONFIG_7_1 && output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_LS_CUSTOM && output_config != AUDIO_CONFIG_MONO && output_config != AUDIO_CONFIG_STEREO ) ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT && - ( output_config != AUDIO_CONFIG_5_1 && output_config != AUDIO_CONFIG_5_1_2 && output_config != AUDIO_CONFIG_5_1_4 && output_config != AUDIO_CONFIG_7_1 && output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_LS_CUSTOM && output_config != AUDIO_CONFIG_MONO && output_config != AUDIO_CONFIG_STEREO ) ) -#endif { if ( output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_FOA ) { @@ -401,49 +375,27 @@ void ivas_renderer_select( } st_ivas->renderer_type = RENDERER_SBA_LINEAR_DEC; } -#ifdef SBA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || ( ivas_format == SBA_FORMAT && ( output_config == AUDIO_CONFIG_STEREO || output_config == AUDIO_CONFIG_MONO ) ) ) -#else - else if ( ( st_ivas->ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || - ( st_ivas->ivas_format == SBA_FORMAT && ( output_config == AUDIO_CONFIG_STEREO || output_config == AUDIO_CONFIG_MONO ) ) ) -#endif { *renderer_type = RENDERER_DISABLE; } -#ifdef SBA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) ) -#else - else if ( ( st_ivas->ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) ) -#endif { *renderer_type = RENDERER_DISABLE; } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_STEREO ) -#else - else if ( st_ivas->ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_STEREO ) -#endif { *renderer_type = RENDERER_STEREO_PARAMETRIC; } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) -#else - else if ( st_ivas->ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) -#endif { *renderer_type = RENDERER_DISABLE; } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_FORMAT && output_config == AUDIO_CONFIG_MONO ) -#else - else if ( st_ivas->ivas_format == SBA_FORMAT && output_config == AUDIO_CONFIG_MONO ) -#endif { *renderer_type = RENDERER_SBA_LINEAR_DEC; } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_OSBA_STEREO; @@ -452,27 +404,19 @@ void ivas_renderer_select( { *renderer_type = RENDERER_MONO_DOWNMIX; } -#endif -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_ISM_FORMAT && ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) ) { *renderer_type = RENDERER_OSBA_AMBI; } -#endif -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_ISM_FORMAT && ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 || output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_LS_CUSTOM ) ) { *renderer_type = RENDERER_OSBA_LS; } -#endif -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) { *renderer_type = RENDERER_SBA_LINEAR_DEC; } -#endif } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { *renderer_type = RENDERER_DIRAC; @@ -490,7 +434,6 @@ void ivas_renderer_select( *renderer_type = RENDERER_DISABLE; } } -#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { *internal_config = transport_config; diff --git a/lib_dec/ivas_pca_dec.c b/lib_dec/ivas_pca_dec.c index 9e5cb019916f0dfd1ee815a0da53f2ed3b0790e1..8dbbbded046491db1904bda01143ddc398e7ab9a 100644 --- a/lib_dec/ivas_pca_dec.c +++ b/lib_dec/ivas_pca_dec.c @@ -92,11 +92,7 @@ static void pca_dec_reset_mem_eigvec( static void pca_inv_transform_sub( float *eigVec, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *transformed_data[], /* i : input/transformed audio channels */ -#else - float transformed_data[][L_FRAME48k], /* i : input/transformed audio channels */ -#endif const int16_t start, const int16_t len, const int16_t n_channels ) @@ -133,11 +129,7 @@ static void pca_dec_inv_transform( float *qr, const int16_t n_samples, const int16_t n_channels, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *decoded_data[] ) -#else - float decoded_data[][L_FRAME48k] ) -#endif { int16_t j; int16_t slot_len; @@ -232,11 +224,7 @@ void ivas_pca_dec( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ const int16_t bfi, /* i : bad frame indicator */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *pcm_out[] /* o : output audio channels */ -#else - float pcm_out[][L_FRAME48k] /* o : output audio channels */ -#endif + float *pcm_out[] /* o : output audio channels */ ) { float ql[IVAS_PCA_INTERP], qr[IVAS_PCA_INTERP]; diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c old mode 100755 new mode 100644 index 23c8a5a09ed98c26ffc21ecaca09aa0ab9bbf090..a8089c7e23808aabb8aa9bc9431c716d2cee8366 --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -53,15 +53,11 @@ *-------------------------------------------------------------------------*/ void ivas_post_proc( - SCE_DEC_HANDLE hSCE, /* i/o: SCE decoder structure */ - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - const int16_t n, /* i : channel number */ - float synth[], /* i/o: output synthesis signal */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis signal */ -#endif + SCE_DEC_HANDLE hSCE, /* i/o: SCE decoder structure */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + const int16_t n, /* i : channel number */ + float synth[], /* i/o: output synthesis signal */ + float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ const int16_t output_frame, /* i : output frame length */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ ) diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 8920dc52ce2d560cf23bea886c1758083591cbcb..d5ef4c81c0f93a3567282ffc5342e8e8a625cb82 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -55,9 +55,6 @@ static int16_t ivas_qmetadata_raw_decode_dir( IVAS_QDIRECTION *q_direction, uint static uint16_t ivas_qmetadata_DecodeQuasiUniform( const uint16_t *bitstream, int16_t *index, const uint16_t alphabet_size ); -#ifndef MASA_AND_OBJECTS -static int16_t ivas_qmetadata_DecodeExtendedGR( uint16_t *bitstream, int16_t *index, const int16_t alph_size, const int16_t gr_param ); -#endif static int16_t ivas_qmetadata_ReorderElevationDecoded( const int16_t elev_dist, const int16_t elev_avg, const int16_t elev_alph ); @@ -103,9 +100,7 @@ static int16_t read_surround_coherence_hr( uint16_t *bitstream, int16_t *p_bit_p static int16_t read_coherence_data_hr_512( uint16_t *bitstream, int16_t *p_bit_pos, IVAS_QMETADATA *hQMetaData, const int16_t idx_dir, const int16_t nbits_coh ); -#ifdef MASA_AND_OBJECTS static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, const int16_t len_stream, uint16_t *bit_stream, int16_t *index, const int16_t first_line ); -#endif /*-----------------------------------------------------------------------* @@ -2348,16 +2343,13 @@ static uint16_t ivas_qmetadata_DecodeQuasiUniform( *------------------------------------------------------------------------*/ /*! r: Value decoded from the bitstream */ -#ifndef MASA_AND_OBJECTS -static -#endif - int16_t - ivas_qmetadata_DecodeExtendedGR( - uint16_t *bitstream, /* i : pointer to the bitstream to read */ - int16_t *index, /* i/o: position in the bitstream to start reading (gets updated with reading) */ - const int16_t alph_size, /* i : size of the alphabet, used to calculate the number of bits needed */ - const int16_t gr_param /* i : GR parameter that indicates the limit for the most significant bits (msb) */ - ) +int16_t +ivas_qmetadata_DecodeExtendedGR( + uint16_t *bitstream, /* i : pointer to the bitstream to read */ + int16_t *index, /* i/o: position in the bitstream to start reading (gets updated with reading) */ + const int16_t alph_size, /* i : size of the alphabet, used to calculate the number of bits needed */ + const int16_t gr_param /* i : GR parameter that indicates the limit for the most significant bits (msb) */ +) { int16_t i, msb_size; uint16_t value; @@ -4345,7 +4337,6 @@ static void decode_combined_index( } -#ifdef MASA_AND_OBJECTS static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, @@ -4544,4 +4535,3 @@ void ivas_omasa_decode_masa_to_total( return; } -#endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 572960178b648176e6699a052492199cb3513f66..5a76aa885db77b4f87a01a340a58b1e4a8f319d6 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -111,15 +111,11 @@ ivas_error ivas_sba_dec_reconfigure( int32_t ivas_total_brate; int32_t last_ivas_total_brate; int16_t num_channels, num_md_sub_frames; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t ch, nchan_out_buff, nchan_out_buff_old; -#endif DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; -#ifdef OSBA_BR_SWITCHING ISM_MODE ism_mode_old; ism_mode_old = st_ivas->ism_mode; -#endif error = IVAS_ERR_OK; @@ -134,7 +130,6 @@ ivas_error ivas_sba_dec_reconfigure( ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nchan_hp20_old = getNumChanSynthesis( st_ivas ); -#ifdef OSBA_BR_SWITCHING if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( ivas_total_brate >= IVAS_256k ) @@ -150,15 +145,12 @@ ivas_error ivas_sba_dec_reconfigure( { st_ivas->ism_mode = ISM_MODE_NONE; } -#endif nSCE_old = st_ivas->nSCE; nCPE_old = st_ivas->nCPE; nchan_transport_old = st_ivas->nchan_transport; sba_dirac_stereo_flag_old = st_ivas->sba_dirac_stereo_flag; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas ); -#endif st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); @@ -330,7 +322,6 @@ ivas_error ivas_sba_dec_reconfigure( /*-----------------------------------------------------------------* * Allocate, initialize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ -#ifdef OSBA_BR_SWITCHING if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( ism_mode_old == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -418,14 +409,12 @@ ivas_error ivas_sba_dec_reconfigure( nchan_transport_old = st_ivas->nchan_transport; } } -#endif if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, nCPE_old, nchan_transport_old, sba_dirac_stereo_flag_old, st_ivas->hDecoderConfig->ivas_total_brate / st_ivas->nchan_transport, ( st_ivas->hDecoderConfig->ivas_total_brate / st_ivas->nchan_transport ) * CPE_CHANNELS ) ) != IVAS_ERR_OK ) { return error; } -#ifdef OSBA_BR_SWITCHING if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -433,7 +422,6 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->nchan_transport -= st_ivas->nchan_ism; } } -#endif /*-----------------------------------------------------------------* * HP20 memories @@ -518,7 +506,6 @@ ivas_error ivas_sba_dec_reconfigure( } } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ @@ -547,7 +534,6 @@ ivas_error ivas_sba_dec_reconfigure( } } } -#endif return error; } @@ -701,9 +687,7 @@ void ivas_sba_dec_render( if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) { ivas_sba_linear_renderer( output_f, *nSamplesRendered, st_ivas->hIntSetup.nchan_out_woLFE, -#ifdef SBA_AND_OBJECTS 0, -#endif st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); } diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index e55d37657c42527e0f69b73954c1089700e3d716..1497c76dcbe69496242397b16bd3b0c23ed3776d 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -78,7 +78,6 @@ int16_t ivas_get_sba_dirac_stereo_flag( } } } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( output_config == AUDIO_CONFIG_STEREO ) @@ -86,7 +85,6 @@ int16_t ivas_get_sba_dirac_stereo_flag( sba_dirac_stereo_flag = 1; } } -#endif return sba_dirac_stereo_flag; } @@ -609,13 +607,9 @@ static void ivas_sba_dirac_stereo_upmix_hb( static void ivas_sba_dirac_stereo_apply_td_stefi( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder DFT stereo handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis signal */ -#endif - const int16_t output_frame, /* i : output frame length per channel */ - const int16_t spar_flag /* i : SPAR flag */ + float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ + const int16_t output_frame, /* i : output frame length per channel */ + const int16_t spar_flag /* i : SPAR flag */ ) { int16_t i; @@ -824,14 +818,10 @@ void ivas_sba_dirac_stereo_smooth_parameters( *-------------------------------------------------------------------*/ void ivas_sba_dirac_stereo_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis signal */ -#endif - const int16_t output_frame, /* i : output frame length per channel */ - const int16_t mcmasa /* i : McMASA flag */ + const int16_t output_frame, /* i : output frame length per channel */ + const int16_t mcmasa /* i : McMASA flag */ ) { int16_t dtx_flag, fd_cng_flag; @@ -865,11 +855,7 @@ void ivas_sba_dirac_stereo_dec( memOffset = NS2SA( output_frame * FRAMES_PER_SEC, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ); ivas_sba_dirac_stereo_config( hStereoDft->hConfig ); -#ifdef SBA_AND_OBJECTS hStereoDft->nbands = ivas_sba_dirac_stereo_band_config( hStereoDft->band_limits, st_ivas->hDecoderConfig->output_Fs, hStereoDft->NFFT, ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) ); -#else - hStereoDft->nbands = ivas_sba_dirac_stereo_band_config( hStereoDft->band_limits, st_ivas->hDecoderConfig->output_Fs, hStereoDft->NFFT, ( st_ivas->ivas_format == SBA_FORMAT && !mcmasa ) ); -#endif stereo_dft_dec_update( hStereoDft, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/ ); if ( st_ivas->nchan_transport > 1 ) { @@ -893,18 +879,9 @@ void ivas_sba_dirac_stereo_dec( /* mapping of DirAC parameters (azimuth, elevation, diffuseness) to DFT Stereo parameters (side gain, prediction gain) */ map_params_dirac_to_stereo( hStereoDft, st_ivas->hQMetaData, tmp_synth, DFT[0], st_ivas->ivas_format == MC_FORMAT, -#ifdef SBA_AND_OBJECTS ( ( st_ivas->ivas_format != SBA_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) || mcmasa ) ? hSCE->hCoreCoder[0]->L_frame : output_frame, ( ( st_ivas->ivas_format != SBA_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) || mcmasa ) ); -#else - ( st_ivas->ivas_format != SBA_FORMAT || mcmasa ) ? hSCE->hCoreCoder[0]->L_frame : output_frame, - ( st_ivas->ivas_format != SBA_FORMAT || mcmasa ) ); -#endif -#ifdef SBA_AND_OBJECTS if ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT && !mcmasa ) -#endif { set_f( hStereoDft->res_pred_gain, 1.f, 3 * STEREO_DFT_BAND_MAX ); } @@ -948,11 +925,7 @@ void ivas_sba_dirac_stereo_dec( ivas_sba_dirac_stereo_compute_hb_gain( hStereoDft, hb_gain ); ivas_sba_dirac_stereo_upmix_hb( hb_synth_stereo, hSCE->save_hb_synth, hb_gain, output_frame, -#ifdef SBA_AND_OBJECTS ( ( st_ivas->ivas_format != SBA_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) || mcmasa ), sba_mono_flag, hSCE->hCoreCoder[0]->bwidth, hStereoDft ); -#else - ( st_ivas->ivas_format != SBA_FORMAT || mcmasa ), sba_mono_flag, hSCE->hCoreCoder[0]->bwidth, hStereoDft ); -#endif /* add HB to ACELP core */ v_add( output[0], hb_synth_stereo[0], output[0], output_frame ); @@ -961,11 +934,7 @@ void ivas_sba_dirac_stereo_dec( v_add( output[1], hb_synth_stereo[1], output[1], output_frame ); /* apply TD Stereo Filling as is done in ICBWE */ -#ifdef SBA_AND_OBJECTS ivas_sba_dirac_stereo_apply_td_stefi( hStereoDft, output, output_frame, ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) ); -#else - ivas_sba_dirac_stereo_apply_td_stefi( hStereoDft, output, output_frame, ( st_ivas->ivas_format == SBA_FORMAT && !mcmasa ) ); -#endif } } diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 4cb9eb339d882a5bc6e598ee5d058c854fdc8392..15be85b04fcae0cfa71f5b94f5c358248ba68374 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -221,11 +221,7 @@ void ivas_mc2sba( /*! r: SBA DirAC stereo flag */ int16_t ivas_sba_remapTCs( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *sba_data[], /* i/o: SBA signals */ -#else - float sba_data[][L_FRAME48k], /* i/o: SBA signals */ -#endif + float *sba_data[], /* i/o: SBA signals */ Decoder_Struct *st_ivas, /* i/o: decoder struct */ const int16_t output_frame /* i : frame length */ ) @@ -393,19 +389,13 @@ void ivas_ism2sba_sf( *-------------------------------------------------------------------*/ ivas_error ivas_sba_upmixer_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: transport/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: transport/output audio channels */ -#endif + 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; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t sba_ch_idx; -#endif ivas_error error; push_wmops( "ivas_sba_upmixer_renderer" ); @@ -417,20 +407,12 @@ ivas_error ivas_sba_upmixer_renderer( if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) { -#ifdef SBA_AND_OBJECTS float *output_f[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; -#else - float *output_f[MAX_OUTPUT_CHANNELS]; -#endif int16_t ch; -#ifdef SBA_AND_OBJECTS AUDIO_CONFIG output_config; output_config = ( st_ivas->ivas_format == SBA_ISM_FORMAT ? st_ivas->hOutSetup.output_config : st_ivas->hDecoderConfig->output_config ); -#endif -#ifdef SBA_AND_OBJECTS -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP sba_ch_idx = 0; if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { @@ -438,24 +420,14 @@ ivas_error ivas_sba_upmixer_renderer( } for ( ch = 0; ch < ivas_get_nchan_buffers_dec( st_ivas ) - sba_ch_idx; ch++ ) -#else - for ( ch = 0; ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch++ ) -#endif -#else - for ( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) -#endif { output_f[ch] = output[ch]; } -#ifdef SBA_AND_OBJECTS 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, st_ivas->hoa_dec_mtx ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_sba_linear_renderer( output_f, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); -#endif } pop_wmops(); @@ -533,9 +505,7 @@ 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 */ const int16_t nchan_in, /* i : number of input ambisonics channels */ -#ifdef SBA_AND_OBJECTS const int16_t nchan_ism, -#endif const AUDIO_CONFIG output_config, /* i : output audio configuration */ const IVAS_OUTPUT_SETUP output_setup, /* i : output format setup */ const float hoa_dec_mtx[] /* i : HOA decoding mtx */ @@ -604,7 +574,6 @@ ivas_error ivas_sba_linear_renderer( set_zero( output_f[i], output_frame ); } break; -#ifdef SBA_AND_OBJECTS case AUDIO_CONFIG_EXTERNAL: for ( i = output_setup.nchan_out_woLFE - 1; i >= nchan_ism; i-- ) { @@ -615,7 +584,6 @@ ivas_error ivas_sba_linear_renderer( set_zero( output_f[i], output_frame ); } break; -#endif default: return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: illegal output configuration, Exiting.\n" ); } @@ -631,12 +599,8 @@ ivas_error ivas_sba_linear_renderer( *-------------------------------------------------------------------*/ void ivas_sba_mix_matrix_determiner( - SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: transport/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: transport/output audio channels */ -#endif + SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ + float *output[], /* i/o: transport/output audio channels */ const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame, /* i : output frame length */ diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c old mode 100755 new mode 100644 index 2a78d742b309297e64917418e9e9e80a866d0328..945a93858ac15f9e0684ab815bcb0aa870e2d7bf --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -52,13 +52,9 @@ *--------------------------------------------------------------------------*/ ivas_error ivas_sce_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t sce_id, /* i : SCE # identifier */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[1], /* o : output synthesis signal */ -#else - float output[1][L_FRAME48k], /* o : output synthesis signal */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int16_t sce_id, /* i : SCE # identifier */ + float *output[1], /* o : output synthesis signal */ const int16_t output_frame, /* i : output frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ) @@ -157,24 +153,18 @@ ivas_error ivas_sce_dec( if ( ( st_ivas->hQMetaData != NULL ) && ( st_ivas->ivas_format != SBA_FORMAT ) ) { -#ifdef MASA_AND_OBJECTS if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { st->bits_frame_nominal = (int16_t) ( ( hSCE->element_brate / FRAMES_PER_SEC ) - ISM_NB_BITS_METADATA_NOMINAL ); } else if ( ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) -#endif { st->bits_frame_nominal = (int16_t) ( hSCE->element_brate / FRAMES_PER_SEC ); } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ism_mode == ISM_MODE_NONE && st_ivas->ivas_format == SBA_ISM_FORMAT ) { st->bits_frame_nominal = (int16_t) ( st_ivas->hSpar->core_nominal_brate / FRAMES_PER_SEC ); } -#endif else { st->bits_frame_nominal = st_ivas->hQMetaData->bits_frame_nominal; @@ -204,11 +194,7 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } -#ifdef MASA_AND_OBJECTS else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ -#else - else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ -#endif { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } @@ -217,13 +203,9 @@ ivas_error ivas_sce_dec( * Core codec configuration *----------------------------------------------------------------*/ -/* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ -#ifdef MASA_AND_OBJECTS + /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) -#else - if ( st_ivas->ivas_format == ISM_FORMAT && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) -#endif { st->flag_ACELP16k = 0; } @@ -320,14 +302,12 @@ ivas_error ivas_sce_dec( dbgwrite( output, sizeof( float ), output_frame, 1, fname( debug_dir, "output.sce", 0, sce_id, DEC ) ); -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) { tmpF = 0; dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.cpe", 0, sce_id, DEC ) ); dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, sce_id, DEC ) ); } -#endif } } #endif @@ -390,11 +370,7 @@ ivas_error create_sce_dec( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; st->is_ism_format = 0; -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == ISM_FORMAT ) -#endif { st->is_ism_format = 1; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c old mode 100755 new mode 100644 index 5ff94a0f15590ec2f54c81760f079ee3f45eae40..f5131535a5166116dd18eb9c3fc38f78b64dad22 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -320,47 +320,30 @@ ivas_error ivas_spar_dec( bit_stream_orig = st0->bit_stream; next_bit_pos_orig = st0->next_bit_pos; -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { -#ifndef SBA_AND_OBJECTS - last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ); - /* the number of objects was read */ - last_bit_pos -= NO_BITS_MASA_ISM_NO_OBJ; - *nb_bits_read += NO_BITS_MASA_ISM_NO_OBJ; -#else last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ) - nb_bits_read[1]; -#endif } else { *nb_bits_read = 0; last_bit_pos = 0; } -#endif /* read DirAC bitstream */ if ( st_ivas->hQMetaData != NULL ) { -#ifdef SBA_AND_OBJECTS ivas_dirac_dec_read_BS( hDecoderConfig->ivas_total_brate, st0, st_ivas->hDirAC, st_ivas->hSpatParamRendCom, st_ivas->hQMetaData, nb_bits_read, last_bit_pos, ivas_get_hodirac_flag( hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ), st_ivas->hSpar->dirac_to_spar_md_bands ); -#else - ivas_dirac_dec_read_BS( hDecoderConfig->ivas_total_brate, st0, st_ivas->hDirAC, st_ivas->hSpatParamRendCom, st_ivas->hQMetaData, nb_bits_read, ivas_get_hodirac_flag( hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ), st_ivas->hSpar->dirac_to_spar_md_bands ); -#endif } -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ) - nb_bits_read[1]; } else { -#endif last_bit_pos = (int16_t) ( ( hDecoderConfig->ivas_total_brate / FRAMES_PER_SEC ) - 1 ); -#ifdef SBA_AND_OBJECTS } -#endif if ( !st0->bfi && hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) { last_bit_pos -= SID_FORMAT_NBITS; @@ -1124,12 +1107,8 @@ static void ivas_spar_calc_smooth_facs( *-------------------------------------------------------------------*/ void ivas_spar_dec_agc_pca( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: input/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: input/output audio channels */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output[], /* i/o: input/output audio channels */ const int16_t output_frame /* i : output frame length */ ) { @@ -1336,12 +1315,8 @@ void ivas_spar_dec_digest_tc( *-------------------------------------------------------------------*/ void ivas_spar_dec_upmixer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: input/output audio channels */ -#else - float output[][L_FRAME48k], /* i/o: input/output audio channels */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output[], /* i/o: input/output audio channels */ const int16_t nchan_internal, /* i : number of internal channels */ const int16_t output_frame /* i : output frame length */ ) @@ -1362,11 +1337,7 @@ void ivas_spar_dec_upmixer( for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP output_f_local[n] = output[n]; -#else - output_f_local[n] = &output[n][0]; -#endif } for ( n = 0; n < nchan_internal; n++ ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 8c920b781f30b752aff1b5ecfcb02271d97c6799..d6167f57085c5e5ec20a7a3020413b2d7ef82fcd 100755 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -722,9 +722,7 @@ typedef struct cpe_dec_data_structure float old_out_mdct[STEREO_MDCT2DFT_FADE_LEN_48k]; float old_outLB_mdct[2 * STEREO_MDCT2DFT_FADE_LEN_48k]; -#ifdef MASA_AND_OBJECTS int32_t brate_surplus; /* bitrate surplus for bitrate adaptation in combined format coding */ -#endif } CPE_DEC_DATA, *CPE_DEC_HANDLE; @@ -786,9 +784,7 @@ typedef struct renderer_struct { float prev_gains[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS]; float *interpolator; -#ifdef MASA_AND_OBJECTS int16_t interpolator_length; -#endif float gains[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS]; } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; @@ -854,7 +850,6 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; -#ifdef MASA_AND_OBJECTS /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure { @@ -886,7 +881,6 @@ typedef struct ivas_masa_ism_data_structure int16_t delayBuffer_nchan; } MASA_ISM_DATA, *MASA_ISM_DATA_HANDLE; -#endif /*----------------------------------------------------------------------------------* @@ -1001,9 +995,7 @@ typedef struct Decoder_Struct DECODER_CONFIG_HANDLE hDecoderConfig; /* Decoder configuration structure */ IVAS_FORMAT ivas_format; /* IVAS format */ -#ifdef MASA_AND_OBJECTS IVAS_FORMAT last_ivas_format; /* last frame IVAS format */ -#endif int16_t sid_format; /* IVAS format indicator from SID frame */ int16_t nchan_transport; /* number of transport channels */ IVAS_OUTPUT_SETUP hOutSetup; /* output setup structure */ @@ -1027,9 +1019,7 @@ typedef struct Decoder_Struct float **mem_hp20_out; /* output signals HP filter memories */ IVAS_LIMITER_HANDLE hLimiter; /* Limiter handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *p_output_f[MAX_OUTPUT_CHANNELS+MAX_NUM_OBJECTS]; /* floating-point output audio buffers */ -#endif /* core-decoder modules */ int16_t nSCE; /* number of total SCEs */ @@ -1088,13 +1078,9 @@ typedef struct Decoder_Struct COMBINED_ORIENTATION_HANDLE hCombinedOrientationData; /* Combined external and head orientation data structure */ DIRAC_REND_HANDLE hDirACRend; /* DirAC renderer handle */ SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; /* Spatial parametric (DirAC rend, ParamBin, ParamISM) rendering common data handle. */ -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS MASA_ISM_DATA_HANDLE hMasaIsmData; -#endif -#ifdef MASA_AND_OBJECTS int16_t flag_omasa_brate; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_DEC_SPLIT_REND_WRAPPER hSplitBinRend; /* split binuaral rendering handle */ diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 598b5fd08b09f47df14b9c97cf1bfee88f642e0f..276081237bc13b7ab89d659afc6cc37bb37ab38a 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -744,14 +744,10 @@ void stereo_cng_dec_update( *-------------------------------------------------------------------*/ void stereo_cng_compute_PScorr( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[CPE_CHANNELS], /* i : Output signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i : Output signal */ -#endif - float *c_PS_LT, /* i/o: Correlation */ - const int16_t L_frame_0, /* i : L_frame channel 0 */ - const int16_t L_frame_1 /* i : L_frame channel 1 */ + float *c_PS_LT, /* i/o: Correlation */ + const int16_t L_frame_0, /* i : L_frame channel 0 */ + const int16_t L_frame_1 /* i : L_frame channel 1 */ ) { int16_t i; @@ -804,14 +800,10 @@ void stereo_cng_compute_PScorr( *-------------------------------------------------------------------*/ static void stereo_cng_compute_LRcorr( - CPE_DEC_HANDLE hCPE, /* i/o: CPE handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + CPE_DEC_HANDLE hCPE, /* i/o: CPE handle */ float *output[CPE_CHANNELS], /* i : Output signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i : Output signal */ -#endif - const int16_t output_frame, /* i : Output frame length */ - const int16_t tdm_ratio_idx /* i : TDM ratio index */ + const int16_t output_frame, /* i : Output frame length */ + const int16_t tdm_ratio_idx /* i : TDM ratio index */ ) { int16_t i; @@ -897,14 +889,10 @@ static void FindEmEs( *-------------------------------------------------------------------*/ void stereo_cna_update_params( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ float *output[CPE_CHANNELS], /* i : Output signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i : Output signal */ -#endif - const int16_t output_frame, /* i : Output frame length */ - const int16_t tdm_ratio_idx /* i : TDM ratio index */ + const int16_t output_frame, /* i : Output frame length */ + const int16_t tdm_ratio_idx /* i : TDM ratio index */ ) { int16_t i; diff --git a/lib_dec/ivas_stereo_ica_dec.c b/lib_dec/ivas_stereo_ica_dec.c index 461611c87c2e97158dc5e61a65bbfb729a0d01bb..e5c6c00b0a5683cf5a016ed6accfae28e077b592 100644 --- a/lib_dec/ivas_stereo_ica_dec.c +++ b/lib_dec/ivas_stereo_ica_dec.c @@ -54,13 +54,9 @@ * ---------------------------------------------------------------*/ void stereo_tca_dec( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ float *synth[CPE_CHANNELS], /* i/o: output synth */ -#else - float synth[CPE_CHANNELS][L_FRAME48k], /* i/o: output synth */ -#endif - const int16_t output_frame /* i : length of a frame per channel */ + const int16_t output_frame /* i : length of a frame per channel */ ) { /* Buffers, input Left and right channels @ input_Fs*/ @@ -270,12 +266,8 @@ void stereo_tca_dec( *-------------------------------------------------------------------*/ void stereo_tca_scale_R_channel( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output, /* i/o: output synthesis, R channel */ -#else - float output[L_FRAME48k], /* i/o: output synthesis, R channel */ -#endif + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + float *output, /* i/o: output synthesis, R channel */ const int16_t output_frame /* i : frame length */ ) { diff --git a/lib_dec/ivas_stereo_icbwe_dec.c b/lib_dec/ivas_stereo_icbwe_dec.c index d60dcef17caecf9e55775d8021a55c1dd5413173..2be60ffcba1ffa088554ee523c8148cf7f461e10 100644 --- a/lib_dec/ivas_stereo_icbwe_dec.c +++ b/lib_dec/ivas_stereo_icbwe_dec.c @@ -515,12 +515,8 @@ void stereo_icBWE_dec( *-------------------------------------------------------------------*/ void stereo_icBWE_decproc( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[CPE_CHANNELS], /* i/o: output synthesis */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis */ -#endif + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + float *output[CPE_CHANNELS], /* i/o: output synthesis */ float outputHB[CPE_CHANNELS][L_FRAME48k], /* i : HB synthesis */ const int16_t last_core, /* i : last core, primary channel */ const int16_t last_bwidth, /* i : last bandwidth */ diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index 2c541768e98470aca41642cf3a439a1c94e3ce00..74dafc3aeeae012025cfb6f9e33561a446671991 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -139,13 +139,9 @@ static void stereo_mdct_dec_stereo( *--------------------------------------------------------------------*/ void stereo_mdct_core_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *signal_out[CPE_CHANNELS], /* o : synthesis @internal_FS */ -#else - float signal_out[CPE_CHANNELS][L_FRAME48k], /* o : synthesis @internal_FS */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + float *signal_out[CPE_CHANNELS], /* o : synthesis @internal_FS */ float signal_outFB[CPE_CHANNELS][L_FRAME48k] /* o : synthesis @output_FS */ ) { @@ -219,11 +215,7 @@ void stereo_mdct_core_dec( set_s( ms_mask[1], 0, MAX_SFB ); initMdctStereoDecData( hCPE->hStereoMdct, sts[0]->igf, sts[0]->hIGFDec->igfData.igfInfo.grid, hCPE->element_brate, sts[0]->bwidth ); -#ifdef SBA_AND_OBJECTS hCPE->hStereoMdct->isSBAStereoMode = ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#else - hCPE->hStereoMdct->isSBAStereoMode = ( ( st_ivas->ivas_format == SBA_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#endif if ( !bfi ) { ivas_mdct_dec_side_bits_frame_channel( hCPE, param_lpc, p_param, hCPE->hCoreCoder[0], nTnsBitsTCX10, param, 0, 0 ); diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index 650cb827ce155b1cfc2e96b6db5dd4ce8a1438d1..2d2a40d21fbaacbe896e57c517ed57db117e897d 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -552,13 +552,9 @@ void synchonize_channels_mdct_sid( *-------------------------------------------------------------------*/ void updateBuffersForDmxMdctStereo( - CPE_DEC_HANDLE hCPE, /* i/o: CPE handle */ - const int16_t output_frame, /* i : output frame length */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[CPE_CHANNELS], /* i/o: decoder output */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: decoder output */ -#endif + CPE_DEC_HANDLE hCPE, /* i/o: CPE handle */ + const int16_t output_frame, /* i : output frame length */ + float *output[CPE_CHANNELS], /* i/o: decoder output */ float synth[CPE_CHANNELS][L_FRAME48k] /* i/o: decoder synthesis */ ) { @@ -638,13 +634,9 @@ void updateBuffersForDmxMdctStereo( *-------------------------------------------------------------------*/ void applyDmxMdctStereo( - const CPE_DEC_HANDLE hCPE, /* i : CPE handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + const CPE_DEC_HANDLE hCPE, /* i : CPE handle */ float *output[CPE_CHANNELS], /* i/o: core decoder output */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: core decoder output */ -#endif - const int16_t output_frame /* i : output frame length */ + const int16_t output_frame /* i : output frame length */ ) { int16_t crossfade_len, i; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 8b8a9b89de9f876261bb5c72941fbde9e887eb10..62ca749f405a258745496e5dcb629a30b8e30395 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -768,11 +768,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hCoreCoder[0]->bfi == 0 ) { st = hCPE->hCoreCoder[1]; -#ifdef MASA_AND_OBJECTS hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate + hCPE->brate_surplus, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + ( hCPE->brate_surplus / FRAMES_PER_SEC ) - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); -#else - hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); -#endif if ( hCPE->hStereoTD->tdm_LRTD_flag ) { @@ -880,11 +876,7 @@ ivas_error stereo_memory_dec( * Bitrate switching in MASA format *---------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && nchan_transport == 2 ) -#else - if ( ivas_format == MASA_FORMAT && nchan_transport == 2 ) -#endif { if ( hCPE->nchan_out == 1 ) { @@ -1016,13 +1008,9 @@ ivas_error stereo_memory_dec( *-------------------------------------------------------------------*/ void synchro_synthesis( - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: output synthesis signal */ -#endif + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ const int16_t output_frame, /* i : Number of samples */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ ) @@ -1798,13 +1786,9 @@ static float ncross_corr_self( #define DFT2TD_CORR_THRESH 0.9f void smooth_dft2td_transition( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ float *output[CPE_CHANNELS], /* i/o: synthesis @external Fs */ -#else - float output[CPE_CHANNELS][L_FRAME48k], /* i/o: synthesis @external Fs */ -#endif - const int16_t output_frame /* i : output frame lenght */ + const int16_t output_frame /* i : output frame lenght */ ) { Decoder_State **sts; diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 3b654960c18af14a7a869041da48af43b155a000..630129c474b4b37678ae4c69e1476959085dc70f 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -84,10 +84,8 @@ void stereo_td_init_dec( *-------------------------------------------------------------------*/ void tdm_configure_dec( -#ifdef MASA_AND_OBJECTS - const int16_t ivas_format, /* i : IVAS format */ - const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif + const int16_t ivas_format, /* i : IVAS format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ @@ -98,18 +96,14 @@ void tdm_configure_dec( int16_t tdm_tmp_SM_LRTD_flag; int16_t mod_ct, core, bits_offset; int16_t idx_LRTD_pri_side, tdm_inst_ratio_idx; -#ifdef MASA_AND_OBJECTS int32_t element_brate_adapt; int16_t bstr_last_pos; -#endif hStereoTD = hCPE->hStereoTD; sts = hCPE->hCoreCoder; -#ifdef MASA_AND_OBJECTS element_brate_adapt = hCPE->element_brate + hCPE->brate_surplus; bstr_last_pos = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); -#endif /*----------------------------------------------------------------* * Decode CoreCoder signaling @@ -136,11 +130,7 @@ void tdm_configure_dec( /* Get few parameters needed to decode the bitrate allocated to each channel */ /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ -#ifdef MASA_AND_OBJECTS sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); -#else - sts[1]->coder_type = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING ), TDM_SECONDARY_SIGNALLING ); -#endif /* Get the LRTD config flag: 1 = LRTD configuration, favor closer bitrate per channel; 0 = Pri/Sec configuration, bitrates linked wrt. the mono */ @@ -168,31 +158,19 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ /* Get the correlation ratio */ -#ifdef MASA_AND_OBJECTS *tdm_ratio_idx = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); -#else - *tdm_ratio_idx = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); -#endif hStereoTD->tdm_use_IAWB_Ave_lpc = 0; if ( sts[1]->coder_type == INACTIVE ) { /* Get the flag on the LPC reusage type (primary channel of ave LPC */ -#ifdef MASA_AND_OBJECTS hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); -#else - hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); -#endif hStereoTD->tdm_lp_reuse_flag = 1; } else { /* Get the flag on the LPC reusage */ -#ifdef MASA_AND_OBJECTS hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); -#else - hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); -#endif } sts[0]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; /* the flag was already read in function stereo_memory_dec() */ @@ -248,11 +226,7 @@ void tdm_configure_dec( int16_t tmpS = 20; if ( hStereoTD->tdm_LRTD_flag == 0 ) { -#ifdef MASA_AND_OBJECTS tmpS = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); -#else - tmpS = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); -#endif } hCPE->hStereoDftDmx->targetGain = usdequant( tmpS, STEREO_TCA_GDMIN, STEREO_TCA_GDSTEP ); hCPE->hStereoDftDmx->targetGain = powf( 10, hCPE->hStereoDftDmx->targetGain ); @@ -261,15 +235,9 @@ void tdm_configure_dec( { if ( hStereoTD->tdm_LRTD_flag == 0 ) { -#ifdef MASA_AND_OBJECTS hCPE->hStereoTCA->refChanIndx = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS, STEREO_BITS_TCA_CHAN ); hCPE->hStereoTCA->indx_ica_NCShift = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN, STEREO_BITS_TCA_CORRSTATS ); hCPE->hStereoTCA->indx_ica_gD = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); -#else - hCPE->hStereoTCA->refChanIndx = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS ), STEREO_BITS_TCA_CHAN ); - hCPE->hStereoTCA->indx_ica_NCShift = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN ), STEREO_BITS_TCA_CORRSTATS ); - hCPE->hStereoTCA->indx_ica_gD = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); -#endif } else { @@ -289,11 +257,7 @@ void tdm_configure_dec( #endif /* set the BW of the secondary channel */ -#ifdef MASA_AND_OBJECTS if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel >= IVAS_16k4 / FRAMES_PER_SEC ) -#else - if ( hStereoTD->tdm_LRTD_flag && hCPE->element_brate > IVAS_13k2 ) -#endif { /* set BW of the secondary channel in LRTD stereo mode as the BW of the primary channel at higher bitrates */ sts[1]->bwidth = sts[0]->bwidth; @@ -308,16 +272,12 @@ void tdm_configure_dec( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS tdm_bit_alloc( ivas_format, ism_mode, hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); -#else - tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); -#endif return; } diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index 060fb130742907e8aff745deb6afdb1db8122caf..4098c62763774822c1162b0718e8f6d056520eaf 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -141,11 +141,7 @@ static enum VirtualSpeakerNodeType check_need_of_virtual_speaker_node( VBAP_HAND static int16_t determine_best_triplet_and_gains( VBAP_SEARCH_STRUCT *search_struct, const float panning_unit_vec[3], const int16_t azi_deg, float gains[3] ); -#ifdef MASA_AND_OBJECTS static void determine_virtual_speaker_node_division_gains( const int16_t virtual_speaker_node_index, float *virtual_node_division_gains, int16_t connections[][2], const enum VirtualSpeakerNodeType type, const int16_t max_num_connections, const int16_t num_speaker_nodes, const int16_t use_object_mode ); -#else -static void determine_virtual_speaker_node_division_gains( const int16_t virtual_speaker_node_index, float *virtual_node_division_gains, int16_t connections[][2], const enum VirtualSpeakerNodeType type, const int16_t max_num_connections, const int16_t num_speaker_nodes ); -#endif static void reorder_triplets( VBAP_VS_TRIPLET *triplets, const int16_t *target_order, const int16_t num_triplets ); @@ -161,10 +157,8 @@ ivas_error vbap_init_data( const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ -#ifdef MASA_AND_OBJECTS , const IVAS_FORMAT ivas_format /* i : IVAS format */ -#endif ) { /* Variables */ @@ -215,11 +209,9 @@ ivas_error vbap_init_data( vbap->bottom_virtual_speaker_node_division_gains = NULL; vbap->top_virtual_speaker_node_division_gains = NULL; vbap->back_virtual_speaker_node_division_gains = NULL; -#ifdef MASA_AND_OBJECTS vbap->object_mode_bottom_virtual_speaker_node_division_gains = NULL; vbap->object_mode_top_virtual_speaker_node_division_gains = NULL; vbap->object_mode_back_virtual_speaker_node_division_gains = NULL; -#endif vbap->num_speaker_nodes = num_speaker_nodes; vbap->num_speaker_nodes_internal = num_speaker_nodes; @@ -243,7 +235,6 @@ ivas_error vbap_init_data( set_zero( vbap->bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->bottom_virtual_speaker_node_division_gains != NULL; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { if ( ( vbap->object_mode_bottom_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) @@ -253,7 +244,6 @@ ivas_error vbap_init_data( set_zero( vbap->object_mode_bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->object_mode_bottom_virtual_speaker_node_division_gains != NULL; } -#endif speaker_node_azi_deg_internal[vbap->bottom_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->bottom_virtual_speaker_node_index] = -90.0f; @@ -268,7 +258,6 @@ ivas_error vbap_init_data( set_zero( vbap->top_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->top_virtual_speaker_node_division_gains != NULL; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { if ( ( vbap->object_mode_top_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) @@ -278,7 +267,6 @@ ivas_error vbap_init_data( set_zero( vbap->object_mode_top_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->object_mode_top_virtual_speaker_node_division_gains != NULL; } -#endif speaker_node_azi_deg_internal[vbap->top_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->top_virtual_speaker_node_index] = 90.0f; @@ -293,7 +281,6 @@ ivas_error vbap_init_data( set_zero( vbap->back_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->back_virtual_speaker_node_division_gains != NULL; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { if ( ( vbap->object_mode_back_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) @@ -303,7 +290,6 @@ ivas_error vbap_init_data( set_zero( vbap->object_mode_back_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->object_mode_back_virtual_speaker_node_division_gains != NULL; } -#endif speaker_node_azi_deg_internal[vbap->back_virtual_speaker_node_index] = 180.0f; speaker_node_ele_deg_internal[vbap->back_virtual_speaker_node_index] = 0.0f; } @@ -393,7 +379,6 @@ ivas_error vbap_init_data( /* Determine how the virtual node gains should be distributed to real nodes, if necessary (checked within function). */ if ( is_success ) { -#ifdef MASA_AND_OBJECTS determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->top_virtual_speaker_node_division_gains, connections, virtual_top_type, max_num_connections, num_speaker_nodes, 0 ); determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type, max_num_connections, num_speaker_nodes, 0 ); determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes, 0 ); @@ -403,13 +388,6 @@ ivas_error vbap_init_data( determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->object_mode_bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->object_mode_back_virtual_speaker_node_division_gains, connections, virtual_back_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); } -#else - determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->top_virtual_speaker_node_division_gains, connections, virtual_top_type, max_num_connections, num_speaker_nodes ); - - determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type, max_num_connections, num_speaker_nodes ); - - determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes ); -#endif } pop_wmops(); @@ -454,7 +432,6 @@ void vbap_free_data( { free( ( *hVBAPdata )->back_virtual_speaker_node_division_gains ); } -#ifdef MASA_AND_OBJECTS if ( ( *hVBAPdata )->object_mode_bottom_virtual_speaker_node_division_gains != NULL ) { free( ( *hVBAPdata )->object_mode_bottom_virtual_speaker_node_division_gains ); @@ -467,7 +444,6 @@ void vbap_free_data( { free( ( *hVBAPdata )->object_mode_back_virtual_speaker_node_division_gains ); } -#endif if ( ( *hVBAPdata )->search_struct[0].triplets != NULL ) { free( ( *hVBAPdata )->search_struct[0].triplets ); @@ -495,10 +471,8 @@ void vbap_determine_gains( float *gains, /* o : gain vector for loudspeakers for given direction */ const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left)*/ const int16_t ele_deg /* i : elevation in degrees for panning direction (positive up)*/ -#ifdef MASA_AND_OBJECTS , const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ -#endif ) { /* This function formulates gains for the given angle. The triplet-selection has been pre-formulated. */ @@ -532,7 +506,6 @@ void vbap_determine_gains( bottom_virtual_speaker_node_index = hVBAPdata->bottom_virtual_speaker_node_index; top_virtual_speaker_node_index = hVBAPdata->top_virtual_speaker_node_index; back_virtual_speaker_node_index = hVBAPdata->back_virtual_speaker_node_index; -#ifdef MASA_AND_OBJECTS if ( use_object_mode ) { bottom_virtual_speaker_node_division_gains = hVBAPdata->object_mode_bottom_virtual_speaker_node_division_gains; @@ -545,11 +518,6 @@ void vbap_determine_gains( top_virtual_speaker_node_division_gains = hVBAPdata->top_virtual_speaker_node_division_gains; back_virtual_speaker_node_division_gains = hVBAPdata->back_virtual_speaker_node_division_gains; } -#else - bottom_virtual_speaker_node_division_gains = hVBAPdata->bottom_virtual_speaker_node_division_gains; - top_virtual_speaker_node_division_gains = hVBAPdata->top_virtual_speaker_node_division_gains; - back_virtual_speaker_node_division_gains = hVBAPdata->back_virtual_speaker_node_division_gains; -#endif panning_wrap_angles( (float) azi_deg, (float) ele_deg, &azi_temp, &ele_temp ); azi_rad = azi_temp * PI_OVER_180; @@ -798,10 +766,8 @@ static void determine_virtual_speaker_node_division_gains( const enum VirtualSpeakerNodeType type, /* i : virtual speaker node typel */ const int16_t max_num_connections, /* i : max number of connections */ const int16_t num_speaker_nodes /* i : max number of speaker nodes */ -#ifdef MASA_AND_OBJECTS , const int16_t use_object_mode /* i : use VBAP in object panning mode vs. spatial panning mode */ -#endif ) { /* When node type is VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, the gains of the virtual node @@ -844,12 +810,10 @@ static void determine_virtual_speaker_node_division_gains( for ( ch = 0; ch < num_speaker_nodes; ch++ ) { virtual_node_division_gains[ch] /= sum_val; -#ifdef MASA_AND_OBJECTS if ( use_object_mode ) { virtual_node_division_gains[ch] = powf( virtual_node_division_gains[ch], 0.8f ); } -#endif } } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 78c8aecf942d0ceb6b904f7ae813d1dab16f4663..f790be3f0b83f16ae2a92c1f886b2c2411f7ef37 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -206,8 +206,6 @@ ivas_error IVAS_DEC_Open( st_ivas->sba_planar = 0; st_ivas->sba_analysis_order = 0; -#ifdef MASA_AND_OBJECTS -#endif return IVAS_ERR_OK; } @@ -304,16 +302,12 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( return IVAS_DEC_BS_MC; case SBA_FORMAT: return IVAS_DEC_BS_SBA; -#ifdef SBA_AND_OBJECTS case SBA_ISM_FORMAT: return IVAS_DEC_BS_SBA_ISM; -#endif case MASA_FORMAT: return IVAS_DEC_BS_MASA; -#ifdef MASA_AND_OBJECTS case MASA_ISM_FORMAT: return IVAS_DEC_BS_MASA_ISM; -#endif default: break; } @@ -915,20 +909,9 @@ ivas_error IVAS_DEC_GetNumObjects( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT -#ifdef SBA_AND_OBJECTS - || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT -#endif -#ifdef MASA_AND_OBJECTS - || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT -#endif - ) + if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS *numObjects = hIvasDec->st_ivas->nchan_ism; -#else - *numObjects = hIvasDec->st_ivas->hDecoderConfig->nchan_out; -#endif } else { @@ -1010,23 +993,12 @@ ivas_error IVAS_DEC_GetObjectMetadata( } st_ivas = hIvasDec->st_ivas; - if ( st_ivas->ivas_format != ISM_FORMAT -#ifdef MASA_AND_OBJECTS - && st_ivas->ivas_format != MASA_ISM_FORMAT -#endif -#ifdef SBA_AND_OBJECTS - && st_ivas->ivas_format != SBA_ISM_FORMAT -#endif - ) + if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) { return IVAS_ERR_WRONG_MODE; } -#if defined SBA_AND_OBJECTS || defined MASA_AND_OBJECTS if ( objectIdx >= st_ivas->nchan_ism ) -#else - if ( objectIdx >= st_ivas->hDecoderConfig->nchan_out ) -#endif { return IVAS_ERR_INVALID_INDEX; } @@ -1077,11 +1049,7 @@ ivas_error IVAS_DEC_GetMasaMetadata( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef MASA_AND_OBJECTS if ( hIvasDec->st_ivas->ivas_format != MASA_FORMAT && hIvasDec->st_ivas->ivas_format != MASA_ISM_FORMAT ) -#else - if ( hIvasDec->st_ivas->ivas_format != MASA_FORMAT ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -2572,21 +2540,15 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "Input configuration: Scene Based Audio, Ambisonic order %i%s, %d transport channel(s)\n", st_ivas->sba_order, st_ivas->sba_planar ? " (Planar)" : "", st_ivas->nchan_transport ); } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { fprintf( stdout, "Input configuration: Combined Scene Based Audio, Ambisonic order %i, with %d Objects \n", st_ivas->sba_order, st_ivas->nchan_ism ); } -#endif else if ( st_ivas->ivas_format == MASA_FORMAT ) { fprintf( stdout, "Input configuration: MASA - %d channel(s)\n", st_ivas->nchan_transport ); } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MC_FORMAT ) -#else - else /* MC_FORMAT */ -#endif { if ( ( error = get_channel_config( st_ivas->transport_config, &config_str[0] ) ) != IVAS_ERR_OK ) { @@ -2595,12 +2557,10 @@ static ivas_error printConfigInfo_dec( fprintf( stdout, "Input configuration: %s\n", config_str ); } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { fprintf( stdout, "Input configuration: combined ISM and MASA (%i ISM stream(s)) \n", st_ivas->nchan_ism ); } -#endif } get_channel_config( st_ivas->hDecoderConfig->output_config, &config_str[0] ); diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 535379201d3f285ff8e8958c23c07e5da828dc80..623603b6c342f8c57425f573f9ff38eeffa5c36a 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -89,14 +89,10 @@ typedef enum _IVAS_DEC_BS_FORMAT IVAS_DEC_BS_STEREO, IVAS_DEC_BS_MC, IVAS_DEC_BS_SBA, -#ifdef SBA_AND_OBJECTS IVAS_DEC_BS_SBA_ISM, -#endif IVAS_DEC_BS_OBJ, IVAS_DEC_BS_MASA, -#ifdef MASA_AND_OBJECTS IVAS_DEC_BS_MASA_ISM, -#endif IVAS_DEC_BS_UNKOWN = 0xffff } IVAS_DEC_BS_FORMAT; diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 15e2c267fba3737bebada4886128456dc4768447..3fdb704672ce3702de794eef9829a6a96397b87f 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -102,9 +102,7 @@ ivas_error ivas_core_enc( float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; -#ifdef MASA_AND_OBJECTS int16_t diff_nBits; -#endif ivas_error error; int16_t max_num_indices_BWE; @@ -191,7 +189,6 @@ ivas_error ivas_core_enc( } } -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ @@ -201,7 +198,6 @@ ivas_error ivas_core_enc( { ivas_combined_format_brate_sanity( hCPE->element_brate, sts[0]->core, &( sts[0]->core_brate ), &diff_nBits ); } -#endif /*---------------------------------------------------------------------* * Core Encoding @@ -436,7 +432,6 @@ ivas_error ivas_core_enc( } } -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Write potentially unused bits in combined format coding *-----------------------------------------------------------------*/ @@ -450,7 +445,6 @@ ivas_error ivas_core_enc( diff_nBits -= n; } } -#endif #ifdef DEBUG_MODE_INFO for ( n = 0; n < n_CoreChannels; n++ ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index ee2406bdcdb08135c82d9d03ce7c9e673d9e468e..153d85e4f2383fbdb90f42a79202274813efae04 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -271,22 +271,14 @@ ivas_error ivas_corecoder_enc_reconfig( } /* propagate input audio buffers */ -#ifdef MASA_AND_OBJECTS if ( n_CoreCoder_existing > sce_id && hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) -#else - if ( n_CoreCoder_existing > sce_id ) -#endif { mvr2r( input_buff[sce_id], st_ivas->hSCE[sce_id]->hCoreCoder[0]->input_buff, len_inp_memory ); } /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ -#ifdef MASA_AND_OBJECTS if ( sce_id > 0 || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) -#else - if ( sce_id > 0 ) -#endif { reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->nb_ind_tot ); @@ -311,13 +303,9 @@ ivas_error ivas_corecoder_enc_reconfig( copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 ); st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef MASA_AND_OBJECTS if ( ( cpe_id * CPE_CHANNELS + n > 0 ) || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) || ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 ) ) -#else - if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) -#endif { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->nb_ind_tot ); @@ -532,11 +520,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct->mdct_stereo_mode_cmdl = hEncoderConfig->stereo_mode_cmdl; #endif initMdctStereoEncData( st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct, hEncoderConfig->ivas_format, st_ivas->hCPE[st_ivas->nCPE - 1]->element_mode, st_ivas->hCPE[st_ivas->nCPE - 1]->element_brate, hEncoderConfig->max_bwidth, 0, NULL, 1 ); -#ifdef OSBA_BR_SWITCHING st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct->isSBAStereoMode = ( ( hEncoderConfig->ivas_format == SBA_FORMAT || hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#else - st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct->isSBAStereoMode = ( ( hEncoderConfig->ivas_format == SBA_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#endif } } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 0ef6072187f5dd5da9119a7ffee0c6247398b3a5..cae911900082b45a6e3e4bf815fbf92f15311b04 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -45,13 +45,11 @@ #include "wmc_auto.h" -#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------------------* * Local function prototypes *--------------------------------------------------------------------------*/ static void stereo_mode_combined_format_enc( const Encoder_Struct *st_ivas, CPE_ENC_HANDLE hCPE ); -#endif /*-------------------------------------------------------------------* @@ -110,10 +108,8 @@ ivas_error ivas_cpe_enc( ENCODER_CONFIG_HANDLE hEncoderConfig; int32_t ivas_total_brate; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t cpe_brate; int32_t element_brate_ref; -#endif error = IVAS_ERR_OK; @@ -126,9 +122,7 @@ ivas_error ivas_cpe_enc( ivas_format = hEncoderConfig->ivas_format; input_Fs = hEncoderConfig->input_Fs; ivas_total_brate = hEncoderConfig->ivas_total_brate; -#ifdef MASA_AND_OBJECTS element_brate_ref = hCPE->element_brate; -#endif /*------------------------------------------------------------------* * Initialization - general @@ -184,9 +178,7 @@ ivas_error ivas_cpe_enc( hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } -#ifdef MASA_AND_OBJECTS stereo_mode_combined_format_enc( st_ivas, hCPE ); -#endif if ( ( error = front_vad( hCPE, NULL, hEncoderConfig, &hCPE->hFrontVad[0], st_ivas->hMCT != NULL, input_frame, vad_flag_dtx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, vad_hover_flag, band_energies_LR, NULL, NULL ) ) != IVAS_ERR_OK ) { @@ -289,25 +281,19 @@ ivas_error ivas_cpe_enc( if ( hCPE->element_mode != IVAS_CPE_MDCT && ( hCPE->element_brate != hCPE->last_element_brate || hCPE->last_element_mode != hCPE->element_mode || sts[0]->ini_frame == 0 || -#ifdef MASA_AND_OBJECTS ( ivas_total_brate != st_ivas->hEncoderConfig->last_ivas_total_brate ) || -#endif sts[0]->last_core_brate <= SID_2k40 ) ) /* If the last frame was SID or NO_DATA, we need to run stereo_dft_config here since VAD decision is not known yet */ { if ( st_ivas->hQMetaData != NULL ) { -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.70f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } else { -#endif stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); -#ifdef MASA_AND_OBJECTS } -#endif } else { @@ -331,7 +317,6 @@ ivas_error ivas_cpe_enc( if ( hCPE->element_mode == IVAS_CPE_MDCT ) { -#ifdef MASA_AND_OBJECTS /* compute bit-rate surplus per channel in combined format coding */ int32_t brate_surplus[CPE_CHANNELS]; if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -339,7 +324,6 @@ ivas_error ivas_cpe_enc( brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; } -#endif /* this is just for initialization, the true values of "total_brate" and "bits_frame_channel" are set later */ for ( n = 0; n < n_CoreChannels; n++ ) @@ -358,14 +342,12 @@ ivas_error ivas_cpe_enc( sts[n]->bits_frame_channel = (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) / n_CoreChannels ); sts[n]->total_brate = hCPE->element_brate / n_CoreChannels; -#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); sts[n]->total_brate += brate_surplus[n]; } -#endif } } @@ -376,11 +358,7 @@ ivas_error ivas_cpe_enc( hCPE->hStereoMdct->mdct_stereo_mode_cmdl = hEncoderConfig->mdct_stereo_mode_cmdl; #endif initMdctStereoEncData( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, max_bwidth, 0, NULL, 0 ); -#ifdef SBA_AND_OBJECTS hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#else - hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#endif } } @@ -417,9 +395,7 @@ ivas_error ivas_cpe_enc( { /* Determine the energy ratio between the 2 channels */ tdm_ratio_idx = stereo_tdm_ener_analysis( -#ifdef MASA_AND_OBJECTS ivas_format, -#endif hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM ); /* Compute the downmix signal based on the ratio index */ @@ -428,9 +404,7 @@ ivas_error ivas_cpe_enc( /* signal the bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); -#ifdef MASA_AND_OBJECTS sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); -#endif if ( st_ivas->hQMetaData != NULL ) { sts[1]->bits_frame_channel -= st_ivas->hQMetaData->metadata_max_bits; @@ -555,11 +529,7 @@ ivas_error ivas_cpe_enc( if ( sts[0]->bwidth != sts[0]->last_bwidth || ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->last_element_mode != hCPE->element_mode ) && sts[0]->bwidth != sts[0]->max_bwidth ) ) { initMdctStereoEncData( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, sts[0]->bwidth, 0, NULL, 0 ); -#ifdef SBA_AND_OBJECTS hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#else - hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#endif if ( hCPE->element_brate <= MAX_MDCT_ITD_BRATE && ivas_format == STEREO_FORMAT ) { @@ -590,10 +560,8 @@ ivas_error ivas_cpe_enc( tdm_ol_pitch_comparison( hCPE, pitch_fr, voicing_fr ); tdm_configure_enc( -#ifdef MASA_AND_OBJECTS ivas_format, st_ivas->ism_mode, -#endif hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata ); if ( hEncoderConfig->Opt_DTX_ON ) @@ -626,9 +594,7 @@ ivas_error ivas_cpe_enc( * DFT Stereo parameters writing into the bitstream *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS cpe_brate = 0; -#endif if ( hCPE->element_mode == IVAS_CPE_DFT ) { if ( hEncoderConfig->Opt_DTX_ON ) @@ -657,7 +623,6 @@ ivas_error ivas_cpe_enc( } /* Write stereo bitstream */ -#ifdef MASA_AND_OBJECTS cpe_brate = st_ivas->hCPE[0]->element_brate; /* DFT stereo side bits */ @@ -686,26 +651,6 @@ ivas_error ivas_cpe_enc( stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, max_bits ); } -#else - if ( ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) - { - nb_bits = 0; /* Only mono downmix is transmitted in this case */ - } - else if ( ivas_format == MASA_FORMAT && ( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) - { - nb_bits = hCPE->hMetaData->nb_bits_tot; - } - else - { - stereo_dft_enc_write_BS( hCPE, &nb_bits ); - } - - if ( !( ivas_format == MASA_FORMAT && ( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) ) - { - /* Residual coding in MDCT domain */ - stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal - ( ( ivas_format == MASA_FORMAT ) ? nb_bits_metadata : 0 ) ) ); - } -#endif if ( sts[0]->core_brate == FRAME_NO_DATA || sts[0]->core_brate == SID_2k40 ) { assert( ( nb_bits <= ( ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS ) ) && "Stereo DFT CNG: bit budget is violated" ); @@ -721,13 +666,11 @@ ivas_error ivas_cpe_enc( /* subtract metadata bitbudget */ sts[0]->total_brate -= ( nb_bits_metadata * FRAMES_PER_SEC ); -#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ if ( 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 || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { sts[0]->total_brate += hCPE->brate_surplus; } -#endif } @@ -747,12 +690,10 @@ ivas_error ivas_cpe_enc( hCPE->last_element_brate = hCPE->element_brate; hCPE->last_element_mode = hCPE->element_mode; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { hCPE->element_brate = element_brate_ref; } -#endif if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->hStereoMdct != NULL && hCPE->hStereoMdct->hItd != NULL ) { @@ -887,9 +828,7 @@ ivas_error create_cpe_enc( hCPE->hFrontVad[0] = NULL; hCPE->hFrontVad[1] = NULL; -#ifdef MASA_AND_OBJECTS hCPE->brate_surplus = 0; -#endif /*-----------------------------------------------------------------* * Input memory buffer: allocate and initialize @@ -897,11 +836,7 @@ ivas_error create_cpe_enc( for ( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef MASA_AND_OBJECTS if ( ivas_format == STEREO_FORMAT || ivas_format == MASA_FORMAT || ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == STEREO_FORMAT || ivas_format == MASA_FORMAT || ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) -#endif { if ( ( hCPE->input_mem[n] = (float *) malloc( sizeof( float ) * NS2SA( input_Fs, STEREO_DFT_OVL_NS ) ) ) == NULL ) { @@ -966,12 +901,7 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; if ( ( error = init_encoder( st, st_ivas, n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, -#ifdef MASA_AND_OBJECTS - ISM_MODE_NONE -#else - st_ivas->ism_mode -#endif - ) ) != IVAS_ERR_OK ) + ISM_MODE_NONE ) ) != IVAS_ERR_OK ) { return error; } @@ -1096,11 +1026,7 @@ ivas_error create_cpe_enc( hCPE->hStereoMdct->mdct_stereo_mode_cmdl = st_ivas->hEncoderConfig->mdct_stereo_mode_cmdl; #endif initMdctStereoEncData( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, max_bwidth, 0, NULL, 1 ); -#ifdef SBA_AND_OBJECTS hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#else - hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); -#endif if ( hCPE->element_mode == IVAS_CPE_MDCT && element_brate <= MAX_MDCT_ITD_BRATE && ivas_format == STEREO_FORMAT ) { @@ -1213,7 +1139,6 @@ void destroy_cpe_enc( } -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------------- * stereo_mode_combined_format_enc() * @@ -1269,4 +1194,3 @@ static void stereo_mode_combined_format_enc( return; } -#endif diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index a30ae2774017ca0bbf2c6f40069b24dc37d5bb40..40c07944ecc492c446a9a543f5e807b26675f8dc 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -407,11 +407,7 @@ void ivas_signaling_enc( * Write element mode info *--------------------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS if ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ -#else - if ( st->element_mode >= IVAS_CPE_DFT && element_brate < MIN_BRATE_MDCT_STEREO && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ -#endif { ind = st->element_mode - IVAS_CPE_DFT; push_indice( hBstr, IND_SMODE, ind, NBITS_ELEMENT_MODE ); diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 915d1653138aa14747daa20fa21e6574b912ced0..3251e3040873d573045663768237b9b3c440f71f 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -287,17 +287,13 @@ void ivas_dirac_enc( DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i/o: SBA channels */ -#else - float data_f[][L_FRAME48k], /* i/o: SBA channels */ -#endif - float **ppIn_FR_real, /* o : real freq domain values */ - float **ppIn_FR_imag, /* o : imag freq domain values */ - const int16_t input_frame, /* i : input frame length */ - const int16_t dtx_vad, /* i : DTX vad flag */ - const IVAS_FORMAT ivas_format, /* i : ivas format */ - int16_t hodirac_flag ) /* i : hodirac flag */ + float *data_f[], /* i/o: SBA channels */ + float **ppIn_FR_real, /* o : real freq domain values */ + float **ppIn_FR_imag, /* o : imag freq domain values */ + const int16_t input_frame, /* i : input frame length */ + const int16_t dtx_vad, /* i : DTX vad flag */ + const IVAS_FORMAT ivas_format, /* i : ivas format */ + int16_t hodirac_flag ) /* i : hodirac flag */ { int16_t orig_dirac_bands; float dir[3], avg_dir[3]; @@ -599,11 +595,7 @@ void ivas_dirac_param_est_enc( DIRAC_ENC_HANDLE hDirAC, IVAS_QDIRECTION *q_direction, const uint8_t useLowerRes, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], -#else - float data_f[][L_FRAME48k], -#endif float **pp_fr_real, float **pp_fr_imag, const int16_t input_frame, @@ -662,11 +654,7 @@ void ivas_dirac_param_est_enc( /* Copy current frame to memory for delay compensation */ for ( i = 0; i < nchan_fb_in; i++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP pcm_in[i] = data_f[i]; -#else - pcm_in[i] = &data_f[i][0]; -#endif p_Cldfb_RealBuffer[i] = &Cldfb_RealBuffer[i][0]; p_Cldfb_ImagBuffer[i] = &Cldfb_ImagBuffer[i][0]; } diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 0fbc02585cc90dbf432c2e154624ccb9c52a1331..8096199382060275a91c8b75937c913e57536308 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -61,24 +61,8 @@ ivas_error ivas_enc( ENCODER_CONFIG_HANDLE hEncoderConfig; BSTR_ENC_HANDLE hMetaData; Encoder_State *st; /* used for bitstream handling */ -#ifdef MASA_AND_OBJECTS int16_t nb_bits_metadata[MAX_SCE + 1]; -#else - int16_t nb_bits_metadata[MAX_SCE]; -#endif -#ifdef SBA_AND_OBJECTS -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS]; -#else - float data_f[MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; -#endif -#else -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[MAX_INPUT_CHANNELS]; -#else - float data_f[MAX_INPUT_CHANNELS][L_FRAME48k]; -#endif -#endif int32_t ivas_total_brate; ivas_error error; error = IVAS_ERR_OK; @@ -99,22 +83,16 @@ ivas_error ivas_enc( input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); n_samples_chan = n_samples / nchan_inp; -#ifdef MASA_AND_OBJECTS set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); -#else - set_s( nb_bits_metadata, 0, MAX_SCE ); -#endif /*----------------------------------------------------------------* * convert 'short' input data to 'float' *----------------------------------------------------------------*/ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP for ( n = 0; n < MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { data_f[n] = st_ivas->p_data_f[n]; } -#endif n = 0; while ( n < nchan_inp ) @@ -204,12 +182,8 @@ ivas_error ivas_enc( ivas_param_ism_stereo_dmx( st_ivas, data_f, input_frame ); /* Core coding of Stereo DMX */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata -#ifdef MASA_AND_OBJECTS - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -217,12 +191,8 @@ ivas_error ivas_enc( else if ( st_ivas->ism_mode == ISM_MODE_DISC ) { /* Analysis, decision about bitrates per channel & core coding */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata -#ifdef MASA_AND_OBJECTS - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -263,12 +233,8 @@ ivas_error ivas_enc( return error; } if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, - ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 -#ifdef MASA_AND_OBJECTS - , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0, 0 -#endif - ) ) != IVAS_ERR_OK ) + ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, + ISM_MODE_NONE, -1, NULL, -1, NULL, 0, 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -309,14 +275,9 @@ ivas_error ivas_enc( } } } -#ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_separated_object; -#else - float data_separated_object[L_FRAME48k]; -#endif int16_t idx_separated_object; int16_t flag_omasa_ener_brate; @@ -339,9 +300,7 @@ ivas_error ivas_enc( set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); idx_separated_object = 0; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP data_separated_object = data_f[hEncoderConfig->nchan_ism + CPE_CHANNELS]; -#endif /* put audio object data in SCE's */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) @@ -407,29 +366,14 @@ ivas_error ivas_enc( return error; } } -#endif -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_ISM_FORMAT ) { -#ifdef SBA_AND_OBJECTS ivas_osba_enc_reconfig( st_ivas ); -#endif -#ifndef SBA_AND_OBJECTS - if ( st_ivas->ism_mode == ISM_MODE_NONE ) /*rendering of objects in SBA signal*/ - { -#endif - /* Analyze objects and determine needed audio signals */ - ivas_osba_enc( st_ivas->hOSba, st_ivas->hIsmMetaData, data_f, input_frame, hEncoderConfig->nchan_ism, st_ivas->ism_mode, st_ivas->sba_analysis_order -#ifdef SBA_AND_OBJECTS - , - hEncoderConfig->input_Fs -#endif - ); -#ifndef SBA_AND_OBJECTS - } -#endif + /* Analyze objects and determine needed audio signals */ + ivas_osba_enc( st_ivas->hOSba, st_ivas->hIsmMetaData, data_f, input_frame, hEncoderConfig->nchan_ism, st_ivas->ism_mode, st_ivas->sba_analysis_order, + hEncoderConfig->input_Fs ); if ( st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -496,7 +440,6 @@ ivas_error ivas_enc( n = hEncoderConfig->nchan_ism; st = st_ivas->hCPE[0]->hCoreCoder[0]; hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; -#ifdef SBA_AND_OBJECTS if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { @@ -508,7 +451,6 @@ ivas_error ivas_enc( { return error; } -#endif /* Write SBA planar flag */ push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); @@ -549,7 +491,6 @@ ivas_error ivas_enc( } } } -#endif else if ( ivas_format == MC_FORMAT ) { /* select MC format mode; write MC LS setup; reconfigure the MC format encoder */ @@ -620,11 +561,8 @@ ivas_error ivas_enc( ivas_mcmasa_enc( st_ivas->hMcMasa, st_ivas->hQMetaData, st_ivas->hMasa, data_f, input_frame, st_ivas->nchan_transport, nchan_inp ); - if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 -#ifdef MASA_AND_OBJECTS - , + if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1, ISM_MODE_NONE, -1, NULL, -1, NULL, 0, 0 -#endif ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 3b0fa49d7b226148ba54ef4b9dc2871db5edf2e5..4a870d5977fee90a1d6e8b9a7c7d47da0f23292f 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -37,9 +37,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_stat_enc.h" -#ifdef MASA_AND_OBJECTS #include "ivas_rom_com.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -86,7 +84,6 @@ void ivas_write_format( ind = 7; nBits += extra_bits; break; -#ifdef MASA_AND_OBJECTS case MASA_ISM_FORMAT: if ( st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -99,8 +96,6 @@ void ivas_write_format( nBits += extra_bits + IVAS_COMBINED_FORMAT_SIGNALLING_BITS; } break; -#endif -#ifdef SBA_AND_OBJECTS case SBA_ISM_FORMAT: if ( st_ivas->hEncoderConfig->ivas_total_brate < IVAS_24k4 ) { @@ -113,7 +108,6 @@ void ivas_write_format( nBits += extra_bits + IVAS_COMBINED_FORMAT_SIGNALLING_BITS; } break; -#endif default: assert( !"Invalid format. Aborting." ); break; @@ -233,18 +227,14 @@ int16_t getNumChanAnalysis( { n = st_ivas->hEncoderConfig->nchan_inp; } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { n = st_ivas->hEncoderConfig->nchan_inp; } -#endif -#ifdef SBA_AND_OBJECTS else if ( st_ivas->hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) { n = st_ivas->hEncoderConfig->nchan_ism + ( st_ivas->sba_analysis_order + 1 ) * ( st_ivas->sba_analysis_order + 1 ); } -#endif return n; } @@ -358,15 +348,11 @@ void ivas_initialize_handles_enc( /* LFE low pass filter handle */ st_ivas->hLfeLpf = NULL; -#ifdef MASA_AND_OBJECTS /* Object MASA handle */ st_ivas->hOMasa = NULL; -#endif -#ifdef SBA_AND_OBJECTS /* OSBA handle */ st_ivas->hOSba = NULL; -#endif return; } @@ -383,9 +369,7 @@ ivas_error ivas_init_encoder( ) { int16_t i, n; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t nchan_inp_buff; -#endif int16_t sce_id, cpe_id; IVAS_FORMAT ivas_format; int32_t input_Fs, ivas_total_brate; @@ -411,7 +395,6 @@ ivas_error ivas_init_encoder( st_ivas->nchan_transport = -1; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*-----------------------------------------------------------------* * Allocate floating-point input audio buffers *-----------------------------------------------------------------*/ @@ -443,7 +426,6 @@ ivas_error ivas_init_encoder( { st_ivas->p_data_f[n] = NULL; } -#endif /*-----------------------------------------------------------------* * Allocate and initialize buffer of indices @@ -628,7 +610,6 @@ ivas_error ivas_init_encoder( } } } -#ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT ) { int32_t element_brate_tmp[MAX_NUM_OBJECTS]; @@ -690,8 +671,6 @@ ivas_error ivas_init_encoder( return error; } } -#endif -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_ISM_FORMAT ) { int32_t element_brate_tmp[MAX_NUM_OBJECTS]; @@ -779,14 +758,10 @@ ivas_error ivas_init_encoder( return error; } } -#endif else if ( ivas_format == MC_FORMAT ) { st_ivas->mc_mode = ivas_mc_mode_select( hEncoderConfig->mc_input_setup, ivas_total_brate ); -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup ); -#endif if ( ( error = ivas_create_lfe_lpf_enc( &st_ivas->hLfeLpf, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) { return error; @@ -1159,11 +1134,7 @@ void ivas_destroy_enc( } /* ISM metadata handles */ -#ifdef MASA_AND_OBJECTS ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); -#else - ivas_ism_metadata_close( st_ivas->hIsmMetaData ); -#endif /* ISM DTX Handle */ if ( st_ivas->hISMDTX != NULL ) @@ -1209,15 +1180,11 @@ void ivas_destroy_enc( /* Multi-channel MASA handle */ ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); -#ifdef MASA_AND_OBJECTS /* OMASA handle */ ivas_omasa_enc_close( &( st_ivas->hOMasa ) ); -#endif -#ifdef SBA_AND_OBJECTS /* OSBA handle */ ivas_osba_enc_close( &( st_ivas->hOSba ) ); -#endif /* Stereo downmix for EVS encoder handle */ stereo_dmx_evs_close_encoder( &( st_ivas->hStereoDmxEVS ) ); @@ -1240,7 +1207,6 @@ void ivas_destroy_enc( free( st_ivas->ind_list_metadata ); } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /* floating-point input audio buffers */ for ( n = 0; n < MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { @@ -1250,7 +1216,6 @@ void ivas_destroy_enc( st_ivas->p_data_f[n] = NULL; } } -#endif /* main IVAS handle */ free( st_ivas ); diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index e2268ecc617bcaac89241ac75583af80faa9c521..35878e58489cfecc09fa579ff602f333e7f0abce 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -49,18 +49,11 @@ *-------------------------------------------------------------------*/ ivas_error ivas_ism_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data[MAX_NUM_OBJECTS], /* i : input signal */ -#else - float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ -#endif - const int16_t input_frame, /* i : input frame length per channel */ - int16_t *nb_bits_metadata /* i : number of metadata bits */ -#ifdef MASA_AND_OBJECTS - , + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + float *data[MAX_NUM_OBJECTS], /* i : input signal */ + const int16_t input_frame, /* i : input frame length per channel */ + int16_t *nb_bits_metadata, /* i : number of metadata bits */ const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ -#endif ) { SCE_ENC_HANDLE hSCE; @@ -96,10 +89,8 @@ ivas_error ivas_ism_enc( int16_t nchan_ism, dtx_flag, sid_flag, flag_noisy_speech; int16_t md_diff_flag[MAX_NUM_OBJECTS]; Encoder_State *prev_st = NULL; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate_ref, ism_total_brate; int16_t i, nchan_transport_ism; -#endif ivas_error error; push_wmops( "ivas_ism_enc" ); @@ -117,7 +108,6 @@ ivas_error ivas_ism_enc( nchan_ism = st_ivas->hEncoderConfig->nchan_ism; set_s( md_diff_flag, 1, nchan_ism ); -#ifdef MASA_AND_OBJECTS nchan_transport_ism = st_ivas->nchan_transport; if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { @@ -128,18 +118,12 @@ ivas_error ivas_ism_enc( { nchan_transport_ism = st_ivas->hEncoderConfig->nchan_ism; } -#endif /*------------------------------------------------------------------* * Preprocesing *-----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) -#else - /* in ISM format: st_ivas->nchan_transport = st_ivas->nSCE */ - for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) -#endif { hSCE = st_ivas->hSCE[sce_id]; st = hSCE->hCoreCoder[0]; @@ -251,21 +235,12 @@ ivas_error ivas_ism_enc( } else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { -#ifdef MASA_AND_OBJECTS ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, - nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1, 0, NULL -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame -#endif - ); -#else - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); -#endif + nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1, 0, NULL, + st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame ); } else /* ISM_MODE_DISC */ { -#ifdef MASA_AND_OBJECTS if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { ism_total_brate = 0; @@ -282,20 +257,13 @@ ivas_error ivas_ism_enc( ism_total_brate_ref = ism_total_brate; ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, - nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.hOmasaData->lp_noise_CPE : 0, flag_omasa_ener_brate, st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.hOmasaData->omasa_stereo_sw_cnt ) : NULL -#ifdef SBA_AND_OBJECTS - , - st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame -#endif - ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.hOmasaData->lp_noise_CPE : 0, flag_omasa_ener_brate, st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.hOmasaData->omasa_stereo_sw_cnt ) : NULL, + st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame ); if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - ism_total_brate; } -#else - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); -#endif } update_last_metadata( nchan_ism, st_ivas->hIsmMetaData, md_diff_flag ); @@ -311,23 +279,17 @@ ivas_error ivas_ism_enc( ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr ); } -#ifdef SBA_AND_OBJECTS /*only metadata encoding is needed for this case*/ if ( st_ivas->hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) { assert( st_ivas->ism_mode != ISM_MODE_NONE ); return error; } -#endif /*------------------------------------------------------------------* * CoreCoders encoding *-----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) -#else - for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) -#endif { hSCE = st_ivas->hSCE[sce_id]; st = hSCE->hCoreCoder[0]; @@ -391,11 +353,7 @@ ivas_error ivas_ism_enc( if ( dtx_flag ) { -#ifdef MASA_AND_OBJECTS for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) -#else - for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) -#endif { if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) { @@ -413,11 +371,7 @@ ivas_error ivas_ism_enc( int16_t id, n; n = 0; -#ifdef MASA_AND_OBJECTS for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) -#else - for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) -#endif { if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) { @@ -494,12 +448,8 @@ ivas_error ivas_ism_enc_config( st_ivas->nSCE = st_ivas->nchan_transport; st_ivas->nCPE = 0; - if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hEncoderConfig->nchan_inp, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL -#ifdef MASA_AND_OBJECTS - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hEncoderConfig->nchan_inp, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, + 0 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 1b608987ae6adec50545cd3795ea2251aa8bcaa6..a01c2187bab9bbb76c6af415c3592f96ecb13db6 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -168,32 +168,21 @@ static void rate_ism_importance( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_enc( -#ifdef MASA_AND_OBJECTS - int32_t *ism_total_brate, /* i/o: ISM total bitrate */ -#else - const int32_t ism_total_brate, /* i : ISM total bitrate */ -#endif - const int16_t nchan_ism, /* i : number of ISM channels */ - const int16_t nchan_transport, /* i : number of transport channels */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ - BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ - int16_t nb_bits_metadata[], /* o : number of metadata bits */ - const int16_t vad_flag[], /* i : VAD flag */ - const int16_t ism_mode, /* i : ISM mode */ - const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Enc Handle */ - const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ -#ifdef MASA_AND_OBJECTS - , + int32_t *ism_total_brate, /* i/o: ISM total bitrate */ + const int16_t nchan_ism, /* i : number of ISM channels */ + const int16_t nchan_transport, /* i : number of transport channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ + BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ + int16_t nb_bits_metadata[], /* o : number of metadata bits */ + const int16_t vad_flag[], /* i : VAD flag */ + const int16_t ism_mode, /* i : ISM mode */ + const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Enc Handle */ + const int16_t ism_extended_metadata_flag, /* i : Extended metadata flag */ const float lp_noise_CPE, const int16_t flag_omasa_ener_brate, /* i : less bitrate for objects in OMASA flag */ - int16_t *omasa_stereo_sw_cnt -#endif -#ifdef SBA_AND_OBJECTS - , - const int16_t ini_frame -#endif -) + int16_t *omasa_stereo_sw_cnt, + const int16_t ini_frame ) { int16_t i, ch, nb_bits_start = 0; int16_t flag_abs_azimuth[MAX_NUM_OBJECTS]; @@ -230,7 +219,6 @@ ivas_error ivas_ism_metadata_enc( set_s( null_metadata_flag, 0, nchan_ism ); set_s( lowrate_metadata_flag, 0, nchan_ism ); -#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { /*----------------------------------------------------------------* @@ -241,7 +229,6 @@ ivas_error ivas_ism_metadata_enc( } else { -#endif /*----------------------------------------------------------------* * Set Metadata presence / importance flag *----------------------------------------------------------------*/ @@ -252,23 +239,13 @@ ivas_error ivas_ism_metadata_enc( { hIsmMeta[ch]->ism_metadata_flag = 1; } -#ifdef MASA_AND_OBJECTS - else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC -#ifdef SBA_AND_OBJECTS - || ism_mode == ISM_SBA_MODE_DISC -#endif - ) -#else - else if ( ism_mode == ISM_MODE_DISC ) -#endif + else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) { null_metadata_flag[ch] = !hIsmMeta[ch]->ism_metadata_flag; if ( hIsmMeta[ch]->ism_metadata_flag == 1 ) { -#ifdef SBA_AND_OBJECTS if ( ism_mode != ISM_SBA_MODE_DISC ) -#endif { /* In case of low level noise for low bitrate inactive frames, do not sent metadata */ hIsmMeta[ch]->ism_metadata_flag = vad_flag[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10 || hSCE[ch]->hCoreCoder[0]->tcxonly; @@ -314,39 +291,25 @@ ivas_error ivas_ism_metadata_enc( /*----------------------------------------------------------------* * Rate importance of particular ISM streams *----------------------------------------------------------------*/ -#ifdef SBA_AND_OBJECTS if ( ism_mode != ISM_SBA_MODE_DISC ) { rate_ism_importance( nchan_transport, hIsmMeta, hSCE, lowrate_metadata_flag, ism_imp ); } -#else - rate_ism_importance( nchan_transport, hIsmMeta, hSCE, lowrate_metadata_flag, ism_imp ); -#endif -#ifdef MASA_AND_OBJECTS } -#endif /*----------------------------------------------------------------* * Write ISM common signaling *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS - if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ -#ifdef SBA_AND_OBJECTS - && ism_mode != ISM_SBA_MODE_DISC -#endif - ) + if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && ism_mode != ISM_SBA_MODE_DISC ) { -#endif /* write number of objects - unary coding */ for ( ch = 1; ch < nchan_ism; ch++ ) { push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); } push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); -#ifdef MASA_AND_OBJECTS } -#endif for ( ch = 0; ch < nchan_ism; ch++ ) { @@ -356,15 +319,7 @@ ivas_error ivas_ism_metadata_enc( } /* write extended metadata presence flag */ -#ifdef MASA_AND_OBJECTS -#ifdef SBA_AND_OBJECTS if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) && *ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) -#else - if ( ism_mode == ISM_MODE_DISC && *ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) -#endif -#else - if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) -#endif { push_indice( hBstr, IND_ISM_EXTENDED_FLAG, ism_extended_metadata_flag, ISM_EXTENDED_METADATA_BITS ); @@ -375,11 +330,9 @@ ivas_error ivas_ism_metadata_enc( } } -#ifdef FIX_691_OSBA_NULL_META /* write ISM metadata flag (one per object) */ for ( ch = 0; ch < nchan_transport; ch++ ) { -#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { /* flags will be written in ivas_masa_encode() */ @@ -389,7 +342,6 @@ ivas_error ivas_ism_metadata_enc( } else { -#endif if ( null_metadata_flag[ch] ) { /* signal NULL metadata frame */ @@ -424,64 +376,9 @@ ivas_error ivas_ism_metadata_enc( /* all objects are considered active*/ push_indice( hBstr, IND_ISM_METADATA_FLAG, 1, 1 ); } -#ifdef MASA_AND_OBJECTS - } -#endif - } -#else - /* write ISM metadata flag (one per object) */ - for ( ch = 0; ch < nchan_transport; ch++ ) - { -#ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) - { - /* flags will be written in ivas_masa_encode() */ - hIsmMeta[ch]->ism_imp = ism_imp[ch]; - hIsmMeta[ch]->ism_md_null_flag = null_metadata_flag[ch]; - hIsmMeta[ch]->ism_md_lowrate_flag = lowrate_metadata_flag[ch]; - } - else -#ifdef SBA_AND_OBJECTS - if ( ism_mode != ISM_SBA_MODE_DISC ) -#endif - { -#endif - if ( null_metadata_flag[ch] ) - { - /* signal NULL metadata frame */ - push_indice( hBstr, IND_ISM_MD_NULL_FLAG, 1, ISM_METADATA_MD_FLAG_BITS ); - - /* write the ISM class to ISM_NO_META and again the true ISM class */ - push_indice( hBstr, IND_ISM_METADATA_FLAG, ISM_NO_META, ISM_METADATA_FLAG_BITS ); - push_indice( hBstr, IND_ISM_MD_INACTIVE_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); - } - else - { - push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); - - if ( ism_imp[ch] == ISM_NO_META ) - { - /* signal low-rate ISM_NO_META frame */ - push_indice( hBstr, IND_ISM_MD_NULL_FLAG, 0, ISM_METADATA_MD_FLAG_BITS ); - - /* signal presence of MD in low-rate ISM_NO_META frame */ - push_indice( hBstr, IND_ISM_MD_INACTIVE_FLAG, lowrate_metadata_flag[ch], ISM_METADATA_INACTIVE_FLAG_BITS ); - } - } -#ifdef MASA_AND_OBJECTS - } -#endif -#ifdef SBA_AND_OBJECTS - else /*ism_mode == ISM_SBA_MODE_DISC*/ - { - /* all objects are considered active*/ - push_indice( hBstr, IND_ISM_METADATA_FLAG, 1, 1 ); } -#endif } -#endif - if ( ism_metadata_flag_global ) { @@ -501,15 +398,7 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_ism; ch++ ) { hIsmMetaData = hIsmMeta[ch]; -#ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ -#ifdef SBA_AND_OBJECTS - || ism_mode == ISM_SBA_MODE_DISC -#endif - ) -#else - if ( ism_mode == ISM_MODE_DISC ) -#endif + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_SBA_MODE_DISC ) { nb_bits_start = hBstr->nb_bits_tot; } @@ -544,15 +433,7 @@ ivas_error ivas_ism_metadata_enc( } else { -#ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ -#ifdef SBA_AND_OBJECTS - || ism_mode == ISM_SBA_MODE_DISC -#endif - ) -#else - if ( ism_mode == ISM_MODE_DISC ) -#endif + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_SBA_MODE_DISC ) { idx_angle1_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); idx_angle2_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); @@ -562,44 +443,24 @@ ivas_error ivas_ism_metadata_enc( idx_angle1_abs = hParamIsm->azi_index[ch]; idx_angle2_abs = hParamIsm->ele_index[ch]; } -#ifdef SBA_AND_OBJECTS encode_angle_indices( hBstr, &( hIsmMetaData->position_angle ), hIsmMetaData->last_ism_metadata_flag, ini_frame, idx_angle1_abs, idx_angle2_abs, &flag_abs_azimuth[ch], &flag_abs_elevation[ch] ); -#else - encode_angle_indices( hBstr, &( hIsmMetaData->position_angle ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_angle1_abs, idx_angle2_abs, &flag_abs_azimuth[ch], &flag_abs_elevation[ch] ); -#endif /*----------------------------------------------------------------* * Quantize and encode radius, yaw, and pitch *----------------------------------------------------------------*/ -#ifdef SBA_AND_OBJECTS if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) && ism_extended_metadata_flag ) -#else - if ( ism_mode == ISM_MODE_DISC && ism_extended_metadata_flag ) -#endif { idx_angle1_abs = ism_quant_meta( hIsmMetaData->yaw, &valQ, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); idx_angle2_abs = ism_quant_meta( hIsmMetaData->pitch, &valQ, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); idx_radius_abs = usquant( hIsmMetaData->radius, &valQ, ISM_RADIUS_MIN, ISM_RADIUS_DELTA, 1 << ISM_RADIUS_NBITS ); -#ifdef SBA_AND_OBJECTS encode_angle_indices( hBstr, &( hIsmMetaData->orientation_angle ), hIsmMetaData->last_ism_metadata_flag, ini_frame, idx_angle1_abs, idx_angle2_abs, &flag_abs_yaw[ch], &flag_abs_pitch[ch] ); -#else - encode_angle_indices( hBstr, &( hIsmMetaData->orientation_angle ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_angle1_abs, idx_angle2_abs, &flag_abs_yaw[ch], &flag_abs_pitch[ch] ); -#endif encode_radius( hBstr, &hIsmMetaData->last_radius_idx, &hIsmMetaData->radius_diff_cnt, hIsmMetaData->last_ism_metadata_flag, idx_radius_abs, &flag_abs_radius[ch] ); } } /* save number of metadata bits written */ -#ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ -#ifdef SBA_AND_OBJECTS - || ism_mode == ISM_SBA_MODE_DISC -#endif - ) -#else - if ( ism_mode == ISM_MODE_DISC ) -#endif + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_SBA_MODE_DISC ) { nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; } @@ -682,7 +543,6 @@ ivas_error ivas_ism_metadata_enc( } } -#ifdef SBA_AND_OBJECTS if ( ism_mode == ISM_SBA_MODE_DISC ) { int16_t md_diff_flag[MAX_NUM_OBJECTS]; @@ -709,7 +569,6 @@ ivas_error ivas_ism_metadata_enc( pop_wmops(); return error; } -#endif if ( ism_mode == ISM_MODE_PARAM ) { /* Keep the metdata transmission as is during active parts */ @@ -759,15 +618,12 @@ ivas_error ivas_ism_metadata_enc( } } } -#ifdef FIX_691_OSBA_NULL_META else if ( ism_mode == ISM_SBA_MODE_DISC ) { pop_wmops(); return error; } -#endif -#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------* * Take into account the combined format bit-budget distribution *----------------------------------------------------------------*/ @@ -816,13 +672,11 @@ ivas_error ivas_ism_metadata_enc( } } } -#endif /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { if ( ( error = ivas_ism_config( *ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, ism_extended_metadata_flag, null_metadata_flag, ism_imp, element_brate, total_brate, nb_bits_metadata, 1 ) ) != IVAS_ERR_OK ) @@ -837,12 +691,6 @@ ivas_error ivas_ism_metadata_enc( return error; } } -#else - if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, ism_extended_metadata_flag, null_metadata_flag, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif for ( ch = 0; ch < nchan_ism; ch++ ) { @@ -860,7 +708,6 @@ ivas_error ivas_ism_metadata_enc( hIsmMeta[ch]->ism_md_inc_diff_cnt = min( hIsmMeta[ch]->ism_md_inc_diff_cnt, ISM_MD_INC_DIFF_CNT_MAX ); } -#ifdef MASA_AND_OBJECTS for ( ch = 0; ch < nchan_transport; ch++ ) { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; @@ -890,29 +737,6 @@ ivas_error ivas_ism_metadata_enc( reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->nb_ind_tot ); } } -#else - for ( ch = 0; ch < nchan_transport; ch++ ) - { - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; - if ( ism_mode == ISM_MODE_DISC ) - { - if ( ism_imp[ch] == ISM_NO_META && ( ( total_brate[ch] < ACELP_8k00 && element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) || - ( total_brate[ch] <= ACELP_16k_LOW_LIMIT && element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) ) ) - { - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; - } - } - - hSCE[ch]->element_brate = element_brate[ch]; - hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; - - /* write metadata only in active frames */ - if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) - { - reset_indices_enc( hSCE[ch]->hMetaData, hSCE[ch]->hMetaData->nb_ind_tot ); - } - } -#endif pop_wmops(); @@ -935,22 +759,18 @@ ivas_error ivas_ism_metadata_enc_create( int16_t ch, nchan_transport; ivas_error error; -#ifdef MASA_AND_OBJECTS nchan_transport = st_ivas->nchan_transport; if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { nchan_transport = MAX_PARAM_ISM_WAVE; ivas_set_omasa_TC( st_ivas->ism_mode, n_ISms, &st_ivas->nSCE, &st_ivas->nCPE ); } -#ifdef SBA_AND_OBJECTS else if ( st_ivas->hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) { nchan_transport = n_ISms; } -#endif else { -#endif if ( st_ivas->ism_mode == ISM_MODE_NONE ) { nchan_transport = st_ivas->nchan_transport; @@ -978,9 +798,7 @@ ivas_error ivas_ism_metadata_enc_create( st_ivas->nchan_transport = nchan_transport; st_ivas->nSCE = nchan_transport; st_ivas->nCPE = 0; -#ifdef MASA_AND_OBJECTS } -#endif /* allocate ISM metadata handles */ for ( ch = 0; ch < n_ISms; ch++ ) @@ -1001,13 +819,11 @@ ivas_error ivas_ism_metadata_enc_create( st_ivas->hIsmMetaData[ch]->radius_diff_cnt = ISM_FEC_MAX - 2; st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; -#ifdef MASA_AND_OBJECTS st_ivas->hIsmMetaData[ch]->ism_imp = -1; st_ivas->hIsmMetaData[ch]->ism_md_null_flag = 0; st_ivas->hIsmMetaData[ch]->ism_md_lowrate_flag = 0; st_ivas->hIsmMetaData[ch]->q_azimuth_old = 0.0f; st_ivas->hIsmMetaData[ch]->q_elevation_old = 0.0f; -#endif ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); @@ -1021,7 +837,6 @@ ivas_error ivas_ism_metadata_enc_create( st_ivas->hIsmMetaData[ch]->last_true_radius = 1.0f; } -#ifdef MASA_AND_OBJECTS if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) @@ -1046,12 +861,6 @@ ivas_error ivas_ism_metadata_enc_create( return error; } } -#else - if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif return IVAS_ERR_OK; } diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index b6d0d4b3fe4debf93491b0b655459db52a02cfea..dbd31953a432baf28507afac38dffe881082ba9f 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -213,13 +213,9 @@ static void ivas_param_ism_enc_quantize_DOA( *-------------------------------------------------------------------------*/ void ivas_param_ism_stereo_dmx( - Encoder_Struct *st_ivas, /* i : IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + Encoder_Struct *st_ivas, /* i : IVAS encoder structure */ float *data[MAX_NUM_OBJECTS], /* i/o: input signal/stereo dmx */ -#else - float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i/o: input signal/stereo dmx */ -#endif - const int16_t input_frame /* i : Length of input frame */ + const int16_t input_frame /* i : Length of input frame */ ) { int16_t i, j; @@ -444,13 +440,9 @@ void ivas_param_ism_enc_close( *-------------------------------------------------------------------------*/ void ivas_param_ism_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ float *data[MAX_NUM_OBJECTS], /* i : input signal */ -#else - float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ -#endif - const int16_t input_frame /* i : input frame length per channel */ + const int16_t input_frame /* i : input frame length per channel */ ) { int16_t i, j, ts, l_ts; @@ -476,11 +468,7 @@ void ivas_param_ism_enc( for ( i = 0; i < nchan_ism; i++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP pcm_in[i] = data[i]; -#else - pcm_in[i] = &data[i][0]; -#endif set_zero( fb_RealBuffer[i], DIRAC_NO_FB_BANDS_MAX ); set_zero( fb_ImagBuffer[i], DIRAC_NO_FB_BANDS_MAX ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 663ccde448a4e14c30731812a62ed1c6a53abfa5..a98e42739bf00eed07871c03530d7104de3b14ea 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -47,9 +47,6 @@ static void combine_freqbands_and_subframes( MASA_ENCODER_HANDLE hMasa ); -#ifndef MASA_AND_OBJECTS -static void combine_directions( MASA_ENCODER_HANDLE hMasa ); -#endif static void find_n_largest( const float *input, int16_t *largestIndices, const int16_t numElements, const int16_t numLargest ); static void move_metadata_to_qmetadata( const MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMeta ); @@ -60,13 +57,9 @@ static void compensate_energy_ratios( MASA_ENCODER_HANDLE hMasa ); static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate ); -#ifdef MASA_AND_OBJECTS static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], const int16_t nchan_ism, const int16_t low_bitrate_mode, const int16_t omasa_nbands, const int16_t omasa_nblocks, const int16_t idx_separated_object, const int16_t ism_imp ); static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); -#else -static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); -#endif static void average_masa_metadata( MASA_METADATA_FRAME *masaMetadata, float energy[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], const SPHERICAL_GRID_DATA *sphGrid, const uint8_t useSphGrid ); @@ -105,9 +98,7 @@ ivas_error ivas_masa_enc_open( MASA_ENCODER_HANDLE hMasa; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; -#endif error = IVAS_ERR_OK; @@ -120,11 +111,7 @@ ivas_error ivas_masa_enc_open( generate_gridEq( &( hMasa->data.Sph_Grid16 ) ); -#ifdef MASA_AND_OBJECTS if ( hEncoderConfig->ivas_format == MASA_FORMAT || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) -#else - if ( hEncoderConfig->ivas_format == MASA_FORMAT ) -#endif { hMasa->data.num_Cldfb_instances = st_ivas->nchan_transport; } @@ -141,7 +128,6 @@ ivas_error ivas_masa_enc_open( } } -#ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { @@ -150,14 +136,9 @@ ivas_error ivas_masa_enc_open( ism_total_brate += st_ivas->hSCE[i]->element_brate; } } -#endif - ivas_masa_set_elements( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE -#ifdef MASA_AND_OBJECTS - , - hEncoderConfig->ivas_format, st_ivas->ism_mode, ism_total_brate -#endif - ); + ivas_masa_set_elements( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, + hEncoderConfig->ivas_format, st_ivas->ism_mode, ism_total_brate ); mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 ); @@ -179,7 +160,6 @@ ivas_error ivas_masa_enc_open( set_zero( hMasa->data.dir_align_state.previous_azi_dir2, MASA_FREQUENCY_BANDS ); set_zero( hMasa->data.dir_align_state.previous_ele_dir2, MASA_FREQUENCY_BANDS ); -#ifdef MASA_AND_OBJECTS if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { OMASA_ENCODER_DATA_HANDLE hOmasaData; @@ -201,7 +181,6 @@ ivas_error ivas_masa_enc_open( { hMasa->data.hOmasaData = NULL; } -#endif st_ivas->hMasa = hMasa; @@ -231,13 +210,11 @@ void ivas_masa_enc_close( deleteCldfb( &( ( *hMasa )->data.cldfbAnaEnc[i] ) ); } -#ifdef MASA_AND_OBJECTS if ( ( *hMasa )->data.hOmasaData != NULL ) { free( ( *hMasa )->data.hOmasaData ); ( *hMasa )->data.hOmasaData = NULL; } -#endif free( ( *hMasa ) ); ( *hMasa ) = NULL; @@ -253,17 +230,15 @@ void ivas_masa_enc_close( *-----------------------------------------------------------------------*/ ivas_error ivas_masa_encode( - MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder structure */ - IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ - int16_t *nb_bits_metadata, /* o : number of metadata bits written */ - const int16_t nchan_transport, /* i : number of MASA input/transport channels */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t Opt_DTX_ON, /* i : DTX on flag */ - const int16_t element_mode /* i : element mode */ -#ifdef MASA_AND_OBJECTS - , + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder structure */ + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ + int16_t *nb_bits_metadata, /* o : number of metadata bits written */ + const int16_t nchan_transport, /* i : number of MASA input/transport channels */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t Opt_DTX_ON, /* i : DTX on flag */ + const int16_t element_mode, /* i : element mode */ const ISM_MODE ism_mode, /* i : ISM format mode */ const int16_t nchan_ism, /* i : number of ISM channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ @@ -271,26 +246,19 @@ ivas_error ivas_masa_encode( OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ const int16_t ism_imp, /* i : importance of separated object */ const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ -#endif ) { MASA_DIRECTIONAL_SPATIAL_META *h_orig_metadata; int16_t i, j; int16_t masa_sid_descriptor; -#ifdef MASA_AND_OBJECTS int16_t low_bitrate_mode; int32_t masa_total_brate; -#endif masa_sid_descriptor = -1; h_orig_metadata = NULL; -#ifdef MASA_AND_OBJECTS low_bitrate_mode = 0; if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT ) -#endif { /* Create the MASA SID descriptor for the metadata and CPE mode, in order to have the SID frame self-contained. */ if ( Opt_DTX_ON && hQMetaData != NULL ) @@ -327,11 +295,7 @@ ivas_error ivas_masa_encode( } } -#ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ivas_total_brate >= IVAS_384k ) -#else - if ( ( ivas_format == MASA_FORMAT ) && ivas_total_brate >= IVAS_384k ) -#endif { hMasa->config.mergeRatiosOverSubframes = 0; } @@ -340,22 +304,13 @@ ivas_error ivas_masa_encode( combine_freqbands_and_subframes( hMasa ); } -#ifdef MASA_AND_OBJECTS if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands && ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) ) -#else - if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands && ivas_format == MASA_FORMAT ) -#endif { -#ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) || ( ivas_format != MASA_ISM_FORMAT ) ) { /* Combine directions */ ivas_masa_combine_directions( hMasa ); } -#else - /* Combine directions */ - combine_directions( hMasa ); -#endif /* If we joined all bands, then metadata is now one directional. */ if ( hMasa->config.numTwoDirBands == 0 ) @@ -368,18 +323,8 @@ ivas_error ivas_masa_encode( /* Reset qmetadata bit budget */ hQMetaData->metadata_max_bits = hMasa->config.max_metadata_bits; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT ) -#endif { -#ifndef MASA_AND_OBJECTS - /* write the number of MASA transport channels */ - push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); - hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; -#endif -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) { /* write the number of objects in ISM_MASA format*/ @@ -401,7 +346,6 @@ ivas_error ivas_masa_encode( } else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { -#ifdef MASA_AND_OBJECTS if ( hIsmMetaData[0]->ism_md_null_flag ) { /* signal NULL metadata frame */ @@ -430,23 +374,11 @@ ivas_error ivas_masa_encode( hQMetaData->metadata_max_bits -= ISM_METADATA_INACTIVE_FLAG_BITS; } } -#else - push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); - hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; - - if ( hIsmMetaData[0]->ism_metadata_flag == 0 ) - { - /* write VAD flag */ - push_next_indice( hMetaData, hIsmMetaData[0]->ism_vad_flag, ISM_METADATA_VAD_FLAG_BITS ); - hQMetaData->metadata_max_bits -= ISM_METADATA_VAD_FLAG_BITS; - } -#endif } else if ( ism_mode == ISM_MASA_MODE_DISC ) { for ( i = 0; i < nchan_ism; i++ ) { -#ifdef MASA_AND_OBJECTS if ( hIsmMetaData[i]->ism_md_null_flag ) { /* signal NULL metadata frame */ @@ -475,17 +407,6 @@ ivas_error ivas_masa_encode( hQMetaData->metadata_max_bits -= ISM_METADATA_INACTIVE_FLAG_BITS; } } -#else - push_next_indice( hMetaData, hIsmMetaData[i]->ism_imp, ISM_METADATA_FLAG_BITS ); - hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; - - if ( hIsmMetaData[i]->ism_metadata_flag == 0 ) - { - /* write VAD flag */ - push_next_indice( hMetaData, hIsmMetaData[i]->ism_vad_flag, ISM_METADATA_VAD_FLAG_BITS ); - hQMetaData->metadata_max_bits -= ISM_METADATA_VAD_FLAG_BITS; - } -#endif } if ( ivas_total_brate == IVAS_128k && nchan_ism >= 3 ) @@ -501,7 +422,6 @@ ivas_error ivas_masa_encode( push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; } -#endif if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { @@ -535,31 +455,22 @@ ivas_error ivas_masa_encode( } /* Move data from encoder to qmetadata */ -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT ) -#endif { move_metadata_to_qmetadata( hMasa, hQMetaData ); } if ( hMasa->config.max_metadata_bits < MINIMUM_BIT_BUDGET_NORMAL_META && !hMasa->config.joinedSubframes ) { -#ifdef MASA_AND_OBJECTS reduce_metadata_further( hMasa, hQMetaData, ivas_format ); low_bitrate_mode = ( ivas_total_brate <= 32000 ); -#else - reduce_metadata_further( hMasa, hQMetaData, ivas_format ); -#endif /* Write low bitrate mode. 1 signals that we have merged through time, 0 signals merge through frequency. */ push_next_indice( hMetaData, hQMetaData->q_direction[0].cfg.nblocks == 1 ? 1 : 0, MASA_LOWBITRATE_MODE_BITS ); hQMetaData->metadata_max_bits -= MASA_LOWBITRATE_MODE_BITS; } -#ifdef MASA_AND_OBJECTS /* Encode MASA+ISM metadata */ if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { @@ -574,10 +485,8 @@ ivas_error ivas_masa_encode( hMasa->data.hOmasaData->masa_to_total_energy_ratio[0][0] = -1; /* signals NOT to adjust the energy ratios */ } } -#endif /* Encode metadata */ -#ifdef MASA_AND_OBJECTS masa_total_brate = ivas_total_brate; if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MASA_MODE_DISC ) { @@ -595,32 +504,17 @@ ivas_error ivas_masa_encode( ivas_qmetadata_enc_encode_hr_384_512( hMetaData, hQMetaData, 11, 3 ); } } -#else - if ( ivas_total_brate >= IVAS_384k ) - { - if ( ivas_total_brate >= IVAS_512k ) - { - ivas_qmetadata_enc_encode_hr_384_512( hMetaData, hQMetaData, 16, 4 ); - } - else - { - ivas_qmetadata_enc_encode_hr_384_512( hMetaData, hQMetaData, 11, 3 ); - } - } -#endif else { ivas_qmetadata_enc_encode( hMetaData, hQMetaData, 0 ); } -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { /* Modify spatial metadata based on the MASA-to-total energy ratios */ ivas_omasa_modify_masa_energy_ratios( hQMetaData, hMasa->data.hOmasaData->masa_to_total_energy_ratio ); } -#endif *nb_bits_metadata = hMetaData->nb_bits_tot; if ( ivas_format == MASA_FORMAT && Opt_DTX_ON ) @@ -654,11 +548,7 @@ ivas_error ivas_masa_encode( if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands ) { /* Combine directions */ -#ifdef MASA_AND_OBJECTS ivas_masa_combine_directions( hMasa ); -#else - combine_directions( hMasa ); -#endif /* If we joined all bands, then metadata is now one directional. */ if ( hMasa->config.numTwoDirBands == 0 ) @@ -701,12 +591,8 @@ ivas_error ivas_masa_encode( *-----------------------------------------------------------------------*/ void ivas_masa_estimate_energy( - MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Input audio channels */ -#else - float data_f[][L_FRAME48k], /* i : Input audio channels */ -#endif + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder structure */ + float *data_f[], /* i : Input audio channels */ const int16_t input_frame, /* i : frame length */ const int16_t nchan_transport /* i : number of MASA input/transport channels */ ) @@ -786,10 +672,8 @@ ivas_error ivas_masa_enc_config( uint8_t maxBand; int16_t maxBin, sf; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; int32_t masa_total_brate; -#endif error = IVAS_ERR_OK; @@ -798,7 +682,6 @@ ivas_error ivas_masa_enc_config( ivas_format = st_ivas->hEncoderConfig->ivas_format; ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; -#ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { @@ -807,21 +690,12 @@ ivas_error ivas_masa_enc_config( ism_total_brate += st_ivas->hSCE[i]->element_brate; } } -#endif - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE -#ifdef MASA_AND_OBJECTS - , - ivas_format, st_ivas->ism_mode, ism_total_brate -#endif - ); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, + ivas_format, st_ivas->ism_mode, ism_total_brate ); hQMetaData->is_masa_ivas_format = 1; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT ) -#endif { masa_metadata_direction_alignment( hMasa ); @@ -846,18 +720,14 @@ ivas_error ivas_masa_enc_config( hMasa->config.numberOfDirections = 1; } -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); } else { -#endif ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, ivas_total_brate, st_ivas->nchan_transport, ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); -#ifdef MASA_AND_OBJECTS } -#endif /* Setup importance weights for two-direction band selection. */ if ( hMasa->config.numberOfDirections == 2 ) @@ -942,7 +812,6 @@ ivas_error ivas_masa_enc_config( } maxBand--; -#ifdef MASA_AND_OBJECTS st_ivas->hQMetaData->q_direction->cfg.inactiveBands = 0; masa_total_brate = ivas_total_brate; if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -950,9 +819,6 @@ ivas_error ivas_masa_enc_config( masa_total_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism ); } if ( masa_total_brate >= IVAS_384k && ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) ) -#else - if ( ivas_total_brate > IVAS_256k ) -#endif { int16_t continueLoop; continueLoop = 1; @@ -982,11 +848,7 @@ ivas_error ivas_masa_enc_config( } } -#ifdef MASA_AND_OBJECTS masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, maxBand, masa_total_brate >= IVAS_384k, NULL ); -#else - masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, maxBand, ivas_total_brate > IVAS_256k, NULL ); -#endif if ( hMasa->config.numTwoDirBands >= hMasa->config.numCodingBands ) { @@ -996,20 +858,11 @@ ivas_error ivas_masa_enc_config( /* Transmit stereo signals using a mono downmix at lowest bitrates */ -#ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) -#else - if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) -#endif { -#ifdef MASA_AND_OBJECTS st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ( ivas_total_brate - ism_total_brate < MASA_STEREO_MIN_BITRATE ) ? 1 : 0; -#else - st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ivas_total_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; -#endif } -#ifdef MASA_AND_OBJECTS if ( 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 || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT || st_ivas->hMasa->data.hOmasaData->omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) @@ -1021,7 +874,6 @@ ivas_error ivas_masa_enc_config( st_ivas->hMasa->data.hOmasaData->lp_noise_CPE = ( st_ivas->hCPE[0]->hCoreCoder[0]->lp_noise + st_ivas->hCPE[0]->hCoreCoder[1]->lp_noise ) / CPE_CHANNELS; } } -#endif return error; } @@ -1257,11 +1109,7 @@ static void combine_freqbands_and_subframes( return; } -#ifdef MASA_AND_OBJECTS void ivas_masa_combine_directions( -#else -static void combine_directions( -#endif MASA_ENCODER_HANDLE hMasa ) { int16_t i, j, k; @@ -1377,9 +1225,7 @@ static void combine_directions( ambience2dir = 1.0f - ratioSum; hMeta->directional_meta[0].energy_ratio[j][i] = sumVecLen[j][i] / ( hMeta->directional_meta[0].energy_ratio[j][i] + hMeta->directional_meta[1].energy_ratio[j][i] + ambience2dir / 2.0f ); -#ifdef MASA_AND_OBJECTS hMeta->directional_meta[1].energy_ratio[j][i] = 0.0f; -#endif if ( computeCoherence ) { ambience1dir = 1.0f - hMeta->directional_meta[0].energy_ratio[j][i]; @@ -1714,11 +1560,7 @@ static void reduce_metadata_further( /* Get energy for the input data in 4-subframe, 5-band format */ totalEnergySum = 0.0f; -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ -#else - if ( ivas_format == MASA_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ -#endif { for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { @@ -2097,13 +1939,10 @@ void ivas_masa_enc_reconfigure( int16_t n, tmp; int16_t sce_id, cpe_id; int32_t ivas_total_brate; -#ifdef MASA_AND_OBJECTS int32_t ism_total_brate; -#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; -#ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { @@ -2112,7 +1951,6 @@ void ivas_masa_enc_reconfigure( ism_total_brate += st_ivas->hSCE[sce_id]->element_brate; } } -#endif if ( ivas_total_brate != st_ivas->hEncoderConfig->last_ivas_total_brate ) { @@ -2134,7 +1972,6 @@ void ivas_masa_enc_reconfigure( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ } -#ifdef MASA_AND_OBJECTS if ( ivas_total_brate - ism_total_brate < MASA_STEREO_MIN_BITRATE || ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) { st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_DFT; @@ -2143,28 +1980,10 @@ void ivas_masa_enc_reconfigure( { st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_MDCT; } -#else - if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_DFT; - } - else if ( ivas_total_brate < MIN_BRATE_MDCT_STEREO ) - { - st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_DFT; - } - else - { - st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_MDCT; - } -#endif } - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp -#ifdef MASA_AND_OBJECTS - , - st_ivas->hEncoderConfig->ivas_format, st_ivas->ism_mode, ism_total_brate -#endif - ); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, + st_ivas->hEncoderConfig->ivas_format, st_ivas->ism_mode, ism_total_brate ); } return; @@ -2741,7 +2560,6 @@ static void masa_metadata_direction_alignment( } -#ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------* * ivas_merge_masa_metadata() * @@ -3829,13 +3647,8 @@ static void ivas_encode_masaism_metadata( void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f2[], float *data_out_f[], -#else - float data_in_f2[][L_FRAME48k], - float data_out_f[][L_FRAME48k], -#endif const int16_t input_frame, const int16_t num_transport_channels ) { @@ -3851,4 +3664,3 @@ void ivas_merge_masa_transports( return; } -#endif diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 8722b67ab36f7e9700572fa0507324ff3c6d56f1..fba29756654186cdef4c5166f822b1b4b99865b3 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -54,15 +54,9 @@ * Local function prototypes *------------------------------------------------------------------------*/ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static void ivas_param_mc_dmx( PARAM_MC_ENC_HANDLE hParamMC, float *data_f[], float data_dmx[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); static void ivas_param_mc_param_est_enc( PARAM_MC_ENC_HANDLE hParamMC, float *data_f[], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); -#else -static void ivas_param_mc_dmx( PARAM_MC_ENC_HANDLE hParamMC, float data_f[][L_FRAME48k], float data_dmx[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); - -static void ivas_param_mc_param_est_enc( PARAM_MC_ENC_HANDLE hParamMC, float input_frame_t[][L_FRAME48k], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); -#endif static void ivas_param_mc_parameter_quantizer( const float *x, const int16_t L, const int16_t sz_quantizer, const float *quantizer, int16_t *quant_idx, float *y ); @@ -401,12 +395,8 @@ void ivas_param_mc_enc_close( void ivas_param_mc_enc( Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i/o: input/transport MC data */ -#else - float data_f[][L_FRAME48k], /* i/o: input: MC data */ -#endif - const int16_t input_frame /* i : input frame length */ + float *data_f[], /* i/o: input/transport MC data */ + const int16_t input_frame /* i : input frame length */ ) { int16_t k; @@ -584,11 +574,7 @@ void ivas_param_mc_enc( static void ivas_param_mc_dmx( PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Input frame */ -#else - float data_f[][L_FRAME48k], /* i : Input frame */ -#endif + float *data_f[], /* i : Input frame */ float data_dmx[][L_FRAME48k], /* o : Down mixed frame */ const int16_t input_frame, /* i : Input frame length */ const int16_t nchan_input, /* i : number of input channels */ @@ -628,12 +614,8 @@ static void ivas_param_mc_dmx( *------------------------------------------------------------------------*/ static void ivas_param_mc_param_est_enc( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Input frame in the time domain */ -#else - float data_f[][L_FRAME48k], /* i : Input frame in the time domain */ -#endif + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + float *data_f[], /* i : Input frame in the time domain */ float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* o : Covariance matrix for the original frame */ float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* o : Covariance matrix for the downmixed frame */ const int16_t input_frame, /* i : Input frame length */ @@ -691,11 +673,7 @@ static void ivas_param_mc_param_est_enc( for ( i = 0; i < nchan_input; i++ ) { idx_ls = map_ls[i]; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP pcm_in[i] = data_f[idx_ls]; -#else - pcm_in[i] = &data_f[idx_ls][0]; -#endif p_slot_frame_f_real[i] = &slot_frame_f_real[i][0]; p_slot_frame_f_imag[i] = &slot_frame_f_imag[i][0]; } diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index 4e71f104a869b1c2cd0bb0ee6866e910f15ed2c6..27ed7f250d93e8af5e3d6ed7abb965841140806d 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -53,15 +53,9 @@ * Local function prototypes *------------------------------------------------------------------------*/ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP 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] ); -#else -static void ivas_mc_paramupmix_dmx( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, float data_f[][L_FRAME48k], const int16_t input_frame ); - -static void ivas_mc_paramupmix_param_est_enc( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, float input_frame_t[][L_FRAME48k], const int16_t input_frame, float alphas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS], float betas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS] ); -#endif static void get_huff_table( const PAR_TYPE par_type, const QUANT_TYPE quant_type, HUFF_TAB *df0, HUFF_TAB *df, HUFF_TAB *dt ); @@ -85,13 +79,9 @@ static void quantize_pars( const int16_t nv, const float *v, const int16_t nq, c *------------------------------------------------------------------------*/ void ivas_mc_paramupmix_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ - BSTR_ENC_HANDLE hBStr, /* i/o: IVAS Metadata bitstream handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i/o: input/transport MC data */ -#else - float data_f[][L_FRAME48k], /* i/o: input: MC data */ -#endif + Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ + BSTR_ENC_HANDLE hBStr, /* i/o: IVAS Metadata bitstream handle */ + float *data_f[], /* i/o: input/transport MC data */ const int16_t input_frame /* i : input frame length */ ) { @@ -690,12 +680,8 @@ static void put_ec_data( static void ivas_mc_paramupmix_dmx( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, /* i/o: MC ParamUpmix encoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i/o: Input, downmix out */ -#else - float data_f[][L_FRAME48k], /* i/o: Input, downmix out */ -#endif - const int16_t input_frame /* i : Input frame length */ + float *data_f[], /* i/o: Input, downmix out */ + const int16_t input_frame /* i : Input frame length */ ) { int16_t i, l; @@ -739,12 +725,8 @@ static void ivas_mc_paramupmix_dmx( static void ivas_mc_paramupmix_param_est_enc( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, /* i/o: MC Param-Upmix encoder handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Input frame in the time domain */ -#else - float data_f[][L_FRAME48k], /* i : Input frame in the time domain */ -#endif - const int16_t input_frame, /* i : Input frame length */ + float *data_f[], /* i : Input frame in the time domain */ + const int16_t input_frame, /* i : Input frame length */ float alphas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS], float betas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS] ) { diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index f556b6200a4170a3bd7ae85dd7ca197fc9480654..3df783ad0523c9f39b183e13cb950612f7031cd7 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -65,11 +65,7 @@ typedef struct float xi[MCMASA_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; } CovarianceMatrix; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static void ivas_mcmasa_dmx( MCMASA_ENC_HANDLE hMcMasa, float *data_f[], const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_inp ); -#else -static void ivas_mcmasa_dmx( MCMASA_ENC_HANDLE hMcMasa, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_inp ); -#endif static void compute_cov_mtx( float sr[MCMASA_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], float si[MCMASA_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], const int16_t freq, const int16_t N, CovarianceMatrix *COVls ); @@ -79,11 +75,7 @@ static void computeVerticalDiffuseness( float **buffer_intensity, const float *b static void computeEvenLayout( const float *ls_azimuth, float *ls_azimuth_even, const int16_t numChannels ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static void computeLfeEnergy( MCMASA_ENC_HANDLE hMcMasa, float *data_f[], const int16_t input_frame ); -#else -static void computeLfeEnergy( MCMASA_ENC_HANDLE hMcMasa, float data_f[][L_FRAME48k], const int16_t input_frame ); -#endif /*--------------------------------------------------------------------------* @@ -563,14 +555,10 @@ void ivas_mcmasa_enc_close( *--------------------------------------------------------------------------*/ void ivas_mcmasa_enc( - MCMASA_ENC_HANDLE hMcMasa, /* i/o: Encoder McMASA handle */ - IVAS_QMETADATA_HANDLE hQMeta, /* o : Qmetadata handle */ - MASA_ENCODER_HANDLE hMasa, /* i/o: Encoder MASA handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Input frame of audio */ -#else - float data_f[][L_FRAME48k], /* i : Input frame of audio */ -#endif + MCMASA_ENC_HANDLE hMcMasa, /* i/o: Encoder McMASA handle */ + IVAS_QMETADATA_HANDLE hQMeta, /* o : Qmetadata handle */ + MASA_ENCODER_HANDLE hMasa, /* i/o: Encoder MASA handle */ + float *data_f[], /* i : Input frame of audio */ const int16_t input_frame, /* i : Input frame size */ const int16_t nchan_transport, /* i : Number of transport channels */ const int16_t nchan_inp /* i : Number of input channels */ @@ -736,13 +724,9 @@ void ivas_mcmasa_enc( *--------------------------------------------------------------------------*/ void ivas_mcmasa_param_est_enc( - MCMASA_ENC_HANDLE hMcMasa, /* i : McMASA encoder structure */ - MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Audio frame in MC-format */ -#else - float data_f[][L_FRAME48k], /* i : Audio frame in MC-format */ -#endif + MCMASA_ENC_HANDLE hMcMasa, /* i : McMASA encoder structure */ + MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder structure */ + float *data_f[], /* i : Audio frame in MC-format */ float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated elevation */ float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated azimuth */ float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated direct-to-total ratio */ @@ -818,11 +802,7 @@ void ivas_mcmasa_param_est_enc( /* Copy current frame to memory for delay compensation */ for ( i = 0; i < numAnalysisChannels; i++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP pcm_in[i] = data_f[i]; -#else - pcm_in[i] = &data_f[i][0]; -#endif p_Chnl_RealBuffer[i] = &Chnl_RealBuffer[i][0]; p_Chnl_ImagBuffer[i] = &Chnl_ImagBuffer[i][0]; } @@ -1344,11 +1324,7 @@ void ivas_mcmasa_dmx_modify( /* Compute downmix */ static void ivas_mcmasa_dmx( MCMASA_ENC_HANDLE hMcMasa, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], -#else - float data_f[][L_FRAME48k], -#endif const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_inp ) @@ -1642,11 +1618,7 @@ static void computeEvenLayout( static void computeLfeEnergy( MCMASA_ENC_HANDLE hMcMasa, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], -#else - float data_f[][L_FRAME48k], -#endif const int16_t input_frame ) { int16_t l_ts; @@ -1663,13 +1635,8 @@ static void computeLfeEnergy( if ( hMcMasa->separateChannelEnabled ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP mvr2r( data_f[lfeChannelIndex], &( hMcMasa->delay_buffer_lfe[0][hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp] ), hMcMasa->offset_comp ); mvr2r( data_f[separateChannelIndex], &( hMcMasa->delay_buffer_lfe[1][hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp] ), hMcMasa->offset_comp ); -#else - mvr2r( &data_f[lfeChannelIndex][0], &( hMcMasa->delay_buffer_lfe[0][hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp] ), hMcMasa->offset_comp ); - mvr2r( &data_f[separateChannelIndex][0], &( hMcMasa->delay_buffer_lfe[1][hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp] ), hMcMasa->offset_comp ); -#endif } else { @@ -1688,17 +1655,10 @@ static void computeLfeEnergy( float delayedInputSignal[2][L_FRAME48k]; float lowPassSignal[2][L_FRAME48k]; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP mvr2r( &( hMcMasa->delay_buffer_lfe[0][0] ), &( delayedInputSignal[0][0] ), hMcMasa->num_slots_delay_comp * l_ts ); mvr2r( data_f[lfeChannelIndex] + hMcMasa->offset_comp, &( delayedInputSignal[0][hMcMasa->num_slots_delay_comp * l_ts] ), ( MDFT_NO_COL_MAX - hMcMasa->num_slots_delay_comp ) * l_ts ); mvr2r( &( hMcMasa->delay_buffer_lfe[1][0] ), &( delayedInputSignal[1][0] ), hMcMasa->num_slots_delay_comp * l_ts ); mvr2r( data_f[separateChannelIndex] + hMcMasa->offset_comp, &( delayedInputSignal[1][hMcMasa->num_slots_delay_comp * l_ts] ), ( MDFT_NO_COL_MAX - hMcMasa->num_slots_delay_comp ) * l_ts ); -#else - mvr2r( &( hMcMasa->delay_buffer_lfe[0][0] ), &( delayedInputSignal[0][0] ), hMcMasa->num_slots_delay_comp * l_ts ); - mvr2r( &( data_f[lfeChannelIndex][hMcMasa->offset_comp] ), &( delayedInputSignal[0][hMcMasa->num_slots_delay_comp * l_ts] ), ( MDFT_NO_COL_MAX - hMcMasa->num_slots_delay_comp ) * l_ts ); - mvr2r( &( hMcMasa->delay_buffer_lfe[1][0] ), &( delayedInputSignal[1][0] ), hMcMasa->num_slots_delay_comp * l_ts ); - mvr2r( &( data_f[separateChannelIndex][hMcMasa->offset_comp] ), &( delayedInputSignal[1][hMcMasa->num_slots_delay_comp * l_ts] ), ( MDFT_NO_COL_MAX - hMcMasa->num_slots_delay_comp ) * l_ts ); -#endif lowpassCoef = 1.0f / ( (float) hMcMasa->ringBufferSize ); @@ -1769,13 +1729,8 @@ static void computeLfeEnergy( if ( hMcMasa->separateChannelEnabled ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP mvr2r( data_f[lfeChannelIndex] + ( input_frame - hMcMasa->num_samples_delay_comp + hMcMasa->offset_comp ), &( hMcMasa->delay_buffer_lfe[0][0] ), ( hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp ) ); mvr2r( data_f[separateChannelIndex] + ( input_frame - hMcMasa->num_samples_delay_comp + hMcMasa->offset_comp ), &( hMcMasa->delay_buffer_lfe[1][0] ), ( hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp ) ); -#else - mvr2r( &data_f[lfeChannelIndex][input_frame - hMcMasa->num_samples_delay_comp + hMcMasa->offset_comp], &( hMcMasa->delay_buffer_lfe[0][0] ), ( hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp ) ); - mvr2r( &data_f[separateChannelIndex][input_frame - hMcMasa->num_samples_delay_comp + hMcMasa->offset_comp], &( hMcMasa->delay_buffer_lfe[1][0] ), ( hMcMasa->num_samples_delay_comp - hMcMasa->offset_comp ) ); -#endif } return; diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 828a5585b1ceb621b4efb5686a016276e18e9d6f..bad65750ef25dd439435aa722318be88545ac464 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -481,20 +481,14 @@ void ivas_mct_core_enc( nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS; nAvailBits -= MC_LS_SETUP_BITS; } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - else if ( ivas_format == SBA_FORMAT ) -#endif { nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS_EXTENDED; nAvailBits -= SBA_ORDER_BITS + SBA_PLANAR_BITS; -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_ISM_FORMAT && nChannels > 4 ) { nAvailBits -= IVAS_COMBINED_FORMAT_SIGNALLING_BITS; } -#endif } for ( cpe_id = 0, i = 0; cpe_id < nCPE; cpe_id++ ) @@ -568,9 +562,7 @@ void ivas_mct_core_enc( #ifdef DEBUGGING format_bits = ( ivas_format == MC_FORMAT ? IVAS_FORMAT_SIGNALING_NBITS + MC_LS_SETUP_BITS : IVAS_FORMAT_SIGNALING_NBITS_EXTENDED + SBA_ORDER_BITS + SBA_PLANAR_BITS ); -#ifdef SBA_AND_OBJECTS format_bits += ( ivas_format == SBA_ISM_FORMAT && nChannels > FOA_CHANNELS ); -#endif mct_bits += hMCT->nBitsMCT + hMCT->nchan_out_woLFE; assert( ( total_brate + ( NBITS_BWIDTH + format_bits + mct_bits + sba_meta + lfe_bits ) * FRAMES_PER_SEC ) == ivas_total_brate ); #endif diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 6e86ecdd14cda414b0003449227549473ef98670..895e8647972f7f6f94e18712a47490a545f67734 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -105,15 +105,10 @@ static void set_mct_enc_params( static void map_input_to_cpe_channels( const Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ float *pdata[MAX_INPUT_CHANNELS], /* o : mapped input pointers */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data[MCT_MAX_CHANNELS] /* i : input channel data */ -#else - float data[MCT_MAX_CHANNELS][L_FRAME48k] /* i : input channel data */ -#endif + float *data[MCT_MAX_CHANNELS] /* i : input channel data */ ) { int16_t i, n; -#ifdef SBA_AND_OBJECTS int16_t nchan_transport; nchan_transport = st_ivas->nchan_transport; @@ -121,7 +116,6 @@ static void map_input_to_cpe_channels( { nchan_transport += st_ivas->hEncoderConfig->nchan_ism; } -#endif i = 0; for ( n = 0; n < LFE_CHANNEL - 1; n++ ) @@ -131,11 +125,7 @@ static void map_input_to_cpe_channels( } if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) { -#ifndef SBA_AND_OBJECTS - for ( n = LFE_CHANNEL + 1; n < st_ivas->nchan_transport; n++ ) -#else for ( n = LFE_CHANNEL + 1; n < nchan_transport; n++ ) -#endif { pdata[i] = data[n]; i++; @@ -144,11 +134,7 @@ static void map_input_to_cpe_channels( } else { -#ifndef SBA_AND_OBJECTS - for ( ; n < st_ivas->nchan_transport; n++ ) -#else for ( ; n < nchan_transport; n++ ) -#endif { pdata[i] = data[n]; i++; @@ -156,12 +142,8 @@ static void map_input_to_cpe_channels( } /* odd channel CPE*/ -#ifndef SBA_AND_OBJECTS - if ( ( st_ivas->nchan_transport < st_ivas->nCPE * CPE_CHANNELS ) || ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hMCT->nchan_out_woLFE < st_ivas->nCPE * CPE_CHANNELS ) ) -#else if ( ( nchan_transport < st_ivas->nCPE * CPE_CHANNELS ) || ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hMCT->nchan_out_woLFE < st_ivas->nCPE * CPE_CHANNELS ) ) -#endif { pdata[st_ivas->nCPE * CPE_CHANNELS - 1] = NULL; } @@ -177,12 +159,8 @@ static void map_input_to_cpe_channels( *-------------------------------------------------------------------*/ ivas_error ivas_mct_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ float *data[MCT_MAX_CHANNELS], /* i : input signal buffers */ -#else - float data[MCT_MAX_CHANNELS][L_FRAME48k], /* i : input signal */ -#endif const int16_t input_frame, /* i : input frame length per channel */ const int16_t nb_bits_metadata /* i : number of metadata bits */ ) @@ -333,19 +311,13 @@ ivas_error create_mct_enc( { hMCT->nchan_out_woLFE = st_ivas->hEncoderConfig->nchan_inp - 1; /* LFE channel is coded separately */ } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - else if ( ivas_format == SBA_FORMAT ) -#endif { hMCT->nchan_out_woLFE = ivas_get_sba_num_TCs( ivas_total_brate, st_ivas->sba_analysis_order ); -#ifdef SBA_AND_OBJECTS if ( ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { hMCT->nchan_out_woLFE += st_ivas->hEncoderConfig->nchan_ism; } -#endif } else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) { @@ -469,11 +441,7 @@ ivas_error mct_enc_reconfigure( { hMCT->nchan_out_woLFE = ivas_param_mc_getNumTransportChannels( ivas_total_brate, st_ivas->hEncoderConfig->mc_input_setup ); } -#ifdef SBA_AND_OBJECTS else if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) -#else - else if ( ivas_format == SBA_FORMAT ) -#endif { hMCT->nchan_out_woLFE = st_ivas->nchan_transport; } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 349ae992bd2980b7be47f7e245c6bf7b349847c5..5f232d8168d6d6a646ae8765e395d034e9e40405 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -44,25 +44,16 @@ #endif #include "wmc_auto.h" -#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------------- * Local function prototypes *------------------------------------------------------------------------*/ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, OMASA_ENCODER_DATA_HANDLE hOmasaData, ISM_METADATA_HANDLE hIsmMeta[], float *data_f[], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], float diffuseness_m[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, OMASA_ENCODER_DATA_HANDLE hOmasaData, float *data_f[], const int16_t input_frame, const int16_t nchan_inp ); static void ivas_omasa_dmx( float *data_in_f[], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ); -#else -static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, OMASA_ENCODER_DATA_HANDLE hOmasaData, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], float diffuseness_m[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); - -static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, OMASA_ENCODER_DATA_HANDLE hOmasaData, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_inp ); - -static void ivas_omasa_dmx( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ); -#endif static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); @@ -392,21 +383,13 @@ void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_in_f[], /* i/o: Input / transport audio signals */ -#else - float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ -#endif - const int16_t input_frame, /* i : Input frame size */ - const int16_t nchan_transport, /* i : Number of transport channels */ - const int16_t nchan_ism, /* i : Number of objects for parameter analysis */ - const ISM_MODE ism_mode, /* i : ISM mode */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_separated_object, /* o : Separated object audio signal */ -#else - float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ -#endif - int16_t *idx_separated_object /* o : Index of the separated object */ + float *data_in_f[], /* i/o: Input / transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t nchan_transport, /* i : Number of transport channels */ + const int16_t nchan_ism, /* i : Number of objects for parameter analysis */ + const ISM_MODE ism_mode, /* i : ISM mode */ + float *data_separated_object, /* o : Separated object audio signal */ + int16_t *idx_separated_object /* o : Index of the separated object */ ) { int16_t i, j; @@ -743,12 +726,8 @@ void ivas_set_surplus_brate_enc( int16_t ivas_omasa_ener_brate( const int16_t nchan_ism, /* i : number of ISMs */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i : Input / transport audio signals */ -#else - float data_f[][L_FRAME48k], /* i : Input / transport audio signals */ -#endif - const int16_t input_frame /* i : Input frame size */ + float *data_f[], /* i : Input / transport audio signals */ + const int16_t input_frame /* i : Input frame size */ ) { int16_t i, flag_omasa_ener_brate; @@ -791,11 +770,7 @@ static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, OMASA_ENCODER_DATA_HANDLE hOmasaData, ISM_METADATA_HANDLE hIsmMeta[], -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], -#else - float data_f[][L_FRAME48k], -#endif float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], @@ -985,11 +960,7 @@ static void ivas_omasa_param_est_enc( static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, OMASA_ENCODER_DATA_HANDLE hOmasaData, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_f[], -#else - float data_f[][L_FRAME48k], -#endif const int16_t input_frame, const int16_t nchan_ism ) { @@ -1071,11 +1042,7 @@ static void ivas_omasa_energy_and_ratio_est( /* Compute downmix */ static void ivas_omasa_dmx( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f[], -#else - float data_in_f[][L_FRAME48k], -#endif float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_transport, @@ -1191,5 +1158,3 @@ static void computeReferencePower_omasa( return; } - -#endif /* MASA_AND_OBJECTS */ diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 497b43c628c56073f29b3d5f9efcab7c53bb9b6a..8630c9767137ac63c86b012a1df81bbafdae4f30 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -44,17 +44,12 @@ #endif #include "wmc_auto.h" -#ifdef SBA_AND_OBJECTS /*------------------------------------------------------------------------- * Local function prototypes *------------------------------------------------------------------------*/ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static void ivas_osba_render_ism_to_sba( float *data_in_f[], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_sba, const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MAX_INPUT_CHANNELS], const float interpolator[L_FRAME48k] ); -#else -static void ivas_osba_render_ism_to_sba( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_sba, const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MAX_INPUT_CHANNELS], const float interpolator[L_FRAME48k] ); -#endif /*-------------------------------------------------------------------* * ivas_merge_sba_transports() @@ -64,13 +59,8 @@ static void ivas_osba_render_ism_to_sba( float data_in_f[][L_FRAME48k], float da static void ivas_merge_sba_transports( float data_in_f1[][L_FRAME48k], -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f2[], float *data_out_f[], -#else - float data_in_f2[][L_FRAME48k], - float data_out_f[][L_FRAME48k], -#endif const int16_t input_frame, const int16_t sba_analysis_order ) { @@ -384,13 +374,9 @@ ivas_error ivas_osba_enc_reconfig( *--------------------------------------------------------------------------*/ void ivas_osba_enc( - OSBA_ENC_HANDLE hOSba, /* i/o: OSBA encoder handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_in_f[], /* i/o: Input / transport audio signals */ -#else - float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ -#endif + OSBA_ENC_HANDLE hOSba, /* i/o: OSBA encoder handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ + float *data_in_f[], /* i/o: Input / transport audio signals */ const int16_t input_frame, /* i : Input frame size */ const int16_t nchan_ism, /* i : Number of objects for parameter analysis */ const ISM_MODE ism_mode, /* i : ISM mode */ @@ -445,11 +431,7 @@ void ivas_osba_enc( /* Render ISMs to SBA */ static void ivas_osba_render_ism_to_sba( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *data_in_f[], -#else - float data_in_f[][L_FRAME48k], -#endif float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t sba_analysis_order, @@ -508,4 +490,3 @@ static void ivas_osba_render_ism_to_sba( return; } -#endif /* SBA_AND_OBJECTS */ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 84668daccaad4155753e18ecfc28948dd56df9ad..9969669b93c56e34cfb2d9558d50179a8c374ff0 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -63,15 +63,9 @@ static int16_t ivas_qmetadata_entropy_encode_dir( BSTR_ENC_HANDLE hMetaData, IVA static int16_t ivas_qmetadata_raw_encode_dir( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, const int16_t nbands, const int16_t start_band ); -#ifndef MASA_AND_OBJECTS -static -#endif - int16_t - ivas_qmetadata_encode_extended_gr_length( const uint16_t value, const uint16_t alphabet_size, const int16_t gr_param ); +int16_t +ivas_qmetadata_encode_extended_gr_length( const uint16_t value, const uint16_t alphabet_size, const int16_t gr_param ); -#ifndef MASA_AND_OBJECTS -static void ivas_qmetadata_encode_extended_gr( BSTR_ENC_HANDLE hMetaData, const uint16_t value, const uint16_t alphabet_size, const int16_t gr_param ); -#endif static int16_t ivas_qmetadata_get_optimal_gr_param( uint16_t *unsigned_data, const int16_t count, const int16_t gr_param_count, int16_t *opt_gr_size ); @@ -135,13 +129,11 @@ static void ivas_qmetadata_reorder_2dir_bands_hr( IVAS_QMETADATA_HANDLE hQMetaDa static int16_t ivas_qmetadata_quantize_coherence_hr_512( IVAS_QMETADATA *hQMetaData, const int16_t idx_d, const int16_t all_coherence_zero, BSTR_ENC_HANDLE hMetaData, const int16_t bits_coh ); -#ifdef MASA_AND_OBJECTS static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, const int16_t len_stream, BSTR_ENC_HANDLE hMetaData, const int16_t first_line, const int16_t low_bitrate_mode ); static int16_t find_optimal_GR_order( const int16_t *q_idx, const int16_t len, int16_t *GR ); static int16_t find_optimal_GR_orders( const int16_t *q_idx, const int16_t len, const int16_t len_max_GR1, int16_t *GR1, int16_t *GR2, int16_t *i_min ); -#endif /*-----------------------------------------------------------------------* @@ -3133,14 +3125,11 @@ static int16_t ivas_qmetadata_get_optimal_gr_param( * *------------------------------------------------------------------------*/ -#ifndef MASA_AND_OBJECTS -static -#endif - int16_t - ivas_qmetadata_encode_extended_gr_length( - const uint16_t value, - const uint16_t alphabet_size, - const int16_t gr_param ) +int16_t +ivas_qmetadata_encode_extended_gr_length( + const uint16_t value, + const uint16_t alphabet_size, + const int16_t gr_param ) { uint16_t msb_alphabet_size; int16_t bits; @@ -3280,15 +3269,11 @@ static int16_t ivas_qmetadata_reorder_azimuth_index( * *------------------------------------------------------------------------*/ -#ifndef MASA_AND_OBJECTS -static -#endif - void - ivas_qmetadata_encode_extended_gr( - BSTR_ENC_HANDLE hMetaData, - const uint16_t value, - const uint16_t alphabet_size, - const int16_t gr_param ) +void ivas_qmetadata_encode_extended_gr( + BSTR_ENC_HANDLE hMetaData, + const uint16_t value, + const uint16_t alphabet_size, + const int16_t gr_param ) { uint16_t msb_alphabet_size; uint16_t msb, lsb, cnt; @@ -6037,7 +6022,6 @@ static float direction_distance( } #endif -#ifdef MASA_AND_OBJECTS static int16_t divide_GR_orders( const int16_t *q_idx, @@ -6528,4 +6512,3 @@ void ivas_omasa_encode_masa_to_total( return; } -#endif diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index 3d5be7e13e615483517d4c52ec4bd08d0d41f8b2..318bc90ddd2a454a209c2862ff84a3e4a2d7e6c9 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -53,11 +53,7 @@ *-------------------------------------------------------------------*/ void ivas_sba_getTCs( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *sba_data[], /* i : SBA signals */ -#else - float sba_data[][L_FRAME48k], /* i : SBA signals */ -#endif + float *sba_data[], /* i : SBA signals */ Encoder_Struct *st_ivas, /* i/o: Encoder struct */ const int16_t input_frame /* i : frame length */ ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 47d9b74c413a23b510053163823c6100b5523e85..f8c7afa6caefbe5817a45680512c9818088db526 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -143,11 +143,7 @@ ivas_error ivas_sce_enc( /* set "bits_frame_nominal" */ if ( st_ivas->hQMetaData != NULL && st_ivas->hSpar == NULL ) { -#ifdef MASA_AND_OBJECTS if ( ( ( st_ivas->mc_mode == MC_MODE_MCMASA ) && ( st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) ) || ( st_ivas->ism_mode >= ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) -#endif { st->bits_frame_nominal = (int16_t) ( hSCE->element_brate / FRAMES_PER_SEC ); } @@ -210,7 +206,6 @@ ivas_error ivas_sce_enc( reset_metadata_spatial( ivas_format, hSCE->hMetaData, hSCE->element_brate, &st->total_brate, st->core_brate, nb_bits_metadata ); -#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------* * Combined format coding: get the ISM importance and the bit-rate *----------------------------------------------------------------*/ @@ -221,7 +216,6 @@ ivas_error ivas_sce_enc( st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_PARAM_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ) - nb_bits_metadata * FRAMES_PER_SEC; } -#endif /*----------------------------------------------------------------* * Write IVAS format signaling in SID frames @@ -241,12 +235,10 @@ ivas_error ivas_sce_enc( { st->flag_ACELP16k = set_ACELP_flag( IVAS_SCE, hSCE->element_brate, st->core_brate, 0, 0, -1, -1 ); } -#ifdef MASA_AND_OBJECTS else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st->low_rate_mode ) { st->flag_ACELP16k = 0; } -#endif else { st->flag_ACELP16k = set_ACELP_flag( IVAS_SCE, hSCE->element_brate, st->total_brate, 0, 0, -1, -1 ); @@ -358,12 +350,10 @@ ivas_error create_sce_enc( copy_encoder_config( st_ivas, st, 1 ); -#ifdef MASA_AND_OBJECTS if ( st_ivas->hEncoderConfig->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 || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { st->element_mode = IVAS_SCE; } -#endif st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 1d6f434ce447841fa52497ee348c9050b9a9943b..476a1f39c36c226f5e9e7ccf22e0a70460afc44f 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -48,11 +48,7 @@ * Local function prototypes *--------------------------------------------------------------------*/ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP static ivas_error ivas_spar_enc_process( Encoder_Struct *st_ivas, const ENCODER_CONFIG_HANDLE hEncoderConfig, BSTR_ENC_HANDLE hMetaData, const int16_t front_vad_flag, float *data_f[] ); -#else -static ivas_error ivas_spar_enc_process( Encoder_Struct *st_ivas, const ENCODER_CONFIG_HANDLE hEncoderConfig, BSTR_ENC_HANDLE hMetaData, const int16_t front_vad_flag, float data_f[][L_FRAME48k] ); -#endif /*------------------------------------------------------------------------- @@ -328,12 +324,8 @@ void ivas_spar_enc_close( *-------------------------------------------------------------------*/ ivas_error ivas_spar_enc( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* i/o: input/transport audio channels */ -#else - float data_f[][L_FRAME48k], /* i/o: input/transport audio channels */ -#endif + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + float *data_f[], /* i/o: input/transport audio channels */ const int16_t input_frame, /* i : input frame length */ int16_t *nb_bits_metadata, /* i : number of MD bits written */ BSTR_ENC_HANDLE hMetaData /* o : MetaData handle */ @@ -538,11 +530,7 @@ static ivas_error ivas_spar_enc_process( const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ const int16_t front_vad_flag, /* i : front-VAD decision */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[] /* i/o: input/transport audio channels */ -#else - float data_f[][L_FRAME48k] /* i/o: input/transport audio channels */ -#endif + float *data_f[] /* i/o: input/transport audio channels */ ) { float pcm_tmp[DIRAC_MAX_ANA_CHANS][L_FRAME48k * 2]; @@ -629,11 +617,7 @@ static ivas_error ivas_spar_enc_process( { ppIn_FR_real[i] = p_pcm_tmp[i]; ppIn_FR_imag[i] = p_pcm_tmp[i] + input_frame; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP p_pcm_tmp[i] = data_f[i]; -#else - p_pcm_tmp[i] = &data_f[i][0]; -#endif } l_ts = input_frame / MAX_PARAM_SPATIAL_SUBFRAMES; diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 023cc550f777e72723412258ae64ca4b4ad49e04..05bf62a92a6e15889363b711912ddc11701667a5 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -710,9 +710,7 @@ typedef struct ivas_spar_enc_lib_t int16_t front_vad_dtx_flag; int16_t force_front_vad; -#ifdef SBA_AND_OBJECTS float *input_data_mem[MAX_NUM_OBJECTS]; -#endif } SPAR_ENC_DATA, *SPAR_ENC_HANDLE; @@ -758,7 +756,6 @@ typedef struct ivas_mc_paramupmix_enc_data_structure } MC_PARAMUPMIX_ENC_DATA, *MC_PARAMUPMIX_ENC_HANDLE; -#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------------------------* * Object MASA (OMASA) encoder structure *----------------------------------------------------------------------------------*/ @@ -808,7 +805,6 @@ typedef struct ivas_omasa_encoder_one_data_struct int16_t omasa_stereo_sw_cnt; } OMASA_ENCODER_DATA_STATE, *OMASA_ENCODER_DATA_HANDLE; -#endif /*----------------------------------------------------------------------------------* @@ -856,9 +852,7 @@ typedef struct ivas_masa_encoder_data_struct MASA_DIR_ALIGN_STATE dir_align_state; -#ifdef MASA_AND_OBJECTS OMASA_ENCODER_DATA_HANDLE hOmasaData; -#endif } MASA_ENCODER_DATA; @@ -929,7 +923,6 @@ typedef struct ivas_mcmasa_enc_data_structure } MCMASA_ENC_DATA, *MCMASA_ENC_HANDLE; -#ifdef SBA_AND_OBJECTS /*----------------------------------------------------------------------------------* * Object SBA (OSBA) encoder structure *----------------------------------------------------------------------------------*/ @@ -944,7 +937,6 @@ typedef struct ivas_osba_enc_data_structure float *input_data_mem[MAX_NUM_OBJECTS]; } OSBA_ENC_DATA, *OSBA_ENC_HANDLE; -#endif /*----------------------------------------------------------------------------------* * Stereo CNG handle @@ -1013,9 +1005,7 @@ typedef struct cpe_enc_data_structure float *input_mem[CPE_CHANNELS]; /* input channels buffers memory; needed to be up-to-date for TD->DFT stereo switching */ -#ifdef MASA_AND_OBJECTS int32_t brate_surplus; /* bitrate surplus for bitrate adaptation in combined format coding */ -#endif #ifdef DEBUGGING int16_t stereo_mode_cmdl; /* stereo mode forced from the commaand-line */ #endif @@ -1213,9 +1203,7 @@ typedef struct { ENCODER_CONFIG_HANDLE hEncoderConfig; /* Encoder configuration structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *p_data_f[MAX_INPUT_CHANNELS+MAX_NUM_OBJECTS]; /* floating-point input audio buffers */ -#endif Indice *ind_list; /* List of indices */ int16_t ivas_max_num_indices; /* Maximum allowed number of indices in the list */ @@ -1246,12 +1234,8 @@ typedef struct PARAM_MC_ENC_HANDLE hParamMC; /* Parametric MC handle */ MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix; /* MC Param-Upmix handle */ MCMASA_ENC_HANDLE hMcMasa; /* Multi-channel MASA data handle */ -#ifdef SBA_AND_OBJECTS OSBA_ENC_HANDLE hOSba; /* Object-SBA data handle */ -#endif -#ifdef MASA_AND_OBJECTS OMASA_ENC_HANDLE hOMasa; /* Object-MASA data handle */ -#endif LFE_ENC_HANDLE hLFE; /* LFE data handle */ ivas_filters_process_state_t *hLfeLpf; /* low pass filter state for LFE */ diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index cedccea00e18beaa4cdaec80e791ad4580ef1e36..8e979fcf1f7302b927102090784a6e7bce17afb5 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -120,11 +120,7 @@ int16_t select_stereo_mode( stereo_switching_flag = 0; } -#ifdef MASA_AND_OBJECTS if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO && !( hCPE->element_brate == IVAS_48k && ivas_total_brate == IVAS_32k ) ) /* the second condition for PARAM mode OMASA */ -#else - if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO ) -#endif { hStereoClassif->prev_lrtd_mode = 0; hStereoClassif->lrtd_mode = 0; diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 2c428726b25379e24a98229305f67c3707098791..c7ce9f4e47cd702cbcad18d73cccdc40de254003 100755 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -458,11 +458,7 @@ void stereo_mdct_core_enc( sts[ch]->total_brate = ( sts[ch]->bits_frame_channel + sts[ch]->side_bits_frame_channel ) * FRAMES_PER_SEC; } stereo_bits += SMDCT_NBBITS_SPLIT_RATIO; -#ifdef MASA_AND_OBJECTS assert( ( sts[0]->total_brate + sts[1]->total_brate + ( stereo_bits + signal_bits + meta_bits ) * FRAMES_PER_SEC ) == hCPE->element_brate + hCPE->brate_surplus ); -#else - assert( ( sts[0]->total_brate + sts[1]->total_brate + ( stereo_bits + signal_bits + meta_bits ) * FRAMES_PER_SEC ) == hCPE->element_brate ); -#endif assert( hStereoMdct->split_ratio > 0 && hStereoMdct->split_ratio < SMDCT_BITRATE_RATIO_RANGE ); push_next_indice( hBstr, hStereoMdct->split_ratio, SMDCT_NBBITS_SPLIT_RATIO ); diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index 7ab19d1ba19624ad286c0e7f64257414a0edb484..fc318ce6b68b3e1c6b925b33d0123c8ea6c7dec5 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -82,9 +82,7 @@ #define RMS_THR 100 #define RATIO_PG_LRTD 0.96f -#ifdef MASA_AND_OBJECTS #define IVAS_BRATE_OMASA_STEREO_SW_THR 15000 -#endif /*-------------------------------------------------------------------* @@ -115,9 +113,7 @@ static float Comp_diff_lt_corr( CPE_ENC_HANDLE hCPE, const int16_t IsSideMono, c *-------------------------------------------------------------------*/ int16_t stereo_tdm_ener_analysis( -#ifdef MASA_AND_OBJECTS - const int16_t ivas_format, /* i : IVAS format */ -#endif + const int16_t ivas_format, /* i : IVAS format */ CPE_ENC_HANDLE hCPE, /* i : CPE structure */ const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ @@ -202,7 +198,6 @@ int16_t stereo_tdm_ener_analysis( * of L and R needed to create new mono/side signals *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { @@ -211,7 +206,6 @@ int16_t stereo_tdm_ener_analysis( hStereoTD->prev_fr_LRTD_TD_dec = 0; } } -#endif rms_thd = RMS_MIN; if ( hCPE->hStereoClassif->lrtd_mode == 1 ) diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index b75eb604a416a38c5307177462ffca28ec3cae4c..596c0dcfb61df22d6e457deb017ca25445078942 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -309,10 +309,8 @@ ivas_error stereo_set_tdm( *-------------------------------------------------------------------*/ void tdm_configure_enc( -#ifdef MASA_AND_OBJECTS - const int16_t ivas_format, /* i : IVAS format */ - const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif + const int16_t ivas_format, /* i : IVAS format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag in TD stereo OR LRTD primary channel */ @@ -428,7 +426,6 @@ void tdm_configure_enc( sts[1]->coder_type = GENERIC; } -#ifdef MASA_AND_OBJECTS if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 ) { if ( sts[1]->coder_type == UNVOICED ) @@ -450,7 +447,6 @@ void tdm_configure_enc( sts[0]->coder_type = GENERIC; } } -#endif mod_ct = AUDIO; if ( hCPE->element_brate < IVAS_24k4 ) @@ -485,16 +481,12 @@ void tdm_configure_enc( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS tdm_bit_alloc( ivas_format, ism_mode, hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); -#else - tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); -#endif if ( sts[0]->GSC_IVAS_mode > 0 && sts[0]->total_brate <= STEREO_GSC_BIT_RATE_ALLOC ) { diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 38a445c76ba1f1e7fa635b052927fe527cca07d1..c1c8b047e8f20eadca1eae31aa9de92cb69f1810 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -330,7 +330,6 @@ ivas_error IVAS_ENC_ConfigureForStereo( } -#ifdef MASA_AND_OBJECTS /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForMASAObjects() * @@ -384,7 +383,6 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( return configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); } -#endif /*---------------------------------------------------------------------* @@ -453,15 +451,7 @@ ivas_error IVAS_ENC_FeedObjectMetadata( return IVAS_ERR_NOT_CONFIGURED; } -#ifdef MASA_AND_OBJECTS - if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != ISM_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT -#ifdef SBA_AND_OBJECTS - && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != SBA_ISM_FORMAT -#endif - ) -#else - if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != ISM_FORMAT ) -#endif + if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != ISM_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != SBA_ISM_FORMAT ) { return IVAS_ERR_METADATA_NOT_EXPECTED; } @@ -547,7 +537,6 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( return error; } -#ifdef SBA_AND_OBJECTS /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForSBAObjects() * @@ -596,7 +585,6 @@ ivas_error IVAS_ENC_ConfigureForSBAObjects( return configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); } -#endif /*---------------------------------------------------------------------* @@ -669,11 +657,7 @@ ivas_error IVAS_ENC_FeedMasaMetadata( return IVAS_ERR_NOT_CONFIGURED; } -#ifdef MASA_AND_OBJECTS if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) -#else - if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_FORMAT ) -#endif { return IVAS_ERR_METADATA_NOT_EXPECTED; } @@ -735,9 +719,7 @@ ivas_error IVAS_ENC_ConfigureForMultichannel( break; } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup ); -#endif hIvasEnc->maxBandwidthUser = max_bwidth_user; @@ -764,9 +746,7 @@ static ivas_error configureEncoder( Encoder_Struct *st_ivas; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; -#ifdef MASA_AND_OBJECTS int32_t cpe_brate; -#endif error = IVAS_ERR_OK; @@ -908,7 +888,6 @@ static ivas_error configureEncoder( } } } -#ifdef MASA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { st_ivas->ism_mode = ivas_omasa_ism_mode_select( st_ivas->hEncoderConfig->ivas_total_brate, hEncoderConfig->nchan_ism ); @@ -924,13 +903,10 @@ static ivas_error configureEncoder( } } } -#endif -#ifdef SBA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) { st_ivas->ism_mode = ISM_MODE_NONE; } -#endif } else /* EVS mono */ { @@ -1006,14 +982,7 @@ static ivas_error configureEncoder( if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && ( ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || - hEncoderConfig->ivas_format == MC_FORMAT -#ifdef MASA_AND_OBJECTS - || hEncoderConfig->ivas_format == MASA_ISM_FORMAT -#endif -#ifdef SBA_AND_OBJECTS - || hEncoderConfig->ivas_format == SBA_ISM_FORMAT -#endif - ) ) + hEncoderConfig->ivas_format == MC_FORMAT || hEncoderConfig->ivas_format == MASA_ISM_FORMAT || hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) ) { return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } @@ -1737,18 +1706,14 @@ static ivas_error printConfigInfo_enc( fprintf( stdout, "IVAS mode: Multi-Channel 7.1+4\n" ); } } -#ifdef SBA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) { fprintf( stdout, "IVAS format: combined ISM and SBA (%i ISM stream(s))\n", hEncoderConfig->nchan_ism ); } -#endif -#ifdef MASA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { fprintf( stdout, "IVAS format: combined ISM and MASA (%i ISM stream(s))\n", hEncoderConfig->nchan_ism ); } -#endif if ( hEncoderConfig->is_binaural ) { diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 95de2d3a64ec53c62b2eaccd90c3499f46f21b48..b7582ed9e428dd310c5bfb9cb539231cffe5dbb2 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -50,12 +50,8 @@ typedef enum _IVAS_ENC_INPUT_FORMAT IVAS_ENC_INPUT_SBA, IVAS_ENC_INPUT_MASA, IVAS_ENC_INPUT_MC, -#ifdef MASA_AND_OBJECTS IVAS_ENC_INPUT_MASA_ISM, -#endif -#ifdef SBA_AND_OBJECTS IVAS_ENC_INPUT_SBA_ISM, -#endif IVAS_DEC_INPUT_UNKNOWN = 0xffff } IVAS_ENC_INPUT_FORMAT; @@ -107,13 +103,11 @@ typedef enum _IVAS_ENC_COMPLEXITY_LEVEL IVAS_ENC_COMPLEXITY_LEVEL_THREE = 3 } IVAS_ENC_COMPLEXITY_LEVEL; -#ifdef MASA_AND_OBJECTS typedef enum _IVAS_ENC_COMBINED_FORMAT { IVAS_ENC_MASA_ISM = 1, IVAS_ENC_COMBINED_UNDEFINED = 0xffff } IVAS_ENC_COMBINED_FORMAT; -#endif #ifdef DEBUGGING typedef enum _IVAS_ENC_STEREO_MODE @@ -207,7 +201,6 @@ ivas_error IVAS_ENC_ConfigureForObjects( const bool ism_extended_metadata /* i : Extended metadata used (true/false), where extended metadata includes radius and orientation */ ); -#ifdef MASA_AND_OBJECTS /*! r: encoder error code */ ivas_error IVAS_ENC_ConfigureForMASAObjects( IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ @@ -218,9 +211,7 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( const uint16_t numObjects, /* i : number of objects to be encoded */ const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ ); -#endif -#ifdef SBA_AND_OBJECTS /*! r: encoder error code */ ivas_error IVAS_ENC_ConfigureForSBAObjects( IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ @@ -233,7 +224,6 @@ ivas_error IVAS_ENC_ConfigureForSBAObjects( const bool isPlanar, /* i : if true, input is treated as planar Ambisonics */ const bool Opt_PCA_ON /* i : PCA option flag */ ); -#endif /*! r: error code */ ivas_error IVAS_ENC_ConfigureForAmbisonics( diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 1427ce69e84bcda8d22499f7ef3c938d342d8ff9..20ed1a066ea29d113608d30a82208ec1886a0ba9 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1863,11 +1863,7 @@ ivas_error ivas_rend_crendProcessSubframe( { int16_t subframe_idx, subframe_len; int16_t nchan_out, nchan_in, ch, first_sf, last_sf, slot_size, slots_to_render; -#ifdef FIX_679_JBM_MC2SBA float *tc_local[MAX_OUTPUT_CHANNELS]; -#else - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; float *p_pcm_tmp[BINAURAL_CHANNELS]; IVAS_REND_AudioConfigType inConfigType; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index cf1cde9860489a8b4f048d3065463261396de9ba..b378236c8991d74f65919a4c91110f590275d601 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -57,9 +57,7 @@ #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) #define SBA_CARDI_TARGET_ENERGY_GAIN 0.5f -#ifdef MASA_AND_OBJECTS #define STEREO_PREPROCESS_IIR_FACTOR ( 0.9f ) -#endif /* powf(0.95f, 4.0f) for sub-frame smoothing instead of CLDFB slot */ #define ADAPT_HTPROTO_IIR_FAC 0.81450625f @@ -69,11 +67,7 @@ #define ADAPT_HTPROTO_ROT_LIM_0 0.4f #define ADAPT_HTPROTO_ROT_LIM_1 0.8f -#ifdef MASA_AND_OBJECTS #define MAX_GAIN_CACHE_SIZE ( ( MASA_MAXIMUM_DIRECTIONS * 3 ) + MAX_NUM_OBJECTS ) /* == different calls to get gains */ -#else -#define MAX_GAIN_CACHE_SIZE 6 -#endif typedef struct hrtfGainCache { @@ -92,9 +86,7 @@ typedef struct parambin_rend_config_data int16_t nchan_transport; float qualityBasedSmFactor; int16_t processReverb; -#ifdef MASA_AND_OBJECTS ISM_MODE ism_mode; -#endif } PARAMBIN_REND_CONFIG, *PARAMBIN_REND_CONFIG_HANDLE; @@ -108,24 +100,12 @@ static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_BIN_HANDLE hDiracDecBin, #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t subframe, float *subFrameTotalEne, float *IIReneLimiter ); -#ifdef MASA_AND_OBJECTS static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const float *subFrameTotalEne, const float *IIReneLimiter, const MASA_ISM_DATA_HANDLE hMasaIsmData ); #else -static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const float *subFrameTotalEne, const float *IIReneLimiter ); -#endif -#else -#ifdef MASA_AND_OBJECTS static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const MASA_ISM_DATA_HANDLE hMasaIsmData ); -#else -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked ); -#endif #endif -#ifdef MASA_AND_OBJECTS static void ivas_dirac_dec_binaural_determine_processing_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, const int16_t max_band_decorr, float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const int16_t nchanSeparateChannels, const MASA_ISM_DATA_HANDLE hMasaIsmData ); -#else -static void ivas_dirac_dec_binaural_determine_processing_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, const int16_t max_band_decorr, float Rmat[3][3], const int16_t isHeadtracked ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN static void ivas_dirac_dec_binaural_process_output( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, HANDLE_CLDFB_FILTER_BANK cldfbSynDec[MAX_OUTPUT_CHANNELS], float *output_f[], float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t max_band_decorr, const int16_t numInChannels, const int16_t processReverb, const int16_t subframe, float outRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float outIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float reverbRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float reverbIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decorrRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decorrIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const uint8_t recompute ); @@ -196,11 +176,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef MASA_AND_OBJECTS for ( k = 0; k < BINAURAL_CHANNELS + MAX_NUM_OBJECTS; k++ ) -#else - for ( k = 0; k < BINAURAL_CHANNELS + 1; k++ ) -#endif { set_zero( hDiracDecBin->processMtxRe[j][k], nBins ); set_zero( hDiracDecBin->processMtxIm[j][k], nBins ); @@ -340,12 +316,9 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) { int16_t nchan_to_allocate; -#ifdef MASA_AND_OBJECTS int16_t n_samples_granularity; -#endif nchan_to_allocate = 2 * BINAURAL_CHANNELS; -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; @@ -358,9 +331,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( } if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, ivas_jbm_dec_get_num_tc_channels( st_ivas ), nchan_to_allocate, nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, ivas_jbm_dec_get_num_tc_channels( st_ivas ), nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -551,11 +521,7 @@ void ivas_dirac_dec_binaural_render( *------------------------------------------------------------------------*/ void ivas_dirac_dec_binaural_sba_gain( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif + float *output[], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ ) @@ -590,12 +556,8 @@ void ivas_dirac_dec_binaural_sba_gain( void ivas_dirac_dec_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif - const int16_t nchan_transport /* i : number of transport channels */ + float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ + const int16_t nchan_transport /* i : number of transport channels */ ) { int16_t subframe; @@ -605,27 +567,17 @@ void ivas_dirac_dec_binaural( int16_t ch; int16_t slot_size; int16_t numInChannels; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *decorr_signal[BINAURAL_CHANNELS], decorr_signal_buff[BINAURAL_CHANNELS][L_FRAME48k]; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { p_output[ch] = output_f[ch]; p_output[ch + BINAURAL_CHANNELS] = decorr_signal_buff[ch]; } -#else - for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ ) - { - p_output[ch] = &output_f[ch][0]; - } -#endif numInChannels = nchan_transport; -#ifdef MASA_AND_OBJECTS 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++; @@ -634,12 +586,6 @@ void ivas_dirac_dec_binaural( { numInChannels += (uint8_t) st_ivas->nchan_ism; } -#else - if ( st_ivas->hOutSetup.separateChannelEnabled ) - { - numInChannels++; - } -#endif for ( ch = 0; ch < numInChannels; ch++ ) { @@ -647,11 +593,7 @@ void ivas_dirac_dec_binaural( } ivas_dirac_dec_set_md_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); -#ifdef SBA_AND_OBJECTS if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT ) -#endif { ivas_spar_dec_set_render_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); } @@ -661,18 +603,11 @@ void ivas_dirac_dec_binaural( if ( st_ivas->hDiracDecBin->useTdDecorr ) #endif { -#ifndef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *decorr_signal[BINAURAL_CHANNELS]; -#endif int16_t output_frame; for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP decorr_signal[ch] = decorr_signal_buff[ch]; -#else - decorr_signal[ch] = (float *) &( output_f[ch + BINAURAL_CHANNELS][0] ); -#endif st_ivas->hTcBuffer->tc[ch + BINAURAL_CHANNELS] = decorr_signal[ch]; } output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); @@ -728,14 +663,9 @@ static void ivas_dirac_dec_binaural_internal( SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; PARAMBIN_REND_CONFIG config_data; int16_t slot, ch, numInChannels; -#ifdef MASA_AND_OBJECTS float Cldfb_RealBuffer_in[6][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_in[6][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; int16_t nchanSeparateChannels; -#else - float Cldfb_RealBuffer_in[4][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_in[4][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#endif float Rmat[3][3]; int16_t max_band_decorr; DIFFUSE_DISTRIBUTION_DATA diffuseDistData; @@ -772,7 +702,6 @@ static void ivas_dirac_dec_binaural_internal( config_data.nchan_transport = st_ivas->nchan_transport; config_data.qualityBasedSmFactor = st_ivas->hMasa != NULL ? st_ivas->hMasa->data.dir_decode_quality : 1.0f; config_data.processReverb = st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ? 1 : 0; -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { config_data.ism_mode = st_ivas->ism_mode; @@ -781,11 +710,9 @@ static void ivas_dirac_dec_binaural_internal( { config_data.ism_mode = ISM_MODE_NONE; } -#endif /* The input channel number at this processing function (not nchan_transport) */ numInChannels = BINAURAL_CHANNELS; -#ifdef MASA_AND_OBJECTS if ( config_data.separateCenterChannelRendering || ( 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++; @@ -794,12 +721,6 @@ static void ivas_dirac_dec_binaural_internal( { numInChannels += (uint8_t) st_ivas->nchan_ism; } -#else - if ( config_data.separateCenterChannelRendering ) - { - numInChannels++; - } -#endif Rmat[0][0] = 1.0f; Rmat[0][1] = 0.0f; @@ -902,12 +823,8 @@ static void ivas_dirac_dec_binaural_internal( Cldfb_RealBuffer_in[ch][slot], Cldfb_ImagBuffer_in[ch][slot], nBins, st_ivas->cldfbAnaDec[ch] ); -#ifdef SBA_AND_OBJECTS if ( config_data.nchan_transport == 1 && ( config_data.ivas_format == SBA_FORMAT || config_data.ivas_format == SBA_ISM_FORMAT ) ) -#else - if ( config_data.nchan_transport == 1 && config_data.ivas_format == SBA_FORMAT ) -#endif { v_multc( Cldfb_RealBuffer_in[ch][slot], INV_SQRT_2, Cldfb_RealBuffer_in[ch][slot], nBins ); v_multc( Cldfb_ImagBuffer_in[ch][slot], INV_SQRT_2, Cldfb_ImagBuffer_in[ch][slot], nBins ); @@ -916,11 +833,7 @@ static void ivas_dirac_dec_binaural_internal( } } -#ifdef SBA_AND_OBJECTS if ( config_data.ivas_format == SBA_FORMAT || config_data.ivas_format == SBA_ISM_FORMAT ) -#else - if ( config_data.ivas_format == SBA_FORMAT ) -#endif { hDiracDecBin->hDiffuseDist = &diffuseDistData; @@ -928,12 +841,10 @@ static void ivas_dirac_dec_binaural_internal( ivas_sba_prototype_renderer( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, subframe ); } -#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { ivas_omasa_preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, nBins, subframe ); } -#endif if ( hCombinedOrientationData ) { @@ -958,13 +869,8 @@ static void ivas_dirac_dec_binaural_internal( #ifndef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN -#ifdef MASA_AND_OBJECTS 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 ); -#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 ); -#endif #endif if ( config_data.ivas_format == ISM_FORMAT ) @@ -984,18 +890,11 @@ static void ivas_dirac_dec_binaural_internal( #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN ivas_dirac_dec_binaural_formulate_input_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, subframe, subFrameTotalEne, IIReneLimiter ); -#ifdef MASA_AND_OBJECTS ivas_dirac_dec_binaural_formulate_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, subFrameTotalEne, IIReneLimiter, st_ivas->hMasaIsmData ); -#else - ivas_dirac_dec_binaural_formulate_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, - subFrameTotalEne, IIReneLimiter ); -#endif #endif -#ifdef MASA_AND_OBJECTS nchanSeparateChannels = 0; if ( config_data.separateCenterChannelRendering || ( 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 ) ) ) { @@ -1009,10 +908,6 @@ static void ivas_dirac_dec_binaural_internal( 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 ); -#else - ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0 ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN pMultiBinPoseData = &st_ivas->hSplitBinRend.splitrend.multiBinPoseData; @@ -1072,11 +967,7 @@ static void ivas_dirac_dec_binaural_internal( hDiracDecBin = st_ivas->hDiracDecBin[pos_idx]; assert( hDiracDecBin != NULL && "No DiracDecBin handle for this position" ); -#ifdef SBA_AND_OBJECTS if ( config_data.ivas_format == SBA_FORMAT || config_data.ivas_format == SBA_ISM_FORMAT ) -#else - if ( config_data.ivas_format == SBA_FORMAT ) -#endif { hDiracDecBin->hDiffuseDist = &diffuseDistData; } @@ -1089,7 +980,6 @@ static void ivas_dirac_dec_binaural_internal( mvr2r( st_ivas->hDiracDecBin[0]->ChCrossRe, hDiracDecBin->ChCrossRe, hSpatParamRendCom->num_freq_bands ); mvr2r( st_ivas->hDiracDecBin[0]->ChCrossIm, hDiracDecBin->ChCrossIm, hSpatParamRendCom->num_freq_bands ); -#ifdef MASA_AND_OBJECTS ivas_dirac_dec_binaural_formulate_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_local, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, subFrameTotalEne, IIReneLimiter, st_ivas->hMasaIsmData ); @@ -1097,16 +987,6 @@ static void ivas_dirac_dec_binaural_internal( ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_local, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, nchanSeparateChannels, st_ivas->hMasaIsmData ); -#else - ivas_dirac_dec_binaural_formulate_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_local, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, - subFrameTotalEne, IIReneLimiter ); - - - ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_local, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0 ); - -#endif /* re-use reverb and decorr from main direction for the sides */ ivas_dirac_dec_binaural_process_output( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, @@ -1287,11 +1167,7 @@ static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices( } } -#ifdef SBA_AND_OBJECTS if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && nchan_transport == 2 ) -#else - if ( ivas_format == SBA_FORMAT && nchan_transport == 2 ) -#endif { float tempRe, tempIm; float subFrameSumEne[CLDFB_NO_CHANNELS_MAX]; @@ -1369,12 +1245,8 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( const int16_t subframe, const int16_t isHeadtracked, const float *subFrameTotalEne, - const float *IIReneLimiter -#ifdef MASA_AND_OBJECTS - , - const MASA_ISM_DATA_HANDLE hMasaIsmData -#endif -) + const float *IIReneLimiter, + const MASA_ISM_DATA_HANDLE hMasaIsmData ) { int16_t ch, bin; int16_t separateCenterChannelRendering; @@ -1385,9 +1257,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( PARAMBIN_HRTF_GAIN_CACHE gainCache[MAX_GAIN_CACHE_SIZE]; IVAS_FORMAT ivas_format; MC_MODE mc_mode; -#ifdef MASA_AND_OBJECTS int16_t gainCacheBaseIndex; -#endif separateCenterChannelRendering = hConfig->separateCenterChannelRendering; ivas_format = hConfig->ivas_format; @@ -1417,10 +1287,8 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( for ( bin = 0; bin < nBins; bin++ ) { float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ -#ifdef MASA_AND_OBJECTS float diffusenessValForDecorrelationReduction = 1.0f; float diffEneValForDecorrelationReduction; -#endif float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ float diffEne, dirEne, meanEnePerCh; int16_t dirIndex; @@ -1439,9 +1307,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( float lRealp, lImagp, rRealp, rImagp; float lRealpTmp, lImagpTmp, rRealpTmp, rImagpTmp; float hrtfEne[BINAURAL_CHANNELS], hrtfCrossRe, hrtfCrossIm, ratio; -#ifdef MASA_AND_OBJECTS uint8_t isIsmDirection = 0; -#endif if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ { @@ -1449,15 +1315,9 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( eleDeg = hSpatParamRendCom->elevation[dirac_read_idx][bin]; ratio = hSpatParamRendCom->energy_ratio1[dirac_read_idx][bin]; spreadCoh = hSpatParamRendCom->spreadCoherence[dirac_read_idx][bin]; -#ifdef MASA_AND_OBJECTS gainCacheBaseIndex = 0; -#endif } -#ifdef MASA_AND_OBJECTS else if ( ivas_format != MASA_ISM_FORMAT || ( ivas_format == MASA_ISM_FORMAT && dirIndex < hSpatParamRendCom->numParametricDirections ) ) /* For second of the two simultaneous directions */ -#else - else /* For second of the two simultaneous directions */ -#endif { if ( ( ratio = hSpatParamRendCom->energy_ratio2[dirac_read_idx][bin] ) < 0.001 ) { @@ -1470,11 +1330,8 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( aziDeg = hSpatParamRendCom->azimuth2[dirac_read_idx][bin]; eleDeg = hSpatParamRendCom->elevation2[dirac_read_idx][bin]; spreadCoh = hSpatParamRendCom->spreadCoherence2[dirac_read_idx][bin]; -#ifdef MASA_AND_OBJECTS gainCacheBaseIndex = 3; -#endif } -#ifdef MASA_AND_OBJECTS else /* For object directions of MASA_ISM_FORMAT */ { isIsmDirection = 1; @@ -1495,11 +1352,9 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = 0.0f; gainCacheBaseIndex = 6 + ismDirIndex; } -#endif diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ -#ifdef MASA_AND_OBJECTS if ( diffuseness < 0.0f ) { diffuseness = 0.0f; @@ -1513,7 +1368,6 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( { diffusenessValForDecorrelationReduction -= ratio; } -#endif if ( separateCenterChannelRendering ) { @@ -1529,11 +1383,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef MASA_AND_OBJECTS getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 )], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1576,11 +1426,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef MASA_AND_OBJECTS getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 + 1 )], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1590,11 +1436,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef MASA_AND_OBJECTS getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 + 2 )], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -1662,32 +1504,22 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( diffEne = diffuseness * meanEnePerCh; surCoh = hSpatParamRendCom->surroundingCoherence[dirac_read_idx][bin]; -#ifdef MASA_AND_OBJECTS diffusenessValForDecorrelationReduction = max( 0.0f, diffusenessValForDecorrelationReduction ); diffEneValForDecorrelationReduction = diffusenessValForDecorrelationReduction * meanEnePerCh; -#endif if ( ( ivas_format == MC_FORMAT && mc_mode == MC_MODE_MCMASA ) ) { if ( !hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { -#ifdef MASA_AND_OBJECTS float spectrumModVal; idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; diffEne *= spectrumModVal; -#else - idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); - /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ - diffEne *= ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; -#endif -#ifdef MASA_AND_OBJECTS /* Modify also the value for decorrelation reduction */ diffEneValForDecorrelationReduction *= spectrumModVal; -#endif } } hDiracDecBin->ChEneOut[0][bin] += diffEne; /* Diff ene part*/ @@ -1700,11 +1532,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( } else /* When rendering binaural, ambience has frequency dependent ICC. */ { -#ifdef SBA_AND_OBJECTS if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) -#else - if ( ivas_format == SBA_FORMAT && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) -#endif { float diffuseFieldCoherence; diffuseFieldCoherence = hDiracDecBin->hDiffuseDist->diffuseRatioX[bin] * hDiracDecBin->diffuseFieldCoherenceX[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioY[bin] * hDiracDecBin->diffuseFieldCoherenceY[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioZ[bin] * hDiracDecBin->diffuseFieldCoherenceZ[bin]; @@ -1717,11 +1545,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( } /* Store parameters for formulating average diffuseness over frame */ -#ifdef MASA_AND_OBJECTS hDiracDecBin->frameMeanDiffuseness[bin] += diffEneValForDecorrelationReduction; -#else - hDiracDecBin->frameMeanDiffuseness[bin] += diffEne; -#endif frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } @@ -1770,12 +1594,8 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float Rmat[3][3], const int16_t subframe, - const int16_t isHeadtracked -#ifdef MASA_AND_OBJECTS - , - const MASA_ISM_DATA_HANDLE hMasaIsmData -#endif -) + const int16_t isHeadtracked, + const MASA_ISM_DATA_HANDLE hMasaIsmData ) { int16_t ch, slot, bin; int16_t separateCenterChannelRendering; @@ -1792,9 +1612,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric MC_MODE mc_mode; int32_t ivas_total_brate; int16_t nchan_transport; -#ifdef MASA_AND_OBJECTS int16_t gainCacheBaseIndex; -#endif separateCenterChannelRendering = hConfig->separateCenterChannelRendering; ivas_format = hConfig->ivas_format; @@ -1884,11 +1702,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } } -#ifdef SBA_AND_OBJECTS if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && nchan_transport == 2 ) -#else - if ( ivas_format == SBA_FORMAT && nchan_transport == 2 ) -#endif { float tempRe, tempIm; float subFrameSumEne[CLDFB_NO_CHANNELS_MAX]; @@ -1915,10 +1729,8 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric for ( bin = 0; bin < nBins; bin++ ) { float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ -#ifdef MASA_AND_OBJECTS float diffusenessValForDecorrelationReduction = 1.0f; float diffEneValForDecorrelationReduction; -#endif float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ float diffEne, dirEne, meanEnePerCh; int16_t dirIndex; @@ -1937,9 +1749,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric float lRealp, lImagp, rRealp, rImagp; float lRealpTmp, lImagpTmp, rRealpTmp, rImagpTmp; float hrtfEne[BINAURAL_CHANNELS], hrtfCrossRe, hrtfCrossIm, ratio; -#ifdef MASA_AND_OBJECTS uint8_t isIsmDirection = 0; -#endif if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ { @@ -1947,15 +1757,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric eleDeg = hSpatParamRendCom->elevation[dirac_read_idx][bin]; ratio = hSpatParamRendCom->energy_ratio1[dirac_read_idx][bin]; spreadCoh = hSpatParamRendCom->spreadCoherence[dirac_read_idx][bin]; -#ifdef MASA_AND_OBJECTS gainCacheBaseIndex = 0; -#endif } -#ifdef MASA_AND_OBJECTS else if ( ivas_format != MASA_ISM_FORMAT || ( ivas_format == MASA_ISM_FORMAT && dirIndex < hSpatParamRendCom->numParametricDirections ) ) /* For second of the two simultaneous directions */ -#else - else /* For second of the two simultaneous directions */ -#endif { if ( ( ratio = hSpatParamRendCom->energy_ratio2[dirac_read_idx][bin] ) < 0.001 ) { @@ -1968,11 +1772,8 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric aziDeg = hSpatParamRendCom->azimuth2[dirac_read_idx][bin]; eleDeg = hSpatParamRendCom->elevation2[dirac_read_idx][bin]; spreadCoh = hSpatParamRendCom->spreadCoherence2[dirac_read_idx][bin]; -#ifdef MASA_AND_OBJECTS gainCacheBaseIndex = 3; -#endif } -#ifdef MASA_AND_OBJECTS else /* For object directions of MASA_ISM_FORMAT */ { isIsmDirection = 1; @@ -1993,11 +1794,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = 0.0f; gainCacheBaseIndex = 6 + ismDirIndex; } -#endif diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ -#ifdef MASA_AND_OBJECTS if ( diffuseness < 0.0f ) { diffuseness = 0.0f; @@ -2011,7 +1810,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric { diffusenessValForDecorrelationReduction -= ratio; } -#endif if ( separateCenterChannelRendering ) { @@ -2027,11 +1825,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef MASA_AND_OBJECTS getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 )], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -2074,11 +1868,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef MASA_AND_OBJECTS getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 + 1 )], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -2088,11 +1878,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef MASA_AND_OBJECTS getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 + 2 )], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -2160,32 +1946,22 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric diffEne = diffuseness * meanEnePerCh; surCoh = hSpatParamRendCom->surroundingCoherence[dirac_read_idx][bin]; -#ifdef MASA_AND_OBJECTS diffusenessValForDecorrelationReduction = max( 0.0f, diffusenessValForDecorrelationReduction ); diffEneValForDecorrelationReduction = diffusenessValForDecorrelationReduction * meanEnePerCh; -#endif if ( ( ivas_format == MC_FORMAT && mc_mode == MC_MODE_MCMASA ) ) { if ( !hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { -#ifdef MASA_AND_OBJECTS float spectrumModVal; idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; diffEne *= spectrumModVal; -#else - idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); - /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ - diffEne *= ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; -#endif -#ifdef MASA_AND_OBJECTS /* Modify also the value for decorrelation reduction */ diffEneValForDecorrelationReduction *= spectrumModVal; -#endif } } hDiracDecBin->ChEneOut[0][bin] += diffEne; /* Diff ene part*/ @@ -2198,11 +1974,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } else /* When rendering binaural, ambience has frequency dependent ICC. */ { -#ifdef SBA_AND_OBJECTS if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) -#else - if ( ivas_format == SBA_FORMAT && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) -#endif { float diffuseFieldCoherence; diffuseFieldCoherence = hDiracDecBin->hDiffuseDist->diffuseRatioX[bin] * hDiracDecBin->diffuseFieldCoherenceX[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioY[bin] * hDiracDecBin->diffuseFieldCoherenceY[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioZ[bin] * hDiracDecBin->diffuseFieldCoherenceZ[bin]; @@ -2215,11 +1987,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } /* Store parameters for formulating average diffuseness over frame */ -#ifdef MASA_AND_OBJECTS hDiracDecBin->frameMeanDiffuseness[bin] += diffEneValForDecorrelationReduction; -#else - hDiracDecBin->frameMeanDiffuseness[bin] += diffEne; -#endif frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } @@ -2293,60 +2061,38 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( PARAMBIN_REND_CONFIG_HANDLE hConfig, const int16_t max_band_decorr, float Rmat[3][3], -#ifdef MASA_AND_OBJECTS const int16_t subframe, -#endif - const int16_t isHeadtracked -#ifdef MASA_AND_OBJECTS - , + const int16_t isHeadtracked, const int16_t nchanSeparateChannels, - const MASA_ISM_DATA_HANDLE hMasaIsmData -#endif -) + const MASA_ISM_DATA_HANDLE hMasaIsmData ) { int16_t chA, chB, bin; int16_t separateCenterChannelRendering; int16_t nBins; -#ifdef MASA_AND_OBJECTS int16_t dirac_read_idx; -#endif -#ifdef MASA_AND_OBJECTS PARAMBIN_HRTF_GAIN_CACHE gainCache[MAX_NUM_OBJECTS]; int16_t idx; ISM_MODE ism_mode; -#else - PARAMBIN_HRTF_GAIN_CACHE gainCache; -#endif IVAS_FORMAT ivas_format; MC_MODE mc_mode; int32_t ivas_total_brate; int16_t nchan_transport; ivas_format = hConfig->ivas_format; -#ifdef MASA_AND_OBJECTS separateCenterChannelRendering = nchanSeparateChannels > 0; -#else - separateCenterChannelRendering = hConfig->separateCenterChannelRendering; -#endif mc_mode = hConfig->mc_mode; ivas_total_brate = hConfig->ivas_total_brate; nchan_transport = hConfig->nchan_transport; nBins = hSpatParamRendCom->num_freq_bands; /* Actually bins */ -#ifdef MASA_AND_OBJECTS ism_mode = hConfig->ism_mode; dirac_read_idx = hSpatParamRendCom->render_to_md_map[subframe]; -#endif -#ifdef MASA_AND_OBJECTS for ( idx = 0; idx < MAX_NUM_OBJECTS; idx++ ) { gainCache[idx].azi = -1000; /* Use -1000 as value for uninitialized cache. */ } -#else - gainCache.azi = -1000; /* Use -1000 as value for uninitialized cache. */ -#endif for ( bin = 0; bin < nBins; bin++ ) { @@ -2409,11 +2155,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { decorrelationReductionFactor = sqrtf( fmaxf( 0.0f, hDiracDecBin->frameMeanDiffuseness[bin] ) ); } -#ifdef SBA_AND_OBJECTS else if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && nchan_transport == 1 ) -#else - else if ( ivas_format == SBA_FORMAT && nchan_transport == 1 ) -#endif { decorrelationReductionFactor = 1.0f; } @@ -2486,7 +2228,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( float gainFactor; int16_t aziDeg = 0; int16_t eleDeg = 0; -#ifdef MASA_AND_OBJECTS uint8_t instantChange = 0; if ( ivas_format == MASA_ISM_FORMAT ) @@ -2537,21 +2278,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( } } } -#else - gainFactor = 0.8414f * sqrtf( hDiracDecBin->earlyPartEneCorrection[bin] ); - for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) - { - hDiracDecBin->processMtxRePrev[chA][2][bin] = hDiracDecBin->processMtxRe[chA][2][bin]; - hDiracDecBin->processMtxImPrev[chA][2][bin] = hDiracDecBin->processMtxIm[chA][2][bin]; - } - - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache, isHeadtracked ); - - hDiracDecBin->processMtxRe[0][2][bin] = lRealp * gainFactor; - hDiracDecBin->processMtxIm[0][2][bin] = lImagp * gainFactor; - hDiracDecBin->processMtxRe[1][2][bin] = rRealp * gainFactor; - hDiracDecBin->processMtxIm[1][2][bin] = rImagp * gainFactor; -#endif } } @@ -2652,14 +2378,12 @@ static void ivas_dirac_dec_binaural_process_output( /* Processing of the first / HRTF part of the binaural output. */ for ( chB = 0; chB < numInChannels; chB++ ) { -#ifdef MASA_AND_OBJECTS if ( chB < BINAURAL_CHANNELS ) { /* Decorrelator signal for TD decorrelation is stored in two input channels above the two normal inputs. * It should be noted that TD decorrelation is used only in cases where numInChannels is 2. If this * changes, additional adjustments are required. When using CLDFB decorrelator, we simply assign the * pointers to buffers. */ -#endif if ( hDiracDecBin->useTdDecorr ) { decSlotRePointer = inRe[chB + 2][slot]; @@ -2670,14 +2394,12 @@ static void ivas_dirac_dec_binaural_process_output( decSlotRePointer = decSlotRe[chB]; decSlotImPointer = decSlotIm[chB]; } -#ifdef MASA_AND_OBJECTS } else { decSlotRePointer = NULL; /* below these pointers are used only for chB < 2 */ decSlotImPointer = NULL; } -#endif for ( bin = 0; bin < nBins; bin++ ) @@ -3503,7 +3225,6 @@ float configure_reqularization_factor( } -#ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------* * ivas_omasa_preProcessStereoTransportsForMovedObjects() * @@ -3728,4 +3449,3 @@ void ivas_omasa_preProcessStereoTransportsForMovedObjects( return; } -#endif diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index aade9f4e19cb41ebf89c724bc5b1e794deeba2d8..7c73d0fc9e4abd006873290e9d7c51dd137b7ea2 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -585,9 +585,7 @@ void ivas_dirac_dec_output_synthesis_process_slot( hDirACRend, hVBAPdata, NULL, -#ifdef MASA_AND_OBJECTS NULL, -#endif azimuth, elevation, md_idx, @@ -637,9 +635,7 @@ void ivas_dirac_dec_output_synthesis_process_slot( hDirACRend, hVBAPdata, NULL, -#ifdef MASA_AND_OBJECTS NULL, -#endif azimuth, elevation, md_idx, @@ -1749,9 +1745,7 @@ void ivas_dirac_dec_compute_directional_responses( DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const MASA_DECODER_HANDLE hMasa, /* i : MASA decoder structure */ -#ifdef MASA_AND_OBJECTS - MASA_ISM_DATA_HANDLE hMasaIsm, /* i : MASA_ISM data structure */ -#endif + MASA_ISM_DATA_HANDLE hMasaIsm, /* i : MASA_ISM data structure */ const int16_t *azimuth, const int16_t *elevation, const int16_t md_idx, @@ -1787,11 +1781,7 @@ void ivas_dirac_dec_compute_directional_responses( } num_channels_dir = hDirACRend->num_outputs_dir; -#ifdef MASA_AND_OBJECTS if ( hSpatParamRendCom->numParametricDirections == 2 ) -#else - if ( hSpatParamRendCom->numSimultaneousDirections == 2 ) -#endif { azimuth2 = hSpatParamRendCom->azimuth2[md_idx]; elevation2 = hSpatParamRendCom->elevation2[md_idx]; @@ -1866,11 +1856,7 @@ void ivas_dirac_dec_compute_directional_responses( /* Synthesize the first direction */ spreadCoherencePanningHoa( azimuth[k], elevation[k], hSpatParamRendCom->spreadCoherence[md_idx][k], direct_response_hoa, num_channels_dir, hDirACRend->hOutSetup.ambisonics_order ); /* Synthesize the second direction and combine the gains */ -#ifdef MASA_AND_OBJECTS if ( hSpatParamRendCom->numParametricDirections == 2 ) -#else - if ( hSpatParamRendCom->numSimultaneousDirections == 2 ) -#endif { spreadCoherencePanningHoa( azimuth2[k], elevation2[k], hSpatParamRendCom->spreadCoherence2[md_idx][k], direct_response_dir2, num_channels_dir, hDirACRend->hOutSetup.ambisonics_order ); /* Combine gains from the two directions */ @@ -1884,7 +1870,6 @@ void ivas_dirac_dec_compute_directional_responses( } } -#ifdef MASA_AND_OBJECTS if ( hSpatParamRendCom->numIsmDirections > 0 ) { int16_t dir; @@ -1933,7 +1918,6 @@ void ivas_dirac_dec_compute_directional_responses( direct_response_hoa[l] += directRatio[1] * direct_response_ism[l]; } } -#endif /* Synthesize surrounding coherence */ if ( surCohRatio != NULL && surCohRatio[k] > 0.f ) @@ -1979,11 +1963,7 @@ void ivas_dirac_dec_compute_directional_responses( normalizePanningGains( direct_response_ls, num_channels_dir ); /* Synthesize the second direction and combine the gains */ -#ifdef MASA_AND_OBJECTS if ( hSpatParamRendCom->numParametricDirections == 2 ) -#else - if ( hSpatParamRendCom->numSimultaneousDirections == 2 ) -#endif { spreadCoherencePanningVbap( azimuth2[k], elevation2[k], hSpatParamRendCom->spreadCoherence2[md_idx][k], direct_response_dir2, num_channels_dir, hVBAPdata ); normalizePanningGains( direct_response_dir2, num_channels_dir ); @@ -2000,7 +1980,6 @@ void ivas_dirac_dec_compute_directional_responses( normalizePanningGains( direct_response_ls, num_channels_dir ); } -#ifdef MASA_AND_OBJECTS if ( hSpatParamRendCom->numIsmDirections > 0 ) { int16_t dir; @@ -2051,7 +2030,6 @@ void ivas_dirac_dec_compute_directional_responses( } normalizePanningGains( direct_response_ls, num_channels_dir ); } -#endif /* Synthesize surrounding coherence */ if ( surCohRatio != NULL && surCohRatio[k] > 0.f ) { @@ -2153,14 +2131,10 @@ void ivas_dirac_dec_compute_power_factors( void ivas_lfe_synth_with_filters( MCMASA_LFE_SYNTH_DATA_HANDLE hMasaLfeSynth, /* i/o: LFE synthesis structure for McMASA */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *data_f[], /* o : output signals */ -#else - float data_f[][L_FRAME48k], /* o : output signals */ -#endif - const int16_t output_frame, /* i : output frame length per channel */ - const int16_t separateChannelIndex, /* i : separate channel index */ - const int16_t lfeChannelIndex /* i : LFE channel index */ + float *data_f[], /* o : output signals */ + const int16_t output_frame, /* i : output frame length per channel */ + const int16_t separateChannelIndex, /* i : separate channel index */ + const int16_t lfeChannelIndex /* i : LFE channel index */ ) { float lowpassCoef; @@ -2541,21 +2515,12 @@ static void spreadCoherencePanningVbap( return; } -#ifdef MASA_AND_OBJECTS vbap_determine_gains( hVBAPdata, direct_response, azimuth, elevation, 0 ); -#else - vbap_determine_gains( hVBAPdata, direct_response, azimuth, elevation ); -#endif if ( spreadCoh > 0.f ) { -#ifdef MASA_AND_OBJECTS vbap_determine_gains( hVBAPdata, direct_response_left, azimuth + 30, elevation, 0 ); vbap_determine_gains( hVBAPdata, direct_response_right, azimuth - 30, elevation, 0 ); -#else - vbap_determine_gains( hVBAPdata, direct_response_left, azimuth + 30, elevation ); - vbap_determine_gains( hVBAPdata, direct_response_right, azimuth - 30, elevation ); -#endif if ( spreadCoh < 0.5f ) { diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 8d3b50613c2a5adfdb62d77391872bacaa1529da..326930e0db35299781f9104cc38bdc2e79147bf0 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -232,23 +232,15 @@ ivas_error ivas_spat_hSpatParamRendCom_config( hSpatParamRendCom->slots_rendered = 0; hSpatParamRendCom->num_slots = DEFAULT_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME; hSpatParamRendCom->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); -#ifdef MASA_AND_OBJECTS hSpatParamRendCom->numSimultaneousDirections = 0; hSpatParamRendCom->numParametricDirections = 0; hSpatParamRendCom->numIsmDirections = 0; -#else - hSpatParamRendCom->numSimultaneousDirections = 0; -#endif } -/*-----------------------------------------------------------------* - * set input parameters - *-----------------------------------------------------------------*/ -#ifdef SBA_AND_OBJECTS + /*-----------------------------------------------------------------* + * set input parameters + *-----------------------------------------------------------------*/ if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && flag_config == DIRAC_RECONFIGURE ) -#else - if ( ivas_format == SBA_FORMAT && flag_config == DIRAC_RECONFIGURE ) -#endif { if ( hodirac_flag && hSpatParamRendCom->azimuth2 == NULL ) { @@ -278,11 +270,7 @@ ivas_error ivas_spat_hSpatParamRendCom_config( hSpatParamRendCom->render_to_md_map[map_idx] = map_idx; } } -#ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - else if ( ivas_format == MASA_FORMAT ) -#endif { hSpatParamRendCom->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR; hSpatParamRendCom->dirac_bs_md_write_idx = DELAY_MASA_PARAM_DEC_SFR; @@ -313,17 +301,7 @@ ivas_error ivas_spat_hSpatParamRendCom_config( return error; } -#ifdef MASA_AND_OBJECTS - if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT -#ifdef SBA_AND_OBJECTS - || ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && hodirac_flag ) -#else - || ( ivas_format == SBA_FORMAT && hodirac_flag ) -#endif - ) -#else - if ( ivas_format == MASA_FORMAT || ( ivas_format == SBA_FORMAT && hodirac_flag ) ) -#endif + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && hodirac_flag ) ) { if ( ( error = ivas_dirac_allocate_parameters( hSpatParamRendCom, 2 ) ) != IVAS_ERR_OK ) { @@ -996,35 +974,19 @@ void initDiffuseResponses( set_zero( &diffuse_response_function[num_horizontal_speakers], NUM_ELEVATED_SPEAKERS ); *num_ele_spk_no_diffuse_rendering = NUM_ELEVATED_SPEAKERS; } -#ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) -#else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) -#endif { mvr2r( diffuse_response_CICP6, diffuse_response_function, num_channels ); } -#ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1_2 && num_channels == 7 ) -#else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1_2 && num_channels == 7 ) -#endif { mvr2r( diffuse_response_CICP14, diffuse_response_function, num_channels ); } -#ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) -#else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) -#endif { mvr2r( diffuse_response_CICP16, diffuse_response_function, num_channels ); } -#ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) -#else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) -#endif { if ( transport_config == AUDIO_CONFIG_5_1 || transport_config == AUDIO_CONFIG_7_1 ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 6e2d843ee851b23bb2de7ab415493225eb9c6b01..e1da3aaa414f81ccdafd3a2fc421331da50aa0a2 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -194,15 +194,7 @@ ivas_error ivas_td_binaural_open_unwrap( } } -#ifdef MASA_AND_OBJECTS - if ( ivas_format == ISM_FORMAT || ivas_format == MASA_ISM_FORMAT -#ifdef SBA_AND_OBJECTS - || ivas_format == SBA_ISM_FORMAT -#endif - ) -#else - if ( ivas_format == ISM_FORMAT ) -#endif + if ( ivas_format == ISM_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == SBA_ISM_FORMAT ) { DirAtten_p = pBinRendTd->DirAtten_p; @@ -226,18 +218,10 @@ ivas_error ivas_td_binaural_open_unwrap( *hBinRendererTd = pBinRendTd; -#ifdef MASA_AND_OBJECTS - if ( ivas_format != MASA_ISM_FORMAT -#ifdef SBA_AND_OBJECTS - && ivas_format != SBA_ISM_FORMAT -#endif - ) + if ( ivas_format != MASA_ISM_FORMAT && ivas_format != SBA_ISM_FORMAT ) { *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); } -#else - *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); -#endif return error; } @@ -481,15 +465,7 @@ void TDREND_Update_object_positions( /* For each source, write the frame data to the source object*/ for ( nS = 0; nS < num_src; nS++ ) { -#ifdef MASA_AND_OBJECTS - if ( in_format == ISM_FORMAT || in_format == MASA_ISM_FORMAT -#ifdef SBA_AND_OBJECTS - || in_format == SBA_ISM_FORMAT -#endif - ) -#else - if ( in_format == ISM_FORMAT ) -#endif + if ( in_format == ISM_FORMAT || in_format == MASA_ISM_FORMAT || in_format == SBA_ISM_FORMAT ) { /* Update the source positions */ /* Source position and direction */ @@ -740,12 +716,8 @@ ivas_error ivas_td_binaural_renderer_ext( *---------------------------------------------------------------------*/ ivas_error ObjRenderIvasFrame_splitBinaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP - float *output[], /* i/o: SCE channels / Binaural synthesis */ -#else - float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame /* i : output frame length */ ) { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 9590e73a2aaccd01a8d1720cf64ece4dcdeb597f..3c4bf2d2aae334d0bfca06d2ff2e2f7badc14767 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -255,7 +255,6 @@ void ivas_output_init( } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*-----------------------------------------------------------------* * ivas_get_nchan_buffers_dec() * @@ -396,4 +395,3 @@ int16_t ivas_get_nchan_buffers_dec( return nchan_out_buff; } -#endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 69723f9cbebc10128ba3038c608363119df039e2..3a56fd3993ff5c42fd83460031ad0c60492e206d 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -70,12 +70,10 @@ void ivas_output_init( const AUDIO_CONFIG output_config /* i : output audio configuration */ ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP /*! r: number of decoder buffers */ int16_t ivas_get_nchan_buffers_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#endif /*----------------------------------------------------------------------------------* @@ -154,11 +152,7 @@ ivas_error ivas_sba_get_hoa_dec_matrix( ); void ivas_dirac_dec_binaural_sba_gain( -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ ); @@ -166,11 +160,7 @@ void ivas_dirac_dec_binaural_sba_gain( void ivas_dirac_dec_binaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ -#else - float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ -#endif const int16_t nchan_transport /* i : number of transport channels */ ); @@ -469,9 +459,7 @@ void ivas_dirac_dec_compute_directional_responses( DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const MASA_DECODER_HANDLE hMasa, /* i : MASA decoder structure */ -#ifdef MASA_AND_OBJECTS MASA_ISM_DATA_HANDLE hMasaIsm, /* i : MASA_ISM data structure */ -#endif const int16_t *azimuth, const int16_t *elevation, const int16_t md_idx, @@ -1472,11 +1460,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_bands, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], -#else - float output[][L_FRAME48k], -#endif const int16_t low_res_pre_rend_rot, int16_t td_input, const int16_t pcm_out @@ -1696,11 +1680,7 @@ void masaPrerendClose( /* TODO(sgi): Rework interface */ ivas_error ObjRenderIvasFrame_splitBinaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], /* i/o: SCE channels / Binaural synthesis */ -#else - float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ -#endif const int16_t output_frame /* i : output frame length */ ); diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index 40dbba3d0078c88dc37c5555b670a595d442ce42..e630837acaa17cafda84d111dda40788ff75d3c6 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -2152,11 +2152,7 @@ static ivas_error splitRendLc3plusEncodeAndWrite( SPLIT_REND_WRAPPER *hSplitBin, ivas_split_rend_bits_t *pBits, const int32_t SplitRendBitRate, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *in[] ) -#else - float in[][L_FRAME48k] ) -#endif { ivas_error error; int16_t i; @@ -2208,11 +2204,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( const int32_t SplitRendBitRate, ivas_split_rend_bits_t *pBits, const int16_t max_bands, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *in[], -#else - float in[][L_FRAME48k], -#endif const int16_t low_res_pre_rend_rot, const int16_t pcm_out ) { @@ -2414,11 +2406,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_bands, -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP float *output[], -#else - float output[][L_FRAME48k], -#endif const int16_t low_res_pre_rend_rot, int16_t td_input, const int16_t pcm_out ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 35812f74faaf62e3f6b49f51a20e64fc4d74b708..2f110efe97bc1dd23945cc1510bc0ac938e91554 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -133,13 +133,9 @@ typedef struct ivas_spatial_parametric_rend_common_data_structure int16_t nb_subframes; int16_t num_freq_bands; -#ifdef MASA_AND_OBJECTS int16_t numSimultaneousDirections; /* From 1 to 2 + MAX_NUM_OBJECTS */ int16_t numParametricDirections; /* 1 or 2 */ int16_t numIsmDirections; /* From 0 to MAX_NUM_OBJECTS */ -#else - int16_t numSimultaneousDirections; /* 1 or 2 */ -#endif int16_t **azimuth; int16_t **elevation; @@ -415,11 +411,9 @@ typedef struct vbap_data_structure float *bottom_virtual_speaker_node_division_gains; float *top_virtual_speaker_node_division_gains; float *back_virtual_speaker_node_division_gains; -#ifdef MASA_AND_OBJECTS float *object_mode_bottom_virtual_speaker_node_division_gains; float *object_mode_top_virtual_speaker_node_division_gains; float *object_mode_back_virtual_speaker_node_division_gains; -#endif } VBAP_DATA, *VBAP_HANDLE; @@ -492,13 +486,8 @@ typedef struct ivas_dirac_dec_binaural_data_structure float ChEneOut[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float ChCrossReOut[CLDFB_NO_CHANNELS_MAX]; float ChCrossImOut[CLDFB_NO_CHANNELS_MAX]; -#ifdef MASA_AND_OBJECTS float processMtxRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; float processMtxIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; -#else - float processMtxRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; /* +1 refers to SeparateChannel */ - float processMtxIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; -#endif float processMtxDecRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float processMtxDecIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float diffuseFieldCoherence[CLDFB_NO_CHANNELS_MAX]; @@ -509,13 +498,8 @@ typedef struct ivas_dirac_dec_binaural_data_structure REVERB_STRUCT_HANDLE hReverb; uint8_t renderStereoOutputInsteadOfBinaural; float frameMeanDiffuseness[CLDFB_NO_CHANNELS_MAX]; -#ifdef MASA_AND_OBJECTS float processMtxRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; float processMtxImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; -#else - float processMtxRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; - float processMtxImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; -#endif float processMtxDecRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float processMtxDecImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; uint16_t useTdDecorr; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8d0582865725f1c7976692625eaeb3ce53482c76..9380ac42605ff93159e8d4c1d9a2046565fb555a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7829,9 +7829,7 @@ static void copyMasaMetadataToDiracRenderer( int16_t band, sf, bin; int16_t meta_write_index; -#ifdef MASA_AND_OBJECTS hSpatParamRendCom->numParametricDirections = meta->descriptive_meta.numberOfDirections + 1; -#endif hSpatParamRendCom->numSimultaneousDirections = meta->descriptive_meta.numberOfDirections + 1; for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) @@ -7870,7 +7868,6 @@ static void renderMasaToMc( input_masa *masaInput, IVAS_REND_AudioBuffer outAudio ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t ch; float *tmpBuffer[MAX_OUTPUT_CHANNELS], tmpBuffer_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -7880,11 +7877,6 @@ static void renderMasaToMc( } copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer_buff ); -#else - float tmpBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - - copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer ); -#endif copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hSpatParamRendCom ); if ( masaInput->decDummy->renderer_type == RENDERER_STEREO_PARAMETRIC ) @@ -7896,11 +7888,7 @@ static void renderMasaToMc( ivas_dirac_dec( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); } -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBuffer_buff, &outAudio ); -#else - accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); -#endif return; } @@ -7909,7 +7897,6 @@ static void renderMasaToSba( input_masa *masaInput, IVAS_REND_AudioBuffer outAudio ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t ch; float *tmpBuffer[MAX_OUTPUT_CHANNELS], tmpBuffer_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -7919,20 +7906,11 @@ static void renderMasaToSba( } copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer_buff ); -#else - float tmpBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - - copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer ); -#endif copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hSpatParamRendCom ); ivas_dirac_dec( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBuffer_buff, &outAudio ); -#else - accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); -#endif return; } @@ -7946,7 +7924,6 @@ static void renderMasaToBinaural( #endif ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t ch; float *tmpBuffer[MAX_OUTPUT_CHANNELS], tmpBuffer_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -7956,11 +7933,6 @@ static void renderMasaToBinaural( } copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer_buff ); -#else - float tmpBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - - copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer ); -#endif copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hSpatParamRendCom ); ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); @@ -7973,11 +7945,7 @@ static void renderMasaToBinaural( else { #endif -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBuffer_buff, &outAudio ); -#else - accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT } #endif @@ -8579,7 +8547,6 @@ ivas_error IVAS_REND_GetSamples( int16_t td_input; float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP int16_t ch; float *tmpBinaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS], tmpBinaural_buff[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; @@ -8587,9 +8554,6 @@ ivas_error IVAS_REND_GetSamples( { tmpBinaural[ch] = tmpBinaural_buff[ch]; } -#else - float tmpBinaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; -#endif if ( outAudio.config.is_cldfb == 1 ) { @@ -8599,11 +8563,7 @@ ivas_error IVAS_REND_GetSamples( else { td_input = 1; -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP copyBufferTo2dArray( outAudio, tmpBinaural_buff ); -#else - copyBufferTo2dArray( outAudio, tmpBinaural ); -#endif } /* Encode split rendering bitstream */ @@ -8631,11 +8591,7 @@ ivas_error IVAS_REND_GetSamples( if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { -#ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBinaural_buff, &outAudio ); -#else - accumulate2dArrayToBuffer( tmpBinaural, &outAudio ); -#endif } } #endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 6a3b7e7eae6def57d643f175795fec95e6c571d2..da1e76c79853bfff96ac0961909ae9574752fed0 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -120,14 +120,12 @@ typedef enum typedef uint16_t IVAS_REND_InputId; -#ifdef FIX_706_REND_COMPLEXITY_LEVELS typedef enum _IVAS_REND_COMPLEXITY_LEVEL { IVAS_REND_COMPLEXITY_LEVEL_ONE = 1, IVAS_REND_COMPLEXITY_LEVEL_TWO = 2, IVAS_REND_COMPLEXITY_LEVEL_THREE = 3 } IVAS_REND_COMPLEXITY_LEVEL; -#endif /* clang-format off */ diff --git a/readme.txt b/readme.txt index aaa04389a78f93280c23c04a535f0358558b1f88..58efed4bb663fa353bfaff45152869337b514554 100644 --- a/readme.txt +++ b/readme.txt @@ -76,7 +76,7 @@ following data: Word16 SyncWord Word16 DataLen - Word16 1st Databit + Word16 1st DataBit Word16 2nd DataBit . . @@ -131,6 +131,7 @@ should have the following structure: |-- lib_rend |-- lib_util |-- readme.txt + |-- .clang-format The package includes a Makefile for gcc, which has been verified on 32-bit Linux systems. The code can be compiled by entering the directory @@ -516,7 +517,7 @@ it is assumed that the remaining three columns contain three Euler angles. Other columns are interpreted as a Quaternion. The input is expected to have one line for each subframe of 5 ms. In the case of Quaternion-based input, the columns are the w, x, y, z components of a unit quaternion. -Proper normalization to 1 mustshall be maintained in the input. The coordinate system is defined such that +Proper normalization to 1 shall be maintained in the input. The coordinate system is defined such that the x-axis points from the left to the right ear, the y axis points into the direction of view, and the z axis point from bottom to top. The origin is in the center of the head. diff --git a/scripts/prepare_delivery.sh b/scripts/prepare_delivery.sh index 17bae7e4475b355c97bb85fe1746ac2447ff9daf..b925ac667782e0a5be8c36134ef8b08b074abb13 100755 --- a/scripts/prepare_delivery.sh +++ b/scripts/prepare_delivery.sh @@ -130,6 +130,7 @@ cp ${ROOT}/.clang-format ${OUTDIR} # in case we strip it later, it will be explicitly disabled again belo sed -i.bak -e "s/\/\*\ *\(#define\ *SPLIT_REND_WITH_HEAD_ROT\ *\)\*\//\1/g" ${OUTDIR}/lib_com/options.h + ########################## # # # Strip Split Rendering #